From a758bc277ff4d1f8ede96a03cbbc10b96176be82 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 21 七月 2023 15:28:36 +0800 Subject: [PATCH] 路由配置 --- Source/UBCS-WEB/src/router/avue-router.js | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Source/UBCS-WEB/src/router/avue-router.js b/Source/UBCS-WEB/src/router/avue-router.js index 0e68bda..6548d8e 100644 --- a/Source/UBCS-WEB/src/router/avue-router.js +++ b/Source/UBCS-WEB/src/router/avue-router.js @@ -23,18 +23,23 @@ 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') { @@ -85,13 +90,11 @@ }, //鍔ㄦ�佽矾鐢� // 璺敱鏄笓闂ㄧ殑涓�涓帴鍙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; @@ -124,7 +127,7 @@ 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 { @@ -179,11 +182,12 @@ /** * 杩欓噷鏄噸鐐癸紝褰撴湁瀛愯矾鐢辩殑鏃跺�� 浼氬啀鍘绘墽琛� formatRoutes 鏂规硶锛岀劧鍚庡張浼氭湁涓�涓柊鐨� aMenu for寰幆銆� * 鏈�鍚庤繑鍥炵殑鏄竴涓暟缁� aRouter 杩欎釜鏁扮粍灏变細浣滀负 childen鐨勫�艰 return - */ + */ return this.formatRoutes(children, false) })() } aRouter.push(oRouter) + // console.log(aRouter) } // for寰幆缁撴潫 // 杩欎釜first 鍗$殑鍏跺疄灏辨槸棣栬矾鐢� -- Gitblit v1.9.3