@utogether/udp-core 2.0.0-beta.26 → 2.0.0-beta.27

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 (161) hide show
  1. package/dist/403-gdcH0-Bo.js +65 -0
  2. package/dist/404-Se2SF97M.js +65 -0
  3. package/dist/500-B6j9AqLo.js +67 -0
  4. package/dist/AuthorityInfo-CQ8ydZvr.js +4 -0
  5. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-C4NRvS8p.js +100 -0
  6. package/dist/AuthorityPanel-lVnZ5bce.js +4 -0
  7. package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-nsfhDlvV.js +113 -0
  8. package/dist/Company-BzSVBSC4.js +25 -0
  9. package/dist/CompanyPanel-DBjZB4aJ.js +204 -0
  10. package/dist/DataSet-iBHzs75s.js +147 -0
  11. package/dist/Department-BkgseHo8.js +25 -0
  12. package/dist/DepartmentPanel-Sen93_2M.js +249 -0
  13. package/dist/DesignPanel-pqDcwaFC.js +4 -0
  14. package/dist/DesignPanel.vue_vue_type_style_index_0_lang-BjtYyEw7.js +1013 -0
  15. package/dist/DictView-CJLG4LlE.js +110 -0
  16. package/dist/InvOrganization-D0Jq1IAa.js +74 -0
  17. package/dist/Org-CO_1WT39.js +39 -0
  18. package/dist/Preview-DLI4Bwel.js +48 -0
  19. package/dist/ReportDefine-Cw46OnJ_.js +10 -0
  20. package/dist/ReportDesign-D4sHTXT7.js +165 -0
  21. package/dist/ReportQuery-DtOCvQSN.js +74 -0
  22. package/dist/ReportQueryFrom-QjL-ETPq.js +4 -0
  23. package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-Dj9ne87n.js +177 -0
  24. package/dist/ReportTemplate-BxAgc_Aj.js +161 -0
  25. package/dist/Role-Df77BBD-.js +25 -0
  26. package/dist/RoleAssign-BrunouML.js +26 -0
  27. package/dist/RolePanel-DSVwqhiD.js +4 -0
  28. package/dist/RolePanel-HLA7XBlN.js +4 -0
  29. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CKlbqRa5.js +132 -0
  30. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CN0rUxKz.js +152 -0
  31. package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-D_FeSXKv.js +99 -0
  32. package/dist/Staff-BeL1xcRf.js +26 -0
  33. package/dist/StaffInfo-CIfnltyX.js +4 -0
  34. package/dist/StaffInfo.vue_vue_type_script_setup_true_lang-DbLFwWfG.js +107 -0
  35. package/dist/StaffPanel-BV2CHWac.js +4 -0
  36. package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-CvT-Vp2G.js +153 -0
  37. package/dist/SysUser-DPfNvthk.js +15 -0
  38. package/dist/SysUserPanel-CoLKYlQE.js +4 -0
  39. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-lcO3Cjbq.js +353 -0
  40. package/dist/SystemMenu-sdj1dRDA.js +156 -0
  41. package/dist/UserInfo-CTX4hhFl.js +4 -0
  42. package/dist/UserInfo.vue_vue_type_style_index_0_lang-ClhCd_8z.js +160 -0
  43. package/dist/await-to-js.es5-Bv3Eu4mi.js +10 -0
  44. package/dist/childView-BDmWwJO5.js +4 -0
  45. package/dist/childView-Dx3ACtHa.js +4 -0
  46. package/dist/childView.vue_vue_type_style_index_0_lang-CfKq_0FN.js +183 -0
  47. package/dist/childView.vue_vue_type_style_index_0_lang-DxZNtkhd.js +143 -0
  48. package/dist/code-rule-cvN4gYC_.js +148 -0
  49. package/dist/core.es.js +24 -6
  50. package/dist/cron-task-B0TkxFdp.js +135 -0
  51. package/dist/flow-task-PoDnE_kE.js +10 -0
  52. package/dist/frameView-5cy5BSgS.js +43 -0
  53. package/dist/img/minicolors.png +0 -0
  54. package/dist/index-C5WRTwvI.js +3006 -0
  55. package/dist/layout-home-DrARg-3o.js +232 -0
  56. package/dist/layoutView-25v_ngk5.js +3191 -0
  57. package/dist/log-in-Bmz5Uhbt.js +116 -0
  58. package/dist/log-out-B-8m3oNj.js +130 -0
  59. package/dist/login-Cmp2RvvW.js +217 -0
  60. package/dist/login-log-CVvRgZSu.js +70 -0
  61. package/dist/lov-view-BATtzw2X.js +99 -0
  62. package/dist/menuInfo-BIvrE7nm.js +4 -0
  63. package/dist/menuInfo.vue_vue_type_style_index_0_lang-B6USomit.js +360 -0
  64. package/dist/pda-app-CzHVyeEa.js +707 -0
  65. package/dist/redirect-DTz8GSnv.js +15 -0
  66. package/dist/resource-Y5lGB38n.js +97 -0
  67. package/dist/su-welcome-CXA6OzBw.js +878 -0
  68. package/dist/sys-config-CqO03LeC.js +385 -0
  69. package/dist/udp-core.css +1 -2
  70. package/dist/useNav-C-rCgubt.js +84 -0
  71. package/dist/utogether-MlnyYtNS.js +4 -0
  72. package/dist/wecom-push-B75FLee5.js +70 -0
  73. package/index.ts +3 -2
  74. package/package.json +1 -1
  75. package/src/App.vue +79 -78
  76. package/src/api/index.ts +1 -1
  77. package/src/components/SuQrcode/src/index.tsx +231 -236
  78. package/src/layout/components/lay-panel/index.vue +2 -6
  79. package/src/layout/components/lay-search/components/SearchModal.vue +7 -3
  80. package/src/main.ts +25 -23
  81. package/src/router/index.ts +156 -187
  82. package/src/store/modules/system.ts +7 -0
  83. package/src/style/vxetable.scss +372 -364
  84. package/src/utils/authority/index.ts +46 -29
  85. package/src/utils/udp/http/index.ts +115 -64
  86. package/src/utils/udp/http/types.d.ts +15 -14
  87. package/src/views/login/login-view.vue +4 -21
  88. package/src/views/organization/department/DepartmentPanel.vue +3 -4
  89. package/src/views/system/sys/sys-config.vue +344 -344
  90. package/src/views/uhome/components/home-todo.vue +179 -178
  91. package/src/views/ulogin/login.vue +5 -9
  92. package/tsconfig.json +2 -3
  93. package/types/global.d.ts +234 -234
  94. package/vite.config.ts +2 -1
  95. package/dist/403-D6Wb3JJh.js +0 -72
  96. package/dist/404-B_HNbPNV.js +0 -72
  97. package/dist/500-BMemTTy1.js +0 -77
  98. package/dist/AuthorityInfo-6wHxwiFM.js +0 -91
  99. package/dist/AuthorityPanel-OqF_DvXA.js +0 -98
  100. package/dist/Company-BLXSfow0.js +0 -21
  101. package/dist/CompanyPanel-B4kRZ5Cg.js +0 -199
  102. package/dist/DataSet-CuGZcKC-.js +0 -141
  103. package/dist/Department-oFhsa7cd.js +0 -21
  104. package/dist/DepartmentPanel-B1UGpu-r.js +0 -242
  105. package/dist/DepartmentPanel-BL58AdoT.js +0 -2
  106. package/dist/DesignPanel-DmkFVw1N.js +0 -1196
  107. package/dist/DictView-CC5yMzOq.js +0 -100
  108. package/dist/File-WJXjGYxr.js +0 -89
  109. package/dist/InvOrganization-BwMmD8Ua.js +0 -76
  110. package/dist/Org-HgnOWubi.js +0 -76
  111. package/dist/Preview-CAzWxLmP.js +0 -45
  112. package/dist/ReIcon-DecitXmg.js +0 -413
  113. package/dist/ReportDefine-BgLM-Rjk.js +0 -10
  114. package/dist/ReportDesign-DwchGG2P.js +0 -158
  115. package/dist/ReportQuery-D5jaRJEn.js +0 -101
  116. package/dist/ReportQueryFrom-CNlmtYey.js +0 -198
  117. package/dist/ReportTemplate-CNcTmccs.js +0 -162
  118. package/dist/Role-Be8WfdCA.js +0 -21
  119. package/dist/RoleAssign-CtehGAUf.js +0 -22
  120. package/dist/RolePanel-CAwITg_q.js +0 -131
  121. package/dist/RolePanel-SN0FGFZ7.js +0 -176
  122. package/dist/ScrollPanel-DW30pGz1.js +0 -88
  123. package/dist/Staff-V2YsNKcj.js +0 -22
  124. package/dist/StaffInfo-CKRPW0r4.js +0 -149
  125. package/dist/StaffPanel-BxcgMg7u.js +0 -143
  126. package/dist/SysUser-Dxyj5w5m.js +0 -12
  127. package/dist/SysUserPanel-DI6CWcZo.js +0 -365
  128. package/dist/SystemMenu-BBHREM8T.js +0 -154
  129. package/dist/UserInfo-BMVQ0xwE.js +0 -194
  130. package/dist/_plugin-vue_export-helper-C6QCLu9I.js +0 -8
  131. package/dist/api-BFNxcxSN.js +0 -30
  132. package/dist/authority-BJFEUdrh.js +0 -20
  133. package/dist/await-to-js.es5-DkWYmPXW.js +0 -10
  134. package/dist/childView-BBjPEraB.js +0 -184
  135. package/dist/childView-DNqG2UVm.js +0 -181
  136. package/dist/code-rule-QFrhqFrW.js +0 -151
  137. package/dist/contant-Q77dU_V3.js +0 -4
  138. package/dist/cron-task-BpUDKEAU.js +0 -131
  139. package/dist/flow-task-DAc2NrDU.js +0 -11
  140. package/dist/frameView-Di0zJZUR.js +0 -39
  141. package/dist/layout-home-BVp7vYLR.js +0 -239
  142. package/dist/layoutView-B6Mx2ERA.js +0 -2662
  143. package/dist/log-in-BrNB0mLz.js +0 -117
  144. package/dist/log-out-dYfqvzy6.js +0 -111
  145. package/dist/login-D_Hjy3Jd.js +0 -231
  146. package/dist/login-log-CJak-ANA.js +0 -79
  147. package/dist/lov-view-DM5Nm5tW.js +0 -95
  148. package/dist/menuInfo-BlOY1KZW.js +0 -346
  149. package/dist/mitt-CQgI7DYU.js +0 -27
  150. package/dist/pda-app-CA7YI37u.js +0 -589
  151. package/dist/redirect-N0k4tImU.js +0 -16
  152. package/dist/resource-CfQTHFcs.js +0 -94
  153. package/dist/su-welcome-DVD3S_du.js +0 -799
  154. package/dist/sys-config-Ddb3vBpK.js +0 -316
  155. package/dist/system-Cm3lyBas.js +0 -1528
  156. package/dist/udp-core-DaQd5CF1.js +0 -2028
  157. package/dist/useDataThemeChange-DJ4K3VGp.js +0 -226
  158. package/dist/useNav-BhOJIdrJ.js +0 -106
  159. package/dist/utogether-l7JXs4Lv.js +0 -4
  160. package/dist/water-mark-WDQZ9YqB.js +0 -119
  161. package/dist/wecom-push-kWkAVRCj.js +0 -77
