12345678910111213141516171819202122232425262728293031 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- import { getGraphElementType } from "@/api/editer.js"
- Vue.use(Vuex)
- export default new Vuex.Store({
- state: {
- GraphCategoryIds: ['NTXT'], //系统类型
- TypeIdToGraphElement:{}, //typeid到图例元素的映射
- },
- mutations: {
- TypeIdToGraphElement(state,data){
- if (data.length) {
- state.TypeIdToGraphElement = {}
- data.forEach(t => {
- state.TypeIdToGraphElement[t.Id] = t;
- })
- }
- }
- },
- actions: {
- getElementType({ commit }, params) {
- getGraphElementType(params).then(res => {
- commit('TypeIdToGraphElement',res.Content)
- })
- }
- },
- modules: {
- }
- })
|