@utogether/udp-core 2.0.0-beta.27 → 2.0.0-beta.28
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-gdcH0-Bo.js → 403-CyoOD-Ik.js} +1 -1
- package/dist/{404-Se2SF97M.js → 404-Ch_OHTw0.js} +1 -1
- package/dist/{500-B6j9AqLo.js → 500-Cf9am7HK.js} +1 -1
- package/dist/{AuthorityInfo-CQ8ydZvr.js → AuthorityInfo-BJ427cqG.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-C4NRvS8p.js → AuthorityInfo.vue_vue_type_style_index_0_lang-D9y7AwbB.js} +11 -12
- package/dist/{Company-BzSVBSC4.js → Company-qo-lKPkv.js} +3 -3
- package/dist/{CompanyPanel-DBjZB4aJ.js → CompanyPanel-DkKWAKvY.js} +7 -7
- package/dist/{Department-BkgseHo8.js → Department-CHUQByKX.js} +3 -3
- package/dist/{DepartmentPanel-Sen93_2M.js → DepartmentPanel-C742dfOO.js} +27 -28
- package/dist/{DesignPanel-pqDcwaFC.js → DesignPanel-D9oE5R7m.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BjtYyEw7.js → DesignPanel.vue_vue_type_style_index_0_lang-hYldVEbo.js} +192 -108
- package/dist/{DictView-CJLG4LlE.js → DictView-CrFXprP9.js} +1 -1
- package/dist/{InvOrganization-D0Jq1IAa.js → InvOrganization-Cz8SzIgs.js} +6 -7
- package/dist/{Org-CO_1WT39.js → Org-Bzt6yKox.js} +9 -10
- package/dist/{Preview-DLI4Bwel.js → Preview-jonigfMQ.js} +1 -1
- package/dist/{ReportDefine-Cw46OnJ_.js → ReportDefine-BpiM5Ovq.js} +1 -1
- package/dist/{ReportDesign-D4sHTXT7.js → ReportDesign-fp09cXJ7.js} +24 -25
- package/dist/{ReportQuery-DtOCvQSN.js → ReportQuery-52ZP1PYP.js} +1 -1
- package/dist/{ReportQueryFrom-QjL-ETPq.js → ReportQueryFrom-DSYavJb1.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-Dj9ne87n.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-DBGYEp0u.js} +4 -4
- package/dist/{ReportTemplate-BxAgc_Aj.js → ReportTemplate-CA_UW0eD.js} +3 -3
- package/dist/{Role-Df77BBD-.js → Role-DqOt8Bk0.js} +3 -3
- package/dist/{RoleAssign-BrunouML.js → RoleAssign-BdxhefhQ.js} +3 -3
- package/dist/{RolePanel-HLA7XBlN.js → RolePanel-2gZ3H0ET.js} +1 -1
- package/dist/{RolePanel-DSVwqhiD.js → RolePanel-BsNd0svJ.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CN0rUxKz.js → RolePanel.vue_vue_type_script_setup_true_lang-DLOwgF99.js} +9 -9
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CKlbqRa5.js → RolePanel.vue_vue_type_script_setup_true_lang-DmzD9kab.js} +26 -27
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-D_FeSXKv.js → ScrollPanel.vue_vue_type_style_index_0_lang-B9ptUMeI.js} +7 -7
- package/dist/{Staff-BeL1xcRf.js → Staff-D3L8fEoY.js} +3 -3
- package/dist/{StaffInfo-CIfnltyX.js → StaffInfo-DYRw6ZYJ.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DbLFwWfG.js → StaffInfo.vue_vue_type_script_setup_true_lang-xqEOQnMs.js} +1 -1
- package/dist/{StaffPanel-BV2CHWac.js → StaffPanel-DkrNH6Px.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-CvT-Vp2G.js → StaffPanel.vue_vue_type_script_setup_true_lang-BPBMnliy.js} +8 -9
- package/dist/{SysUser-DPfNvthk.js → SysUser-Bl1-cIpJ.js} +2 -2
- package/dist/{SysUserPanel-CoLKYlQE.js → SysUserPanel-yxNLaBwt.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-lcO3Cjbq.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BDcsgSl5.js} +11 -12
- package/dist/{SystemMenu-sdj1dRDA.js → SystemMenu-C4_Arn12.js} +9 -10
- package/dist/{UserInfo-CTX4hhFl.js → UserInfo-QcNwJCUR.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-ClhCd_8z.js → UserInfo.vue_vue_type_style_index_0_lang-DLIeUphX.js} +5 -6
- package/dist/{childView-BDmWwJO5.js → childView-B23DEO2u.js} +1 -1
- package/dist/{childView-Dx3ACtHa.js → childView-saDZQv9x.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CfKq_0FN.js → childView.vue_vue_type_style_index_0_lang-RsKR6CAC.js} +14 -15
- package/dist/{childView.vue_vue_type_style_index_0_lang-DxZNtkhd.js → childView.vue_vue_type_style_index_0_lang-ZFEfavUY.js} +11 -12
- package/dist/{code-rule-cvN4gYC_.js → code-rule-2_Ihx_by.js} +12 -13
- package/dist/core.es.js +21 -19
- package/dist/{cron-task-B0TkxFdp.js → cron-task-BFOPJQIk.js} +3 -4
- package/dist/{frameView-5cy5BSgS.js → frameView-f7Ya0Knj.js} +1 -1
- package/dist/img/minicolors.png +0 -0
- package/dist/{index-C5WRTwvI.js → index-BpdTDaTk.js} +811 -604
- package/dist/{layout-home-DrARg-3o.js → layout-home-v3DPJ7rB.js} +12 -13
- package/dist/{layoutView-25v_ngk5.js → layoutView-DZHoQDH1.js} +186 -187
- package/dist/{log-in-Bmz5Uhbt.js → log-in-BPAMJTwH.js} +4 -5
- package/dist/{log-out-B-8m3oNj.js → log-out-DZACF0jg.js} +8 -9
- package/dist/{login-Cmp2RvvW.js → login-B8cwozax.js} +22 -23
- package/dist/{lov-view-BATtzw2X.js → lov-view-Ba7Y7xy0.js} +4 -5
- package/dist/{menuInfo-BIvrE7nm.js → menuInfo-BpRKFYK8.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-B6USomit.js → menuInfo.vue_vue_type_style_index_0_lang-DJ5sUC6m.js} +17 -18
- package/dist/{pda-app-CzHVyeEa.js → pda-app-C0jJecrL.js} +7 -8
- package/dist/{resource-Y5lGB38n.js → resource-BG22Cw4P.js} +4 -4
- package/dist/su-welcome-DaxhbrC6.js +879 -0
- package/dist/{sys-config-CqO03LeC.js → sys-config-CG2fMtak.js} +22 -23
- package/dist/udp-core.css +1 -1
- package/dist/{useNav-C-rCgubt.js → useNav-_u2UAQWk.js} +24 -24
- package/index.ts +54 -51
- package/package.json +21 -21
- package/src/api/http.ts +10 -4
- package/src/api/index.ts +51 -51
- package/src/api/user.ts +64 -64
- package/src/components/udp/content/index.vue +93 -93
- package/src/components/udp/form-upload/form-upload.vue +496 -496
- package/src/components/udp/grid/index.vue +643 -544
- package/src/components/udp/index.ts +2 -1
- package/src/components/udp/modal-form/index.vue +326 -0
- package/src/components/udp/utils.ts +420 -420
- package/src/layout/components/lay-navbar/index.vue +240 -240
- package/src/layout/components/lay-search/components/SearchModal.vue +185 -185
- package/src/layout/components/lay-sidebar/mixNav.vue +261 -261
- package/src/layout/components/lay-sidebar/sidebarItem.vue +199 -195
- package/src/layout/components/lay-sidebar/vertical.vue +92 -92
- package/src/layout/layoutView.vue +1 -0
- package/src/main.ts +111 -111
- package/src/plugins/i18n/zh.ts +5 -1
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/router/index.ts +158 -156
- package/src/router/utils.ts +434 -430
- package/src/store/modules/permission.ts +1 -1
- package/src/store/modules/system.ts +193 -193
- package/src/style/print-lock.css +380 -375
- package/src/style/suprint.css +990 -985
- package/src/utils/authority/index.ts +46 -46
- package/src/utils/dataFormat/index.ts +309 -222
- package/src/utils/udp/http/index.ts +19 -11
- package/src/views/uhome/components/home-todo.vue +15 -3
- package/src/views/uhome/dynamic-card.vue +31 -31
- package/src/views/uhome/su-welcome.vue +310 -310
- package/src/views/ulogin/login.vue +292 -292
- package/src/views/urpt/design/DesignPanel.vue +538 -507
- package/src/views/urpt/design/print-data.ts +39 -59
- package/dist/await-to-js.es5-Bv3Eu4mi.js +0 -10
- package/dist/su-welcome-CXA6OzBw.js +0 -878
|
@@ -1,195 +1,199 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from 'vue';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import extraIcon from './extraIcon.vue';
|
|
5
|
-
import { useNav } from '../../hooks/useNav';
|
|
6
|
-
import { childrenType } from '../../types';
|
|
7
|
-
import { transformI18n } from '../../../plugins/i18n';
|
|
8
|
-
import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
|
|
9
|
-
// import Icon from '@/components/ReIcon/src/Icon.vue';
|
|
10
|
-
|
|
11
|
-
const { appHook, isCollapse, getDivStyle } = useNav();
|
|
12
|
-
const menuMode = ['vertical', 'mix'].includes(appHook.layout);
|
|
13
|
-
|
|
14
|
-
const props = defineProps({
|
|
15
|
-
item: {
|
|
16
|
-
type: Object as PropType<childrenType>
|
|
17
|
-
},
|
|
18
|
-
isNest: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: false
|
|
21
|
-
},
|
|
22
|
-
basePath: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ''
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const getNoDropdownStyle = computed((): CSSProperties => {
|
|
29
|
-
return { display: 'flex', alignItems: 'center' };
|
|
30
|
-
});
|
|
31
|
-
// const getDivStyle = computed((): CSSProperties => {
|
|
32
|
-
// return {
|
|
33
|
-
// width: !isCollapse.value ? '' : '100%',
|
|
34
|
-
// display: 'flex',
|
|
35
|
-
// alignItems: 'center',
|
|
36
|
-
// justifyContent: 'space-between',
|
|
37
|
-
// overflow: 'hidden'
|
|
38
|
-
// };
|
|
39
|
-
// });
|
|
40
|
-
|
|
41
|
-
const getMenuTextStyle = computed(() => {
|
|
42
|
-
return {
|
|
43
|
-
width: !isCollapse.value ? '125px' : '',
|
|
44
|
-
overflow: 'hidden',
|
|
45
|
-
textOverflow: 'ellipsis',
|
|
46
|
-
outline: 'none'
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
const getSubTextStyle = computed((): CSSProperties => {
|
|
50
|
-
return {
|
|
51
|
-
width: !isCollapse.value ? '210px' : '',
|
|
52
|
-
display: 'inline-block',
|
|
53
|
-
overflow: 'hidden',
|
|
54
|
-
textOverflow: 'ellipsis'
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const getSpanStyle = computed((): CSSProperties => {
|
|
59
|
-
return { overflow: 'hidden', textOverflow: 'ellipsis' };
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const onlyOneChild: childrenType = ref(null);
|
|
63
|
-
// 存放菜单是否存在showTooltip属性标识
|
|
64
|
-
const hoverMenuMap = new WeakMap();
|
|
65
|
-
// 存储菜单文本dom元素
|
|
66
|
-
const menuTextRef = ref(null);
|
|
67
|
-
|
|
68
|
-
function hoverMenu(key) {
|
|
69
|
-
// 如果当前菜单showTooltip属性已存在,退出计算
|
|
70
|
-
if (hoverMenuMap.get(key)) return;
|
|
71
|
-
|
|
72
|
-
nextTick(() => {
|
|
73
|
-
// 如果文本内容的整体宽度大于其可视宽度,则文本溢出
|
|
74
|
-
menuTextRef.value?.scrollWidth > menuTextRef.value?.clientWidth
|
|
75
|
-
? Object.assign(key, {
|
|
76
|
-
showTooltip: true
|
|
77
|
-
})
|
|
78
|
-
: Object.assign(key, {
|
|
79
|
-
showTooltip: false
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
hoverMenuMap.set(key, true);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// 左侧菜单折叠后,当菜单没有图标时只显示第一个文字并加上省略号
|
|
87
|
-
function overflowSlice(text, item?: any) {
|
|
88
|
-
const newText = (text?.length > 1 ? text.toString().slice(0, 1) : text) + '...';
|
|
89
|
-
if (item && !(isCollapse.value && item?.parentId === null)) {
|
|
90
|
-
return appHook.layout === 'mix' && item?.pathList?.length === 2 && isCollapse.value ? newText : text;
|
|
91
|
-
}
|
|
92
|
-
return newText;
|
|
93
|
-
}
|
|
94
|
-
function hasOneShowingChild(children: childrenType[] = [], parent: childrenType) {
|
|
95
|
-
const showingChildren = children.filter((item: any) => {
|
|
96
|
-
onlyOneChild.value = item;
|
|
97
|
-
return true;
|
|
98
|
-
});
|
|
99
|
-
if (showingChildren[0]?.meta?.showParent) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
if (showingChildren.length === 1) {
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (showingChildren.length === 0) {
|
|
107
|
-
onlyOneChild.value = { ...parent, path: '', noShowingChildren: true };
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function resolvePath(routePath) {
|
|
114
|
-
const httpReg = /^http(s?):\/\//;
|
|
115
|
-
if (httpReg.test(routePath) || httpReg.test(props.basePath)) {
|
|
116
|
-
return routePath || props.basePath;
|
|
117
|
-
} else {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from 'vue';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import extraIcon from './extraIcon.vue';
|
|
5
|
+
import { useNav } from '../../hooks/useNav';
|
|
6
|
+
import { childrenType } from '../../types';
|
|
7
|
+
import { transformI18n } from '../../../plugins/i18n';
|
|
8
|
+
import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
|
|
9
|
+
// import Icon from '@/components/ReIcon/src/Icon.vue';
|
|
10
|
+
|
|
11
|
+
const { appHook, isCollapse, getDivStyle } = useNav();
|
|
12
|
+
const menuMode = ['vertical', 'mix'].includes(appHook.layout);
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
item: {
|
|
16
|
+
type: Object as PropType<childrenType>
|
|
17
|
+
},
|
|
18
|
+
isNest: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
basePath: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ''
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const getNoDropdownStyle = computed((): CSSProperties => {
|
|
29
|
+
return { display: 'flex', alignItems: 'center' };
|
|
30
|
+
});
|
|
31
|
+
// const getDivStyle = computed((): CSSProperties => {
|
|
32
|
+
// return {
|
|
33
|
+
// width: !isCollapse.value ? '' : '100%',
|
|
34
|
+
// display: 'flex',
|
|
35
|
+
// alignItems: 'center',
|
|
36
|
+
// justifyContent: 'space-between',
|
|
37
|
+
// overflow: 'hidden'
|
|
38
|
+
// };
|
|
39
|
+
// });
|
|
40
|
+
|
|
41
|
+
const getMenuTextStyle = computed(() => {
|
|
42
|
+
return {
|
|
43
|
+
width: !isCollapse.value ? '125px' : '',
|
|
44
|
+
overflow: 'hidden',
|
|
45
|
+
textOverflow: 'ellipsis',
|
|
46
|
+
outline: 'none'
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const getSubTextStyle = computed((): CSSProperties => {
|
|
50
|
+
return {
|
|
51
|
+
width: !isCollapse.value ? '210px' : '',
|
|
52
|
+
display: 'inline-block',
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
textOverflow: 'ellipsis'
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const getSpanStyle = computed((): CSSProperties => {
|
|
59
|
+
return { overflow: 'hidden', textOverflow: 'ellipsis' };
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const onlyOneChild: childrenType = ref(null);
|
|
63
|
+
// 存放菜单是否存在showTooltip属性标识
|
|
64
|
+
const hoverMenuMap = new WeakMap();
|
|
65
|
+
// 存储菜单文本dom元素
|
|
66
|
+
const menuTextRef = ref(null);
|
|
67
|
+
|
|
68
|
+
function hoverMenu(key) {
|
|
69
|
+
// 如果当前菜单showTooltip属性已存在,退出计算
|
|
70
|
+
if (hoverMenuMap.get(key)) return;
|
|
71
|
+
|
|
72
|
+
nextTick(() => {
|
|
73
|
+
// 如果文本内容的整体宽度大于其可视宽度,则文本溢出
|
|
74
|
+
menuTextRef.value?.scrollWidth > menuTextRef.value?.clientWidth
|
|
75
|
+
? Object.assign(key, {
|
|
76
|
+
showTooltip: true
|
|
77
|
+
})
|
|
78
|
+
: Object.assign(key, {
|
|
79
|
+
showTooltip: false
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
hoverMenuMap.set(key, true);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 左侧菜单折叠后,当菜单没有图标时只显示第一个文字并加上省略号
|
|
87
|
+
function overflowSlice(text, item?: any) {
|
|
88
|
+
const newText = (text?.length > 1 ? text.toString().slice(0, 1) : text) + '...';
|
|
89
|
+
if (item && !(isCollapse.value && item?.parentId === null)) {
|
|
90
|
+
return appHook.layout === 'mix' && item?.pathList?.length === 2 && isCollapse.value ? newText : text;
|
|
91
|
+
}
|
|
92
|
+
return newText;
|
|
93
|
+
}
|
|
94
|
+
function hasOneShowingChild(children: childrenType[] = [], parent: childrenType) {
|
|
95
|
+
const showingChildren = children.filter((item: any) => {
|
|
96
|
+
onlyOneChild.value = item;
|
|
97
|
+
return true;
|
|
98
|
+
});
|
|
99
|
+
if (showingChildren[0]?.meta?.showParent) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (showingChildren.length === 1) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (showingChildren.length === 0) {
|
|
107
|
+
onlyOneChild.value = { ...parent, path: '', noShowingChildren: true };
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function resolvePath(routePath) {
|
|
114
|
+
const httpReg = /^http(s?):\/\//;
|
|
115
|
+
if (httpReg.test(routePath) || httpReg.test(props.basePath)) {
|
|
116
|
+
return routePath || props.basePath;
|
|
117
|
+
} else {
|
|
118
|
+
// console.log('routePath ===', routePath);
|
|
119
|
+
if ('/ubase/elevator/elevator-model-class' === routePath) {
|
|
120
|
+
console.log('path.resolve(props.basePath, routePath)', path.resolve(props.basePath, routePath));
|
|
121
|
+
}
|
|
122
|
+
return path.resolve(props.basePath, routePath);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<template>
|
|
128
|
+
<template
|
|
129
|
+
v-if="
|
|
130
|
+
hasOneShowingChild(props.item.children, props.item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren)
|
|
131
|
+
"
|
|
132
|
+
>
|
|
133
|
+
<el-menu-item
|
|
134
|
+
:index="resolvePath(onlyOneChild.path)"
|
|
135
|
+
:class="{
|
|
136
|
+
'submenu-title-noDropdown': !isNest,
|
|
137
|
+
'submenu-mix-fold': !appHook.sidebar.opened && appHook.layout === 'mix'
|
|
138
|
+
}"
|
|
139
|
+
:style="getNoDropdownStyle"
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
v-if="toRaw(props.item.meta.icon)"
|
|
143
|
+
class="sub-menu-icon"
|
|
144
|
+
:class="onlyOneChild.meta.icon || props.item?.meta?.icon"
|
|
145
|
+
>
|
|
146
|
+
<component
|
|
147
|
+
:is="useRenderIcon(toRaw(onlyOneChild.meta.icon) || (props.item.meta && toRaw(props.item.meta.icon)))"
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
150
|
+
<div v-if="!appHook.sidebar.opened && appHook.layout === 'mix'" class="ut-mix-title">
|
|
151
|
+
<span>
|
|
152
|
+
{{ transformI18n(onlyOneChild.meta.title) }}
|
|
153
|
+
</span>
|
|
154
|
+
</div>
|
|
155
|
+
<template #title>
|
|
156
|
+
<div :style="getDivStyle">
|
|
157
|
+
<span v-if="!menuMode">{{ transformI18n(onlyOneChild.meta.title) }}</span>
|
|
158
|
+
<el-tooltip v-else placement="top" :offset="-10" :disabled="!onlyOneChild.showTooltip">
|
|
159
|
+
<template #content>
|
|
160
|
+
{{ transformI18n(onlyOneChild.meta.title) }}
|
|
161
|
+
</template>
|
|
162
|
+
<span ref="menuTextRef" :style="getMenuTextStyle" @mouseover="hoverMenu(onlyOneChild)">
|
|
163
|
+
{{ transformI18n(onlyOneChild.meta.title) }}
|
|
164
|
+
</span>
|
|
165
|
+
</el-tooltip>
|
|
166
|
+
<extraIcon :extra-icon="onlyOneChild.meta.extraIcon" />
|
|
167
|
+
</div>
|
|
168
|
+
</template>
|
|
169
|
+
</el-menu-item>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
<el-sub-menu v-else ref="subMenu" :index="resolvePath(props.item.path)" teleported>
|
|
173
|
+
<template #title>
|
|
174
|
+
<div v-if="toRaw(props.item.meta.icon)" class="sub-menu-icon" :class="props.item.meta.icon">
|
|
175
|
+
<component :is="useRenderIcon(props.item.meta && props.item.meta.icon)" />
|
|
176
|
+
</div>
|
|
177
|
+
<span v-if="!menuMode">{{ transformI18n(props.item.meta.title) }}</span>
|
|
178
|
+
<el-tooltip v-else placement="top" :offset="-10" :disabled="!appHook.sidebar.opened || !props.item.showTooltip">
|
|
179
|
+
<template #content>
|
|
180
|
+
{{ transformI18n(props.item.meta.title) }}
|
|
181
|
+
</template>
|
|
182
|
+
<div ref="menuTextRef" :style="getSubTextStyle" @mouseover="hoverMenu(props.item)">
|
|
183
|
+
<span :style="getSpanStyle">
|
|
184
|
+
{{ overflowSlice(transformI18n(props.item.meta.title), props.item) }}
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
</el-tooltip>
|
|
188
|
+
<extraIcon v-if="!isCollapse" :extra-icon="props.item.meta.extraIcon" />
|
|
189
|
+
</template>
|
|
190
|
+
<sidebar-item
|
|
191
|
+
v-for="child in props.item.children"
|
|
192
|
+
:key="child.path"
|
|
193
|
+
:is-nest="true"
|
|
194
|
+
:item="child"
|
|
195
|
+
:base-path="resolvePath(child.path)"
|
|
196
|
+
class="nest-menu"
|
|
197
|
+
/>
|
|
198
|
+
</el-sub-menu>
|
|
199
|
+
</template>
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: wei.li
|
|
3
|
-
* @Date: 2021-11-17 16:02:30
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime:
|
|
6
|
-
* @Description: 左侧边栏
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
import Logo from './sidebar-logo.vue';
|
|
11
|
-
import { emitter } from '../../../utils/mitt';
|
|
12
|
-
import { useNav } from '../..//hooks/useNav';
|
|
13
|
-
import SidebarItem from './sidebarItem.vue';
|
|
14
|
-
import { storageLocal } from '@utogether/utils';
|
|
15
|
-
import { useRoute } from 'vue-router';
|
|
16
|
-
import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
17
|
-
import { findRouteByPath, getParentPaths } from '../../../router/utils';
|
|
18
|
-
import { responsiveStorageNameSpace } from '../../../config';
|
|
19
|
-
import { usePermissionStoreHook } from '../../../store/modules/permission';
|
|
20
|
-
|
|
21
|
-
defineOptions({ name: 'LayoutVertical' });
|
|
22
|
-
|
|
23
|
-
const route = useRoute();
|
|
24
|
-
const showLogo = ref(storageLocal.getItem(`${responsiveStorageNameSpace()}configure`)?.showLogo ?? true);
|
|
25
|
-
const { device, appHook, isCollapse, menuSelect } = useNav();
|
|
26
|
-
const subMenuData = ref([]);
|
|
27
|
-
|
|
28
|
-
const menuData = computed(() => {
|
|
29
|
-
return appHook.layout === 'mix' && device.value !== 'mobile'
|
|
30
|
-
? subMenuData.value
|
|
31
|
-
: usePermissionStoreHook().wholeMenus;
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const loading = computed(() => (appHook.layout === 'mix' ? false : menuData.value.length === 0 ? true : false));
|
|
35
|
-
|
|
36
|
-
function getSubMenuData(path) {
|
|
37
|
-
subMenuData.value = [];
|
|
38
|
-
// path的上级路由组成的数组
|
|
39
|
-
const parentPathArr = getParentPaths(path, usePermissionStoreHook().wholeMenus);
|
|
40
|
-
// 当前路由的父级路由信息
|
|
41
|
-
const parenetRoute = findRouteByPath(parentPathArr[0] || path, usePermissionStoreHook().wholeMenus);
|
|
42
|
-
if (!parenetRoute?.children) return;
|
|
43
|
-
subMenuData.value = parenetRoute?.children;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getSubMenuData(route.path);
|
|
47
|
-
|
|
48
|
-
watch(
|
|
49
|
-
() => route.path,
|
|
50
|
-
() => {
|
|
51
|
-
if (route.path.includes('/redirect')) return;
|
|
52
|
-
getSubMenuData(route.path);
|
|
53
|
-
menuSelect(route.path);
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
onMounted(() => {
|
|
57
|
-
emitter.on('logoChange', key => {
|
|
58
|
-
showLogo.value = key;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
onBeforeUnmount(() => {
|
|
62
|
-
// 解绑`logoChange`公共事件,防止多次触发
|
|
63
|
-
emitter.off('logoChange');
|
|
64
|
-
});
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div v-spinning="loading" :class="['sidebar-container', showLogo ? 'has-logo' : 'no-logo']">
|
|
69
|
-
<Logo v-if="showLogo" :collapse="isCollapse" />
|
|
70
|
-
<el-scrollbar wrap-class="scrollbar-wrapper" :class="[device === 'mobile' ? 'mobile' : 'pc']">
|
|
71
|
-
<template #default>
|
|
72
|
-
<el-menu
|
|
73
|
-
:default-active="route.path"
|
|
74
|
-
:collapse="isCollapse"
|
|
75
|
-
:collapse-transition="false"
|
|
76
|
-
router
|
|
77
|
-
mode="vertical"
|
|
78
|
-
popper-class="udp-scrollbar"
|
|
79
|
-
class="select-none outer-most"
|
|
80
|
-
>
|
|
81
|
-
<sidebar-item
|
|
82
|
-
v-for="routes in menuData"
|
|
83
|
-
:key="routes.path"
|
|
84
|
-
:item="routes"
|
|
85
|
-
class="select-none outer-most"
|
|
86
|
-
:base-path="routes.path"
|
|
87
|
-
/>
|
|
88
|
-
</el-menu>
|
|
89
|
-
</template>
|
|
90
|
-
</el-scrollbar>
|
|
91
|
-
</div>
|
|
92
|
-
</template>
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:02:30
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2026-09-09 11:32:54
|
|
6
|
+
* @Description: 左侧边栏
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import Logo from './sidebar-logo.vue';
|
|
11
|
+
import { emitter } from '../../../utils/mitt';
|
|
12
|
+
import { useNav } from '../..//hooks/useNav';
|
|
13
|
+
import SidebarItem from './sidebarItem.vue';
|
|
14
|
+
import { storageLocal } from '@utogether/utils';
|
|
15
|
+
import { useRoute } from 'vue-router';
|
|
16
|
+
import { ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
17
|
+
import { findRouteByPath, getParentPaths } from '../../../router/utils';
|
|
18
|
+
import { responsiveStorageNameSpace } from '../../../config';
|
|
19
|
+
import { usePermissionStoreHook } from '../../../store/modules/permission';
|
|
20
|
+
|
|
21
|
+
defineOptions({ name: 'LayoutVertical' });
|
|
22
|
+
|
|
23
|
+
const route = useRoute();
|
|
24
|
+
const showLogo = ref(storageLocal.getItem(`${responsiveStorageNameSpace()}configure`)?.showLogo ?? true);
|
|
25
|
+
const { device, appHook, isCollapse, menuSelect } = useNav();
|
|
26
|
+
const subMenuData = ref([]);
|
|
27
|
+
|
|
28
|
+
const menuData = computed(() => {
|
|
29
|
+
return appHook.layout === 'mix' && device.value !== 'mobile'
|
|
30
|
+
? subMenuData.value
|
|
31
|
+
: usePermissionStoreHook().wholeMenus;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const loading = computed(() => (appHook.layout === 'mix' ? false : menuData.value.length === 0 ? true : false));
|
|
35
|
+
|
|
36
|
+
function getSubMenuData(path) {
|
|
37
|
+
subMenuData.value = [];
|
|
38
|
+
// path的上级路由组成的数组
|
|
39
|
+
const parentPathArr = getParentPaths(path, usePermissionStoreHook().wholeMenus);
|
|
40
|
+
// 当前路由的父级路由信息
|
|
41
|
+
const parenetRoute = findRouteByPath(parentPathArr[0] || path, usePermissionStoreHook().wholeMenus);
|
|
42
|
+
if (!parenetRoute?.children) return;
|
|
43
|
+
subMenuData.value = parenetRoute?.children;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
getSubMenuData(route.path);
|
|
47
|
+
|
|
48
|
+
watch(
|
|
49
|
+
() => route.path,
|
|
50
|
+
() => {
|
|
51
|
+
if (route.path.includes('/redirect')) return;
|
|
52
|
+
getSubMenuData(route.path);
|
|
53
|
+
menuSelect(route.path);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
onMounted(() => {
|
|
57
|
+
emitter.on('logoChange', key => {
|
|
58
|
+
showLogo.value = key;
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
onBeforeUnmount(() => {
|
|
62
|
+
// 解绑`logoChange`公共事件,防止多次触发
|
|
63
|
+
emitter.off('logoChange');
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div v-spinning="loading" :class="['sidebar-container', showLogo ? 'has-logo' : 'no-logo']">
|
|
69
|
+
<Logo v-if="showLogo" :collapse="isCollapse" />
|
|
70
|
+
<el-scrollbar wrap-class="scrollbar-wrapper" :class="[device === 'mobile' ? 'mobile' : 'pc']">
|
|
71
|
+
<template #default>
|
|
72
|
+
<el-menu
|
|
73
|
+
:default-active="route.path"
|
|
74
|
+
:collapse="isCollapse"
|
|
75
|
+
:collapse-transition="false"
|
|
76
|
+
router
|
|
77
|
+
mode="vertical"
|
|
78
|
+
popper-class="udp-scrollbar"
|
|
79
|
+
class="select-none outer-most"
|
|
80
|
+
>
|
|
81
|
+
<sidebar-item
|
|
82
|
+
v-for="routes in menuData"
|
|
83
|
+
:key="routes.path"
|
|
84
|
+
:item="routes"
|
|
85
|
+
class="select-none outer-most"
|
|
86
|
+
:base-path="routes.path"
|
|
87
|
+
/>
|
|
88
|
+
</el-menu>
|
|
89
|
+
</template>
|
|
90
|
+
</el-scrollbar>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|