From 299968bd321e12d5363f0bdd6f46c37287f9e139 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期一, 13 一月 2025 15:54:41 +0800
Subject: [PATCH] 修改部分bug以及整合代码

---
 Source/plt-web/plt-web-ui/src/store/modules/user.js |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/store/modules/user.js b/Source/plt-web/plt-web-ui/src/store/modules/user.js
index da2ef54..fc95d95 100644
--- a/Source/plt-web/plt-web-ui/src/store/modules/user.js
+++ b/Source/plt-web/plt-web-ui/src/store/modules/user.js
@@ -16,8 +16,8 @@
   const propsDefault = {
     label: propsConfig.label || 'name',
     path: propsConfig.path || 'path',
-    icon: propsConfig.icon || 'icon',
-    children: propsConfig.children || 'children'
+    icon: propsConfig.icon || 'source',
+    children: propsConfig.children || 'children',
   }
   const icon = ele[propsDefault.icon];
   ele[propsDefault.icon] = validatenull(icon) ? menu.iconDefault : icon;
@@ -36,7 +36,7 @@
 function updateCode(items) {
   items.forEach(item => {
     item.pathValue = item.path;
-    item.path = '/' + item.code;
+    item.path = '/' + item.id;
     item.query = {}; // 鍒濆鍖� item.query
     if (item.pathValue.indexOf('?') != -1) {
       item.query = queryStringToObject(item.pathValue)
@@ -232,7 +232,7 @@
 
           commit('SET_MENU_ALL', menu)
           commit('SET_MENU', menu)
-          //dispatch('GetButtons');s
+          dispatch('GetButtons');
           resolve(menu)
         })
       })
@@ -302,10 +302,17 @@
         let children = {};
         if (item.children && item.children.length > 0) {
           item.children.forEach(child => {
-            Vue.set(children, child.code, true);
+            // const childObject = {
+            //   [child.code]: true,
+            //   source: child.source
+            // };
+            // Object.assign(children, childObject);
+            children[child.code] = {
+              source: child.source
+            }
           });
         }
-        Vue.set(permission_new, item.code, children);
+        Vue.set(permission_new, item.id, children);
       });
       state.permission = permission_new;
       setStore({name: "permission", content: permission_new});

--
Gitblit v1.9.3