Jelajahi Sumber

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

LAPTOP-16IUEB3P\Lenovo 2 tahun lalu
induk
melakukan
5248762177
3 mengubah file dengan 23 tambahan dan 1 penghapusan
  1. 3 1
      src/config/setting.js
  2. 2 0
      src/store/index.js
  3. 18 0
      src/store/modules/selectCache.js

+ 3 - 1
src/config/setting.js

@@ -109,7 +109,9 @@ export const TOKEN_STORE_NAME = window.__POWERED_BY_QIANKUN__
   : `${SYSTEM_NAME}-access_token`;
 
 // 主题配置存储的名称
-export const THEME_STORE_NAME = 'theme';
+export const THEME_STORE_NAME = window.__POWERED_BY_QIANKUN__
+  ? 'theme'
+  : `${SYSTEM_NAME}-theme`;
 
 // i18n 缓存的名称
 export const I18N_CACHE_NAME = 'i18n-lang';

+ 2 - 0
src/store/index.js

@@ -7,6 +7,7 @@ import getters from './getters';
 import dict from './modules/dict';
 import user from './modules/user';
 import theme from './modules/theme';
+import selectCache from './modules/selectCache';
 import team from './modules/team';
 import createPersistedState from 'vuex-persistedstate';
 
@@ -21,6 +22,7 @@ export default new Vuex.Store({
     dict,
     user,
     theme,
+    selectCache,
     team
   },
   getters,

+ 18 - 0
src/store/modules/selectCache.js

@@ -0,0 +1,18 @@
+// 公共选择组件数据缓存
+import Vue from 'vue';
+const state = {};
+
+const mutations = {
+  ADD_SELECT: (state, { name, dict }) => {
+    Vue.set(state, name, dict);
+  }
+};
+
+const actions = {};
+
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions
+};