@utogether/udp-core 1.0.1-beta.12 → 1.0.1-beta.13

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 (72) hide show
  1. package/dist/{403-D7L5zm05.js → 403-CYdgejwn.js} +1 -1
  2. package/dist/{404-BQKzkK5W.js → 404-CblgDc5z.js} +1 -1
  3. package/dist/{500-BM6k8XR5.js → 500-BZ6wCwWc.js} +1 -1
  4. package/dist/{AuthorityInfo-Dc-7W4L_.js → AuthorityInfo-C7ssheq6.js} +1 -1
  5. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-CKvlh3lm.js → AuthorityInfo.vue_vue_type_style_index_0_lang-DiFYQyk8.js} +1 -1
  6. package/dist/{Company-BgwMUr-I.js → Company-ECS1Fe1S.js} +3 -3
  7. package/dist/{CompanyPanel-CDfVCPKC.js → CompanyPanel-Bka7k-uP.js} +1 -1
  8. package/dist/{Department-CFvEB4Ys.js → Department-DGKkYUdS.js} +3 -3
  9. package/dist/{DepartmentPanel-11Ytcj2u.js → DepartmentPanel-C17CZmjl.js} +1 -1
  10. package/dist/{DesignPanel-CP8z6teZ.js → DesignPanel-BWvmkPpc.js} +1 -1
  11. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-Cp-WR8yE.js → DesignPanel.vue_vue_type_style_index_0_lang-CIrAgdYO.js} +2 -2
  12. package/dist/{DictView-13NoDgPW.js → DictView-B969z8wA.js} +1 -1
  13. package/dist/{InvOrganization-DOD4QdEX.js → InvOrganization-6bVuN-NP.js} +4 -2
  14. package/dist/{Org-cezJs-6P.js → Org-kNkuyf89.js} +1 -1
  15. package/dist/{Preview-DzOKwnp8.js → Preview-CNn9UAsy.js} +1 -1
  16. package/dist/{ReportDefine-DWJq2q0f.js → ReportDefine-Cjv4aRVy.js} +1 -1
  17. package/dist/{ReportDesign-f_ed8u_q.js → ReportDesign-BrCobVSd.js} +2 -2
  18. package/dist/{ReportQuery-D58gv_yZ.js → ReportQuery-Gr87UX2I.js} +1 -1
  19. package/dist/{ReportQueryFrom-R0R6EbYv.js → ReportQueryFrom-CX6cb9GY.js} +1 -1
  20. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CIFpgUAH.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Dz3ZapUS.js} +1 -1
  21. package/dist/{ReportTemplate-BTknctTT.js → ReportTemplate-BDRw8aY4.js} +1 -1
  22. package/dist/{Role-QTDJ16h8.js → Role-B2uHACAG.js} +3 -3
  23. package/dist/{RoleAssign-7aZ3ufp5.js → RoleAssign-Cpwz3ZND.js} +3 -3
  24. package/dist/{RolePanel-XXwmaAgy.js → RolePanel-0G7e5LC8.js} +1 -1
  25. package/dist/{RolePanel-CSe-UoR5.js → RolePanel-CHlQBMqq.js} +1 -1
  26. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-kConrKpo.js → RolePanel.vue_vue_type_script_setup_true_lang-C_vBaRyr.js} +3 -3
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BsNhkvFo.js → RolePanel.vue_vue_type_script_setup_true_lang-Cuyr3Z0F.js} +1 -1
  28. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DtaqM_iA.js → ScrollPanel.vue_vue_type_style_index_0_lang-B_W_v3j5.js} +1 -1
  29. package/dist/{Staff-BsREgfrQ.js → Staff-BALciFZu.js} +3 -3
  30. package/dist/{StaffInfo-CQtVXfvS.js → StaffInfo-BNzGN-gJ.js} +1 -1
  31. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-BRRtcGIH.js → StaffInfo.vue_vue_type_script_setup_true_lang-BSYVizqX.js} +1 -1
  32. package/dist/{StaffPanel-cQTAulcP.js → StaffPanel-xWUgRJqR.js} +1 -1
  33. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-BLeXlrI1.js → StaffPanel.vue_vue_type_script_setup_true_lang-duZSwgoN.js} +2 -2
  34. package/dist/{SysUser-DN5_46io.js → SysUser-q114FdeD.js} +2 -2
  35. package/dist/{SysUserPanel-DTBNR42y.js → SysUserPanel-CognKMl5.js} +1 -1
  36. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-CF2pHcPP.js → SysUserPanel.vue_vue_type_script_setup_true_lang-CMbUdk6A.js} +1 -1
  37. package/dist/{SystemMenu-D9TKZwgb.js → SystemMenu-DVGGSkBO.js} +2 -2
  38. package/dist/{UserInfo-DJ5LRTMe.js → UserInfo-Dug8S6IS.js} +1 -1
  39. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CIpPef_S.js → UserInfo.vue_vue_type_style_index_0_lang-GUvWUfH6.js} +1 -1
  40. package/dist/{childView-CGZSd19y.js → childView-DC4St5Yu.js} +1 -1
  41. package/dist/{childView-DrL_Qi-q.js → childView-DgwW1_pS.js} +1 -1
  42. package/dist/{childView.vue_vue_type_style_index_0_lang-D2AzjPNV.js → childView.vue_vue_type_style_index_0_lang-C6ns1H7X.js} +1 -1
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-B8wEeuFX.js → childView.vue_vue_type_style_index_0_lang-CHB4aljD.js} +1 -1
  44. package/dist/{code-rule-DVEoh1Z4.js → code-rule-DrnZAXq6.js} +1 -1
  45. package/dist/core.es.js +1 -1
  46. package/dist/{cron-task-BBpccUV_.js → cron-task-8TSn9qgc.js} +1 -1
  47. package/dist/{frameView-Cw6_EqfJ.js → frameView-DsJ7Niwn.js} +1 -1
  48. package/dist/index-ChmJT--N.js +2618 -0
  49. package/dist/{layoutView-CL2Ef3bw.js → layoutView-JchyMwjZ.js} +2 -2
  50. package/dist/{login-BDocwo7t.js → login-BXkivLFZ.js} +34 -33
  51. package/dist/{lov-view-R8nnUEbA.js → lov-view-Ck-gMZAO.js} +2 -2
  52. package/dist/{menuInfo-B-nGOcSv.js → menuInfo-u432VWl_.js} +1 -1
  53. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-1VuzxMb0.js → menuInfo.vue_vue_type_style_index_0_lang-JMkwMJ9n.js} +1 -1
  54. package/dist/{pda-app-D5wBClj0.js → pda-app-BeqyF-LQ.js} +1 -1
  55. package/dist/{resource-BXGSsXzw.js → resource-DkNbG8D8.js} +1 -1
  56. package/dist/{su-welcome-DISZAkBB.js → su-welcome-DEVHyaQ4.js} +1 -1
  57. package/dist/{sys-config-DuyYdzXL.js → sys-config-8MIo11zU.js} +1 -1
  58. package/dist/udp-core.css +2 -2
  59. package/dist/{utogether-C2KGHvut.js → utogether-N0mpFm7j.js} +1 -1
  60. package/package.json +18 -18
  61. package/src/api/http.ts +1 -4
  62. package/src/api/index.ts +33 -31
  63. package/src/api/user.ts +2 -2
  64. package/src/main.ts +3 -9
  65. package/src/router/index.ts +177 -177
  66. package/src/style/vxetable.scss +1 -1
  67. package/src/utils/propTypes.ts +42 -42
  68. package/src/utils/udp/http/index.ts +19 -8
  69. package/src/views/login/login-view.vue +300 -300
  70. package/src/views/organization/inv-org/InvOrganization.vue +68 -68
  71. package/src/views/ulogin/login.vue +4 -3
  72. package/dist/index-BAkwQh8m.js +0 -4467