@@ -1,187 +1,156 @@
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 { ascending, initRouter, findRouteByPath, formatTwoStageRoutes, formatFlatteningRoutes } from './utils';
7
- // import { getEnv } from '../config';
8
- import { kLOGINER } from '../contant';
9
-
10
- import homeRouter from './modules/home';
11
- import errorRouter from './modules/error';
12
- import remainingRouter from './modules/remaining';
13
- import flow from './modules/flow';
14
-
15
- const systemRouter = import.meta.glob([
16
- '../views/system/**/*.{vue,tsx}',
17
- '../views/uapp/**/*.{vue,tsx}',
18
- '../views/upms/**/*.{vue,tsx}',
19
- '../views/ufile/**/*.{vue}',
20
- '../views/urpt/**/*.{vue,tsx}',
21
- '../views/organization/**/*.{vue,tsx}',
22
- '../views/udev/**/*.{vue, tsx}'
23
- // '../views/uflow/**/*.{vue, tsx}'
24
- ]);
25
-
26
- export const remainingRouters = remainingRouter;
27
-
28
- // 原始静态路由(未做任何处理)
29
- const routes = [homeRouter, errorRouter, flow];
30
- /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
31
- export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
32
- formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
33
- );
34
-
35
- /** 用于渲染菜单,保持原始层级 */
36
- export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
37
-
38
- /** 不参与菜单的路由 */
39
- export const remainingPaths = Object.keys(remainingRouter).map(v => {
40
- return remainingRouter[v].path;
41
- });
42
-
43
- /** 创建路由实例 */
44
- // export const router: Router = createRouter({
45
- // history: createWebHistory(window.__HISTORY_PATH__),
46
- // routes: constantRoutes.concat(...(remainingRouter as any)),
47
- // strict: true,
48
- // scrollBehavior(to, from, savedPosition) {
49
- // return new Promise(resolve => {
50
- // if (savedPosition) {
51
- // return savedPosition;
52
- // } else {
53
- // if (from.meta.saveSrollTop) {
54
- // const top: number = document.documentElement.scrollTop || document.body.scrollTop;
55
- // resolve({ left: 0, top });
56
- // }
57
- // }
58
- // });
59
- // }
60
- // });
61
-
62
- /** 记录已经加载的页面路径 */
63
- const loadedPaths = new Set<string>();
64
-
65
- /** 重置已加载页面记录 */
66
- export function resetLoadedPaths() {
67
- loadedPaths.clear();
68
- }
69
-
70
- /** 重置路由 */
71
- export function resetRouter() {
72
- router.getRoutes().forEach(route => {
73
- const { name, meta } = route;
74
- if (name && router.hasRoute(name) && meta?.backstage) {
75
- router.removeRoute(name);
76
- router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes))));
77
- }
78
- });
79
- usePermissionStoreHook().clearAllCachePage();
80
- resetLoadedPaths();
81
- }
82
-
83
- let views = null;
84
- export let router = null;
85
- export function setViews(cviews, crouter) {
86
- views = cviews;
87
- router = crouter;
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
- if (userName) {
109
- routerBefore(to, _from, next);
110
- } else {
111
- if (to.path !== '/login') {
112
- if (whiteList.indexOf(to.path) !== -1) {
113
- next();
114
- } else {
115
- next({ path: '/login' });
116
- }
117
- } else {
118
- next();
119
- }
120
- }
121
- });
122
-
123
- router.afterEach(() => {
124
- NProgress?.done();
125
- });
126
-
127
- */
128
- export const routerBefore = (to, _from, next) => {
129
- // TODO 无权限跳转403页面
130
- // if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
131
- // next({ path: "/error/403" });
132
- // }
133
- const userName = cookies.get(kLOGINER);
134
- const externalLink = isUrl(to?.name as string);
135
- /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
136
- function toCorrectRoute() {
137
- whiteList.includes(to.fullPath) ? next(_from.fullPath) : next();
138
- }
139
- if (_from?.name && _from?.name !== 'login') {
140
- // m.name === to.name 判断param路由跳转
141
- const cmp = to.matched.find(m => m.path === to.path || (m.name === to.name && to.params))?.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 = 'UdpWelcome';
176
- } else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
177
- to.path = '/welcome';
178
- to.fullPath = '/welcome';
179
- to.name = 'UdpWelcome';
180
- to.query = {};
181
- }
182
- // next();
183
- toCorrectRoute();
184
- }
185
- };
186
-
187
- // 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 { ascending, initRouter, findRouteByPath, formatTwoStageRoutes, formatFlatteningRoutes } from './utils';
7
+ // import { getEnv } from '../config';
8
+ import { kLOGINER } from '../contant';
9
+
10
+ import homeRouter from './modules/home';
11
+ import errorRouter from './modules/error';
12
+ import remainingRouter from './modules/remaining';
13
+ import flow from './modules/flow';
14
+
15
+ const systemRouter = import.meta.glob([
16
+ '../views/system/**/*.{vue,tsx}',
17
+ '../views/uapp/**/*.{vue,tsx}',
18
+ '../views/upms/**/*.{vue,tsx}',
19
+ '../views/ufile/**/*.{vue}',
20
+ '../views/urpt/**/*.{vue,tsx}',
21
+ '../views/organization/**/*.{vue,tsx}',
22
+ '../views/udev/**/*.{vue, tsx}'
23
+ // '../views/uflow/**/*.{vue, tsx}'
24
+ ]);
25
+
26
+ export const remainingRouters = remainingRouter;
27
+
28
+ // 原始静态路由(未做任何处理)
29
+ const routes = [homeRouter, errorRouter, flow];
30
+ /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
31
+ export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
32
+ formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
33
+ );
34
+
35
+ /** 用于渲染菜单,保持原始层级 */
36
+ export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
37
+
38
+ /** 不参与菜单的路由 */
39
+ export const remainingPaths = Object.keys(remainingRouter).map(v => {
40
+ return remainingRouter[v].path;
41
+ });
42
+
43
+ /** 创建路由实例 */
44
+ // export const router: Router = createRouter({
45
+ // history: createWebHistory(window.__HISTORY_PATH__),
46
+ // routes: constantRoutes.concat(...(remainingRouter as any)),
47
+ // strict: true,
48
+ // scrollBehavior(to, from, savedPosition) {
49
+ // return new Promise(resolve => {
50
+ // if (savedPosition) {
51
+ // return savedPosition;
52
+ // } else {
53
+ // if (from.meta.saveSrollTop) {
54
+ // const top: number = document.documentElement.scrollTop || document.body.scrollTop;
55
+ // resolve({ left: 0, top });
56
+ // }
57
+ // }
58
+ // });
59
+ // }
60
+ // });
61
+
62
+ /** 记录已经加载的页面路径 */
63
+ const loadedPaths = new Set<string>();
64
+
65
+ /** 重置已加载页面记录 */
66
+ export function resetLoadedPaths() {
67
+ loadedPaths.clear();
68
+ }
69
+
70
+ /** 重置路由 */
71
+ export function resetRouter() {
72
+ router.getRoutes().forEach(route => {
73
+ const { name, meta } = route;
74
+ if (name && router.hasRoute(name) && meta?.backstage) {
75
+ router.removeRoute(name);
76
+ router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes))));
77
+ }
78
+ });
79
+ usePermissionStoreHook().clearAllCachePage();
80
+ resetLoadedPaths();
81
+ }
82
+
83
+ let views = null;
84
+ export let router = null;
85
+ export function setViews(cviews, crouter) {
86
+ views = cviews;
87
+ router = crouter;
88
+ Object.assign(views, systemRouter);
89
+ }
90
+
91
+ export function getViews() {
92
+ return views;
93
+ }
94
+
95
+ /** 路由白名单 */
96
+ const whiteList = ['/login'];
97
+ export const routerBefore = (to, _from) => {
98
+ // TODO 无权限跳转403页面
99
+ // if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
100
+ // next({ path: "/error/403" });
101
+ // }
102
+ const userName = cookies.get(kLOGINER);
103
+ const externalLink = isUrl(to?.name as string);
104
+ /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
105
+ function toCorrectRoute() {
106
+ return whiteList.includes(to.fullPath) ? _from.fullPath : undefined;
107
+ }
108
+ if (_from?.name && _from?.name !== 'login') {
109
+ // m.name === to.name 判断param路由跳转
110
+ const cmp = to.matched.find(m => m.path === to.path || (m.name === to.name && to.params))?.components;
111
+ // 如果路由包含http 则是超链接 反之是普通路由
112
+ if (externalLink) {
113
+ openLink(to?.name as string);
114
+ NProgress?.done();
115
+ } else if (cmp?.default || to.name === 'redirect') {
116
+ toCorrectRoute();
117
+ } else {
118
+ return { path: '/error/404' };
119
+ }
120
+ } else {
121
+ // 刷新
122
+ if (usePermissionStoreHook().wholeMenus.length === 0) {
123
+ initRouter(userName).then((router: Router) => {
124
+ if (!useMultiTagsStoreHook().getMultiTagsCache) {
125
+ const { path } = to;
126
+ const index = findIndexOf(remainingRouter, v => v.path === path);
127
+ const routes: any = index === -1 ? router.options.routes[0].children : router.options.routes;
128
+ const route = findRouteByPath(path, routes);
129
+ if (route && route.meta?.title) {
130
+ const { path, name, meta } = route;
131
+ useMultiTagsStoreHook().handleTags('push', { path, name, meta });
132
+ }
133
+ }
134
+ // 确保动态路由完全加入路由列表并且不影响静态路由
135
+ // (注意:动态路由刷新时router.beforeEach可能会触发两次,
136
+ // 第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,
137
+ // 如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次)
138
+ if (isEmpty(to.name)) router.push(to.fullPath);
139
+ });
140
+ }
141
+ if (_from.fullPath === '/' && to.fullPath === '/login' && !to.query?.tokenExpire) {
142
+ to.path = '/welcome';
143
+ to.fullPath = '/welcome';
144
+ to.name = 'UdpWelcome';
145
+ } else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
146
+ to.path = '/welcome';
147
+ to.fullPath = '/welcome';
148
+ to.name = 'UdpWelcome';
149
+ to.query = {};
150
+ }
151
+ // next();
152
+ toCorrectRoute();
153
+ }
154
+ };
155
+
156
+ // export default router;
@@ -22,6 +22,7 @@ interface ISystemState {
22
22
  dicts: IRecord[];
23
23
  invOrgList: IRecord[];
24
24
  homeMenus: IRecord[];
25
+ roleList: IRecord[];
25
26
  sessionKey: string;
26
27
  userName: string;
27
28
  orgId: string;
@@ -43,6 +44,7 @@ export const useSystemStore = defineStore('udp-system', {
43
44
  orgList: [],
44
45
  invOrgList: [],
45
46
  homeMenus: [],
47
+ roleList: [],
46
48
  sessionKey: '',
47
49
  orgId: '',
48
50
  userName: '',
@@ -96,6 +98,9 @@ export const useSystemStore = defineStore('udp-system', {
96
98
  getHomeMenus(state) {
97
99
  return state.homeMenus;
98
100
  },
101
+ getRoleList(state) {
102
+ return state.roleList;
103
+ },
99
104
  getOrganizationCode(state) {
100
105
  return state.invOrgList?.find(f => f.id === state.organizationId)?.organizationCode;
101
106
  },
@@ -168,6 +173,8 @@ export const useSystemStore = defineStore('udp-system', {
168
173
  this.organizationId = systemInfo.organizationId;
169
174
  // 用户所在的业务实体
170
175
  this.orgList = systemInfo.orgList;
176
+ // 设置角色列表
177
+ this.roleList = systemInfo.user?.sysRoles;
171
178
  // 将公共参数缓存到cookie中
172
179
  const query = {
173
180
  orgId: systemInfo.orgId,