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
46
47
48
49
50
51
52
53
| import Vue from 'vue'
| import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
| import { SET_DEPARTTREE } from "@/store/mutation-types"
| import { getAction } from '@/api/manage'
|
| const DepartTree = {
| state: {
| token: '',
| //部门树的权限
| DepartTreeType:""
|
| },
|
| mutations: {
| SET_TOKEN: (state, token) => {
| state.token = token
| },
| SET_DEPARTTREE:(state,DepartTreeType) => {
| state.DepartTreeType = DepartTreeType
| }
| },
|
| actions: {
| // 产线树
| QueryDepartTree({ commit }) {
| return new Promise((resolve, reject) => {
|
| //根据字典Code, 初始化字典数组
| ajaxGetDictItems('depart_is', null).then((res) => {
| if (res.success) {
| const result = res.result
| Vue.ls.set(SET_DEPARTTREE, result)
| commit('SET_DEPARTTREE', result)
| resolve(res)
| }else{
| resolve(res)
|
| }
| }).catch(error => {
| reject(error)
| })
|
| })
| },
|
|
|
|
|
| }
| }
|
| export default DepartTree
|
|