@utogether/udp-core 1.0.1-beta.2 → 1.0.1-beta.4

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.
Files changed (98) hide show
  1. package/build/plugins.ts +6 -1
  2. package/dist/{403-BBQoJwTM.js → 403-CT4J-t-o.js} +1 -1
  3. package/dist/{404-BbJPSIWM.js → 404-BAudfnaK.js} +1 -1
  4. package/dist/{500-BtFL9R4M.js → 500-BlOGtpEE.js} +1 -1
  5. package/dist/{AuthorityInfo-DhiwCeLN.js → AuthorityInfo-Bl03tEhF.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Duyweh89.js → AuthorityInfo.vue_vue_type_style_index_0_lang-CUwS2F3R.js} +1 -1
  7. package/dist/{Company-CGqmslx-.js → Company-CIj9XgQn.js} +3 -3
  8. package/dist/{CompanyPanel-hlDsxD-6.js → CompanyPanel-CublK5NN.js} +16 -16
  9. package/dist/{Department-BZyJtacc.js → Department-BolPW-W3.js} +3 -3
  10. package/dist/{DepartmentPanel-D-a_EBFt.js → DepartmentPanel-BttxSHfM.js} +1 -1
  11. package/dist/{DesignPanel-Bl4luWDV.js → DesignPanel-BwCbn92O.js} +1 -1
  12. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-I8C3iGvz.js → DesignPanel.vue_vue_type_style_index_0_lang-y2AnCTg6.js} +2 -2
  13. package/dist/{DictView-B4a7Hs1X.js → DictView-D85ziNV2.js} +13 -12
  14. package/dist/InvOrganization-CaAk_f7F.js +66 -0
  15. package/dist/{Org-BTGTrAVz.js → Org-CreIihFE.js} +1 -1
  16. package/dist/{Preview-pHD84xqI.js → Preview-DMGbhV6q.js} +1 -1
  17. package/dist/{ReportDefine-DnnCNQWS.js → ReportDefine-DogZwa8T.js} +1 -1
  18. package/dist/{ReportDesign-BnI_Q4pg.js → ReportDesign-CdSsJJeA.js} +2 -2
  19. package/dist/{ReportQuery-Dby2MmtM.js → ReportQuery-DPvKqeUm.js} +1 -1
  20. package/dist/{ReportQueryFrom-Blm1N8P1.js → ReportQueryFrom-UokkfBx_.js} +1 -1
  21. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CnG_Ybnt.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BlOoThY7.js} +1 -1
  22. package/dist/{ReportTemplate-D65RXRY_.js → ReportTemplate-DCnmllXW.js} +1 -1
  23. package/dist/{Role-eFZoTpXc.js → Role-sfmwLiNM.js} +3 -3
  24. package/dist/{RoleAssign-D9-Y3UNz.js → RoleAssign-WRk90VO2.js} +3 -3
  25. package/dist/{RolePanel-DlFw6HSf.js → RolePanel-DhP0_5ur.js} +1 -1
  26. package/dist/{RolePanel-CoUOc3sX.js → RolePanel-iWysS02n.js} +1 -1
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DKHgNWQP.js → RolePanel.vue_vue_type_script_setup_true_lang-CYXqW-d4.js} +1 -1
  28. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Clwk-MHw.js → RolePanel.vue_vue_type_script_setup_true_lang-_hVY31HC.js} +3 -3
  29. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-M2FQJwPU.js → ScrollPanel.vue_vue_type_style_index_0_lang-BozDFES-.js} +1 -1
  30. package/dist/{Staff-DFBLCsAd.js → Staff-Bha-Ijax.js} +3 -3
  31. package/dist/{StaffInfo-d2CK0oBA.js → StaffInfo-CbfYI8UW.js} +1 -1
  32. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-4m8wK9tq.js → StaffInfo.vue_vue_type_script_setup_true_lang-Ce-MUVYH.js} +1 -1
  33. package/dist/{StaffPanel-D6aWLKN3.js → StaffPanel-B8094e97.js} +1 -1
  34. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-C7YT2CVb.js → StaffPanel.vue_vue_type_script_setup_true_lang-_kJIBCtx.js} +2 -2
  35. package/dist/{SysUser-BdZvYxQH.js → SysUser-D1J9vPnb.js} +2 -2
  36. package/dist/{SysUserPanel-BIVa6LLr.js → SysUserPanel-DGDPKKoY.js} +1 -1
  37. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-BsBKpYR7.js → SysUserPanel.vue_vue_type_script_setup_true_lang-D-5-zKn6.js} +1 -1
  38. package/dist/{SystemMenu-C-5VKlHK.js → SystemMenu-Dz8Pllh5.js} +9 -9
  39. package/dist/{UserInfo-DqXCRZts.js → UserInfo-ecAJA2Yg.js} +1 -1
  40. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-N3TwfpPx.js → UserInfo.vue_vue_type_style_index_0_lang-4_-I_sQN.js} +1 -1
  41. package/dist/{childView-B2lSsqS3.js → childView-4uI_RT2m.js} +1 -1
  42. package/dist/{childView-DRUNqgjI.js → childView-OXXoMFg3.js} +1 -1
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-oGriyFTv.js → childView.vue_vue_type_style_index_0_lang-DC-yx4Kv.js} +1 -1
  44. package/dist/{childView.vue_vue_type_style_index_0_lang-B9XBDDU_.js → childView.vue_vue_type_style_index_0_lang-e43PUsUO.js} +1 -1
  45. package/dist/{code-rule-DZC9T6cl.js → code-rule-B667R66s.js} +1 -1
  46. package/dist/core.es.js +14 -11
  47. package/dist/{cron-task-BJwPeA5F.js → cron-task-DcmGSr2D.js} +1 -1
  48. package/dist/{frameView-C6wkvok-.js → frameView-BzgaLYjQ.js} +1 -1
  49. package/dist/img/l_img.svg +1 -1
  50. package/dist/img/minicolors.png +0 -0
  51. package/dist/img/v_img.svg +1 -1
  52. package/dist/{index-DZc3qRTx.js → index-CLliRySq.js} +516 -560
  53. package/dist/{layoutView-CeJBpZb_.js → layoutView-BBQB8pDc.js} +109 -108
  54. package/dist/{login-BOxwzwdB.js → login-DIG7pRU7.js} +2 -2
  55. package/dist/{lov-view-DRF-99U4.js → lov-view-CSIPKZSY.js} +2 -2
  56. package/dist/{menuInfo-3Sjvs9nM.js → menuInfo-CPHjl7id.js} +1 -1
  57. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DrQ560nm.js → menuInfo.vue_vue_type_style_index_0_lang-BXNiinTg.js} +31 -29
  58. package/dist/{pda-app-B9tn7jdv.js → pda-app-BLjbMcdt.js} +1 -1
  59. package/dist/{resource-BqnxbQNe.js → resource-MxqaSJqB.js} +1 -1
  60. package/dist/{su-welcome-VwifUK_O.js → su-welcome-C0flTYCx.js} +1 -1
  61. package/dist/{sys-config-C0-gSBFO.js → sys-config-CXzGs3Nl.js} +1 -1
  62. package/dist/udp-core.css +2 -2
  63. package/dist/{utogether-Di1byIum.js → utogether-CFdIDuAT.js} +1 -1
  64. package/index.ts +40 -36
  65. package/package.json +1 -1
  66. package/src/App.vue +70 -70
  67. package/src/components/udp/grid.vue +505 -0
  68. package/src/components/udp/index.ts +7 -4
  69. package/src/components/udp/lov.vue +410 -0
  70. package/src/components/udp/modal-form.vue +2 -2
  71. package/src/components/udp/modal-grid.vue +297 -0
  72. package/src/components/udp/utils.ts +379 -40
  73. package/src/directives/permission/index.ts +1 -1
  74. package/src/layout/components/lay-navbar/index.vue +1 -1
  75. package/src/layout/components/lay-panel/index.vue +150 -150
  76. package/src/layout/components/lay-sidebar/breadCrumb.vue +1 -1
  77. package/src/layout/components/lay-tag/index.vue +625 -625
  78. package/src/layout/layoutView.vue +215 -215
  79. package/src/main.ts +7 -6
  80. package/src/plugins/i18n/en.ts +291 -289
  81. package/src/plugins/i18n/zh.ts +338 -337
  82. package/src/plugins/vxe-table/index.ts +1 -1
  83. package/src/plugins/vxe-table/render.tsx +4 -2
  84. package/src/router/index.ts +187 -183
  85. package/src/router/modules/remaining.ts +58 -83
  86. package/src/style/button.scss +85 -78
  87. package/src/style/tailwind.css +1 -68
  88. package/src/style/vxetable.scss +265 -256
  89. package/src/utils/authority/index.ts +1 -1
  90. package/src/views/organization/company/CompanyPanel.vue +259 -259
  91. package/src/views/organization/inv-org/InvOrganization.vue +2 -3
  92. package/src/views/system/menu/SystemMenu.vue +1 -1
  93. package/src/views/system/menu/menuInfo.vue +376 -373
  94. package/src/views/udev/dict/DictView.vue +106 -106
  95. package/src/views/udev/lov/lov-view.vue +91 -91
  96. package/types/global.d.ts +2 -1
  97. package/vite.config.ts +4 -1
  98. package/dist/InvOrganization-q4T3y8dQ.js +0 -260
