From a3c868db4d017961be2d394eadb7d428045d5adc Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期四, 13 七月 2023 11:13:16 +0800
Subject: [PATCH] 业务类型页面增加生命周期的处理

---
 Source/UBCS-WEB/dist/src/store/modules/dict.js |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS-WEB/dist/src/store/modules/dict.js b/Source/UBCS-WEB/dist/src/store/modules/dict.js
new file mode 100644
index 0000000..837dbe6
--- /dev/null
+++ b/Source/UBCS-WEB/dist/src/store/modules/dict.js
@@ -0,0 +1,35 @@
+import {getStore, setStore} from '@/util/store'
+
+import {getDictionary} from '@/api/system/dict'
+
+const dict = {
+  state: {
+    flowRoutes: getStore({name: 'flowRoutes'}) || {},
+  },
+  actions: {
+    FlowRoutes({commit}) {
+      return new Promise((resolve, reject) => {
+        getDictionary({code: 'flow'}).then(res => {
+          commit('SET_FLOW_ROUTES', res.data.data);
+          resolve();
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
+  },
+  mutations: {
+    SET_FLOW_ROUTES: (state, data) => {
+      state.flowRoutes = data.map(item => {
+        return {
+          routeKey: `${item.code}_${item.dictKey}`,
+          routeValue: item.remark,
+        };
+      });
+      setStore({name: 'flowRoutes', content: state.flowRoutes})
+    },
+  }
+
+};
+
+export default dict;

--
Gitblit v1.9.3