@utogether/udp-core 1.0.4 → 2.0.0-beta.10
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/dist/{403-DASI6Pwz.js → 403-DjXGcxpa.js} +3 -3
- package/dist/{404-YhBA92cb.js → 404-B_MSn6FQ.js} +1 -1
- package/dist/{500-ywbFF5MX.js → 500-CtI21E9g.js} +2 -2
- package/dist/{AuthorityInfo-tCSX2Fh7.js → AuthorityInfo-CYhRUS8K.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Cwd6UT2i.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BY8hkJ2R.js} +2 -2
- package/dist/{AuthorityPanel-BeBNiwqc.js → AuthorityPanel-CRlAwbaI.js} +1 -1
- package/dist/{AuthorityPanel.vue_vue_type_style_index_0_lang-CIYmnP9-.js → AuthorityPanel.vue_vue_type_style_index_0_lang-DxhZjp1S.js} +31 -24
- package/dist/{Company-l23MEzdM.js → Company-BVH3Zyy0.js} +3 -3
- package/dist/{CompanyPanel-D_s0rh6h.js → CompanyPanel-BKx3WVgS.js} +1 -1
- package/dist/{Department-DSEvORLg.js → Department-BZcr0_eu.js} +3 -3
- package/dist/{DepartmentPanel-WN8nOgCV.js → DepartmentPanel-BZNV3WaF.js} +3 -3
- package/dist/{DesignPanel-DirEGh9M.js → DesignPanel-7gr0Fljt.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-D02hXSrN.js → DesignPanel.vue_vue_type_style_index_0_lang-By9HKa8W.js} +3 -3
- package/dist/{DictView-DiIQdiek.js → DictView-B0dRdinW.js} +20 -19
- package/dist/{InvOrganization-b7v3g9EJ.js → InvOrganization-CwTNjj-a.js} +2 -2
- package/dist/{Org-BORfx1PL.js → Org-D59oQ0VY.js} +2 -2
- package/dist/{Preview-DkRn_TSc.js → Preview-sbZrWUWr.js} +1 -1
- package/dist/{ReportDefine-Cd0QeaWA.js → ReportDefine-C7CZ6RSh.js} +1 -1
- package/dist/{ReportDesign-4qNqyeEW.js → ReportDesign-CuevdD_6.js} +3 -3
- package/dist/{ReportQuery-BJfTFpec.js → ReportQuery-BndhM0Ji.js} +1 -1
- package/dist/{ReportQueryFrom-CB7sExZx.js → ReportQueryFrom-n2k7BNX9.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-CqO_2Ier.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CFtXbzOb.js} +1 -1
- package/dist/{ReportTemplate-B69muSgT.js → ReportTemplate-43Rx_knT.js} +1 -1
- package/dist/{Role-Bo4YrNDC.js → Role-BS2QH_H8.js} +3 -3
- package/dist/{RoleAssign-kOMYJ4s3.js → RoleAssign-C6wMcgfW.js} +3 -3
- package/dist/{RolePanel-BSJmjyqc.js → RolePanel-BwyuGmJw.js} +1 -1
- package/dist/{RolePanel-B1d4e6uk.js → RolePanel-DJop6xpJ.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DgQpfjaU.js → RolePanel.vue_vue_type_script_setup_true_lang-CSkU6fAb.js} +3 -3
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-DCzX-ZP_.js → RolePanel.vue_vue_type_script_setup_true_lang-Cf0BCtgL.js} +2 -2
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-WNOYFxJ1.js → ScrollPanel.vue_vue_type_style_index_0_lang-BZY0JkpB.js} +32 -31
- package/dist/Staff-DI6eAVQs.js +26 -0
- package/dist/{StaffInfo-DcU9_40C.js → StaffInfo-BQhMyQ7u.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-CtfN2CAr.js → StaffInfo.vue_vue_type_script_setup_true_lang-D79C6rw0.js} +9 -9
- package/dist/{StaffPanel-7exWkZd9.js → StaffPanel-By5elrj9.js} +1 -1
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-DtbIZdcq.js +154 -0
- package/dist/{SysUser-B3uB_cp2.js → SysUser-DNYitHEW.js} +2 -2
- package/dist/{SysUserPanel-B0CLp5AO.js → SysUserPanel-_WDSXjfT.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-Cwea_4dY.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BFhIa5Gs.js} +126 -111
- package/dist/{SystemMenu-a59l4hTk.js → SystemMenu-C_H0bTA7.js} +52 -49
- package/dist/{UserInfo-D1IA2oLt.js → UserInfo-Bx25xdkh.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-DDVgYRD5.js → UserInfo.vue_vue_type_style_index_0_lang-B6FE4Epn.js} +2 -2
- package/dist/await-to-js.es5-Bv3Eu4mi.js +10 -0
- package/dist/{childView-6rCeLcsx.js → childView-CiKCAXKS.js} +1 -1
- package/dist/{childView-JdrkroL5.js → childView-WAzRvHLp.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-B8x99f1B.js → childView.vue_vue_type_style_index_0_lang-3n_-DrRj.js} +2 -2
- package/dist/{childView.vue_vue_type_style_index_0_lang-BfcnWnx9.js → childView.vue_vue_type_style_index_0_lang-Bz4630fS.js} +26 -20
- package/dist/{code-rule-2lkPF547.js → code-rule-BehFVVOx.js} +2 -2
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-DV1pGO1m.js → cron-task-C0-R_b64.js} +2 -2
- package/dist/{frameView-C0bzSB8c.js → frameView-4E2U2LM3.js} +1 -1
- package/dist/index-BvU3LB8R.js +7275 -0
- package/dist/layout-home-DJywZo1E.js +232 -0
- package/dist/{layoutView-CTV-E4Cj.js → layoutView-JGsVdXXu.js} +148 -149
- package/dist/{log-in-CoBP2x6u.js → log-in-l4FpOtBL.js} +2 -2
- package/dist/{log-out-KX8FiRVf.js → log-out-Cij2dkih.js} +2 -2
- package/dist/{login-CtCoGWzD.js → login-D4hfm7ZW.js} +124 -134
- package/dist/{login-log-DJBGJVV0.js → login-log-BEHYT0v0.js} +5 -5
- package/dist/{lov-view-Bm0JEzzg.js → lov-view-CpJedb5y.js} +3 -3
- package/dist/{menuInfo-D2qPoRwz.js → menuInfo-ClhT8lVG.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DoQjX9Ly.js → menuInfo.vue_vue_type_style_index_0_lang-VuKVlyhc.js} +38 -36
- package/dist/{pda-app-SbcIclbH.js → pda-app-D_w1bNyU.js} +2 -2
- package/dist/{resource-Cdq1UKGI.js → resource-BxTwBnU4.js} +1 -1
- package/dist/su-welcome-BLNjs5WE.js +42181 -0
- package/dist/{sys-config-CCOf4xbj.js → sys-config-C0RJg9l1.js} +2 -2
- package/dist/udp-core.css +1 -1
- package/package.json +5 -2
- package/src/App.vue +37 -31
- package/src/components/SuScrollTree/ScrollPanel.vue +176 -170
- package/src/components/udp/content/index.vue +88 -88
- package/src/components/udp/form-upload/form-upload.vue +496 -0
- package/src/components/udp/grid/index.vue +524 -524
- package/src/components/udp/index.ts +6 -5
- package/src/components/udp/ut-stamp-badge/index.vue +271 -271
- package/src/components/udp/utils.ts +8 -2
- package/src/layout/components/lay-content/index.vue +4 -11
- package/src/layout/components/lay-search/components/SearchModal.vue +181 -189
- package/src/layout/components/lay-setting/index.vue +503 -503
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -101
- package/src/layout/components/lay-tag/index.vue +598 -598
- package/src/layout/hooks/useNav.ts +176 -176
- package/src/layout/hooks/useTag.ts +227 -227
- package/src/layout/layoutView.vue +216 -215
- package/src/layout/types.ts +93 -93
- package/src/main.ts +111 -115
- package/src/plugins/i18n/zh.ts +19 -3
- package/src/plugins/vxe-table/render.tsx +60 -15
- package/src/router/index.ts +187 -187
- package/src/router/modules/home.ts +32 -32
- package/src/router/utils.ts +420 -420
- package/src/store/modules/epTheme.ts +48 -48
- package/src/style/vxetable.scss +18 -2
- package/src/utils/dataFormat/index.ts +222 -222
- package/src/utils/lifecycle.ts +39 -39
- package/src/views/organization/department/DepartmentPanel.vue +303 -303
- package/src/views/organization/staff/Staff.vue +59 -58
- package/src/views/organization/staff/StaffInfo.vue +3 -2
- package/src/views/organization/staff/StaffPanel.vue +13 -1
- package/src/views/system/layout/layout-home.vue +238 -0
- package/src/views/system/menu/AuthorityPanel.vue +10 -9
- package/src/views/system/menu/SystemMenu.vue +194 -185
- package/src/views/system/menu/menuInfo.vue +384 -384
- package/src/views/system/sysUser/SysUserPanel.vue +363 -347
- package/src/views/udev/coderule/code-rule.vue +132 -132
- package/src/views/udev/dict/DictView.vue +4 -4
- package/src/views/udev/dict/childView.vue +6 -4
- package/src/views/udev/lov/childView.vue +174 -174
- package/src/views/ufile/aggregation/File.vue +85 -87
- package/src/views/uhome/components/common-menu.vue +118 -0
- package/src/views/uhome/components/dynamic-component.vue +66 -0
- package/src/views/uhome/components/home-todo.vue +175 -0
- package/src/views/uhome/components/menu-favorite.vue +315 -315
- package/src/views/uhome/dynamic-card.vue +31 -0
- package/src/views/uhome/su-welcome.vue +47 -114
- package/src/views/ulogin/login.vue +336 -325
- package/src/views/upms/interface/log-in.vue +100 -100
- package/src/views/upms/interface/log-out.vue +104 -104
- package/src/views/upms/user/login-log.vue +54 -54
- package/types/global.d.ts +232 -231
- package/vite.config.ts +83 -84
- package/dist/Staff-BFp3zNNR.js +0 -25
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-v5xOXKRS.js +0 -143
- package/dist/await-to-js.es5-BtRbN2QH.js +0 -10
- package/dist/index-BbtbEMCH.js +0 -4649
- package/dist/su-welcome-BHDsjqqV.js +0 -524
|
@@ -1,176 +1,176 @@
|
|
|
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
|
+
/*
|
|
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
|
+
}
|