@utogether/udp-core 1.0.1-beta.1 → 1.0.1-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/plugins.ts +39 -32
- package/dist/{403-Dp617CWX.js → 403-Ctxjn4q8.js} +1 -1
- package/dist/{404-Cz_Axb6Y.js → 404-W5yzyiZ9.js} +1 -1
- package/dist/{500-BGCtRNse.js → 500-DXuGEOm4.js} +1 -1
- package/dist/{AuthorityInfo-DGGfm7IS.js → AuthorityInfo-C2tflCt8.js} +1 -1
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-SVgy3HX7.js +100 -0
- package/dist/{Company-IV3GTnzY.js → Company-PLez5GoH.js} +3 -3
- package/dist/{CompanyPanel-qV-_VtoL.js → CompanyPanel-CIGaQooL.js} +16 -16
- package/dist/{Department-B3W-OxW8.js → Department-B9wLsXFm.js} +3 -3
- package/dist/{DepartmentPanel-Cw3OWxE7.js → DepartmentPanel-DSM4lTaz.js} +1 -1
- package/dist/{DesignPanel-BFxR2fHJ.js → DesignPanel-B6a9wW_A.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DljbeFba.js → DesignPanel.vue_vue_type_style_index_0_lang-DtHfoDQk.js} +24 -26
- package/dist/DictView-DhFbQxdJ.js +110 -0
- package/dist/InvOrganization-D90AbR3b.js +66 -0
- package/dist/Org-DxBkYabD.js +39 -0
- package/dist/{Preview-BlDMmpdR.js → Preview-BFtRpBxw.js} +1 -1
- package/dist/{ReportDefine-Cub_85LA.js → ReportDefine-BIa2QryC.js} +1 -1
- package/dist/{ReportDesign-hFhq5UVE.js → ReportDesign-CnyjI-WD.js} +43 -43
- package/dist/{ReportQuery-ChkWEyxT.js → ReportQuery-BiK7yEhV.js} +1 -1
- package/dist/{ReportQueryFrom-KVyD_8Dj.js → ReportQueryFrom-C2rqdFTm.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CLNODquq.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Ba9HLnXQ.js} +1 -1
- package/dist/{ReportTemplate-ag9NDvh2.js → ReportTemplate-DdkLscP3.js} +28 -28
- package/dist/{Role-_q3lQ8CZ.js → Role-BrsxgK8D.js} +6 -6
- package/dist/{RoleAssign-DZb9IRsm.js → RoleAssign-DiqwJqDa.js} +8 -8
- package/dist/{RolePanel-CsLsz-Ds.js → RolePanel-BDusGyo7.js} +1 -1
- package/dist/{RolePanel-BQb1LlhD.js → RolePanel-Dqx5dI3f.js} +1 -1
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-2Z1q_5uW.js +132 -0
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BrnRgHEk.js → RolePanel.vue_vue_type_script_setup_true_lang-B5lUnaMI.js} +44 -38
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CaFKRwXu.js → ScrollPanel.vue_vue_type_style_index_0_lang-vSP23fEq.js} +21 -21
- package/dist/{Staff-BSf9Ypbk.js → Staff-Cwi9LQiZ.js} +3 -3
- package/dist/{StaffInfo-BNKasyMF.js → StaffInfo-XjVtyaMv.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DDZ7ukd0.js → StaffInfo.vue_vue_type_script_setup_true_lang-wSrAuyet.js} +11 -11
- package/dist/{StaffPanel-Bpq0WVlH.js → StaffPanel-C-wYcFdv.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-BhiJ0Q-Q.js → StaffPanel.vue_vue_type_script_setup_true_lang-DZNArmnC.js} +2 -2
- package/dist/{SysUser-FAABuNti.js → SysUser-O4tvr-Ur.js} +2 -2
- package/dist/{SysUserPanel-PxJeOgHm.js → SysUserPanel-B853docZ.js} +1 -1
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-DhiYYC97.js +294 -0
- package/dist/{SystemMenu-C-7NAGon.js → SystemMenu-CXR6mrXr.js} +26 -26
- package/dist/{UserInfo-ClXKtyGo.js → UserInfo-BkP8pE2a.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-8N7P4Hl7.js → UserInfo.vue_vue_type_style_index_0_lang-D4r_umjV.js} +39 -37
- package/dist/{childView-C_HmDQNd.js → childView-D0HwbgDT.js} +1 -1
- package/dist/{childView-uUlBcTza.js → childView-TRqUkSDC.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-Ckjmw6wJ.js → childView.vue_vue_type_style_index_0_lang-BzISq0Jf.js} +40 -40
- package/dist/{childView.vue_vue_type_style_index_0_lang-y0sDvYx5.js → childView.vue_vue_type_style_index_0_lang-DQRgNsJY.js} +1 -1
- package/dist/{code-rule-AgCVDKFy.js → code-rule-BV7PQWhK.js} +9 -10
- package/dist/core.es.js +14 -11
- package/dist/{cron-task-C6FgQxTi.js → cron-task-9ZS9bi7K.js} +1 -1
- package/dist/{frameView-BDgISK7N.js → frameView-DE83AN50.js} +1 -1
- package/dist/img/l_img.svg +1 -1
- package/dist/img/minicolors.png +0 -0
- package/dist/img/v_img.svg +1 -1
- package/dist/index-DVARtten.js +2623 -0
- package/dist/{layoutView-yb3DV2DQ.js → layoutView-D1U-c4By.js} +111 -110
- package/dist/{login-log-CvVnyGi3.js → login-log-kqKzKTto.js} +1 -1
- package/dist/{login-RRpljbkm.js → login-sPCEiTGT.js} +106 -113
- package/dist/{lov-view-C9-rjzZR.js → lov-view-76NcYTYl.js} +2 -2
- package/dist/{menuInfo-CzPQyFhp.js → menuInfo-CxjfjFpm.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BumXunCg.js → menuInfo.vue_vue_type_style_index_0_lang-C2qahH3r.js} +100 -97
- package/dist/{pda-app-Dvy3U-b6.js → pda-app-BUH16bLj.js} +211 -197
- package/dist/{resource-Fy0lFkSV.js → resource-CCuHzoA6.js} +15 -15
- package/dist/{su-welcome-DYvSCUST.js → su-welcome-mRArONsd.js} +109 -110
- package/dist/{sys-config-DJ1vNQTy.js → sys-config-Cvt05yF6.js} +7 -7
- package/dist/udp-core.css +2 -2
- package/dist/{utogether-CjmJiHoE.js → utogether-Dm_VBQHR.js} +1 -1
- package/index.ts +40 -36
- package/package.json +1 -1
- package/src/App.vue +65 -70
- package/src/api/index.ts +1 -1
- package/src/components/SuCharts/src/UserInfo.vue +78 -78
- package/src/components/SuScrollTree/ScrollPanel.vue +3 -3
- package/src/components/udp/count-down.vue +536 -0
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +251 -0
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +4 -0
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +113 -0
- package/src/components/udp/form-upload.vue +414 -64
- package/src/components/udp/form.vue +112 -0
- package/src/components/udp/grid.vue +495 -0
- package/src/components/udp/index.ts +10 -4
- package/src/components/udp/lov.vue +388 -0
- package/src/components/udp/modal-form.vue +11 -2
- package/src/components/udp/modal-grid.vue +288 -0
- package/src/components/udp/upload.vue +423 -0
- package/src/components/udp/utils.ts +447 -40
- package/src/directives/permission/index.ts +1 -1
- package/src/layout/components/lay-navbar/index.vue +1 -1
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
- package/src/layout/components/lay-tag/index.vue +625 -625
- package/src/layout/layoutView.vue +215 -215
- package/src/main.ts +23 -13
- package/src/plugins/i18n/en.ts +302 -289
- package/src/plugins/i18n/zh.ts +348 -337
- package/src/plugins/vxe-table/index.ts +53 -46
- package/src/plugins/vxe-table/render.tsx +956 -817
- package/src/router/index.ts +187 -183
- package/src/router/modules/remaining.ts +58 -83
- package/src/style/button.scss +85 -78
- package/src/style/tailwind.css +1 -68
- package/src/style/vxetable.scss +44 -11
- package/src/utils/authority/index.ts +1 -1
- package/src/utils/{http → udp/http}/index.ts +8 -24
- package/src/utils/{http → udp/http}/types.d.ts +8 -5
- package/src/utils/udp/useRender.ts +17 -6
- package/src/views/login/login-view.vue +2 -2
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/inv-org/InvOrganization.vue +2 -3
- package/src/views/organization/org/Org.vue +9 -5
- package/src/views/system/menu/SystemMenu.vue +183 -197
- package/src/views/system/menu/menuInfo.vue +363 -371
- package/src/views/system/role/AuthorityInfo.vue +19 -15
- package/src/views/system/role/Role.vue +1 -5
- package/src/views/system/role/RolePanel.vue +11 -2
- package/src/views/system/role/UserInfo.vue +195 -193
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -136
- package/src/views/system/sys/sys-config.vue +1 -1
- package/src/views/system/sysUser/SysUserPanel.vue +278 -278
- package/src/views/uapp/pda/pda-app.vue +208 -176
- package/src/views/udev/dict/DictView.vue +118 -106
- package/src/views/udev/dict/childView.vue +7 -7
- package/src/views/udev/lov/lov-view.vue +91 -91
- package/src/views/ufile/aggregation/File.vue +5 -5
- package/src/views/ufile/file/water-mark.vue +14 -14
- package/src/views/uhome/su-welcome.vue +3 -3
- package/src/views/ulogin/login.vue +14 -9
- package/src/views/upms/user/login-log.vue +1 -1
- package/src/views/urpt/design/DesignPanel.vue +507 -526
- package/src/views/urpt/design/ReportDesign.vue +15 -19
- package/src/views/urpt/static-resource/resource.vue +3 -3
- package/src/views/urpt/template/ReportTemplate.vue +7 -7
- package/types/global.d.ts +2 -1
- package/vite.config.ts +6 -2
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-BqccGW7v.js +0 -102
- package/dist/DictView-C-i7e4hZ.js +0 -95
- package/dist/InvOrganization-cfT6riGU.js +0 -260
- package/dist/Org-CA7vTDIF.js +0 -35
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-cmW7zBLu.js +0 -126
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-njefUln5.js +0 -288
- package/dist/index-DzOzUkf6.js +0 -3388
package/src/router/index.ts
CHANGED
|
@@ -1,183 +1,187 @@
|
|
|
1
|
-
import { findIndexOf, isEmpty } from 'xe-utils';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
export const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
export const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
1
|
+
import { findIndexOf, isEmpty } from 'xe-utils';
|
|
2
|
+
import type { Router, RouteRecordRaw, RouteComponent } from 'vue-router';
|
|
3
|
+
import { cookies, NProgress, openLink, isUrl, buildHierarchyTree } from '@utogether/utils';
|
|
4
|
+
import { useMultiTagsStoreHook } from '../store/modules/multiTags';
|
|
5
|
+
import { usePermissionStoreHook } from '../store/modules/permission';
|
|
6
|
+
import {
|
|
7
|
+
ascending,
|
|
8
|
+
initRouter,
|
|
9
|
+
findRouteByPath,
|
|
10
|
+
formatTwoStageRoutes,
|
|
11
|
+
formatFlatteningRoutes
|
|
12
|
+
} from './utils';
|
|
13
|
+
// import { getEnv } from '../config';
|
|
14
|
+
import { kLOGINER } from '../contant';
|
|
15
|
+
|
|
16
|
+
import homeRouter from './modules/home';
|
|
17
|
+
import errorRouter from './modules/error';
|
|
18
|
+
import remainingRouter from './modules/remaining';
|
|
19
|
+
|
|
20
|
+
const systemRouter = import.meta.glob([
|
|
21
|
+
'../views/system/**/*.{vue,tsx}',
|
|
22
|
+
'../views/uapp/**/*.{vue,tsx}',
|
|
23
|
+
'../views/upms/**/*.{vue,tsx}',
|
|
24
|
+
'../views/ufile/**/*.{vue}',
|
|
25
|
+
'../views/urpt/**/*.{vue,tsx}',
|
|
26
|
+
'../views/organization/**/*.{vue,tsx}',
|
|
27
|
+
'../views/udev/**/*.{vue, tsx}'
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
export const remainingRouters = remainingRouter;
|
|
31
|
+
|
|
32
|
+
// 原始静态路由(未做任何处理)
|
|
33
|
+
const routes = [homeRouter, errorRouter];
|
|
34
|
+
/** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
|
|
35
|
+
export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
|
|
36
|
+
formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
/** 用于渲染菜单,保持原始层级 */
|
|
40
|
+
export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
|
|
41
|
+
|
|
42
|
+
/** 不参与菜单的路由 */
|
|
43
|
+
export const remainingPaths = Object.keys(remainingRouter).map(v => {
|
|
44
|
+
return remainingRouter[v].path;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/** 创建路由实例 */
|
|
48
|
+
// export const router: Router = createRouter({
|
|
49
|
+
// history: createWebHistory(window.__HISTORY_PATH__),
|
|
50
|
+
// routes: constantRoutes.concat(...(remainingRouter as any)),
|
|
51
|
+
// strict: true,
|
|
52
|
+
// scrollBehavior(to, from, savedPosition) {
|
|
53
|
+
// return new Promise(resolve => {
|
|
54
|
+
// if (savedPosition) {
|
|
55
|
+
// return savedPosition;
|
|
56
|
+
// } else {
|
|
57
|
+
// if (from.meta.saveSrollTop) {
|
|
58
|
+
// const top: number = document.documentElement.scrollTop || document.body.scrollTop;
|
|
59
|
+
// resolve({ left: 0, top });
|
|
60
|
+
// }
|
|
61
|
+
// }
|
|
62
|
+
// });
|
|
63
|
+
// }
|
|
64
|
+
// });
|
|
65
|
+
|
|
66
|
+
/** 重置路由 */
|
|
67
|
+
export function resetRouter() {
|
|
68
|
+
router.getRoutes().forEach(route => {
|
|
69
|
+
const { name, meta } = route;
|
|
70
|
+
if (name && router.hasRoute(name) && meta?.backstage) {
|
|
71
|
+
router.removeRoute(name);
|
|
72
|
+
router.options.routes = formatTwoStageRoutes(
|
|
73
|
+
formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
usePermissionStoreHook().clearAllCachePage();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
let views = null;
|
|
81
|
+
export let router = null;
|
|
82
|
+
export function setViews(cviews, crouter) {
|
|
83
|
+
views = cviews;
|
|
84
|
+
router = crouter;
|
|
85
|
+
Object.assign(views, systemRouter);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function getViews() {
|
|
89
|
+
return views;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** 路由白名单 */
|
|
93
|
+
const whiteList = ['/login'];
|
|
94
|
+
/*
|
|
95
|
+
router.beforeEach((to: ToRouteType, _from, next) => {
|
|
96
|
+
if (to.meta?.keepAlive) {
|
|
97
|
+
handleAliveRoute(to, 'add');
|
|
98
|
+
// 页面整体刷新和点击标签页刷新
|
|
99
|
+
if (_from.name === undefined || _from.name === 'redirect') {
|
|
100
|
+
handleAliveRoute(to);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const userName = cookies.get(kLOGINER);
|
|
104
|
+
NProgress.start();
|
|
105
|
+
if (userName) {
|
|
106
|
+
routerBefore(to, _from, next);
|
|
107
|
+
} else {
|
|
108
|
+
if (to.path !== '/login') {
|
|
109
|
+
if (whiteList.indexOf(to.path) !== -1) {
|
|
110
|
+
next();
|
|
111
|
+
} else {
|
|
112
|
+
next({ path: '/login' });
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
next();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
router.afterEach(() => {
|
|
121
|
+
NProgress?.done();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
*/
|
|
125
|
+
export const routerBefore = (to, _from, next) => {
|
|
126
|
+
// TODO 无权限跳转403页面
|
|
127
|
+
// if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
|
|
128
|
+
// next({ path: "/error/403" });
|
|
129
|
+
// }
|
|
130
|
+
const userName = cookies.get(kLOGINER);
|
|
131
|
+
|
|
132
|
+
const externalLink = isUrl(to?.name as string);
|
|
133
|
+
/** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
|
|
134
|
+
function toCorrectRoute() {
|
|
135
|
+
whiteList.includes(to.fullPath) ? next(_from.fullPath) : next();
|
|
136
|
+
}
|
|
137
|
+
if (_from?.name && _from?.name !== 'login') {
|
|
138
|
+
// m.name === to.name 判断param路由跳转
|
|
139
|
+
const cmp = to.matched.find(
|
|
140
|
+
m => m.path === to.path || (m.name === to.name && to.params)
|
|
141
|
+
)?.components;
|
|
142
|
+
// 如果路由包含http 则是超链接 反之是普通路由
|
|
143
|
+
if (externalLink) {
|
|
144
|
+
openLink(to?.name as string);
|
|
145
|
+
NProgress?.done();
|
|
146
|
+
} else if (cmp?.default || to.name === 'redirect') {
|
|
147
|
+
toCorrectRoute();
|
|
148
|
+
} else {
|
|
149
|
+
next({ path: '/error/404' });
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
// 刷新
|
|
153
|
+
if (usePermissionStoreHook().wholeMenus.length === 0) {
|
|
154
|
+
initRouter(userName).then((router: Router) => {
|
|
155
|
+
if (!useMultiTagsStoreHook().getMultiTagsCache) {
|
|
156
|
+
const { path } = to;
|
|
157
|
+
const index = findIndexOf(remainingRouter, v => v.path === path);
|
|
158
|
+
const routes: any = index === -1 ? router.options.routes[0].children : router.options.routes;
|
|
159
|
+
const route = findRouteByPath(path, routes);
|
|
160
|
+
if (route && route.meta?.title) {
|
|
161
|
+
const { path, name, meta } = route;
|
|
162
|
+
useMultiTagsStoreHook().handleTags('push', { path, name, meta });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// 确保动态路由完全加入路由列表并且不影响静态路由
|
|
166
|
+
// (注意:动态路由刷新时router.beforeEach可能会触发两次,
|
|
167
|
+
// 第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,
|
|
168
|
+
// 如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次)
|
|
169
|
+
if (isEmpty(to.name)) router.push(to.fullPath);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (_from.fullPath === '/' && to.fullPath === '/login' && !to.query?.tokenExpire) {
|
|
173
|
+
to.path = '/welcome';
|
|
174
|
+
to.fullPath = '/welcome';
|
|
175
|
+
to.name = 'SuHome';
|
|
176
|
+
} else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
|
|
177
|
+
to.path = '/welcome';
|
|
178
|
+
to.fullPath = '/welcome';
|
|
179
|
+
to.name = 'SuHome';
|
|
180
|
+
to.query = {};
|
|
181
|
+
}
|
|
182
|
+
// next();
|
|
183
|
+
toCorrectRoute();
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// export default router;
|
|
@@ -1,83 +1,58 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-17 16:02:30
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime:
|
|
6
|
-
* @Description: file content
|
|
7
|
-
*/
|
|
8
|
-
const Layout = () => import('../../layout/layoutView.vue');
|
|
9
|
-
|
|
10
|
-
const remainingRouter: Array<any> = [
|
|
11
|
-
{
|
|
12
|
-
path: '/login',
|
|
13
|
-
name: 'login',
|
|
14
|
-
component: () => import('../../views/ulogin/login.vue'),
|
|
15
|
-
meta: {
|
|
16
|
-
title: 'message.udp.login',
|
|
17
|
-
showLink: false
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
path: '/error/404',
|
|
22
|
-
name: '404',
|
|
23
|
-
component: () => import('../../views/error/404.vue'),
|
|
24
|
-
meta: {
|
|
25
|
-
title: 'message.udp.fourZeroFour',
|
|
26
|
-
showLink: false
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
path: '/error/500',
|
|
31
|
-
name: '500',
|
|
32
|
-
component: () => import('../../views/error/500.vue'),
|
|
33
|
-
meta: {
|
|
34
|
-
title: 'message.udp.five',
|
|
35
|
-
showLink: false
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// meta: {
|
|
60
|
-
// showLink: false
|
|
61
|
-
// }
|
|
62
|
-
// },
|
|
63
|
-
{
|
|
64
|
-
path: '/redirect',
|
|
65
|
-
name: 'redirect',
|
|
66
|
-
component: Layout,
|
|
67
|
-
meta: {
|
|
68
|
-
icon: 'home-filled',
|
|
69
|
-
title: 'message.udp.home',
|
|
70
|
-
showLink: false,
|
|
71
|
-
rank: 104
|
|
72
|
-
},
|
|
73
|
-
children: [
|
|
74
|
-
{
|
|
75
|
-
path: '/redirect/:path(.*)',
|
|
76
|
-
// 2024-12-17
|
|
77
|
-
name: 'redirectView',
|
|
78
|
-
component: () => import('../../layout/redirect.vue')
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
];
|
|
83
|
-
export default remainingRouter;
|
|
1
|
+
/*
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:02:30
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-07-27 11:10:39
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
const Layout = () => import('../../layout/layoutView.vue');
|
|
9
|
+
|
|
10
|
+
const remainingRouter: Array<any> = [
|
|
11
|
+
{
|
|
12
|
+
path: '/login',
|
|
13
|
+
name: 'login',
|
|
14
|
+
component: () => import('../../views/ulogin/login.vue'),
|
|
15
|
+
meta: {
|
|
16
|
+
title: 'message.udp.login',
|
|
17
|
+
showLink: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: '/error/404',
|
|
22
|
+
name: '404',
|
|
23
|
+
component: () => import('../../views/error/404.vue'),
|
|
24
|
+
meta: {
|
|
25
|
+
title: 'message.udp.fourZeroFour',
|
|
26
|
+
showLink: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
path: '/error/500',
|
|
31
|
+
name: '500',
|
|
32
|
+
component: () => import('../../views/error/500.vue'),
|
|
33
|
+
meta: {
|
|
34
|
+
title: 'message.udp.five',
|
|
35
|
+
showLink: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
path: '/redirect',
|
|
40
|
+
name: 'redirect',
|
|
41
|
+
component: Layout,
|
|
42
|
+
meta: {
|
|
43
|
+
icon: 'home-filled',
|
|
44
|
+
title: 'message.udp.home',
|
|
45
|
+
showLink: false,
|
|
46
|
+
rank: 104
|
|
47
|
+
},
|
|
48
|
+
children: [
|
|
49
|
+
{
|
|
50
|
+
path: '/redirect/:path(.*)',
|
|
51
|
+
// 2024-12-17
|
|
52
|
+
name: 'redirectView',
|
|
53
|
+
component: () => import('../../layout/redirect.vue')
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
export default remainingRouter;
|