model.js
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2024-01-03 15:15:25
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2024-01-15 14:52:50
* @FilePath: \scrm-micro-scene\src\mixins\model.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { mapActions, mapState } from 'vuex'
export default {
data() {
return {
...mapActions('model', ['setModelList'])
}
},
computed: {
...mapState('model', ['modelList'])
},
mounted() {
if (!this.modelList) {
this.setModelList()
}
},
methods: {
...mapActions('model', ['setModelList']),
//获取sop映射字段
stageInfo(i) {
if (this.modelList) {
return this.modelList.find(item => {
if (item.id == i) {
return item
}
})
} else {
return {
nodeName: '',
desc: ''
}
}
}
}
}