From 930a0652ab5b2e34c8b3b184659f84ae82e8ce25 Mon Sep 17 00:00:00 2001
From: Ldc <ldc@vci.com>
Date: 星期日, 07 四月 2024 18:14:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/ProjectWeb/src/router/avue-router.js |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/Source/ProjectWeb/src/router/avue-router.js b/Source/ProjectWeb/src/router/avue-router.js
index a12448f..9d2fc30 100644
--- a/Source/ProjectWeb/src/router/avue-router.js
+++ b/Source/ProjectWeb/src/router/avue-router.js
@@ -97,7 +97,9 @@
       // 璁剧疆 props榛樿鍊� 浣滅敤灏辨槸灏嗗瓧娈佃缃垚閰嶇疆鐨�
       const propsDefault = {
         label: propsConfig.label || 'name',
-        path: propsConfig.path || 'path',
+        path:'code',
+        code: 'code',
+        pathValue:'pathValue',
         icon: propsConfig.icon || 'icon',
         children: propsConfig.children || 'children',
         meta: propsConfig.meta || 'meta',
@@ -110,15 +112,25 @@
         const oMenu = aMenu[i];
         // 杩欎竴鍧楃殑璧嬪�� 涔熷氨鏄彇鍒拌繑鍥炵殑鍊�
         let path = (() => {
-            if (first) {
-              // 灏� '/index' 鏇挎崲涓� ''
-              return oMenu[propsDefault.path].replace('/index', '')
-            } else {
-              return oMenu[propsDefault.path]
-            }
-          })(),
-          //鐗规畩澶勭悊缁勪欢 鎵ц瀹岃繖涓� component 涔熷氨鏄簿纭埌鍏蜂綋鐨勬枃浠朵簡  views鏂囦欢澶逛笅闈㈠氨鏄叿浣撶殑椤甸潰浠g爜
-          component = 'views' + path,
+          if (first) {
+            // 灏� '/index' 鏇挎崲涓� ''
+            return oMenu[propsDefault.pathValue].replace('/index', '')
+          } else {
+            return oMenu[propsDefault.pathValue]
+          }
+        })();
+        let code = (() => {
+          return oMenu[propsDefault.code]
+        })();
+        // 灏嗗瓧绗︿覆鍒嗗壊鎴愭暟缁勶紝浠�'?'浣滀负鍒嗛殧绗�
+        let parts = path.split("?");
+        // 濡傛灉鏁扮粍鐨勯暱搴﹀ぇ浜�1锛岃〃绀烘湁'?'锛屽垯鍙栫涓�涓厓绱犵殑绗竴涓儴鍒嗭紝鍚﹀垯鐩存帴鍙栨暣涓瓧绗︿覆
+        let bsValue = parts.length > 1 ? parts[0].split("=")[1] : path.split("=")[1];
+        if (bsValue === '' || bsValue === undefined || bsValue === null) {
+          bsValue = "UI";
+        }
+        //鐗规畩澶勭悊缁勪欢 鎵ц瀹岃繖涓� component 涔熷氨鏄簿纭埌鍏蜂綋鐨勬枃浠朵簡  views鏂囦欢澶逛笅闈㈠氨鏄叿浣撶殑椤甸潰浠g爜
+        let component = bsValue === 'UI' ? 'views/base/UIContentViewer' : `views/custom-ui/${bsValue}`,
           name = oMenu[propsDefault.label],
           icon = oMenu[propsDefault.icon],
           children = oMenu[propsDefault.children],
@@ -134,7 +146,7 @@
         //鏄惁鏈夊瓙璺敱
         const isChild = children.length !== 0;
         const oRouter = {
-          path: path,
+          path: '/' + code,
           component(resolve) {
             // 鍒ゆ柇鏄惁涓洪璺敱
             if (first) {
@@ -162,7 +174,7 @@
           children: !isChild ? (() => {
             if (first) {
               // 杩欓噷鐨刬sURL鍒ゆ柇锛屽洜涓鸿繖涓綉绔欐湁浣跨敤 iframe銆傛墍浠ラ渶瑕佸垽鏂槸鍚︿负缃戦〉閾炬帴
-              if (!isURL(path)) oMenu[propsDefault.path] = `${path}/index`;
+              if (!isURL(path)) oMenu[propsDefault.pathValue] = `${path}/index`;
               return [{
                 component(resolve) {
                   require([`../${component}.vue`], resolve)

--
Gitblit v1.9.3