From 71927d489198518e2a9e4188340dfbdc35caa3a2 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 29 十一月 2023 10:46:08 +0800
Subject: [PATCH] 1.标准变系列,系列变系列测试 2.业务数据数据更改,直接发布
---
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