@utogether/udp-core 1.0.1-beta.33 → 1.0.1-beta.36

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 (64) hide show
  1. package/dist/{403-kwxf8yCK.js → 403-DyXUGKoE.js} +5 -5
  2. package/dist/{404-HtCKNMVs.js → 404-BMsHU2ES.js} +4 -4
  3. package/dist/{500-ClrRGqKR.js → 500-CbNyGD7D.js} +1 -1
  4. package/dist/{AuthorityInfo-CtRBjzja.js → AuthorityInfo-KsKY-NZ6.js} +1 -1
  5. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DMwwnDTE.js → AuthorityInfo.vue_vue_type_style_index_0_lang-CZN4ifJY.js} +1 -1
  6. package/dist/{Company-DTjplho_.js → Company-BLz2bsPR.js} +3 -3
  7. package/dist/{CompanyPanel-Cjy6fVPj.js → CompanyPanel-CR3Mw_9O.js} +12 -12
  8. package/dist/{Department-CH6Yt7f4.js → Department-CXTPaA3G.js} +3 -3
  9. package/dist/{DepartmentPanel-rqSEit_s.js → DepartmentPanel-sdMIyWli.js} +7 -7
  10. package/dist/{DesignPanel-DJ1RlhRO.js → DesignPanel-CDj1NhGj.js} +1 -1
  11. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-Wb6xMGH-.js → DesignPanel.vue_vue_type_style_index_0_lang-CHP7KFmA.js} +2 -2
  12. package/dist/{DictView-BveOTSOM.js → DictView-CesILqIR.js} +1 -1
  13. package/dist/{InvOrganization-DWOGgrPo.js → InvOrganization-BiiaUIkE.js} +1 -1
  14. package/dist/{Org-BN2xMKd6.js → Org-Btuon-rf.js} +3 -3
  15. package/dist/{Preview-DHjo8tzC.js → Preview-yU3fj1g5.js} +1 -1
  16. package/dist/{ReportDefine-_dQiM9xA.js → ReportDefine-B0BKZ8qQ.js} +1 -1
  17. package/dist/{ReportDesign-CdEO2lRV.js → ReportDesign-0KCUda0R.js} +8 -8
  18. package/dist/{ReportQuery-BpkUbbK6.js → ReportQuery-BLKvmD12.js} +1 -1
  19. package/dist/{ReportQueryFrom-CbP80_sr.js → ReportQueryFrom-CgqwICUU.js} +1 -1
  20. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-BVL6ZoEt.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CYTj6VPj.js} +1 -1
  21. package/dist/{ReportTemplate-DSusiJ71.js → ReportTemplate-C4sqLywu.js} +1 -1
  22. package/dist/{Role-C6hy0KuJ.js → Role-yZITpgPO.js} +3 -3
  23. package/dist/{RoleAssign-xKFsJ7Kx.js → RoleAssign-L97nmCrU.js} +3 -3
  24. package/dist/{RolePanel-DfD9rJzO.js → RolePanel-BJXG0B6A.js} +1 -1
  25. package/dist/{RolePanel-B7Q58kiG.js → RolePanel-qj_GbWD7.js} +1 -1
  26. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Bv-uI4Dl.js → RolePanel.vue_vue_type_script_setup_true_lang-BfZoUyAJ.js} +7 -7
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CehA2NNV.js → RolePanel.vue_vue_type_script_setup_true_lang-DPiskBzz.js} +7 -7
  28. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-Wk3ehyH5.js → ScrollPanel.vue_vue_type_style_index_0_lang-B6Q3ctvz.js} +5 -5
  29. package/dist/{Staff-BVUFcmsm.js → Staff-BPITcOkP.js} +3 -3
  30. package/dist/{StaffInfo-Do7TRY0M.js → StaffInfo-BogMLe9z.js} +1 -1
  31. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-baun5eMA.js → StaffInfo.vue_vue_type_script_setup_true_lang-sH4qyCfh.js} +4 -4
  32. package/dist/{StaffPanel-5N37v8nE.js → StaffPanel-CgFVMYwO.js} +1 -1
  33. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-Du_AgvPd.js → StaffPanel.vue_vue_type_script_setup_true_lang-DyhCyFnF.js} +5 -5
  34. package/dist/{SysUser-DwbDMnb-.js → SysUser-DzdliLaI.js} +2 -2
  35. package/dist/{SysUserPanel-CZOyQYb6.js → SysUserPanel-IUraCbnt.js} +1 -1
  36. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-w2cJYId_.js → SysUserPanel.vue_vue_type_script_setup_true_lang-DF2GWJTk.js} +1 -1
  37. package/dist/{SystemMenu-Dt6G8ZoP.js → SystemMenu-DlIb28uw.js} +6 -6
  38. package/dist/{UserInfo-DkqXLpcs.js → UserInfo-DgeRuJCk.js} +1 -1
  39. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CaynWglM.js → UserInfo.vue_vue_type_style_index_0_lang-BmKfJyXE.js} +1 -1
  40. package/dist/{childView-BFFWXXUx.js → childView-C4phKrcY.js} +1 -1
  41. package/dist/{childView-BfeXnKqn.js → childView-DQ-3g54z.js} +1 -1
  42. package/dist/{childView.vue_vue_type_style_index_0_lang-D3UswIrw.js → childView.vue_vue_type_style_index_0_lang-Cl71-OUq.js} +7 -7
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-BJsDq027.js → childView.vue_vue_type_style_index_0_lang-maAkY1Sp.js} +8 -8
  44. package/dist/{code-rule-DG6acadZ.js → code-rule-CxzU64Hb.js} +1 -1
  45. package/dist/core.es.js +8 -8
  46. package/dist/{cron-task-BcSJarq3.js → cron-task-CKLeTK7O.js} +5 -5
  47. package/dist/{frameView-D64-T4BV.js → frameView-CgNT6_Bq.js} +1 -1
  48. package/dist/{index-1BOi1amY.js → index-Da0zJqlp.js} +383 -370
  49. package/dist/{layoutView-CQJ9c3ZV.js → layoutView-CHhWcHC7.js} +244 -244
  50. package/dist/{log-in-EOn9ci11.js → log-in-pet8Awpr.js} +4 -4
  51. package/dist/{log-out-Dw-n4tmS.js → log-out-CPwT8--B.js} +3 -3
  52. package/dist/{login-DHC4RPod.js → login-BGU4ViTq.js} +50 -48
  53. package/dist/{lov-view-BG0lV86e.js → lov-view-HgPnQV9D.js} +9 -9
  54. package/dist/{menuInfo-CC5u9H-w.js → menuInfo-BOg6T9ah.js} +1 -1
  55. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-vnxmY_ro.js → menuInfo.vue_vue_type_style_index_0_lang-DRfGRBJU.js} +1 -1
  56. package/dist/{pda-app-DU1gkWj4.js → pda-app-DiKwdZX9.js} +18 -18
  57. package/dist/{resource-B9x_rSE_.js → resource-ig8i-9QR.js} +7 -7
  58. package/dist/{su-welcome-DGOeEb4b.js → su-welcome-1ZnlQyQu.js} +1 -1
  59. package/dist/{sys-config-C1bZxKpe.js → sys-config-DFrgaSmn.js} +1 -1
  60. package/dist/udp-core.css +1 -1
  61. package/package.json +1 -1
  62. package/src/layout/hooks/useNav.ts +176 -173
  63. package/src/utils/lifecycle.ts +39 -20
  64. package/src/views/ulogin/login.vue +325 -323
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@utogether/udp-core",
3
3
  "private": false,
