From 72c7bbd66b8456db7dabf0dbc15f7aa9c2af2b9d Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期三, 05 六月 2024 14:53:54 +0800
Subject: [PATCH] 项目引用调整
---
Source/ProjectWeb/src/router/avue-router.js | 38 +++++++++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/Source/ProjectWeb/src/router/avue-router.js b/Source/ProjectWeb/src/router/avue-router.js
index e8f5e4b..52c14c9 100644
--- a/Source/ProjectWeb/src/router/avue-router.js
+++ b/Source/ProjectWeb/src/router/avue-router.js
@@ -1,3 +1,5 @@
+import {validatenull} from "@/util/validate";
+
let RouterPlugin = function () {
this.$router = null;
this.$store = null;
@@ -96,9 +98,9 @@
// 璁剧疆 props榛樿鍊� 浣滅敤灏辨槸灏嗗瓧娈佃缃垚閰嶇疆鐨�
const propsDefault = {
label: propsConfig.label || 'name',
- path:'code',
+ path: 'code',
code: 'code',
- pathValue:'pathValue',
+ pathValue: 'pathValue',
icon: propsConfig.icon || 'icon',
children: propsConfig.children || 'children',
meta: propsConfig.meta || 'meta',
@@ -121,16 +123,30 @@
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";
+
+ let component = '';
+ let parts = '';
+
+ // 濡傛灉璺緞涓瓨鍦� '?'锛屽垯鍙栭棶鍙峰墠闈㈤儴鍒嗙粰 parts
+ if (path.includes('?')) {
+ parts = path.split("?")[0];
+ } else {
+ parts = path; // 涓嶅瓨鍦� '?' 鏁存潯璺緞灏辨槸 parts
}
- //鐗规畩澶勭悊缁勪欢 鎵ц瀹岃繖涓� component 涔熷氨鏄簿纭埌鍏蜂綋鐨勬枃浠朵簡 views鏂囦欢澶逛笅闈㈠氨鏄叿浣撶殑椤甸潰浠g爜
- let component = bsValue === 'UI' ? 'views/base/UIContentViewer' : `views/custom-ui/${bsValue}`,
- name = oMenu[propsDefault.label],
+ if(validatenull(parts)){
+ parts='UI';
+ }
+ // 濡傛灉闂彿鍓嶉潰閮ㄥ垎涓嶅湪 ['ui', 'UI', 'base'] 涓紝鍒欐槸鑷畾涔夌粍浠�
+ if (!['ui', 'UI', 'base','bs'].includes(parts) && parts.indexOf('views/')==-1) {
+ component = `views/custom-ui/${parts}`;
+ }else if (['UI', 'ui', 'base','bs'].includes(parts)) {
+ // 濡傛灉闂彿鍓嶉潰绛変簬 UI銆乽i 鍒欎负UI寮曟搸
+ component = 'views/base/UIContentViewer';
+ }else{
+ component = `${parts}`;
+ }
+
+ let name = oMenu[propsDefault.label],
icon = oMenu[propsDefault.icon],
children = oMenu[propsDefault.children],
meta = oMenu[propsDefault.meta] || {};
--
Gitblit v1.9.3