ludc
2025-01-16 391eec3114a17e68652434c6eae610799d80290e
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
54
55
56
57
58
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import common from './modules/common'
import tags from './modules/tags'
import logs from './modules/logs'
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({
  modules: {
    user,
    common,
    logs,
    tags,
    dict,
    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