4
- "version": "1.0.1-beta.33",
4
+ "version": "1.0.1-beta.36",
5
5
  "description": "",
6
6
  "type": "module",
7
7
  "main1": "index.ts",
@@ -1,173 +1,176 @@
1
- /*
2
- * @Author: wei.li
3
- * @Date: 2023-04-18 15:44:40
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-04-16 15:49:31
6
- * @Description: file content
7
- */
8
- import { computed, type CSSProperties } from 'vue';
9
- import { storeToRefs } from 'pinia';
10
- import { useRouter } from 'vue-router';
11
- import { cookies, useGlobal, storageLocal } from '@utogether/utils';
12
- import { router, remainingPaths, resetRouter } from '../../router';
13
- import { emitter } from '../../utils/mitt';
14
- import { getEnv } from '../../config';
15
- import { kTOKEN, kLOGINER, kCKTOKEN, kSYSCONFIG } from '../../contant';
16
- import { routerArrays } from '../types';
17
- // import { transformI18n } from '@/plugins/i18n';
18
- import { useAppStoreHook } from '../../store/modules/app';
19
- import { usePermissionStoreHook } from '../../store/modules/permission';
20
- import { useEpThemeStoreHook } from '../../store/modules/epTheme';
21
- import { useSystemStoreHook } from '../../store/modules/system';
22
- import { useMultiTagsStoreHook } from '../../store/modules/multiTags';
23
-
24
- const errorInfo = '当前路由配置不正确,请检查配置';
25
-
26
- export function useNav() {
27
- const appHook = useAppStoreHook();
28
- const routers = useRouter().options.routes;
29
- const { wholeMenus } = storeToRefs(usePermissionStoreHook());
30
-
31
- const getDivStyle = computed((): CSSProperties => {
32
- return {
33
- width: '100%',
34
- display: 'flex',
35
- alignItems: 'center',
36
- justifyContent: 'space-between',
37
- overflow: 'hidden'
38
- };
39
- });
40
-
41
- /** 设置国际化选中后的样式 */
42
- const getDropdownItemStyle = computed(() => {
43
- return (locale, t) => {
44
- return {
45
- background: locale === t ? useEpThemeStoreHook().epThemeColor : '',
46
- color: locale === t ? '#f4f4f5' : '#000'
47
- };
48
- };
49
- });
50
-
51
- const getDropdownItemClass = computed(() => {
52
- return (locale, t) => {
53
- return locale === t ? '' : 'dark:hover:text-primary!';
54
- };
55
- });
56
-
57
- /** 用户名 */
58
- const userInfo = computed<IRecord>(() => {
59
- return useSystemStoreHook().getUserInfo || {};
60
- });
61
- const avatarsStyle = computed(() => {
62
- return userInfo.value ? { marginRight: '10px' } : '';
63
- });
64
-
65
- const isCollapse = computed(() => {
66
- return !appHook.getSidebarStatus;
67
- });
68
-
69
- const device = computed(() => {
70
- return appHook.getDevice;
71
- });
72
-
73
- const { $storage } = useGlobal();
74
- const layout = computed(() => {
75
- return $storage?.layout?.layout;
76
- });
77
-
78
- const title = computed(() => {
79
- const sysConfig = storageLocal.getItem(kSYSCONFIG) || {};
80
- return sysConfig?.title || 'U-DP';
81
- });
82
-
83
- /** 动态title */
84
- function setDocumentTitle() {
85
- document.title = getEnv().MODE !== 'staging' ? title.value : `${title.value}•测试`;
86
- }
87
-
88
- /** 退出登录 */
89
- function logout() {
90
- useMultiTagsStoreHook().handleTags('equal', [...routerArrays]);
91
- cookies.remove(kCKTOKEN);
92
- cookies.remove(kTOKEN);
93
- cookies.remove(kLOGINER);
94
- usePermissionStoreHook().setWholeMenus([]);
95
- // 关闭全部标签页, 防止缓存了tags,又用另一个账号登录
96
- useMultiTagsStoreHook().handleTags('splice', '', {
97
- startIndex: 1,
98
- length: useMultiTagsStoreHook()?.multiTags?.length
99
- });
100
- usePermissionStoreHook().clearAllCachePage();
101
- resetRouter();
102
- router.push('/login');
103
- }
104
-
105
- function backHome() {
106
- router.push('/welcome');
107
- }
108
-
109
- function onPanel() {
110
- emitter.emit('openPanel');
111
- }
112
-
113
- function toggleSideBar() {
114
- appHook.toggleSideBar();
115
- }
116
-
117
- function handleResize(menuRef) {
118
- menuRef?.handleResize();
119
- }
120
-
121
- function resolvePath(route) {
122
- if (!route.children) return console.error(errorInfo);
123
- const httpReg = /^http(s?):\/\//;
124
- const routeChildPath = route.children[0]?.path;
125
- if (httpReg.test(routeChildPath)) {
126
- return route.path + '/' + routeChildPath;
127
- } else {
128
- return routeChildPath;
129
- }
130
- }
131
- function menuSelect(indexPath: string) {
132
- if (wholeMenus.value.length === 0 || isRemaining(indexPath)) return;
133
- emitter.emit('changLayoutRoute', indexPath);
134
- }
135
-
136
- /** 判断路径是否参与菜单 */
137
- function isRemaining(path: string) {
138
- return remainingPaths.includes(path);
139
- }
140
-
141
- function passwordItems() {
142
- const itemRender = { name: '$input', props: { type: 'password' } };
143
- return [
144
- { field: 'oldUserPwd', title: 'message.udp.oldPwd', required: true, itemRender },
145
- { field: 'userPwd', title: 'message.udp.newPwd', required: true, itemRender },
146
- { field: 'confirmPwd', title: 'message.udp.confirmPwd', required: true, itemRender }
147
- ];
148
- }
149
-
150
- return {
151
- title,
152
- device,
153
- layout,
154
- logout,
155
- routers,
156
- $storage,
157
- backHome,
158
- onPanel,
159
- getDivStyle,
160
- setDocumentTitle,
161
- toggleSideBar,
162
- menuSelect,
163
- handleResize,
164
- resolvePath,
165
- isCollapse,
166
- appHook,
167
- userInfo,
168
- avatarsStyle,
169
- getDropdownItemStyle,
170
- getDropdownItemClass,
171
- passwordItems
172
- };
173
- }
1
+ /*
2
+ * @Author: wei.li
3
+ * @Date: 2023-04-18 15:44:40
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-11-24 15:43:19
6
+ * @Description: file content
7
+ */
8
+ import { computed, type CSSProperties } from 'vue';
9
+ import { storeToRefs } from 'pinia';
10
+ import { useRouter } from 'vue-router';
11
+ import { cookies, useGlobal, storageLocal } from '@utogether/utils';
12
+ import { router, remainingPaths, resetRouter } from '../../router';
13
+ import { emitter } from '../../utils/mitt';
14
+ import { onBeforeLogout, onAfterLogout } from '../../utils/lifecycle';
15
+ import { getEnv } from '../../config';
16
+ import { kTOKEN, kLOGINER, kCKTOKEN, kSYSCONFIG } from '../../contant';
17
+ import { routerArrays } from '../types';
18
+ // import { transformI18n } from '@/plugins/i18n';
19
+ import { useAppStoreHook } from '../../store/modules/app';
20
+ import { usePermissionStoreHook } from '../../store/modules/permission';
21
+ import { useEpThemeStoreHook } from '../../store/modules/epTheme';
22
+ import { useSystemStoreHook } from '../../store/modules/system';
23
+ import { useMultiTagsStoreHook } from '../../store/modules/multiTags';
24
+
25
+ const errorInfo = '当前路由配置不正确,请检查配置';
26
+
27
+ export function useNav() {
28
+ const appHook = useAppStoreHook();
29
+ const routers = useRouter().options.routes;
30
+ const { wholeMenus } = storeToRefs(usePermissionStoreHook());
31
+
32
+ const getDivStyle = computed((): CSSProperties => {
33
+ return {
34
+ width: '100%',
35
+ display: 'flex',
36
+ alignItems: 'center',
37
+ justifyContent: 'space-between',
38
+ overflow: 'hidden'
39
+ };
40
+ });
41
+
42
+ /** 设置国际化选中后的样式 */
43
+ const getDropdownItemStyle = computed(() => {
44
+ return (locale, t) => {
45
+ return {
46
+ background: locale === t ? useEpThemeStoreHook().epThemeColor : '',
47
+ color: locale === t ? '#f4f4f5' : '#000'
48
+ };
49
+ };
50
+ });
51
+
52
+ const getDropdownItemClass = computed(() => {
53
+ return (locale, t) => {
54
+ return locale === t ? '' : 'dark:hover:text-primary!';
55
+ };
56
+ });
57
+
58
+ /** 用户名 */
59
+ const userInfo = computed<IRecord>(() => {
60
+ return useSystemStoreHook().getUserInfo || {};
61
+ });
62
+ const avatarsStyle = computed(() => {
63
+ return userInfo.value ? { marginRight: '10px' } : '';
64
+ });
65
+
66
+ const isCollapse = computed(() => {
67
+ return !appHook.getSidebarStatus;
68
+ });
69
+
70
+ const device = computed(() => {
71
+ return appHook.getDevice;
72
+ });
73
+
74
+ const { $storage } = useGlobal();
75
+ const layout = computed(() => {
76
+ return $storage?.layout?.layout;
77
+ });
78
+
79
+ const title = computed(() => {
80
+ const sysConfig = storageLocal.getItem(kSYSCONFIG) || {};
81
+ return sysConfig?.title || 'U-DP';
82
+ });
83
+
84
+ /** 动态title */
85
+ function setDocumentTitle() {
86
+ document.title = getEnv().MODE !== 'staging' ? title.value : `${title.value}•测试`;
87
+ }
88
+
89
+ /** 退出登录 */
90
+ function logout() {
91
+ onBeforeLogout();
92
+ useMultiTagsStoreHook().handleTags('equal', [...routerArrays]);
93
+ cookies.remove(kCKTOKEN);
94
+ cookies.remove(kTOKEN);
95
+ cookies.remove(kLOGINER);
96
+ usePermissionStoreHook().setWholeMenus([]);
97
+ // 关闭全部标签页, 防止缓存了tags,又用另一个账号登录
98
+ useMultiTagsStoreHook().handleTags('splice', '', {
99
+ startIndex: 1,
100
+ length: useMultiTagsStoreHook()?.multiTags?.length
101
+ });
102
+ usePermissionStoreHook().clearAllCachePage();
103
+ resetRouter();
104
+ onAfterLogout();
105
+ router.push('/login');
106
+ }
107
+
108
+ function backHome() {
109
+ router.push('/welcome');
110
+ }
111
+
112
+ function onPanel() {
113
+ emitter.emit('openPanel');
114
+ }
115
+
116
+ function toggleSideBar() {
117
+ appHook.toggleSideBar();
118
+ }
119
+
120
+ function handleResize(menuRef) {
121
+ menuRef?.handleResize();
122
+ }
123
+
124
+ function resolvePath(route) {
125
+ if (!route.children) return console.error(errorInfo);
126
+ const httpReg = /^http(s?):\/\//;
127
+ const routeChildPath = route.children[0]?.path;
128
+ if (httpReg.test(routeChildPath)) {
129
+ return route.path + '/' + routeChildPath;
130
+ } else {
131
+ return routeChildPath;
132
+ }
133
+ }
134
+ function menuSelect(indexPath: string) {
135
+ if (wholeMenus.value.length === 0 || isRemaining(indexPath)) return;
136
+ emitter.emit('changLayoutRoute', indexPath);
137
+ }
138
+
139
+ /** 判断路径是否参与菜单 */
140
+ function isRemaining(path: string) {
141
+ return remainingPaths.includes(path);
142
+ }
143
+
144
+ function passwordItems() {
145
+ const itemRender = { name: '$input', props: { type: 'password' } };
146
+ return [
147
+ { field: 'oldUserPwd', title: 'message.udp.oldPwd', required: true, itemRender },
148
+ { field: 'userPwd', title: 'message.udp.newPwd', required: true, itemRender },
149
+ { field: 'confirmPwd', title: 'message.udp.confirmPwd', required: true, itemRender }
150
+ ];
151
+ }
152
+
153
+ return {
154
+ title,
155
+ device,
156
+ layout,
157
+ logout,
158
+ routers,
159
+ $storage,
160
+ backHome,
161
+ onPanel,
162
+ getDivStyle,
163
+ setDocumentTitle,
164
+ toggleSideBar,
165
+ menuSelect,
166
+ handleResize,
167
+ resolvePath,
168
+ isCollapse,
169
+ appHook,
170
+ userInfo,
171
+ avatarsStyle,
172
+ getDropdownItemStyle,
173
+ getDropdownItemClass,
174
+ passwordItems
175
+ };
176
+ }
@@ -1,20 +1,39 @@
1
- /*
2
- * @Author: wei.li
3
- * @Date: 2024-06-26 16:30:54
4
- * @LastEditors: wei.li
5
- * @LastEditTime: 2024-06-26 17:11:58
6
- * @Description: file content
7
- */
8
-
9
- export const lifeCycleEvent = {
10
- onLogined: () => {},
11
- onBeforeLogout: () => {}
12
- };
13
-
14
- export const onLogined = () => {
15
- lifeCycleEvent.onLogined();
16
- };
17
-
18
- export const onBeforeLogout = () => {
19
- lifeCycleEvent.onBeforeLogout();
20
- };
1
+ /*
2
+ * @Author: wei.li
3
+ * @Date: 2024-06-26 16:30:54
4
+ * @LastEditors: wei.li
5
+ * @LastEditTime: 2024-06-26 17:11:58
6
+ * @Description: file content
7
+ */
8
+
9
+ export const lifeCycleEvent = {
10
+ onBeforeLogined: () => {},
11
+ onLogined: () => {},
12
+ onBeforeLogout: () => {},
13
+ onAfterLogout: () => {}
14
+ };
15
+
16
+ /**
17
+ * 平台登录前
18
+ */
19
+ export const onBeforeLogined = () => {
20
+ lifeCycleEvent.onBeforeLogined();
21
+ };
22
+ /**
23
+ * 平台登录后
24
+ */
25
+ export const onLogined = () => {
26
+ lifeCycleEvent.onLogined();
27
+ };
28
+ /**
29
+ * 平台退出前
30
+ */
31
+ export const onBeforeLogout = () => {
32
+ lifeCycleEvent.onBeforeLogout();
33
+ };
34
+ /**
35
+ * 平台退出后
36
+ */
37
+ export const onAfterLogout = () => {
38
+ lifeCycleEvent.onAfterLogout();
39
+ };