|
@@ -7,25 +7,32 @@ Vue.use(Vuex)
|
|
export default new Vuex.Store({
|
|
export default new Vuex.Store({
|
|
state: {
|
|
state: {
|
|
GraphCategoryIds: ['NTXT'], //系统类型
|
|
GraphCategoryIds: ['NTXT'], //系统类型
|
|
- TypeIdToGraphElement:{}, //typeid到图例元素的映射
|
|
|
|
|
|
+ TypeIdToGraphElement: {}, //typeid到图例元素的映射
|
|
|
|
+ token: null,
|
|
},
|
|
},
|
|
mutations: {
|
|
mutations: {
|
|
- TypeIdToGraphElement(state,data){
|
|
|
|
|
|
+ TypeIdToGraphElement(state, data) {
|
|
if (data.length) {
|
|
if (data.length) {
|
|
state.TypeIdToGraphElement = {}
|
|
state.TypeIdToGraphElement = {}
|
|
data.forEach(t => {
|
|
data.forEach(t => {
|
|
state.TypeIdToGraphElement[t.Id] = t;
|
|
state.TypeIdToGraphElement[t.Id] = t;
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ SETSSOTOKEN(state, data) {
|
|
|
|
+ state.token = data
|
|
|
|
+ },
|
|
},
|
|
},
|
|
actions: {
|
|
actions: {
|
|
getElementType({ commit }, params) {
|
|
getElementType({ commit }, params) {
|
|
getGraphElementType(params).then(res => {
|
|
getGraphElementType(params).then(res => {
|
|
- commit('TypeIdToGraphElement',res.Content)
|
|
|
|
|
|
+ commit('TypeIdToGraphElement', res.Content)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getters: {
|
|
|
|
+ token: (state) => state.token,
|
|
|
|
+ },
|
|
modules: {
|
|
modules: {
|
|
}
|
|
}
|
|
})
|
|
})
|