liuyg
2021-11-03 ad22bccdb0bd1cee5d038b56f4d23a560c368e27
src/store/modules/dict.js
@@ -1,15 +1,16 @@
import {getStore, setStore} from '@/util/store'
import { getStore, setStore } from '@/util/store'
import {getDictionary} from '@/api/system/dict'
import { getDictionary } from '@/api/system/dict'
const dict = {
  state: {
    flowRoutes: getStore({name: 'flowRoutes'}) || {},
    flowRoutes: getStore({ name: 'flowRoutes' }) || {},
    rotesData: false,
  },
  actions: {
    FlowRoutes({commit}) {
    FlowRoutes({ commit }) {
      return new Promise((resolve, reject) => {
        getDictionary({code: 'flow'}).then(res => {
        getDictionary({ code: 'flow' }).then(res => {
          commit('SET_FLOW_ROUTES', res.data.data);
          resolve();
        }).catch(error => {
@@ -17,6 +18,7 @@
        })
      })
    },
  },
  mutations: {
    SET_FLOW_ROUTES: (state, data) => {
@@ -26,8 +28,11 @@
          routeValue: item.remark,
        };
      });
      setStore({name: 'flowRoutes', content: state.flowRoutes})
      setStore({ name: 'flowRoutes', content: state.flowRoutes })
    },
    setRotesData(state, data) {
      state.rotesData = data;
    }
  }
};