wangting
2024-12-10 d63e6915b164ff94738f1848295406db79da45a7
Source/plt-web/plt-web-ui/src/store/index.js
@@ -7,6 +7,7 @@
import dict from './modules/dict'
import getters from './getters'
import flow from './modules/LifeFlow'
import { setStore } from "@/util/store.js";
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -19,6 +20,39 @@
    flow
  },
  getters,
  state: {
    icons:undefined,//图标库数据
    viewtabparams:undefined, //tab浏览 Action参数
  },
  mutations: {
    // tab浏览参数
    getViewtabparams(state, obj) {
      state.viewtabparams = obj;
    },
    // 图标库
    getIcons(state, obj) {
      state.icons = obj;
    },
  },
  actions: {
    setViewtabparams({ commit }, obj){
      commit("getViewtabparams", obj);
      setStore({
        name:'viewtabparams',
        content:obj,
        type:'session'
      });
    },
    //保存图标库到本地
    setIcons({commit},obj){
      commit("getIcons", obj);
      setStore({
        name:'icons',
        content:obj,
        type:'session'
      });
    }
  }
})
export default store