|
@@ -1,6 +1,6 @@
|
|
|
import Vue from 'vue'
|
|
|
import Vuex from 'vuex'
|
|
|
-import { getGraphElementType } from "@/api/editer.js"
|
|
|
+import { getGraphElementType, graphElementQuery } from "@/api/editer.js"
|
|
|
|
|
|
Vue.use(Vuex)
|
|
|
|
|
@@ -9,6 +9,7 @@ export default new Vuex.Store({
|
|
|
GraphCategoryIds: ['NTXT'], //系统类型
|
|
|
TypeIdToGraphElement: {}, //typeid到图例元素的映射
|
|
|
token: null,
|
|
|
+ GraphElement:[]
|
|
|
},
|
|
|
mutations: {
|
|
|
TypeIdToGraphElement(state, data) {
|
|
@@ -19,6 +20,15 @@ export default new Vuex.Store({
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ GraphElement(state, data) {
|
|
|
+ if (data.length) {
|
|
|
+ state.GraphElement = data.map(t => {
|
|
|
+ if (t.InfoTypeId && t.InfoTypeId.length){
|
|
|
+ return t
|
|
|
+ }
|
|
|
+ }).filter(item => item)
|
|
|
+ }
|
|
|
+ },
|
|
|
SETSSOTOKEN(state, data) {
|
|
|
state.token = data
|
|
|
},
|
|
@@ -28,7 +38,12 @@ export default new Vuex.Store({
|
|
|
getGraphElementType(params).then(res => {
|
|
|
commit('TypeIdToGraphElement', res.Content)
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ getGraphElement({ commit }, params) {
|
|
|
+ graphElementQuery(params).then(res => {
|
|
|
+ commit('GraphElement', res.Content)
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
getters: {
|
|
|
token: (state) => state.token,
|