@@ -1,6 +1,6 @@
1
1
  import { computed as W, ref as L } from "vue";
2
2
  import { useGlobal as g, storageLocal as u, deviceDetection as H, cookies as C, storageSession as M } from "@utogether/utils";
3
- import { y as P, j as E, s as j, g as h, v as d, z as J, l as K, m as R, n as V, u as S, r as G, o as O, A as x, B as Z } from "./index-BAkwQh8m.js";
3
+ import { y as P, j as E, s as j, g as h, v as d, z as J, l as K, m as R, n as V, u as S, r as G, o as O, A as x, B as Z } from "./index-ChmJT--N.js";
4
4
  import { useI18n as f } from "vue-i18n";
5
5
  import { defineStore as v } from "pinia";
6
6
  function I() {
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
- {
2
- "name": "@utogether/udp-core",
3
- "private": false,
4
- "version": "1.0.1-beta.12",
5
- "description": "",
6
- "type": "module",
7
- "main1": "index.ts",
8
- "main": "dist/core.es.js",
9
- "scripts": {
10
- "dev": "vite",
11
- "build": "vite build",
12
- "preview:build": "pnpm build && vite preview",
13
- "report": "rimraf dist && vite build"
14
- },
15
- "keywords": [],
16
- "author": "",
17
- "license": "ISC"
18
- }
1
+ {
2
+ "name": "@utogether/udp-core",
3
+ "private": false,
4
+ "version": "1.0.1-beta.13",
5
+ "description": "",
6
+ "type": "module",
7
+ "main1": "index.ts",
8
+ "main": "dist/core.es.js",
9
+ "scripts": {
10
+ "dev": "vite",
11
+ "build": "vite build",
12
+ "preview:build": "pnpm build && vite preview",
13
+ "report": "rimraf dist && vite build"
14
+ },
15
+ "keywords": [],
16
+ "author": "",
17
+ "license": "ISC"
18
+ }
package/src/api/http.ts CHANGED
@@ -26,10 +26,7 @@ export const getPrintTemp = (printPosition, query?) => {
26
26
  const organizationId = useSystemStoreHook().getOrganizationId;
27
27
  const orgId = useSystemStoreHook().getOrgId;
28
28
  const url = '/upms/v1/printTemplateConfig/ogn';
29
- const param = Object.assign(
30
- { pageSize: 100, pageNum: 1, orgId, organizationId, printPosition },
31
- query || {}
32
- );
29
+ const param = Object.assign({ pageSize: 100, pageNum: 1, orgId, organizationId, printPosition }, query || {});
33
30
  return new Promise(reslove => {
34
31
  http.get(`${getBaseURL()}${url}`, param).then(async (res: IResponseData) => {
35
32
  const templateCode = res.list
package/src/api/index.ts CHANGED
@@ -1,31 +1,33 @@
1
- /*
2
- * @Author: wei.li
3
- * @Date: 2021-11-17 16:24:43
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2024-11-23 10:13:07
6
- * @Description: API封装
7
- */
8
- // import { http } from '@utogether/utils';
9
- import { http } from '../utils/udp/http';
10
- import { getEnv } from '../config';
11
-
12
- // 路由相关服务
13
- export const getServiceApi = () => {
14
- return {
15
- post: (url: string, data: object, config?) => http.post(`${getBaseURL()}${url}`, data, config),
16
- get: (url: string, params: object, config?) => http.get(`${getBaseURL()}${url}`, params, config),
17
- put: (url: string, params: object) => http.put(`${getBaseURL()}${url}`, params),
18
- delete: (url: string, params: object) => http.delete(`${getBaseURL()}${url}`, params)
19
- };
20
- };
21
-
22
- export const setRouter = router => {
23
- http.setRouter(router);
24
- // http.setBaseUrl(getBaseURL());
25
- };
26
-
27
- const origin = window.location.origin + '/gateway';
28
-
29
- export const getBaseURL = () => {
30
- return getEnv().VITE_BASE_URL === 'origin' ? origin : getEnv().VITE_BASE_URL;
31
- };
1
+ /*
2
+ * @Author: wei.li
3
+ * @Date: 2021-11-17 16:24:43
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-09-05 11:53:29
6
+ * @Description: API封装
7
+ */
8
+ import { http } from '@utogether/utils';
9
+ // import { http } from '../utils/udp/http';
10
+ import { getEnv } from '../config';
11
+
12
+ // 路由相关服务
13
+ export const getServiceApi = () => {
14
+ return {
15
+ post: (url: string, data: object, config?) => http.post(`${getBaseURL()}${url}`, data, config),
16
+ get: (url: string, params: object, config?) => http.get(`${getBaseURL()}${url}`, params, config),
17
+ put: (url: string, params: object) => http.put(`${getBaseURL()}${url}`, params),
18
+ delete: (url: string, params: object) => http.delete(`${getBaseURL()}${url}`, params)
19
+ };
20
+ };
21
+
22
+ export const setRouter = router => {
23
+ http.setRouter(router);
24
+ };
25
+ export const setBaseUrl = router => {
26
+ http.setBaseUrl(router);
27
+ };
28
+
29
+ const origin = window.location.origin + '/gateway';
30
+
31
+ export const getBaseURL = () => {
32
+ return getEnv().VITE_BASE_URL === 'origin' ? origin : getEnv().VITE_BASE_URL;
33
+ };
package/src/api/user.ts CHANGED
@@ -2,13 +2,13 @@
2
2
  * @Author: wei.li
3
3
  * @Date: 2021-11-17 16:02:30
4
4
  * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2024-06-06 16:29:39
5
+ * @LastEditTime: 2025-09-05 12:33:08
6
6
  * @Description: file content
7
7
  */
8
8
  import { http } from '@utogether/utils';
9
+ // import { http } from '../utils/udp/http';
9
10
  import { getBaseURL } from './';
10
11
 
11
- http.setBaseUrl(getBaseURL());
12
12
  // 私钥
13
13
  export const getPublicKey = () => http.get(`${getBaseURL()}/public/request`);
14
14
  // 获取验证码
package/src/main.ts CHANGED
@@ -2,17 +2,10 @@
2
2
  * @Author: levi7754 levi7754@163.com
3
3
  * @Date: 2025-07-25 13:38:20
4
4
  * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-08-21 17:15:41
5
+ * @LastEditTime: 2025-09-05 13:48:25
6
6
  * @FilePath: \udp-front\packages\udp-core\src\main.ts
7
7
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
8
  */
9
- /*
10
- * @Author: wei.li
11
- * @Date: 2022-10-18 18:13:54
12
- * @LastEditors: levi7754 levi7754@163.com
13
- * @LastEditTime: 2025-07-31 17:17:32
14
- * @Description: file content
15
- */
16
9
  import { createApp, type Directive } from 'vue';
17
10
  import App from './App.vue';
18
11
  // import router from './router';
@@ -23,7 +16,7 @@ import { useI18n } from '../src/plugins/i18n';
23
16
  import { setTableConfig } from '../src/plugins/vxe-table';
24
17
  import { injectResponsiveStorage } from './utils/storage';
25
18
  import hasAuthority from './utils/authority';
26
- import { getServiceApi, getBaseURL, setRouter } from './api';
19
+ import { getServiceApi, getBaseURL, setRouter, setBaseUrl } from './api';
27
20
 
28
21
  import 'nprogress/nprogress.css';
29
22
  // 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题
@@ -107,6 +100,7 @@ const init = ({ router, config, lang, views, env, tableConfig }) => {
107
100
  // .component('UtModalGrid', UtModalGrid);
108
101
  app.use(VueViewer, { defaultOptions: { zIndex: 9999 } });
109
102
  setGlobal(app);
103
+ setBaseUrl(getBaseURL());
110
104
  setGlobalDirective(app);
111
105
  // 全局组件
112
106
  setupStore(app);
@@ -1,177 +1,177 @@
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
-
14
- const systemRouter = import.meta.glob([
15
- '../views/system/**/*.{vue,tsx}',
16
- '../views/uapp/**/*.{vue,tsx}',
17
- '../views/upms/**/*.{vue,tsx}',
18
- '../views/ufile/**/*.{vue}',
19
- '../views/urpt/**/*.{vue,tsx}',
20
- '../views/organization/**/*.{vue,tsx}',
21
- '../views/udev/**/*.{vue, tsx}'
22
- ]);
23
-
24
- export const remainingRouters = remainingRouter;
25
-
26
- // 原始静态路由(未做任何处理)
27
- const routes = [homeRouter, errorRouter];
28
- /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
29
- export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
30
- formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
31
- );
32
-
33
- /** 用于渲染菜单,保持原始层级 */
34
- export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
35
-
36
- /** 不参与菜单的路由 */
37
- export const remainingPaths = Object.keys(remainingRouter).map(v => {
38
- return remainingRouter[v].path;
39
- });
40
-
41
- /** 创建路由实例 */
42
- // export const router: Router = createRouter({
43
- // history: createWebHistory(window.__HISTORY_PATH__),
44
- // routes: constantRoutes.concat(...(remainingRouter as any)),
45
- // strict: true,
46
- // scrollBehavior(to, from, savedPosition) {
47
- // return new Promise(resolve => {
48
- // if (savedPosition) {
49
- // return savedPosition;
50
- // } else {
51
- // if (from.meta.saveSrollTop) {
52
- // const top: number = document.documentElement.scrollTop || document.body.scrollTop;
53
- // resolve({ left: 0, top });
54
- // }
55
- // }
56
- // });
57
- // }
58
- // });
59
-
60
- /** 重置路由 */
61
- export function resetRouter() {
62
- router.getRoutes().forEach(route => {
63
- const { name, meta } = route;
64
- if (name && router.hasRoute(name) && meta?.backstage) {
65
- router.removeRoute(name);
66
- router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes))));
67
- }
68
- });
69
- usePermissionStoreHook().clearAllCachePage();
70
- }
71
-
72
- let views = null;
73
- export let router = null;
74
- export function setViews(cviews, crouter) {
75
- views = cviews;
76
- router = crouter;
77
- Object.assign(views, systemRouter);
78
- }
79
-
80
- export function getViews() {
81
- return views;
82
- }
83
-
84
- /** 路由白名单 */
85
- const whiteList = ['/login'];
86
- /*
87
- router.beforeEach((to: ToRouteType, _from, next) => {
88
- if (to.meta?.keepAlive) {
89
- handleAliveRoute(to, 'add');
90
- // 页面整体刷新和点击标签页刷新
91
- if (_from.name === undefined || _from.name === 'redirect') {
92
- handleAliveRoute(to);
93
- }
94
- }
95
- const userName = cookies.get(kLOGINER);
96
- NProgress.start();
97
- if (userName) {
98
- routerBefore(to, _from, next);
99
- } else {
100
- if (to.path !== '/login') {
101
- if (whiteList.indexOf(to.path) !== -1) {
102
- next();
103
- } else {
104
- next({ path: '/login' });
105
- }
106
- } else {
107
- next();
108
- }
109
- }
110
- });
111
-
112
- router.afterEach(() => {
113
- NProgress?.done();
114
- });
115
-
116
- */
117
- export const routerBefore = (to, _from, next) => {
118
- // TODO 无权限跳转403页面
119
- // if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
120
- // next({ path: "/error/403" });
121
- // }
122
- const userName = cookies.get(kLOGINER);
123
-
124
- const externalLink = isUrl(to?.name as string);
125
- /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
126
- function toCorrectRoute() {
127
- whiteList.includes(to.fullPath) ? next(_from.fullPath) : next();
128
- }
129
- if (_from?.name && _from?.name !== 'login') {
130
- // m.name === to.name 判断param路由跳转
131
- const cmp = to.matched.find(m => m.path === to.path || (m.name === to.name && to.params))?.components;
132
- // 如果路由包含http 则是超链接 反之是普通路由
133
- if (externalLink) {
134
- openLink(to?.name as string);
135
- NProgress?.done();
136
- } else if (cmp?.default || to.name === 'redirect') {
137
- toCorrectRoute();
138
- } else {
139
- next({ path: '/error/404' });
140
- }
141
- } else {
142
- // 刷新
143
- if (usePermissionStoreHook().wholeMenus.length === 0) {
144
- initRouter(userName).then((router: Router) => {
145
- if (!useMultiTagsStoreHook().getMultiTagsCache) {
146
- const { path } = to;
147
- const index = findIndexOf(remainingRouter, v => v.path === path);
148
- const routes: any = index === -1 ? router.options.routes[0].children : router.options.routes;
149
- const route = findRouteByPath(path, routes);
150
- if (route && route.meta?.title) {
151
- const { path, name, meta } = route;
152
- useMultiTagsStoreHook().handleTags('push', { path, name, meta });
153
- }
154
- }
155
- // 确保动态路由完全加入路由列表并且不影响静态路由
156
- // (注意:动态路由刷新时router.beforeEach可能会触发两次,
157
- // 第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,
158
- // 如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次)
159
- if (isEmpty(to.name)) router.push(to.fullPath);
160
- });
161
- }
162
- if (_from.fullPath === '/' && to.fullPath === '/login' && !to.query?.tokenExpire) {
163
- to.path = '/welcome';
164
- to.fullPath = '/welcome';
165
- to.name = 'SuHome';
166
- } else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
167
- to.path = '/welcome';
168
- to.fullPath = '/welcome';
169
- to.name = 'SuHome';
170
- to.query = {};
171
- }
172
- // next();
173
- toCorrectRoute();
174
- }
175
- };
176
-
177
- // 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
+
14
+ const systemRouter = import.meta.glob([
15
+ '../views/system/**/*.{vue,tsx}',
16
+ '../views/uapp/**/*.{vue,tsx}',
17
+ '../views/upms/**/*.{vue,tsx}',
18
+ '../views/ufile/**/*.{vue}',
19
+ '../views/urpt/**/*.{vue,tsx}',
20
+ '../views/organization/**/*.{vue,tsx}',
21
+ '../views/udev/**/*.{vue, tsx}'
22
+ ]);
23
+
24
+ export const remainingRouters = remainingRouter;
25
+
26
+ // 原始静态路由(未做任何处理)
27
+ const routes = [homeRouter, errorRouter];
28
+ /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */
29
+ export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
30
+ formatFlatteningRoutes(buildHierarchyTree(ascending(routes)))
31
+ );
32
+
33
+ /** 用于渲染菜单,保持原始层级 */
34
+ export const constantMenus: Array<RouteComponent> = ascending(routes).concat(...remainingRouter);
35
+
36
+ /** 不参与菜单的路由 */
37
+ export const remainingPaths = Object.keys(remainingRouter).map(v => {
38
+ return remainingRouter[v].path;
39
+ });
40
+
41
+ /** 创建路由实例 */
42
+ // export const router: Router = createRouter({
43
+ // history: createWebHistory(window.__HISTORY_PATH__),
44
+ // routes: constantRoutes.concat(...(remainingRouter as any)),
45
+ // strict: true,
46
+ // scrollBehavior(to, from, savedPosition) {
47
+ // return new Promise(resolve => {
48
+ // if (savedPosition) {
49
+ // return savedPosition;
50
+ // } else {
51
+ // if (from.meta.saveSrollTop) {
52
+ // const top: number = document.documentElement.scrollTop || document.body.scrollTop;
53
+ // resolve({ left: 0, top });
54
+ // }
55
+ // }
56
+ // });
57
+ // }
58
+ // });
59
+
60
+ /** 重置路由 */
61
+ export function resetRouter() {
62
+ router.getRoutes().forEach(route => {
63
+ const { name, meta } = route;
64
+ if (name && router.hasRoute(name) && meta?.backstage) {
65
+ router.removeRoute(name);
66
+ router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes))));
67
+ }
68
+ });
69
+ usePermissionStoreHook().clearAllCachePage();
70
+ }
71
+
72
+ let views = null;
73
+ export let router = null;
74
+ export function setViews(cviews, crouter) {
75
+ views = cviews;
76
+ router = crouter;
77
+ Object.assign(views, systemRouter);
78
+ }
79
+
80
+ export function getViews() {
81
+ return views;
82
+ }
83
+
84
+ /** 路由白名单 */
85
+ const whiteList = ['/login'];
86
+ /*
87
+ router.beforeEach((to: ToRouteType, _from, next) => {
88
+ if (to.meta?.keepAlive) {
89
+ handleAliveRoute(to, 'add');
90
+ // 页面整体刷新和点击标签页刷新
91
+ if (_from.name === undefined || _from.name === 'redirect') {
92
+ handleAliveRoute(to);
93
+ }
94
+ }
95
+ const userName = cookies.get(kLOGINER);
96
+ NProgress.start();
97
+ if (userName) {
98
+ routerBefore(to, _from, next);
99
+ } else {
100
+ if (to.path !== '/login') {
101
+ if (whiteList.indexOf(to.path) !== -1) {
102
+ next();
103
+ } else {
104
+ next({ path: '/login' });
105
+ }
106
+ } else {
107
+ next();
108
+ }
109
+ }
110
+ });
111
+
112
+ router.afterEach(() => {
113
+ NProgress?.done();
114
+ });
115
+
116
+ */
117
+ export const routerBefore = (to, _from, next) => {
118
+ // TODO 无权限跳转403页面
119
+ // if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) {
120
+ // next({ path: "/error/403" });
121
+ // }
122
+ const userName = cookies.get(kLOGINER);
123
+
124
+ const externalLink = isUrl(to?.name as string);
125
+ /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */
126
+ function toCorrectRoute() {
127
+ whiteList.includes(to.fullPath) ? next(_from.fullPath) : next();
128
+ }
129
+ if (_from?.name && _from?.name !== 'login') {
130
+ // m.name === to.name 判断param路由跳转
131
+ const cmp = to.matched.find(m => m.path === to.path || (m.name === to.name && to.params))?.components;
132
+ // 如果路由包含http 则是超链接 反之是普通路由
133
+ if (externalLink) {
134
+ openLink(to?.name as string);
135
+ NProgress?.done();
136
+ } else if (cmp?.default || to.name === 'redirect') {
137
+ toCorrectRoute();
138
+ } else {
139
+ next({ path: '/error/404' });
140
+ }
141
+ } else {
142
+ // 刷新
143
+ if (usePermissionStoreHook().wholeMenus.length === 0) {
144
+ initRouter(userName).then((router: Router) => {
145
+ if (!useMultiTagsStoreHook().getMultiTagsCache) {
146
+ const { path } = to;
147
+ const index = findIndexOf(remainingRouter, v => v.path === path);
148
+ const routes: any = index === -1 ? router.options.routes[0].children : router.options.routes;
149
+ const route = findRouteByPath(path, routes);
150
+ if (route && route.meta?.title) {
151
+ const { path, name, meta } = route;
152
+ useMultiTagsStoreHook().handleTags('push', { path, name, meta });
153
+ }
154
+ }
155
+ // 确保动态路由完全加入路由列表并且不影响静态路由
156
+ // (注意:动态路由刷新时router.beforeEach可能会触发两次,
157
+ // 第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,
158
+ // 如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次)
159
+ if (isEmpty(to.name)) router.push(to.fullPath);
160
+ });
161
+ }
162
+ if (_from.fullPath === '/' && to.fullPath === '/login' && !to.query?.tokenExpire) {
163
+ to.path = '/welcome';
164
+ to.fullPath = '/welcome';
165
+ to.name = 'SuHome';
166
+ } else if (_from.fullPath === '/' && to.path === '/workflow/approve/index') {
167
+ to.path = '/welcome';
168
+ to.fullPath = '/welcome';
169
+ to.name = 'SuHome';
170
+ to.query = {};
171
+ }
172
+ // next();
173
+ toCorrectRoute();
174
+ }
175
+ };
176
+
177
+ // export default router;
@@ -47,7 +47,7 @@ html[data-vxe-ui-theme='light'] {
47
47
  background-color: #fffbdf;
48
48
  }
