From bf70f3cf825f44c457dba2bebd26e7af73e4b2a8 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期五, 06 九月 2024 15:02:09 +0800
Subject: [PATCH] 解决集成日志查询bug

---
 Source/UBCS-WEB/src/router/avue-router.js |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/Source/UBCS-WEB/src/router/avue-router.js b/Source/UBCS-WEB/src/router/avue-router.js
index 6548d8e..e39c327 100644
--- a/Source/UBCS-WEB/src/router/avue-router.js
+++ b/Source/UBCS-WEB/src/router/avue-router.js
@@ -23,23 +23,18 @@
     return result.join('&');
   }
 
-  let titileName;
   this.$router.$avueRouter = {
     //鍏ㄥ眬閰嶇疆
     $website: this.$store.getters.website,
     group: '',
     meta: {},
     safe: this,
-    tianyuan:'',
     // 璁剧疆鏍囬
     setTitle: (title) => {
-      titileName=title
       const defaultTitle = this.$vue.$t('title');
-      this.$router.$avueRouter.tianyuan=title
       title = title ? `${title}-${defaultTitle}` : defaultTitle;
       document.title = title;
     },
-
     closeTag: (value) => {
       let tag = value || this.$store.getters.tag;
       if (typeof value === 'string') {
@@ -90,11 +85,13 @@
     },
     //鍔ㄦ�佽矾鐢�
     // 璺敱鏄笓闂ㄧ殑涓�涓帴鍙h幏鍙�
-    /**
-     * aMenu: 鎺ュ彈鍒扮殑鍔ㄦ�佽矾鐢辨暟鎹� menu鐨勭粨鏋勫灞傛湁鐖剁骇path 閲岄潰鏈変竴涓猚hilden 璁板綍椤甸潰鐨勮矾鐢�
-     * first: 涓轰簡鍖哄垎澶栫晫 璋冪敤formatRoutes 鍜� 褰撳墠鏂囦欢璋冪敤 formatRoutes
-     */
+      /**
+       * aMenu: 鎺ュ彈鍒扮殑鍔ㄦ�佽矾鐢辨暟鎹� menu鐨勭粨鏋勫灞傛湁鐖剁骇path 閲岄潰鏈変竴涓猚hilden 璁板綍椤甸潰鐨勮矾鐢�
+       * first: 涓轰簡鍖哄垎澶栫晫 璋冪敤formatRoutes 鍜� 褰撳墠鏂囦欢璋冪敤 formatRoutes
+      */
     formatRoutes: function (aMenu = [], first) {
+      // window.console.log('aMenu')
+      // window.console.log(aMenu)
       const aRouter = []
       // 鑾峰彇鍒板叏灞�閰嶇疆涓殑 props
       const propsConfig = this.$website.menu.props;
@@ -102,6 +99,8 @@
       const propsDefault = {
         label: propsConfig.label || 'name',
         path: propsConfig.path || 'path',
+        fullPath: propsConfig.fullPath || 'fullPath',
+        query:propsConfig.query || 'query',
         icon: propsConfig.icon || 'icon',
         children: propsConfig.children || 'children',
         meta: propsConfig.meta || 'meta',
@@ -120,14 +119,29 @@
             } else {
               return oMenu[propsDefault.path]
             }
-          })(),
+          })();
+
+          let fullPath=path;
+        let query=oMenu[propsDefault.query] || {};
+        if(path.indexOf('?')!=-1){
+          let params=path.split('?')[1].split('@');
+          path=path.split('?')[0]
+          params.forEach(pitem=>{
+            try {
+              query[pitem.split('=')[0]]=pitem.split('=')[1];
+            }catch (e) {
+              query[pitem.split('=')[0]]=null;
+            }
+
+          })
+        }
           //鐗规畩澶勭悊缁勪欢 鎵ц瀹岃繖涓� component 涔熷氨鏄簿纭埌鍏蜂綋鐨勬枃浠朵簡  views鏂囦欢澶逛笅闈㈠氨鏄叿浣撶殑椤甸潰浠g爜
-          component = 'views' + oMenu.path,
+         let component = 'views' + path,
           name = oMenu[propsDefault.label],
           icon = oMenu[propsDefault.icon],
           children = oMenu[propsDefault.children],
           meta = oMenu[propsDefault.meta] || {};
-        // meta涓� keepalive 鐨勫鐞�
+          // meta涓� keepalive 鐨勫鐞�
         meta = Object.assign(meta, (function () {
           if (option.keepAlive === true) {
             return {
@@ -139,6 +153,9 @@
         const isChild = children.length !== 0;
         const oRouter = {
           path: path,
+          fullPath:fullPath,
+          query:query,
+          params:query,
           component(resolve) {
             // 鍒ゆ柇鏄惁涓洪璺敱
             if (first) {
@@ -182,12 +199,11 @@
             /**
              * 杩欓噷鏄噸鐐癸紝褰撴湁瀛愯矾鐢辩殑鏃跺�� 浼氬啀鍘绘墽琛� formatRoutes 鏂规硶锛岀劧鍚庡張浼氭湁涓�涓柊鐨� aMenu for寰幆銆�
              * 鏈�鍚庤繑鍥炵殑鏄竴涓暟缁� aRouter 杩欎釜鏁扮粍灏变細浣滀负 childen鐨勫�艰 return
-             */
+            */
             return this.formatRoutes(children, false)
           })()
         }
         aRouter.push(oRouter)
-        // console.log(aRouter)
       }
       // for寰幆缁撴潫
       // 杩欎釜first 鍗$殑鍏跺疄灏辨槸棣栬矾鐢�

--
Gitblit v1.9.3