@@ -2,7 +2,7 @@
2
2
  * @Author: levi7754 levi7754@163.com
3
3
  * @Date: 2024-06-05 14:32:03
4
4
  * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-07-20 11:07:31
5
+ * @LastEditTime: 2025-07-30 09:51:55
6
6
  * @FilePath: /udp-front/packages/udp-core/src/plugins/vxe-table/index.ts
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
8
  */
@@ -2,7 +2,7 @@
2
2
  * @Author: wei.li
3
3
  * @Date: 2021-12-01 09:18:50
4
4
  * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-07-14 18:17:16
5
+ * @LastEditTime: 2025-07-23 09:41:24
6
6
  * @Description: file content
7
7
  */
8
8
 
@@ -59,7 +59,7 @@ export const VxetableRender = (VXETable, { serviceApi, i18n }) => {
59
59
  * @param {*} val 目前的选中值
60
60
  */
61
61
  function onChange(val) {
62
- componentHook.selectChange(val, data, column.field, renderOpts, {
62
+ componentHook.selectChange(val, row, column.field, renderOpts, {
63
63
  column,
64
64
  datasource: 'row'
65
65
  });
@@ -471,6 +471,7 @@ export const VxetableRender = (VXETable, { serviceApi, i18n }) => {
471
471
  const { row, column } = params;
472
472
  const { props, events } = renderOpts;
473
473
  const componentHook = useComponent();
474
+ console.log('lov====');
474
475
  function onChange(record, displayField) {
475
476
  const { mapField, field, displayName, multiple } = props;
476
477
  if (!multiple) {
@@ -493,6 +494,7 @@ export const VxetableRender = (VXETable, { serviceApi, i18n }) => {
493
494
  <ut-lov
494
495
  record={row}
495
496
  mode="vxe"
497
+ transfer
496
498
  {...props}
497
499
  onChange={(v, f) => onChange(v, f)}
498
500
  onClear={() => onClear()}
@@ -1,183 +1,187 @@
1
- import { findIndexOf, isEmpty } from 'xe-utils';
2
- import {
3
- type Router,
4
- createRouter,
5
- type RouteRecordRaw,
6
- type RouteComponent,
7
- createWebHistory
8
- } from 'vue-router';
9
- import { cookies, NProgress, openLink, isUrl, buildHierarchyTree } from '@utogether/utils';
10
- import { useMultiTagsStoreHook } from '../store/modules/multiTags';
11
- import { usePermissionStoreHook } from '../store/modules/permission';
12
- import {
13
- ascending,
14
- initRouter,
15
- findRouteByPath,
16
- handleAliveRoute,
17
- formatTwoStageRoutes,
18
- formatFlatteningRoutes
19
- } from './utils';
20
- import { getEnv } from '../config';
21
- import { kLOGINER } from '../contant';
22
-
23
- import homeRouter from './modules/home';
24
- import errorRouter from './modules/error';
25
- import remainingRouter from './modules/remaining';
26
-
27
- const systemRouter = import.meta.glob([
28
- '../views/system/**/*.{vue,tsx}',
29
- '../views/uapp/**/*.{vue,tsx}',
30
- '../views/upms/**/*.{vue,tsx}',
31
- '../views/ufile/**/*.{vue}',
32
- '../views/urpt/**/*.{vue,tsx}',
33
- '../views/organization/**/*.{vue,tsx}',
34
- '../views/udev/**/*.{vue, tsx}'
35
- ]);
36
-
37
- // 原始静态路由(未做任何处理)
38
- const routes = [homeRouter, errorRouter];
39
- /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
40
- export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
41
- formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
42
- );
43
-
44
- /** 用于渲染菜单,保持原始层级 */
45
- export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
46
-
47
- /** 不参与菜单的路由 */
48
- export const remainingPaths = Object.keys(remainingRouter).map(v => {
49
- return remainingRouter[v].path;
50
- });
51
-
52
- /** 创建路由实例 */
53
- export const router: Router = createRouter({
54
- history: createWebHistory(getEnv().VITE_ROUTER_HISTORY),
55
- routes: constantRoutes.concat(...(remainingRouter as any)),
56
- strict: true,
57
- scrollBehavior(to, from, savedPosition) {
58
- return new Promise(resolve => {
59
- if (savedPosition) {
60
- return savedPosition;
61
- } else {
62
- if (from.meta.saveSrollTop) {
63
- const top: number = document.documentElement.scrollTop || document.body.scrollTop;
64
- resolve({ left: 0, top });
65
- }
66
- }
67
- });
68
- }
69
- });
70
-
71
- /** 重置路由 */
72
- export function resetRouter() {
73
- router.getRoutes().forEach(route => {
74
- const { name, meta } = route;
75
- if (name && router.hasRoute(name) && meta?.backstage) {
76
- router.removeRoute(name);
77
- router.options.routes = formatTwoStageRoutes(
78
- formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
79
- );
80
- }
81
- });
82
- usePermissionStoreHook().clearAllCachePage();
83
- }
84
-
85
- let views = null;
86
- export function setViews(cviews) {
87
- views = cviews;
88
- Object.assign(views, systemRouter);
89
- }
90
-
91
- export function getViews() {
92
- return views;
93
- }
94
-
95
- /** 路由白名单 */
96
- const whiteList = ['/login'];
97
-
98
- router.beforeEach((to: ToRouteType, _from, next) => {
99
- if (to.meta?.keepAlive) {
100
- handleAliveRoute(to, 'add');
101
- // 页面整体刷新和点击标签页刷新
102
- if (_from.name === undefined || _from.name === 'redirect') {
103
- handleAliveRoute(to);
104
- }
105
- }
106
- const userName = cookies.get(kLOGINER);
107
- NProgress.start();
108
- const externalLink = isUrl(to?.name as string);
109
- /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
110
- function toCorrectRoute() {
111
- whiteList.includes(to.fullPath) ? next(_from.fullPath) : next();
112
- }
113
- if (userName) {
114
- // TODO 无权限跳转403页面
115
- // if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
116
- // next({ path: "/error/403" });
117
- // }
118
- if (_from?.name && _from?.name !== 'login') {
119
- // m.name === to.name 判断param路由跳转
120
- const cmp = to.matched.find(
121
- m => m.path === to.path || (m.name === to.name && to.params)
122
- )?.components;
123
- // 如果路由包含http 则是超链接 反之是普通路由
124
- if (externalLink) {
125
- openLink(to?.name as string);
126
- NProgress?.done();
127
- } else if (cmp?.default || to.name === 'redirect') {
128
- toCorrectRoute();
129
- } else {
130
- next({ path: '/error/404' });
131
- }
132
- } else {
133
- // 刷新
134
- if (usePermissionStoreHook().wholeMenus.length === 0) {
135
- initRouter(userName).then((router: Router) => {
136
- if (!useMultiTagsStoreHook().getMultiTagsCache) {
137
- const { path } = to;
138
- const index = findIndexOf(remainingRouter, v => v.path === path);
139
- const routes: any = index === -1 ? router.options.routes[0].children : router.options.routes;
140
- const route = findRouteByPath(path, routes);
141
- if (route && route.meta?.title) {
142
- const { path, name, meta } = route;
143
- useMultiTagsStoreHook().handleTags('push', { path, name, meta });
144
- }
145
- }
146
- // 确保动态路由完全加入路由列表并且不影响静态路由
147
- // (注意:动态路由刷新时router.beforeEach可能会触发两次,
148
- // 第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,
149
- // 如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次)
150
- if (isEmpty(to.name)) router.push(to.fullPath);
151
- });
152
- }
153
- if (_from.fullPath === '/' && to.fullPath === '/login' && !to.query?.tokenExpire) {
154
- to.path = '/welcome';
155
- to.fullPath = '/welcome';
156
- to.name = 'SuHome';
157
- } else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
158
- to.path = '/welcome';
159
- to.fullPath = '/welcome';
160
- to.name = 'SuHome';
161
- to.query = {};
162
- }
163
- // next();
164
- toCorrectRoute();
165
- }
166
- } else {
167
- if (to.path !== '/login') {
168
- if (whiteList.indexOf(to.path) !== -1) {
169
- next();
170
- } else {
171
- next({ path: '/login' });
172
- }
173
- } else {
174
- next();
175
- }
176
- }
177
- });
178
-
179
- router.afterEach(() => {
180
- NProgress?.done();
181
- });
182
-
183
- export default router;
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: 2024-12-18 08:44:24
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: '/print/checkcard',
40
- // name: 'checkcard',
41
- // component: () => import('../../views/print/check-card.vue'),
42
- // meta: {
43
- // title: 'message.checkCard',
44
- // showLink: false
45
- // }
46
- // },
47
- // {
48
- // path: '/lowcode-design-platform',
49
- // name: 'LowcodeDesigin',
50
- // component: () => import('/src/views/udev/gantt/lcd-design.vue'),
51
- // meta: {
52
- // showLink: false
53
- // }
54
- // },
55
- // {
56
- // path: '/ulcd-app-menu',
57
- // name: 'AppMenu',
58
- // component: () => import('/src/views/udev/gantt/app-menu.vue'),
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;