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
43
44
45
| import Vue from 'vue'
| import { SYS_PRODUCTION } from "@/store/mutation-types"
| import { getAction } from '@/api/manage'
|
| const Production = {
| state: {
| token: '',
| //产线树
| ProductionTree:[]
|
| },
|
| mutations: {
| SET_TOKEN: (state, token) => {
| state.token = token
| },
| SET_PRODUCTION:(state,ProductionTree) => {
| state.ProductionTree = ProductionTree
| }
| },
|
| actions: {
| // 产线树
| QueryProduction({ commit },type='MDC') {
| return new Promise((resolve, reject) => {
| getAction("/mdc/mdcEquipment/queryTreeListByProduction",{type}).then(response => {
| if(response.success){
| const result = response.result
| Vue.ls.set(SYS_PRODUCTION, result)
| commit('SET_PRODUCTION', result)
| resolve(response)
| }else{
| resolve(response)
| }
| }).catch(error => {
| reject(error)
| })
| })
| },
|
|
| }
| }
|
| export default Production
|
|