@utogether/udp-core 1.0.1-beta.3 → 1.0.1-beta.30
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 +3 -3
- package/dist/{403-BuP9jvH9.js → 403-DdjDWbkf.js} +1 -1
- package/dist/{404-DfQk8kKl.js → 404-D9vF2gFz.js} +1 -1
- package/dist/{500-OgROWdiZ.js → 500-mVaDmUjL.js} +1 -1
- package/dist/{AuthorityInfo-q2ksfkWH.js → AuthorityInfo-DOUJ_Zrj.js} +1 -1
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-B12sAzqt.js +100 -0
- package/dist/{Company-DgqowAxc.js → Company-DY__kM9F.js} +3 -3
- package/dist/{CompanyPanel-BNb1rUhD.js → CompanyPanel-C5N8QcMA.js} +17 -17
- package/dist/{Department-Cl8CROSU.js → Department-DsuDZdy5.js} +3 -3
- package/dist/{DepartmentPanel-D5VkqKeP.js → DepartmentPanel-CdwI7Rzu.js} +25 -25
- package/dist/{DesignPanel-BGvEusHC.js → DesignPanel-B50-g0TL.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BQF1uQ7w.js → DesignPanel.vue_vue_type_style_index_0_lang-KV8JOZ6v.js} +28 -30
- package/dist/DictView-Be2Z5Obk.js +110 -0
- package/dist/InvOrganization-Lui1q3Ou.js +74 -0
- package/dist/Org-qO5ExsPN.js +39 -0
- package/dist/{Preview-BaGmXH7r.js → Preview-Dq4dfV2D.js} +2 -2
- package/dist/{ReportDefine-DkQdBErt.js → ReportDefine-DH3FvbS1.js} +1 -1
- package/dist/{ReportDesign-DzB_A_G6.js → ReportDesign-Bou01Jbr.js} +43 -43
- package/dist/{ReportQuery-DRcMb6ya.js → ReportQuery-BBkmPPSw.js} +1 -1
- package/dist/{ReportQueryFrom-CeA9xhR4.js → ReportQueryFrom-BCY8lTJ7.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CgGtcs5V.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CpktcM8J.js} +1 -1
- package/dist/{ReportTemplate-qaiTMQuT.js → ReportTemplate-C_yJXxQ-.js} +28 -28
- package/dist/{Role-DsFulAjq.js → Role-CTatYsrC.js} +6 -6
- package/dist/{RoleAssign-DMRdocpa.js → RoleAssign-Cqt3CelK.js} +9 -9
- package/dist/{RolePanel-wXVysDHM.js → RolePanel-C3JMpNu8.js} +1 -1
- package/dist/{RolePanel-B9POS_pg.js → RolePanel-brKRJIhD.js} +1 -1
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-DD8u9pq8.js +132 -0
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CleVvkcY.js → RolePanel.vue_vue_type_script_setup_true_lang-i6Gq4r5B.js} +44 -38
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DlXUs0j9.js → ScrollPanel.vue_vue_type_style_index_0_lang-CiWKyjm3.js} +23 -23
- package/dist/{Staff-Cq4V7ruC.js → Staff-Cd3twQ6Y.js} +3 -3
- package/dist/{StaffInfo-CJDKMbud.js → StaffInfo-DJp0a0qd.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DQ4DL1KY.js → StaffInfo.vue_vue_type_script_setup_true_lang-Dp2AhJ4I.js} +16 -16
- package/dist/{StaffPanel-CG-uggdr.js → StaffPanel-B93hClzs.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-DAgN7zN2.js → StaffPanel.vue_vue_type_script_setup_true_lang-CXjUzq7n.js} +2 -2
- package/dist/{SysUser-kwnzRNdD.js → SysUser-BvI6vaqI.js} +2 -2
- package/dist/{SysUserPanel-DTlZf3vk.js → SysUserPanel-C9V8X-Ek.js} +1 -1
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-bMqTui07.js +343 -0
- package/dist/{SystemMenu-BVT0n-L2.js → SystemMenu-D4WME5d0.js} +27 -27
- package/dist/{UserInfo-BbTQ9Zat.js → UserInfo-D-AfdfJs.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D_bpYDmI.js → UserInfo.vue_vue_type_style_index_0_lang-C-JQYIxe.js} +41 -39
- package/dist/{childView-BJbIhjmf.js → childView--WMSo-wH.js} +1 -1
- package/dist/{childView-DCsGFrG-.js → childView-1MTl6Kaj.js} +1 -1
- package/dist/childView.vue_vue_type_style_index_0_lang-B8Losc4Y.js +170 -0
- package/dist/{childView.vue_vue_type_style_index_0_lang-BCDxpVoD.js → childView.vue_vue_type_style_index_0_lang-BAVKNIXs.js} +1 -1
- package/dist/{code-rule-DePU6cdp.js → code-rule-D-RqrQB6.js} +42 -41
- package/dist/core.es.js +19 -10
- package/dist/{cron-task-DUM1SIGL.js → cron-task-D-X-KFZm.js} +11 -11
- package/dist/flow-task-B07st2aD.js +10 -0
- package/dist/{frameView-CEUTDtSm.js → frameView-MAW_-GHJ.js} +1 -1
- package/dist/index-Bc9vCX7z.js +2904 -0
- package/dist/{layoutView-PCjwVwkX.js → layoutView-De2QIEr2.js} +1639 -1629
- package/dist/{log-in-e7D5Ss1P.js → log-in-CpGqc33f.js} +5 -4
- package/dist/{log-out--RRncZhN.js → log-out-D1b4VRMZ.js} +30 -24
- package/dist/{login-log-CvVnyGi3.js → login-log-BNRXLeMi.js} +4 -3
- package/dist/login-rdZ0GPYc.js +249 -0
- package/dist/{lov-view-D8wwkxFJ.js → lov-view-Ao7LMspL.js} +5 -5
- package/dist/{menuInfo-B5JKVwrB.js → menuInfo-DmOcK6An.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CcM9WX4n.js → menuInfo.vue_vue_type_style_index_0_lang-Ln-zFWV7.js} +121 -99
- package/dist/{pda-app-DIa1p1Ww.js → pda-app-DY63mQ2T.js} +202 -188
- package/dist/{resource-CCQ7Dd-5.js → resource-B21uV58T.js} +18 -18
- package/dist/{su-welcome-CLp9YaJa.js → su-welcome-DgjzJeDF.js} +122 -121
- package/dist/sys-config-DOtK2I32.js +370 -0
- package/dist/udp-core.css +1 -9
- package/dist/utogether-MlnyYtNS.js +4 -0
- package/index.ts +19 -6
- package/package.json +3 -3
- package/src/App.vue +65 -70
- package/src/api/http.ts +1 -4
- package/src/api/index.ts +5 -3
- package/src/api/user.ts +2 -2
- package/src/components/SuCharts/src/UserInfo.vue +3 -3
- package/src/components/SuScrollTree/ScrollPanel.vue +4 -9
- package/src/components/udp/content/index.vue +89 -0
- package/src/components/udp/form/form.vue +109 -0
- package/src/components/udp/{grid.vue → grid/index.vue} +524 -500
- package/src/components/udp/index.ts +4 -6
- package/src/components/udp/ut-stamp-badge/index.vue +272 -0
- package/src/components/udp/utils.ts +408 -379
- package/src/directives/permission/index.ts +1 -1
- package/src/layout/components/lay-navbar/index.vue +8 -6
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +1 -1
- package/src/layout/components/lay-select-org/index.vue +4 -9
- package/src/layout/components/lay-sidebar/horizontal.vue +8 -6
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -258
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +8 -12
- package/src/layout/components/lay-tag/index.vue +596 -625
- package/src/layout/hooks/useTag.ts +12 -18
- package/src/layout/types.ts +3 -2
- package/src/main.ts +115 -110
- package/src/plugins/i18n/en.ts +302 -291
- package/src/plugins/i18n/module/u-workflow.ts +1 -1
- package/src/plugins/i18n/zh.ts +362 -338
- package/src/plugins/vxe-table/index.ts +116 -53
- package/src/plugins/vxe-table/render.tsx +183 -57
- package/src/router/index.ts +101 -97
- package/src/router/modules/flow.ts +35 -0
- package/src/router/modules/remaining.ts +1 -26
- package/src/router/utils.ts +50 -7
- package/src/store/modules/app.ts +1 -3
- package/src/store/modules/multiTags.ts +15 -14
- package/src/store/modules/permission.ts +25 -15
- package/src/store/modules/system.ts +1 -3
- package/src/style/button.scss +85 -85
- package/src/style/login.css +1 -1
- package/src/style/vxetable.scss +348 -258
- package/src/utils/authority/index.ts +1 -1
- package/src/utils/index.ts +3 -1
- package/src/utils/propTypes.ts +1 -6
- package/src/utils/{http → udp/http}/index.ts +27 -30
- package/src/utils/{http → udp/http}/types.d.ts +2 -6
- package/src/views/login/login-view.vue +6 -20
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/department/DepartmentPanel.vue +6 -20
- package/src/views/organization/inv-org/InvOrganization.vue +22 -7
- package/src/views/organization/org/Org.vue +9 -5
- package/src/views/system/cron/cron-task.vue +2 -12
- package/src/views/system/menu/SystemMenu.vue +185 -197
- package/src/views/system/menu/menuInfo.vue +384 -372
- 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 +11 -9
- package/src/views/system/role-assign/RoleAssign.vue +2 -2
- package/src/views/system/role-assign/RolePanel.vue +12 -9
- package/src/views/system/sys/sys-config.vue +70 -21
- package/src/views/system/sysUser/SysUserPanel.vue +132 -62
- package/src/views/uapp/pda/pda-app.vue +48 -16
- package/src/views/udev/coderule/code-rule.vue +132 -121
- package/src/views/udev/dict/DictView.vue +118 -106
- package/src/views/udev/dict/childView.vue +71 -111
- package/src/views/udev/lov/childView.vue +1 -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/components/menu-favorite.vue +314 -331
- package/src/views/uhome/su-welcome.vue +3 -3
- package/src/views/ulogin/login.vue +19 -12
- package/src/views/upms/interface/log-in.vue +2 -8
- package/src/views/upms/interface/log-out.vue +2 -8
- package/src/views/upms/user/login-log.vue +2 -8
- package/src/views/urpt/design/DesignPanel.vue +16 -35
- package/src/views/urpt/design/Preview.vue +1 -0
- package/src/views/urpt/design/ReportDesign.vue +17 -23
- package/src/views/urpt/static-resource/resource.vue +3 -3
- package/src/views/urpt/template/ReportTemplate.vue +7 -7
- package/src/views/utask/flow-task.vue +18 -0
- package/types/global.d.ts +4 -9
- package/vite.config.ts +2 -1
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-Bwsf6lMH.js +0 -102
- package/dist/DictView-BnxfaOBv.js +0 -96
- package/dist/InvOrganization-5y79ZLdY.js +0 -66
- package/dist/Org-2oBAXN2r.js +0 -35
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-t6S_0zmJ.js +0 -126
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-BW6PlGjM.js +0 -288
- package/dist/childView.vue_vue_type_style_index_0_lang-CDtsalCm.js +0 -187
- package/dist/index-ZdgOD7cF.js +0 -3399
- package/dist/login-B1CjWVKu.js +0 -252
- package/dist/sys-config-BBmf_SqF.js +0 -277
- package/dist/utogether-Bkptx2lB.js +0 -182
- package/src/components/udp/form-upload.vue +0 -183
- package/src/components/udp/lov.vue +0 -410
- package/src/components/udp/modal-form.vue +0 -180
- package/src/components/udp/modal-grid.vue +0 -297
- package/src/utils/udp/useRender.ts +0 -420
package/src/router/index.ts
CHANGED
|
@@ -1,28 +1,16 @@
|
|
|
1
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';
|
|
2
|
+
import type { Router, RouteRecordRaw, RouteComponent } from 'vue-router';
|
|
9
3
|
import { cookies, NProgress, openLink, isUrl, buildHierarchyTree } from '@utogether/utils';
|
|
10
4
|
import { useMultiTagsStoreHook } from '../store/modules/multiTags';
|
|
11
5
|
import { usePermissionStoreHook } from '../store/modules/permission';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
initRouter,
|
|
15
|
-
findRouteByPath,
|
|
16
|
-
handleAliveRoute,
|
|
17
|
-
formatTwoStageRoutes,
|
|
18
|
-
formatFlatteningRoutes
|
|
19
|
-
} from './utils';
|
|
20
|
-
import { getEnv } from '../config';
|
|
6
|
+
import { ascending, initRouter, findRouteByPath, formatTwoStageRoutes, formatFlatteningRoutes } from './utils';
|
|
7
|
+
// import { getEnv } from '../config';
|
|
21
8
|
import { kLOGINER } from '../contant';
|
|
22
9
|
|
|
23
10
|
import homeRouter from './modules/home';
|
|
24
11
|
import errorRouter from './modules/error';
|
|
25
12
|
import remainingRouter from './modules/remaining';
|
|
13
|
+
import flow from './modules/flow';
|
|
26
14
|
|
|
27
15
|
const systemRouter = import.meta.glob([
|
|
28
16
|
'../views/system/**/*.{vue,tsx}',
|
|
@@ -32,10 +20,13 @@ const systemRouter = import.meta.glob([
|
|
|
32
20
|
'../views/urpt/**/*.{vue,tsx}',
|
|
33
21
|
'../views/organization/**/*.{vue,tsx}',
|
|
34
22
|
'../views/udev/**/*.{vue, tsx}'
|
|
23
|
+
// '../views/uflow/**/*.{vue, tsx}'
|
|
35
24
|
]);
|
|
36
25
|
|
|
26
|
+
export const remainingRouters = remainingRouter;
|
|
27
|
+
|
|
37
28
|
// 原始静态路由(未做任何处理)
|
|
38
|
-
const routes = [homeRouter, errorRouter];
|
|
29
|
+
const routes = [homeRouter, errorRouter, flow];
|
|
39
30
|
/** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
|
|
40
31
|
export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
|
|
41
32
|
formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
|
|
@@ -50,23 +41,31 @@ export const remainingPaths = Object.keys(remainingRouter).map(v => {
|
|
|
50
41
|
});
|
|
51
42
|
|
|
52
43
|
/** 创建路由实例 */
|
|
53
|
-
export const router: Router = createRouter({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
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
|
+
}
|
|
70
69
|
|
|
71
70
|
/** 重置路由 */
|
|
72
71
|
export function resetRouter() {
|
|
@@ -74,17 +73,18 @@ export function resetRouter() {
|
|
|
74
73
|
const { name, meta } = route;
|
|
75
74
|
if (name && router.hasRoute(name) && meta?.backstage) {
|
|
76
75
|
router.removeRoute(name);
|
|
77
|
-
router.options.routes = formatTwoStageRoutes(
|
|
78
|
-
formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
|
|
79
|
-
);
|
|
76
|
+
router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes))));
|
|
80
77
|
}
|
|
81
78
|
});
|
|
82
79
|
usePermissionStoreHook().clearAllCachePage();
|
|
80
|
+
resetLoadedPaths();
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
let views = null;
|
|
86
|
-
export
|
|
84
|
+
export let router = null;
|
|
85
|
+
export function setViews(cviews, crouter) {
|
|
87
86
|
views = cviews;
|
|
87
|
+
router = crouter;
|
|
88
88
|
Object.assign(views, systemRouter);
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ export function getViews() {
|
|
|
94
94
|
|
|
95
95
|
/** 路由白名单 */
|
|
96
96
|
const whiteList = ['/login'];
|
|
97
|
-
|
|
97
|
+
/*
|
|
98
98
|
router.beforeEach((to: ToRouteType, _from, next) => {
|
|
99
99
|
if (to.meta?.keepAlive) {
|
|
100
100
|
handleAliveRoute(to, 'add');
|
|
@@ -105,64 +105,8 @@ router.beforeEach((to: ToRouteType, _from, next) => {
|
|
|
105
105
|
}
|
|
106
106
|
const userName = cookies.get(kLOGINER);
|
|
107
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
108
|
if (userName) {
|
|
114
|
-
|
|
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
|
-
}
|
|
109
|
+
routerBefore(to, _from, next);
|
|
166
110
|
} else {
|
|
167
111
|
if (to.path !== '/login') {
|
|
168
112
|
if (whiteList.indexOf(to.path) !== -1) {
|
|
@@ -180,4 +124,64 @@ router.afterEach(() => {
|
|
|
180
124
|
NProgress?.done();
|
|
181
125
|
});
|
|
182
126
|
|
|
183
|
-
|
|
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 = '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;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2023-10-10 11:31:53
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-05 19:17:32
|
|
6
|
+
* @FilePath: /sitzone-mes/src/router/modules/tabs.ts
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/
|
|
9
|
+
const Layout = () => import('../../layout/layoutView.vue');
|
|
10
|
+
|
|
11
|
+
const tabsRouter: RouteConfigsTable = {
|
|
12
|
+
component: Layout,
|
|
13
|
+
path: '/utask',
|
|
14
|
+
redirect: '/utask/task/flow-task',
|
|
15
|
+
meta: {
|
|
16
|
+
showLink: false,
|
|
17
|
+
icon: 'IF-pure-iconfont-tabs',
|
|
18
|
+
title: 'message.udp.flowTask'
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
// query 传参模式
|
|
22
|
+
{
|
|
23
|
+
path: '/utask/task/flow-task',
|
|
24
|
+
name: 'FlowTask',
|
|
25
|
+
component: () => import('../../views/utask/flow-task.vue'),
|
|
26
|
+
meta: {
|
|
27
|
+
// 不在menu菜单中显示
|
|
28
|
+
title: '',
|
|
29
|
+
showLink: false,
|
|
30
|
+
activePath: '/uflow/index'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
export default tabsRouter;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-11-17 16:02:30
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2025-07-27 11:10:39
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
const Layout = () => import('../../layout/layoutView.vue');
|
|
@@ -35,31 +35,6 @@ const remainingRouter: Array<any> = [
|
|
|
35
35
|
showLink: false
|
|
36
36
|
}
|
|
37
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
38
|
{
|
|
64
39
|
path: '/redirect',
|
|
65
40
|
name: 'redirect',
|
package/src/router/utils.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2024-08-01 21:42:39
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-17 15:05:02
|
|
6
|
+
* @FilePath: \udp-front\packages\udp-core\src\router\utils.ts
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/
|
|
1
9
|
import type { RouteRecordRaw, RouteComponent } from 'vue-router';
|
|
2
10
|
import { isProxy, toRaw, defineAsyncComponent } from 'vue';
|
|
3
11
|
import { useTimeoutFn } from '@vueuse/core';
|
|
@@ -44,9 +52,7 @@ function ascending(arr: any[]) {
|
|
|
44
52
|
|
|
45
53
|
/** 过滤meta中showLink为false的菜单 */
|
|
46
54
|
function filterTree(data: RouteComponent[]) {
|
|
47
|
-
const newTree = clone(data, true).filter(
|
|
48
|
-
(v: { meta: { showLink: boolean } }) => v && v.meta?.showLink !== false
|
|
49
|
-
);
|
|
55
|
+
const newTree = clone(data, true).filter((v: { meta: { showLink: boolean } }) => v && v.meta?.showLink !== false);
|
|
50
56
|
newTree.forEach((v: { children }) => v.children && (v.children = filterTree(v.children)));
|
|
51
57
|
return newTree;
|
|
52
58
|
}
|
|
@@ -219,9 +225,7 @@ function formatFlatteningRoutes(routesList: RouteRecordRaw[]) {
|
|
|
219
225
|
let hierarchyList = buildHierarchyTree(routesList);
|
|
220
226
|
for (let i = 0; i < hierarchyList.length; i++) {
|
|
221
227
|
if (hierarchyList[i].children) {
|
|
222
|
-
hierarchyList = hierarchyList
|
|
223
|
-
.slice(0, i + 1)
|
|
224
|
-
.concat(hierarchyList[i].children, hierarchyList.slice(i + 1));
|
|
228
|
+
hierarchyList = hierarchyList.slice(0, i + 1).concat(hierarchyList[i].children, hierarchyList.slice(i + 1));
|
|
225
229
|
}
|
|
226
230
|
}
|
|
227
231
|
return hierarchyList;
|
|
@@ -277,6 +281,9 @@ const menuI18n = {
|
|
|
277
281
|
zh: {},
|
|
278
282
|
en: {}
|
|
279
283
|
};
|
|
284
|
+
|
|
285
|
+
const processMenus = [];
|
|
286
|
+
|
|
280
287
|
const addAsyncRoutes = (arrRoutes: Array<any>) => {
|
|
281
288
|
const modulesRoutes = getViews();
|
|
282
289
|
|
|
@@ -290,7 +297,18 @@ const addAsyncRoutes = (arrRoutes: Array<any>) => {
|
|
|
290
297
|
v.redirect = v.children[0].path;
|
|
291
298
|
}
|
|
292
299
|
const { icon, permissionCode, extraIcon, frameSrc } = v;
|
|
293
|
-
|
|
300
|
+
// 流程菜单保存
|
|
301
|
+
v.isApprovalPage === 'Y' && processMenus.push(v);
|
|
302
|
+
|
|
303
|
+
v.meta = {
|
|
304
|
+
keepAlive: true,
|
|
305
|
+
rank: v.sort,
|
|
306
|
+
title: `${v.i18nField}`,
|
|
307
|
+
// 审批流设计页面和审批页面的code写死,只需配置页面即可(保底方式)
|
|
308
|
+
// showLink: !['UDPFlowTask'].includes(v.menuCode) ? null : false
|
|
309
|
+
showLink: v.showLink !== 'N'
|
|
310
|
+
};
|
|
311
|
+
v.hiddenTag = null;
|
|
294
312
|
Object.assign(v.meta, { icon, permissionCode, extraIcon, frameSrc });
|
|
295
313
|
menuI18n.zh[v.i18nField] = v.menuName || v.menuNameEn;
|
|
296
314
|
menuI18n.en[v.i18nField] = v.menuNameEn || v.menuName;
|
|
@@ -362,10 +380,35 @@ function delCurrentRoute(current: any, toNext = true) {
|
|
|
362
380
|
}
|
|
363
381
|
}
|
|
364
382
|
|
|
383
|
+
function handleTopMenu(route) {
|
|
384
|
+
if (route?.children && route.children.length > 1) {
|
|
385
|
+
if (route.redirect) {
|
|
386
|
+
return route.children.filter(cur => cur.path === route.redirect)[0];
|
|
387
|
+
} else {
|
|
388
|
+
return route.children[0];
|
|
389
|
+
}
|
|
390
|
+
} else {
|
|
391
|
+
return route;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/** 获取所有菜单中的第一个菜单(顶级菜单)*/
|
|
396
|
+
function getTopMenu(tag = false) {
|
|
397
|
+
const topMenu = handleTopMenu(usePermissionStoreHook().wholeMenus[0]?.children[0]);
|
|
398
|
+
tag && useMultiTagsStoreHook().handleTags('push', topMenu);
|
|
399
|
+
return topMenu;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function getProcessMenu() {
|
|
403
|
+
return processMenus;
|
|
404
|
+
}
|
|
405
|
+
|
|
365
406
|
export {
|
|
366
407
|
ascending,
|
|
367
408
|
filterTree,
|
|
368
409
|
initRouter,
|
|
410
|
+
getTopMenu,
|
|
411
|
+
getProcessMenu,
|
|
369
412
|
hasPermissions,
|
|
370
413
|
addAsyncRoutes,
|
|
371
414
|
getParentPaths,
|
package/src/store/modules/app.ts
CHANGED
|
@@ -14,9 +14,7 @@ import { responsiveStorageNameSpace, getConfig } from '../../config';
|
|
|
14
14
|
export const useAppStore = defineStore('udp-app', {
|
|
15
15
|
state: (): appType => ({
|
|
16
16
|
sidebar: {
|
|
17
|
-
opened:
|
|
18
|
-
storageLocal.getItem(`${responsiveStorageNameSpace()}layout`)?.sidebarStatus ??
|
|
19
|
-
getConfig().SidebarStatus,
|
|
17
|
+
opened: storageLocal.getItem(`${responsiveStorageNameSpace()}layout`)?.sidebarStatus ?? getConfig().SidebarStatus,
|
|
20
18
|
withoutAnimation: false,
|
|
21
19
|
isClickCollapse: false
|
|
22
20
|
},
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-12-23 17:33:20
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-11-06 17:48:20
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
import { defineStore } from 'pinia';
|
|
9
|
-
import { isEqual
|
|
9
|
+
import { isEqual } from 'xe-utils';
|
|
10
10
|
import { storageLocal, isUrl } from '@utogether/utils';
|
|
11
11
|
import { store } from '../index';
|
|
12
12
|
import { routerArrays } from '../../layout/types';
|
|
@@ -54,25 +54,26 @@ export const useMultiTagsStore = defineStore('udp-multiTags', {
|
|
|
54
54
|
if (isUrl(tagVal?.name)) return;
|
|
55
55
|
// 如果title为空拒绝添加空信息到标签页
|
|
56
56
|
if (tagVal?.meta?.title?.length === 0) return;
|
|
57
|
-
// showLink:false 不添加到标签页
|
|
58
|
-
if (isBoolean(tagVal?.meta?.showLink) && !tagVal?.meta?.showLink) return;
|
|
57
|
+
// showLink:false 不添加到标签页 -- 因审批流注释2025/11/6
|
|
58
|
+
// if (isBoolean(tagVal?.meta?.showLink) && !tagVal?.meta?.showLink) return;
|
|
59
59
|
const tagPath = tagVal.path;
|
|
60
60
|
// 判断tag是否已存在
|
|
61
61
|
const tagHasExits = this.multiTags.some(tag => {
|
|
62
|
-
return tag.path === tagPath;
|
|
62
|
+
return tag.path === tagPath && isEqual(tag?.query, tagVal?.query) && isEqual(tag?.params, tagVal?.params);
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
// 判断tag中的query键值是否相等
|
|
66
|
-
const tagQueryHasExits = this.multiTags.some(tag => {
|
|
67
|
-
|
|
68
|
-
});
|
|
66
|
+
// const tagQueryHasExits = this.multiTags.some(tag => {
|
|
67
|
+
// return isEqual(tag?.query, tagVal?.query);
|
|
68
|
+
// });
|
|
69
69
|
|
|
70
|
-
// 判断tag中的params键值是否相等
|
|
71
|
-
const tagParamsHasExits = this.multiTags.some(tag => {
|
|
72
|
-
|
|
73
|
-
});
|
|
70
|
+
// // 判断tag中的params键值是否相等
|
|
71
|
+
// const tagParamsHasExits = this.multiTags.some(tag => {
|
|
72
|
+
// return isEqual(tag?.params, tagVal?.params);
|
|
73
|
+
// });
|
|
74
74
|
|
|
75
|
-
if (tagHasExits && tagQueryHasExits && tagParamsHasExits) return;
|
|
75
|
+
// if (tagHasExits && tagQueryHasExits && tagParamsHasExits) return;
|
|
76
|
+
if (tagHasExits) return;
|
|
76
77
|
|
|
77
78
|
// 动态路由可打开的最大数量
|
|
78
79
|
const dynamicLevel = tagVal?.meta?.dynamicLevel ?? -1;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-11-17 16:02:30
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-10-19 11:58:29
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
import { defineStore } from 'pinia';
|
|
9
9
|
import { store } from '../index';
|
|
10
10
|
import type { cacheType } from './types';
|
|
11
11
|
import { constantMenus } from '../../router';
|
|
12
|
-
import { clone,
|
|
12
|
+
import { clone, findLastIndexOf } from 'xe-utils';
|
|
13
13
|
import { getKeyList } from '../../utils';
|
|
14
14
|
import { ascending, filterTree, formatFlatteningRoutes } from '../../router/utils';
|
|
15
15
|
import { useMultiTagsStoreHook } from './multiTags';
|
|
@@ -58,35 +58,45 @@ export const usePermissionStore = defineStore('udp-permission', {
|
|
|
58
58
|
setWholeMenus(wholeMenus) {
|
|
59
59
|
this.wholeMenus = wholeMenus;
|
|
60
60
|
},
|
|
61
|
+
|
|
62
|
+
/** 监听缓存页面是否存在于标签页,不存在则删除 */
|
|
63
|
+
clearCache() {
|
|
64
|
+
let cacheLength = this.cachePageList.length;
|
|
65
|
+
const nameList = getKeyList(useMultiTagsStoreHook().multiTags, 'name');
|
|
66
|
+
while (cacheLength > 0) {
|
|
67
|
+
nameList.findIndex(v => v === this.cachePageList[cacheLength - 1]) === -1 &&
|
|
68
|
+
this.cachePageList.splice(this.cachePageList.indexOf(this.cachePageList[cacheLength - 1]), 1);
|
|
69
|
+
cacheLength--;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
61
72
|
cacheOperate({ mode, name }: cacheType) {
|
|
62
73
|
const delIndex = this.cachePageList.findIndex(v => v === name);
|
|
63
74
|
switch (mode) {
|
|
64
75
|
case 'refresh':
|
|
65
76
|
this.cachePageList = this.cachePageList.filter(v => v !== name);
|
|
77
|
+
this.clearCache();
|
|
66
78
|
break;
|
|
67
79
|
case 'add':
|
|
68
80
|
this.cachePageList.push(name);
|
|
69
81
|
break;
|
|
70
82
|
case 'delete':
|
|
71
83
|
delIndex !== -1 && this.cachePageList.splice(delIndex, 1);
|
|
84
|
+
this.clearCache();
|
|
72
85
|
break;
|
|
73
86
|
case 'reset':
|
|
74
87
|
this.cachePageList = [];
|
|
75
88
|
break;
|
|
76
89
|
}
|
|
77
90
|
/** 监听缓存页面是否存在于标签页,不存在则删除 */
|
|
78
|
-
debounce(() => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
cacheLength--;
|
|
88
|
-
}
|
|
89
|
-
}, 500)();
|
|
91
|
+
// debounce(() => {
|
|
92
|
+
// let cacheLength = this.cachePageList.length;
|
|
93
|
+
// const nameList = getKeyList(useMultiTagsStoreHook().multiTags, 'name');
|
|
94
|
+
// while (cacheLength > 0) {
|
|
95
|
+
// nameList.findIndex(v => v === this.cachePageList[cacheLength - 1]) === -1 &&
|
|
96
|
+
// this.cachePageList.splice(this.cachePageList.indexOf(this.cachePageList[cacheLength - 1]), 1);
|
|
97
|
+
// cacheLength--;
|
|
98
|
+
// }
|
|
99
|
+
// }, 500)();
|
|
90
100
|
},
|
|
91
101
|
/** 清空缓存页面 */
|
|
92
102
|
clearAllCachePage() {
|
|
@@ -166,9 +166,7 @@ export const useSystemStore = defineStore('udp-system', {
|
|
|
166
166
|
organizationId: systemInfo.organizationId
|
|
167
167
|
};
|
|
168
168
|
cookies.set('kCookies_param', JSON.stringify(query));
|
|
169
|
-
this.isAdminRole = this.employee.sysRoles.some(
|
|
170
|
-
s => s.roleCode === 'admin' || ['管理员'].includes(s.roleName)
|
|
171
|
-
);
|
|
169
|
+
this.isAdminRole = this.employee.sysRoles.some(s => s.roleCode === 'admin' || ['管理员'].includes(s.roleName));
|
|
172
170
|
// 缓存按钮数据权限
|
|
173
171
|
usePermissionStoreHook().setAuthButton(systemInfo.dataMenus);
|
|
174
172
|
}
|