49
49
 
50
- .el-select__wrapper:not(:disabled) {
50
+ .el-select__wrapper:not(.is-disabled) {
51
51
  background-color: #fffbdf;
52
52
  }
53
53
 
@@ -1,42 +1,42 @@
1
- /*
2
- * @Author: levi7754 levi7754@163.com
3
- * @Date: 2023-06-19 09:14:18
4
- * @LastEditors: wei.li
5
- * @LastEditTime: 2024-07-02 08:57:49
6
- * @FilePath: /sitzone-mes/src/utils/propTypes.ts
7
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
- */
9
- import type { CSSProperties, VNodeChild } from 'vue';
10
- import { createTypes, toValidableType, type VueTypesInterface, type VueTypeValidableDef } from 'vue-types';
11
-
12
- export type VueNode = VNodeChild | JSX.Element;
13
-
14
- type PropTypes = VueTypesInterface & {
15
- readonly style: VueTypeValidableDef<CSSProperties>;
16
- readonly VNodeChild: VueTypeValidableDef<VueNode>;
17
- };
18
-
19
- const newPropTypes = createTypes({
20
- func: undefined,
21
- bool: undefined,
22
- string: undefined,
23
- number: undefined,
24
- object: undefined,
25
- integer: undefined
26
- }) as PropTypes;
27
-
28
- // 从 vue-types v5.0 开始,extend()方法已经废弃,当前已改为官方推荐的ES6+方法 https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
29
- export default class propTypes extends newPropTypes {
30
- // a native-like validator that supports the `.validable` method
31
- static get style() {
32
- return toValidableType('style', {
33
- type: [String, Object]
34
- });
35
- }
36
-
37
- static get VNodeChild() {
38
- return toValidableType('VNodeChild', {
39
- type: undefined
40
- });
41
- }
42
- }
1
+ /*
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2023-06-19 09:14:18
4
+ * @LastEditors: wei.li
5
+ * @LastEditTime: 2024-07-02 08:57:49
6
+ * @FilePath: /sitzone-mes/src/utils/propTypes.ts
7
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8
+ */
9
+ import type { CSSProperties, VNodeChild } from 'vue';
10
+ import { createTypes, toValidableType, type VueTypesInterface, type VueTypeValidableDef } from 'vue-types';
11
+
12
+ export type VueNode = VNodeChild | JSX.Element;
13
+
14
+ type PropTypes = VueTypesInterface & {
15
+ readonly style: VueTypeValidableDef<CSSProperties>;
16
+ readonly VNodeChild: VueTypeValidableDef<VueNode>;
17
+ };
18
+
19
+ const newPropTypes = createTypes({
20
+ func: undefined,
21
+ bool: undefined,
22
+ string: undefined,
23
+ number: undefined,
24
+ object: undefined,
25
+ integer: undefined
26
+ }) as PropTypes;
27
+
28
+ // 从 vue-types v5.0 开始,extend()方法已经废弃,当前已改为官方推荐的ES6+方法 https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
29
+ export default class propTypes extends newPropTypes {
30
+ // a native-like validator that supports the `.validable` method
31
+ static get style() {
32
+ return toValidableType('style', {
33
+ type: [String, Object]
34
+ });
35
+ }
36
+
37
+ static get VNodeChild() {
38
+ return toValidableType('VNodeChild', {
39
+ type: undefined
40
+ });
41
+ }
42
+ }