@deppon/deppon-template 2.4.4 → 2.4.7
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import '../_virtual/_rollup-plugin-inject-process-env.js';
|
|
2
|
-
import
|
|
2
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
-
import
|
|
4
|
+
import _typeof from '@babel/runtime/helpers/typeof';
|
|
5
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
6
|
+
import { useSlots, ref, computed, watch, markRaw, onMounted, onUnmounted, nextTick, openBlock, createBlock, unref, normalizeClass, withCtx, createElementVNode, createElementBlock, renderSlot, normalizeStyle, createCommentVNode, createTextVNode, toDisplayString, createVNode, Fragment, renderList, withModifiers, resolveDynamicComponent, withDirectives, mergeProps, vShow } from 'vue';
|
|
5
7
|
import { useRouter, useRoute } from '@deppon/deppon-router';
|
|
6
|
-
import { ElContainer, ElHeader, ElMenu, ElMenuItem, ElBadge, ElSubMenu, ElInput,
|
|
7
|
-
import { Search, Service, Bell, Close,
|
|
8
|
+
import { ElContainer, ElHeader, ElMenu, ElMenuItem, ElIcon, ElBadge, ElSubMenu, ElInput, ElButton, ElAside, ElScrollbar, ElTooltip, ElMain, ElFooter } from '@deppon/deppon-ui';
|
|
9
|
+
import { Search, Service, Bell, Close, House, Expand, Fold, ArrowRight, ArrowLeft } from '@deppon/deppon-ui/icons-vue';
|
|
8
10
|
import { isMobile as _isMobile } from '../utils/other.js';
|
|
9
11
|
|
|
10
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -28,258 +30,239 @@ var _hoisted_5 = {
|
|
|
28
30
|
"class": "pro-layout__top-menu"
|
|
29
31
|
};
|
|
30
32
|
var _hoisted_6 = {
|
|
31
|
-
"class": "pro-layout__top-menu-
|
|
33
|
+
"class": "pro-layout__top-menu-glass"
|
|
32
34
|
};
|
|
33
35
|
var _hoisted_7 = {
|
|
34
36
|
"class": "pro-layout__top-menu-item-label"
|
|
35
37
|
};
|
|
36
38
|
var _hoisted_8 = {
|
|
37
|
-
"class": "pro-
|
|
39
|
+
"class": "pro-layout__top-menu-item-text"
|
|
38
40
|
};
|
|
39
41
|
var _hoisted_9 = {
|
|
40
|
-
"class": "pro-
|
|
42
|
+
"class": "pro-layout__top-menu-item-label"
|
|
41
43
|
};
|
|
42
44
|
var _hoisted_10 = {
|
|
45
|
+
"class": "pro-layout__top-menu-item-text"
|
|
46
|
+
};
|
|
47
|
+
var _hoisted_11 = {
|
|
48
|
+
"class": "pro-layout__header-right"
|
|
49
|
+
};
|
|
50
|
+
var _hoisted_12 = {
|
|
51
|
+
"class": "pro-layout__header-user-name"
|
|
52
|
+
};
|
|
53
|
+
var _hoisted_13 = {
|
|
43
54
|
key: 0,
|
|
44
55
|
"class": "pro-layout__sider-header"
|
|
45
56
|
};
|
|
46
|
-
var
|
|
57
|
+
var _hoisted_14 = {
|
|
47
58
|
key: 1,
|
|
48
59
|
"class": "pro-layout__menu-search"
|
|
49
60
|
};
|
|
50
|
-
var
|
|
61
|
+
var _hoisted_15 = {
|
|
51
62
|
key: 0,
|
|
52
63
|
"class": "pro-layout__menu-group"
|
|
53
64
|
};
|
|
54
|
-
var
|
|
65
|
+
var _hoisted_16 = {
|
|
55
66
|
"class": "pro-layout__menu-group-header-left"
|
|
56
67
|
};
|
|
57
|
-
var
|
|
68
|
+
var _hoisted_17 = {
|
|
58
69
|
key: 1,
|
|
59
70
|
"class": "pro-layout__menu-group-title"
|
|
60
71
|
};
|
|
61
|
-
var
|
|
72
|
+
var _hoisted_18 = {
|
|
62
73
|
key: 2,
|
|
63
74
|
"class": "pro-layout__menu-group-title-char"
|
|
64
75
|
};
|
|
65
|
-
var
|
|
76
|
+
var _hoisted_19 = {
|
|
66
77
|
key: 0,
|
|
67
78
|
"class": "pro-layout__menu-group-actions"
|
|
68
79
|
};
|
|
69
|
-
var
|
|
80
|
+
var _hoisted_20 = {
|
|
70
81
|
key: 0,
|
|
71
82
|
"class": "pro-layout__menu-group-count"
|
|
72
83
|
};
|
|
73
|
-
var
|
|
84
|
+
var _hoisted_21 = {
|
|
74
85
|
"class": "pro-layout__menu-group-count-current"
|
|
75
86
|
};
|
|
76
|
-
var
|
|
87
|
+
var _hoisted_22 = {
|
|
77
88
|
"class": "pro-layout__menu-group-count-max"
|
|
78
89
|
};
|
|
79
|
-
var
|
|
90
|
+
var _hoisted_23 = {
|
|
80
91
|
key: 1,
|
|
81
92
|
"class": "pro-layout__menu-item-char"
|
|
82
93
|
};
|
|
83
|
-
var
|
|
94
|
+
var _hoisted_24 = {
|
|
84
95
|
key: 1,
|
|
85
96
|
"class": "pro-layout__menu-item-char"
|
|
86
97
|
};
|
|
87
|
-
var
|
|
98
|
+
var _hoisted_25 = {
|
|
88
99
|
key: 1,
|
|
89
100
|
"class": "pro-layout__menu-item-char"
|
|
90
101
|
};
|
|
91
|
-
var
|
|
102
|
+
var _hoisted_26 = {
|
|
103
|
+
"class": "pro-layout__tag-label pro-layout__tag-label--affix-icon"
|
|
104
|
+
};
|
|
105
|
+
var _hoisted_27 = {
|
|
92
106
|
"class": "pro-layout__tag-label"
|
|
93
107
|
};
|
|
94
|
-
var
|
|
108
|
+
var _hoisted_28 = {
|
|
95
109
|
"class": "pro-layout__tag-actions"
|
|
96
110
|
};
|
|
97
111
|
var script = {
|
|
98
112
|
__name: 'ProLayout',
|
|
99
113
|
props: {
|
|
100
|
-
/** 是否显示侧边栏 */
|
|
101
114
|
showSider: {
|
|
102
115
|
type: Boolean,
|
|
103
116
|
"default": true
|
|
104
117
|
},
|
|
105
|
-
/** 侧边栏宽度 */
|
|
106
118
|
siderWidth: {
|
|
107
119
|
type: String,
|
|
108
120
|
"default": '180px'
|
|
109
121
|
},
|
|
110
|
-
/** 侧边栏折叠宽度 */
|
|
111
122
|
siderCollapsedWidth: {
|
|
112
123
|
type: String,
|
|
113
124
|
"default": '64px'
|
|
114
125
|
},
|
|
115
|
-
/** 是否固定头部 */
|
|
116
126
|
fixedHeader: {
|
|
117
127
|
type: Boolean,
|
|
118
128
|
"default": true
|
|
119
129
|
},
|
|
120
|
-
/** 是否折叠 */
|
|
121
130
|
collapsed: {
|
|
122
131
|
type: Boolean,
|
|
123
132
|
"default": true
|
|
124
133
|
},
|
|
125
|
-
/** 是否显示折叠按钮 */
|
|
126
134
|
showCollapse: {
|
|
127
135
|
type: Boolean,
|
|
128
136
|
"default": true
|
|
129
137
|
},
|
|
130
|
-
/** 是否显示 Logo */
|
|
131
138
|
showLogo: {
|
|
132
139
|
type: Boolean,
|
|
133
140
|
"default": true
|
|
134
141
|
},
|
|
135
|
-
/** Logo 图片,可以是字符串(路径)或对象(包含 src 和 size) */
|
|
136
142
|
logo: {
|
|
137
143
|
type: [String, Object],
|
|
138
144
|
"default": null
|
|
139
145
|
},
|
|
140
|
-
/** 标题 */
|
|
141
146
|
title: {
|
|
142
147
|
type: String,
|
|
143
148
|
"default": 'Pro Layout'
|
|
144
149
|
},
|
|
145
|
-
/** 菜单项 */
|
|
146
150
|
menuItems: {
|
|
147
151
|
type: Array,
|
|
148
152
|
"default": function _default() {
|
|
149
153
|
return [];
|
|
150
154
|
}
|
|
151
155
|
},
|
|
152
|
-
/** 顶部菜单项 */
|
|
153
156
|
topMenuItems: {
|
|
154
157
|
type: Array,
|
|
155
158
|
"default": function _default() {
|
|
156
159
|
return [];
|
|
157
160
|
}
|
|
158
161
|
},
|
|
159
|
-
/** 当前激活的菜单 */
|
|
160
162
|
activeMenu: {
|
|
161
163
|
type: String,
|
|
162
164
|
"default": undefined
|
|
163
165
|
},
|
|
164
|
-
/** 菜单折叠动画 */
|
|
165
166
|
menuCollapseTransition: {
|
|
166
167
|
type: Boolean,
|
|
167
168
|
"default": true
|
|
168
169
|
},
|
|
169
|
-
/** 是否只保持一个子菜单的展开 */
|
|
170
170
|
menuUniqueOpened: {
|
|
171
171
|
type: Boolean,
|
|
172
172
|
"default": true
|
|
173
173
|
},
|
|
174
|
-
/** 菜单模式 */
|
|
175
174
|
menuMode: {
|
|
176
175
|
type: String,
|
|
177
176
|
"default": 'vertical'
|
|
178
177
|
},
|
|
179
|
-
/** 是否使用 vue-router 的模式 */
|
|
180
178
|
menuRouter: {
|
|
181
179
|
type: Boolean,
|
|
182
180
|
"default": true
|
|
183
181
|
},
|
|
184
|
-
/** 菜单属性 */
|
|
185
182
|
menuProps: {
|
|
186
183
|
type: Object,
|
|
187
184
|
"default": function _default() {
|
|
188
185
|
return {};
|
|
189
186
|
}
|
|
190
187
|
},
|
|
191
|
-
/** 是否显示头部 */
|
|
192
188
|
showHeader: {
|
|
193
189
|
type: Boolean,
|
|
194
190
|
"default": true
|
|
195
191
|
},
|
|
196
|
-
/** 头部高度 */
|
|
197
192
|
headerHeight: {
|
|
198
193
|
type: String,
|
|
199
194
|
"default": '60px'
|
|
200
195
|
},
|
|
201
|
-
/** 是否显示页脚 */
|
|
202
196
|
showFooter: {
|
|
203
197
|
type: Boolean,
|
|
204
198
|
"default": false
|
|
205
199
|
},
|
|
206
|
-
/** 页脚高度 */
|
|
207
200
|
footerHeight: {
|
|
208
201
|
type: String,
|
|
209
202
|
"default": '60px'
|
|
210
203
|
},
|
|
211
|
-
/** 是否启用响应式布局 */
|
|
212
204
|
responsive: {
|
|
213
205
|
type: Boolean,
|
|
214
206
|
"default": true
|
|
215
207
|
},
|
|
216
|
-
/** 响应式断点(屏幕宽度小于此值时视为移动端) */
|
|
217
208
|
breakpoint: {
|
|
218
209
|
type: Number,
|
|
219
210
|
"default": 768
|
|
220
211
|
},
|
|
221
|
-
/** 是否显示菜单搜索框 */
|
|
222
212
|
showMenuSearch: {
|
|
223
213
|
type: Boolean,
|
|
224
214
|
"default": true
|
|
225
215
|
},
|
|
226
|
-
/** 菜单搜索框占位符 */
|
|
227
216
|
menuSearchPlaceholder: {
|
|
228
217
|
type: String,
|
|
229
218
|
"default": '请输入菜单名称'
|
|
230
219
|
},
|
|
231
|
-
/** 是否显示常用菜单 */
|
|
232
220
|
showCommonMenus: {
|
|
233
221
|
type: Boolean,
|
|
234
222
|
"default": true
|
|
235
223
|
},
|
|
236
|
-
/** 常用菜单最大数量 */
|
|
237
224
|
commonMenusMax: {
|
|
238
225
|
type: Number,
|
|
239
226
|
"default": 5
|
|
240
227
|
},
|
|
241
|
-
/** 是否在头部显示 Logo */
|
|
242
228
|
showLogoInHeader: {
|
|
243
229
|
type: Boolean,
|
|
244
230
|
"default": true
|
|
245
231
|
},
|
|
246
|
-
/** 是否显示顶部菜单 */
|
|
247
232
|
showTopMenu: {
|
|
248
233
|
type: Boolean,
|
|
249
234
|
"default": true
|
|
250
235
|
},
|
|
251
|
-
/** 是否显示头部搜索框 */
|
|
252
236
|
showHeaderSearch: {
|
|
253
237
|
type: Boolean,
|
|
254
238
|
"default": true
|
|
255
239
|
},
|
|
256
|
-
/** 头部搜索框占位符 */
|
|
257
240
|
headerSearchPlaceholder: {
|
|
258
241
|
type: String,
|
|
259
242
|
"default": '输入客户名称'
|
|
260
243
|
},
|
|
261
|
-
/** 是否显示电话图标 */
|
|
262
244
|
showPhoneIcon: {
|
|
263
245
|
type: Boolean,
|
|
264
246
|
"default": true
|
|
265
247
|
},
|
|
266
|
-
/** 是否显示通知图标 */
|
|
267
248
|
showBellIcon: {
|
|
268
249
|
type: Boolean,
|
|
269
250
|
"default": true
|
|
270
251
|
},
|
|
271
|
-
/** 是否显示 TagsView */
|
|
272
252
|
showTagsView: {
|
|
273
253
|
type: Boolean,
|
|
274
254
|
"default": true
|
|
275
255
|
},
|
|
276
|
-
/** TagsView 高度 */
|
|
277
256
|
tagsViewHeight: {
|
|
278
257
|
type: String,
|
|
279
258
|
"default": '40px'
|
|
259
|
+
},
|
|
260
|
+
tagsViewHomePath: {
|
|
261
|
+
type: String,
|
|
262
|
+
"default": '/'
|
|
280
263
|
}
|
|
281
264
|
},
|
|
282
|
-
emits: ['update:collapsed', 'collapse-change', 'logo-click', 'breadcrumb-click', 'breadcrumb-close', 'phone-click', 'bell-click', 'user-command', 'menu-search', 'menu-search-click', 'header-search', 'tag-
|
|
265
|
+
emits: ['update:collapsed', 'collapse-change', 'logo-click', 'breadcrumb-click', 'breadcrumb-close', 'phone-click', 'bell-click', 'user-command', 'menu-search', 'menu-search-click', 'header-search', 'tag-close', 'common-menu-delete'],
|
|
283
266
|
setup: function setup(__props, _ref) {
|
|
284
267
|
var __emit = _ref.emit;
|
|
285
268
|
var slots = useSlots();
|
|
@@ -294,17 +277,21 @@ var script = {
|
|
|
294
277
|
var headerSearchText = ref('');
|
|
295
278
|
var menuTitleRefs = new Map();
|
|
296
279
|
var menuTitleOverflowMap = ref(new Map());
|
|
297
|
-
|
|
298
|
-
// TagsView 相关
|
|
299
280
|
var visitedTags = ref([]);
|
|
300
281
|
var currentPath = ref('');
|
|
301
|
-
|
|
302
|
-
// 为 tags menu 生成唯一的 key,确保动态添加标签时能触发 ellipsis 重新计算
|
|
303
282
|
var tagsMenuKey = computed(function () {
|
|
304
283
|
return "tags-menu-".concat(visitedTags.value.length, "-").concat(visitedTags.value.map(function (t) {
|
|
305
284
|
return t.path;
|
|
306
285
|
}).join('-'));
|
|
307
286
|
});
|
|
287
|
+
var tagsViewHomePath = computed(function () {
|
|
288
|
+
return props.tagsViewHomePath;
|
|
289
|
+
});
|
|
290
|
+
var otherVisitedTags = computed(function () {
|
|
291
|
+
return visitedTags.value.filter(function (t) {
|
|
292
|
+
return t.path !== tagsViewHomePath.value;
|
|
293
|
+
});
|
|
294
|
+
});
|
|
308
295
|
var getMenuTitleKey = function getMenuTitleKey(item) {
|
|
309
296
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
310
297
|
return "".concat(prefix).concat((item === null || item === void 0 ? void 0 : item.path) || (item === null || item === void 0 ? void 0 : item.key) || (item === null || item === void 0 ? void 0 : item.title) || (item === null || item === void 0 ? void 0 : item.label) || '');
|
|
@@ -342,8 +329,6 @@ var script = {
|
|
|
342
329
|
var isMenuTitleOverflow = function isMenuTitleOverflow(key) {
|
|
343
330
|
return menuTitleOverflowMap.value.get(key) === true;
|
|
344
331
|
};
|
|
345
|
-
|
|
346
|
-
// 从 menuItems 中查找标题
|
|
347
332
|
var _findMenuTitle = function findMenuTitle(path) {
|
|
348
333
|
var menuItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : props.menuItems;
|
|
349
334
|
var _iterator = _createForOfIteratorHelper(menuItems),
|
|
@@ -366,29 +351,39 @@ var script = {
|
|
|
366
351
|
}
|
|
367
352
|
return null;
|
|
368
353
|
};
|
|
369
|
-
|
|
370
|
-
|
|
354
|
+
var ensureAffixHomeTag = function ensureAffixHomeTag() {
|
|
355
|
+
var hp = tagsViewHomePath.value;
|
|
356
|
+
var idx = visitedTags.value.findIndex(function (t) {
|
|
357
|
+
return t.path === hp;
|
|
358
|
+
});
|
|
359
|
+
if (idx === -1) {
|
|
360
|
+
var title = _findMenuTitle(hp) || '首页';
|
|
361
|
+
visitedTags.value.unshift({
|
|
362
|
+
path: hp,
|
|
363
|
+
title: title,
|
|
364
|
+
fullPath: hp
|
|
365
|
+
});
|
|
366
|
+
} else if (idx > 0) {
|
|
367
|
+
var _visitedTags$value$sp = visitedTags.value.splice(idx, 1),
|
|
368
|
+
_visitedTags$value$sp2 = _slicedToArray(_visitedTags$value$sp, 1),
|
|
369
|
+
homeTag = _visitedTags$value$sp2[0];
|
|
370
|
+
visitedTags.value.unshift(homeTag);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
371
373
|
var getRouteTitle = function getRouteTitle(route) {
|
|
372
374
|
var _route$meta;
|
|
373
|
-
// 优先使用路由 meta.title
|
|
374
375
|
if ((_route$meta = route.meta) !== null && _route$meta !== void 0 && _route$meta.title) {
|
|
375
376
|
return route.meta.title;
|
|
376
377
|
}
|
|
377
|
-
// 其次从 menuItems 中查找
|
|
378
378
|
var menuTitle = _findMenuTitle(route.path);
|
|
379
379
|
if (menuTitle) {
|
|
380
380
|
return menuTitle;
|
|
381
381
|
}
|
|
382
|
-
// 最后使用路由名称或路径
|
|
383
382
|
return route.name || route.path;
|
|
384
383
|
};
|
|
385
|
-
|
|
386
|
-
// 添加标签
|
|
387
384
|
var addTag = function addTag(route) {
|
|
388
385
|
var path = route.path;
|
|
389
386
|
var title = getRouteTitle(route);
|
|
390
|
-
|
|
391
|
-
// 检查标签是否已存在
|
|
392
387
|
var existingTag = visitedTags.value.find(function (tag) {
|
|
393
388
|
return tag.path === path;
|
|
394
389
|
});
|
|
@@ -401,35 +396,30 @@ var script = {
|
|
|
401
396
|
}
|
|
402
397
|
currentPath.value = path;
|
|
403
398
|
};
|
|
404
|
-
|
|
405
|
-
// 删除标签
|
|
406
399
|
var removeTag = function removeTag(tag) {
|
|
400
|
+
if (tag.path === tagsViewHomePath.value) {
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
407
403
|
var index = visitedTags.value.findIndex(function (t) {
|
|
408
404
|
return t.path === tag.path;
|
|
409
405
|
});
|
|
410
406
|
if (index > -1) {
|
|
411
407
|
visitedTags.value.splice(index, 1);
|
|
412
|
-
|
|
413
|
-
// 如果删除的是当前标签,跳转到最后一个标签或首页
|
|
414
408
|
if (tag.path === currentPath.value) {
|
|
415
409
|
if (visitedTags.value.length > 0) {
|
|
416
410
|
var lastTag = visitedTags.value[visitedTags.value.length - 1];
|
|
417
411
|
router.push(lastTag.fullPath || lastTag.path);
|
|
418
412
|
} else {
|
|
419
|
-
router.push(
|
|
413
|
+
router.push(tagsViewHomePath.value);
|
|
420
414
|
}
|
|
421
415
|
}
|
|
422
416
|
}
|
|
423
417
|
};
|
|
424
|
-
|
|
425
|
-
// 点击标签
|
|
426
418
|
var handleTagClick = function handleTagClick(tag) {
|
|
427
419
|
if (tag.path !== currentPath.value) {
|
|
428
420
|
router.push(tag.fullPath || tag.path);
|
|
429
421
|
}
|
|
430
422
|
};
|
|
431
|
-
|
|
432
|
-
// 处理 el-menu 的 select 事件
|
|
433
423
|
var handleTagMenuSelect = function handleTagMenuSelect(index) {
|
|
434
424
|
var tag = visitedTags.value.find(function (t) {
|
|
435
425
|
return t.path === index;
|
|
@@ -438,50 +428,30 @@ var script = {
|
|
|
438
428
|
handleTagClick(tag);
|
|
439
429
|
}
|
|
440
430
|
};
|
|
441
|
-
|
|
442
|
-
// 刷新标签
|
|
443
|
-
var handleTagRefresh = function handleTagRefresh(tag) {
|
|
444
|
-
// 触发路由刷新,通过重新导航到相同路径并添加时间戳参数
|
|
445
|
-
var currentQuery = _objectSpread({}, route.query);
|
|
446
|
-
currentQuery._t = Date.now();
|
|
447
|
-
router.replace({
|
|
448
|
-
path: tag.fullPath || tag.path,
|
|
449
|
-
query: currentQuery
|
|
450
|
-
});
|
|
451
|
-
emit('tag-refresh', tag);
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
// 关闭标签
|
|
455
431
|
var handleTagClose = function handleTagClose(tag) {
|
|
456
|
-
|
|
457
|
-
if (visitedTags.value.length <= 1) {
|
|
432
|
+
if (tag.path === tagsViewHomePath.value) {
|
|
458
433
|
return;
|
|
459
434
|
}
|
|
460
435
|
removeTag(tag);
|
|
461
436
|
emit('tag-close', tag);
|
|
462
437
|
};
|
|
463
|
-
|
|
464
|
-
// 监听路由变化
|
|
465
438
|
watch(function () {
|
|
466
439
|
return route.path;
|
|
467
440
|
}, function (newPath) {
|
|
468
441
|
if (props.showTagsView && newPath) {
|
|
469
442
|
addTag(route);
|
|
443
|
+
ensureAffixHomeTag();
|
|
470
444
|
}
|
|
471
445
|
}, {
|
|
472
446
|
immediate: true
|
|
473
447
|
});
|
|
474
|
-
|
|
475
|
-
// 图标组件
|
|
476
448
|
var SearchIcon = markRaw(Search);
|
|
477
449
|
var PhoneIcon = markRaw(Service);
|
|
478
450
|
var BellIcon = markRaw(Bell);
|
|
479
451
|
var CloseIcon = markRaw(Close);
|
|
480
|
-
var
|
|
452
|
+
var HouseIcon = markRaw(House);
|
|
481
453
|
var ExpandIcon = markRaw(Expand);
|
|
482
454
|
var FoldIcon = markRaw(Fold);
|
|
483
|
-
|
|
484
|
-
// Logo 相关计算属性
|
|
485
455
|
var logoSrc = computed(function () {
|
|
486
456
|
if (!props.logo) return null;
|
|
487
457
|
if (typeof props.logo === 'string') {
|
|
@@ -517,8 +487,6 @@ var script = {
|
|
|
517
487
|
}
|
|
518
488
|
return {};
|
|
519
489
|
});
|
|
520
|
-
|
|
521
|
-
// 检测是否为移动端
|
|
522
490
|
var checkMobile = function checkMobile() {
|
|
523
491
|
if (!props.responsive) {
|
|
524
492
|
isMobile.value = _isMobile();
|
|
@@ -526,8 +494,6 @@ var script = {
|
|
|
526
494
|
}
|
|
527
495
|
windowWidth.value = window.innerWidth;
|
|
528
496
|
isMobile.value = windowWidth.value < props.breakpoint || _isMobile();
|
|
529
|
-
|
|
530
|
-
// 移动端自动折叠侧边栏
|
|
531
497
|
if (isMobile.value && !collapsed.value) {
|
|
532
498
|
collapsed.value = true;
|
|
533
499
|
}
|
|
@@ -562,8 +528,6 @@ var script = {
|
|
|
562
528
|
var toggleCollapse = function toggleCollapse() {
|
|
563
529
|
collapsed.value = !collapsed.value;
|
|
564
530
|
};
|
|
565
|
-
|
|
566
|
-
// 计算下方容器的高度和位置
|
|
567
531
|
var bodyStyle = computed(function () {
|
|
568
532
|
var style = {};
|
|
569
533
|
if (props.showHeader) {
|
|
@@ -578,39 +542,27 @@ var script = {
|
|
|
578
542
|
}
|
|
579
543
|
return style;
|
|
580
544
|
});
|
|
581
|
-
|
|
582
|
-
// 计算折叠按钮的位置
|
|
583
545
|
var collapseBtnStyle = computed(function () {
|
|
584
546
|
var siderWidthValue = collapsed.value ? props.siderCollapsedWidth : props.siderWidth;
|
|
585
|
-
// 将宽度值转换为数字(去掉 px 单位)
|
|
586
547
|
var widthNum = parseFloat(siderWidthValue);
|
|
587
548
|
return {
|
|
588
549
|
left: "".concat(widthNum, "px")
|
|
589
550
|
};
|
|
590
551
|
});
|
|
591
|
-
|
|
592
|
-
// 处理菜单项的通用函数
|
|
593
552
|
var _processMenuItem = function processMenuItem(item) {
|
|
594
553
|
var processed = _objectSpread({}, item);
|
|
595
|
-
// 如果 icon 是组件,使用 markRaw 标记
|
|
596
554
|
if (processed.icon && _typeof(processed.icon) === 'object' && 'setup' in processed.icon) {
|
|
597
555
|
processed.icon = markRaw(processed.icon);
|
|
598
556
|
}
|
|
599
|
-
|
|
600
|
-
// 菜单搜索过滤
|
|
601
557
|
if (props.showMenuSearch && menuSearchText.value) {
|
|
602
558
|
var searchText = menuSearchText.value.toLowerCase();
|
|
603
559
|
var title = (processed.title || processed.label || '').toLowerCase();
|
|
604
|
-
|
|
605
|
-
// 如果当前项匹配,保留所有子项
|
|
606
560
|
if (title.includes(searchText)) {
|
|
607
561
|
if (processed.children && Array.isArray(processed.children)) {
|
|
608
562
|
processed.children = processed.children.map(_processMenuItem);
|
|
609
563
|
}
|
|
610
564
|
return processed;
|
|
611
565
|
}
|
|
612
|
-
|
|
613
|
-
// 如果当前项不匹配,检查子项
|
|
614
566
|
if (processed.children && Array.isArray(processed.children)) {
|
|
615
567
|
var filteredChildren = processed.children.map(_processMenuItem).filter(function (child) {
|
|
616
568
|
return child !== null;
|
|
@@ -620,24 +572,16 @@ var script = {
|
|
|
620
572
|
return processed;
|
|
621
573
|
}
|
|
622
574
|
}
|
|
623
|
-
|
|
624
|
-
// 都不匹配,返回 null
|
|
625
575
|
return null;
|
|
626
576
|
}
|
|
627
|
-
|
|
628
|
-
// 递归处理子菜单(无搜索时)
|
|
629
577
|
if (processed.children && Array.isArray(processed.children)) {
|
|
630
578
|
processed.children = processed.children.map(_processMenuItem);
|
|
631
579
|
}
|
|
632
580
|
return processed;
|
|
633
581
|
};
|
|
634
|
-
|
|
635
|
-
// 处理菜单组,将 menuItems 中的组数据转换为可渲染的格式
|
|
636
582
|
var menuGroups = computed(function () {
|
|
637
583
|
return props.menuItems.map(function (group) {
|
|
638
|
-
// 如果 group 有 type 和 children,说明是分组格式
|
|
639
584
|
if (group.type && group.children) {
|
|
640
|
-
// 如果 type 是 'common' 且 showCommonMenus 为 false,则跳过
|
|
641
585
|
if (group.type === 'common' && !props.showCommonMenus) {
|
|
642
586
|
return null;
|
|
643
587
|
}
|
|
@@ -650,7 +594,6 @@ var script = {
|
|
|
650
594
|
items: processedItems
|
|
651
595
|
};
|
|
652
596
|
}
|
|
653
|
-
// 如果没有 type,说明是单个菜单项,需要包装成组
|
|
654
597
|
var processed = _processMenuItem(group);
|
|
655
598
|
if (processed) {
|
|
656
599
|
return {
|
|
@@ -664,38 +607,26 @@ var script = {
|
|
|
664
607
|
return group !== null && group.items.length > 0;
|
|
665
608
|
});
|
|
666
609
|
});
|
|
667
|
-
|
|
668
|
-
// 自动计算常用菜单数量
|
|
669
610
|
var commonMenusCount = computed(function () {
|
|
670
611
|
var commonGroup = menuGroups.value.find(function (group) {
|
|
671
612
|
return group.type === 'common';
|
|
672
613
|
});
|
|
673
614
|
return commonGroup ? commonGroup.items.length : 0;
|
|
674
615
|
});
|
|
675
|
-
|
|
676
|
-
// 菜单组展开/收缩状态管理
|
|
677
616
|
var menuGroupExpanded = ref({});
|
|
678
|
-
|
|
679
|
-
// 初始化菜单组展开状态(默认全部展开)
|
|
680
617
|
var initMenuGroupExpanded = function initMenuGroupExpanded() {
|
|
681
618
|
menuGroups.value.forEach(function (group, index) {
|
|
682
619
|
if (menuGroupExpanded.value[index] === undefined) {
|
|
683
|
-
menuGroupExpanded.value[index] = true;
|
|
620
|
+
menuGroupExpanded.value[index] = true;
|
|
684
621
|
}
|
|
685
622
|
});
|
|
686
623
|
};
|
|
687
|
-
|
|
688
|
-
// 判断菜单组是否展开
|
|
689
624
|
var isMenuGroupExpanded = function isMenuGroupExpanded(groupIndex) {
|
|
690
|
-
return menuGroupExpanded.value[groupIndex] !== false;
|
|
625
|
+
return menuGroupExpanded.value[groupIndex] !== false;
|
|
691
626
|
};
|
|
692
|
-
|
|
693
|
-
// 切换菜单组展开/收缩状态
|
|
694
627
|
var toggleMenuGroup = function toggleMenuGroup(groupIndex) {
|
|
695
628
|
menuGroupExpanded.value[groupIndex] = !isMenuGroupExpanded(groupIndex);
|
|
696
629
|
};
|
|
697
|
-
|
|
698
|
-
// 监听 menuGroups 变化,初始化展开状态
|
|
699
630
|
watch(menuGroups, function () {
|
|
700
631
|
initMenuGroupExpanded();
|
|
701
632
|
nextTick(checkAllMenuTitleOverflow);
|
|
@@ -708,41 +639,49 @@ var script = {
|
|
|
708
639
|
}, function () {
|
|
709
640
|
nextTick(checkAllMenuTitleOverflow);
|
|
710
641
|
});
|
|
711
|
-
|
|
712
|
-
// 编辑模式状态
|
|
713
642
|
var isEditMode = ref(false);
|
|
714
|
-
|
|
715
|
-
// 切换编辑模式
|
|
716
643
|
var toggleEditMode = function toggleEditMode() {
|
|
717
644
|
isEditMode.value = !isEditMode.value;
|
|
718
645
|
};
|
|
719
|
-
|
|
720
|
-
// 处理常用菜单删除
|
|
721
646
|
var handleCommonMenuDelete = function handleCommonMenuDelete(item) {
|
|
722
647
|
emit('common-menu-delete', item);
|
|
723
648
|
};
|
|
724
|
-
|
|
725
|
-
// 获取文字的第一个字符
|
|
726
649
|
var getFirstChar = function getFirstChar(text) {
|
|
727
650
|
if (!text) return '';
|
|
728
|
-
// 获取第一个字符(支持中文和英文)
|
|
729
651
|
var firstChar = text.trim().charAt(0);
|
|
730
652
|
return firstChar || '';
|
|
731
653
|
};
|
|
732
|
-
|
|
733
|
-
// 顶部菜单项(优先使用传入的 topMenuItems,否则从 menuItems 中提取顶级菜单)
|
|
734
654
|
var topMenuItems = computed(function () {
|
|
735
|
-
// 如果传入了 topMenuItems,直接使用
|
|
736
655
|
if (props.topMenuItems && props.topMenuItems.length > 0) {
|
|
737
656
|
return props.topMenuItems;
|
|
738
657
|
}
|
|
739
658
|
return [];
|
|
740
659
|
});
|
|
741
660
|
|
|
742
|
-
|
|
661
|
+
/** 顶栏只保留「工作台」右侧一条竖向分隔线 */
|
|
662
|
+
var topMenuItemsWithDividers = computed(function () {
|
|
663
|
+
var list = topMenuItems.value;
|
|
664
|
+
if (!list.length) return [];
|
|
665
|
+
if (list.length === 1) return list;
|
|
666
|
+
return [list[0], {
|
|
667
|
+
__divider: true,
|
|
668
|
+
key: 'top-menu-div-lead'
|
|
669
|
+
}].concat(_toConsumableArray(list.slice(1)));
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
/** 顶栏横向菜单中第一个真实项(工作台 / 首页)在扁平列表里的下标,用于常驻灰底样式 */
|
|
673
|
+
var topMenuLeadFlatIndex = computed(function () {
|
|
674
|
+
var arr = topMenuItemsWithDividers.value;
|
|
675
|
+
var i = arr.findIndex(function (x) {
|
|
676
|
+
return !x.__divider;
|
|
677
|
+
});
|
|
678
|
+
return i >= 0 ? i : -1;
|
|
679
|
+
});
|
|
680
|
+
var isTopMenuLeadItem = function isTopMenuLeadItem(index) {
|
|
681
|
+
return index === topMenuLeadFlatIndex.value;
|
|
682
|
+
};
|
|
743
683
|
var activeTopMenu = computed(function () {
|
|
744
684
|
var currentPath = route.path;
|
|
745
|
-
// 查找匹配的菜单项
|
|
746
685
|
var _iterator2 = _createForOfIteratorHelper(props.topMenuItems),
|
|
747
686
|
_step2;
|
|
748
687
|
try {
|
|
@@ -751,7 +690,6 @@ var script = {
|
|
|
751
690
|
if (item.path && (currentPath === item.path || currentPath.startsWith(item.path + '/'))) {
|
|
752
691
|
return item.path || item.key;
|
|
753
692
|
}
|
|
754
|
-
// 检查子菜单
|
|
755
693
|
if (item.children && item.children.length > 0) {
|
|
756
694
|
var _iterator3 = _createForOfIteratorHelper(item.children),
|
|
757
695
|
_step3;
|
|
@@ -776,27 +714,18 @@ var script = {
|
|
|
776
714
|
}
|
|
777
715
|
return '';
|
|
778
716
|
});
|
|
779
|
-
|
|
780
|
-
// 处理顶部菜单点击
|
|
781
717
|
var handleTopMenuClick = function handleTopMenuClick(item) {
|
|
782
718
|
if (item.path) {
|
|
783
719
|
router.push(item.path);
|
|
784
720
|
}
|
|
785
721
|
};
|
|
786
|
-
|
|
787
|
-
// 处理菜单搜索按钮点击
|
|
788
722
|
var handleMenuSearchClick = function handleMenuSearchClick() {
|
|
789
|
-
// 点击后展开菜单
|
|
790
723
|
collapsed.value = false;
|
|
791
724
|
emit('menu-search-click');
|
|
792
725
|
};
|
|
793
|
-
|
|
794
|
-
// 监听菜单搜索
|
|
795
726
|
watch(menuSearchText, function (val) {
|
|
796
727
|
emit('menu-search', val);
|
|
797
728
|
});
|
|
798
|
-
|
|
799
|
-
// 监听头部搜索
|
|
800
729
|
watch(headerSearchText, function (val) {
|
|
801
730
|
emit('header-search', val);
|
|
802
731
|
});
|
|
@@ -807,7 +736,7 @@ var script = {
|
|
|
807
736
|
}])
|
|
808
737
|
}, {
|
|
809
738
|
"default": withCtx(function () {
|
|
810
|
-
return [
|
|
739
|
+
return [__props.showHeader ? (openBlock(), createBlock(unref(ElHeader), {
|
|
811
740
|
key: 0,
|
|
812
741
|
height: __props.headerHeight,
|
|
813
742
|
"class": normalizeClass(["pro-layout__header", {
|
|
@@ -815,7 +744,7 @@ var script = {
|
|
|
815
744
|
}])
|
|
816
745
|
}, {
|
|
817
746
|
"default": withCtx(function () {
|
|
818
|
-
return [createElementVNode("div", _hoisted_1, [
|
|
747
|
+
return [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [__props.showLogoInHeader ? (openBlock(), createElementBlock("div", {
|
|
819
748
|
key: 0,
|
|
820
749
|
"class": "pro-layout__header-logo",
|
|
821
750
|
onClick: _cache[0] || (_cache[0] = function ($event) {
|
|
@@ -828,45 +757,81 @@ var script = {
|
|
|
828
757
|
alt: __props.title,
|
|
829
758
|
"class": "pro-layout__header-logo-img",
|
|
830
759
|
style: normalizeStyle(logoStyle.value)
|
|
831
|
-
}, null, 12 /* STYLE, PROPS */, _hoisted_3)) : createCommentVNode("v-if", true), __props.title ? (openBlock(), createElementBlock("span", _hoisted_4, [_cache[
|
|
760
|
+
}, null, 12 /* STYLE, PROPS */, _hoisted_3)) : createCommentVNode("v-if", true), __props.title ? (openBlock(), createElementBlock("span", _hoisted_4, [_cache[6] || (_cache[6] = createElementVNode("span", {
|
|
832
761
|
"class": "pro-layout__header-logo-divider"
|
|
833
762
|
}, null, -1 /* CACHED */)), createTextVNode(" " + toDisplayString(__props.title), 1 /* TEXT */)])) : createCommentVNode("v-if", true)];
|
|
834
763
|
})])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "header-left", {
|
|
835
764
|
collapsed: collapsed.value
|
|
836
|
-
})]),
|
|
765
|
+
})]), __props.showTopMenu && topMenuItems.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5, [createElementVNode("div", _hoisted_6, [createCommentVNode(" 顶栏不用 el-menu 内置 router:与 @click handleTopMenuClick 会重复 router.push,造成卡顿 "), createVNode(unref(ElMenu), {
|
|
837
766
|
"default-active": activeTopMenu.value,
|
|
838
767
|
mode: "horizontal",
|
|
839
|
-
router:
|
|
768
|
+
router: false,
|
|
840
769
|
ellipsis: true,
|
|
841
770
|
"class": "pro-layout__top-menu-el"
|
|
842
771
|
}, {
|
|
843
772
|
"default": withCtx(function () {
|
|
844
|
-
return [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
773
|
+
return [(openBlock(true), createElementBlock(Fragment, null, renderList(topMenuItemsWithDividers.value, function (item, index) {
|
|
845
774
|
return openBlock(), createElementBlock(Fragment, {
|
|
846
|
-
key: item.path || item.key || item.label
|
|
847
|
-
}, [
|
|
775
|
+
key: item.__divider ? item.key : item.path || item.key || item.label || String(index)
|
|
776
|
+
}, [item.__divider ? (openBlock(), createBlock(unref(ElMenuItem), {
|
|
848
777
|
key: 0,
|
|
778
|
+
index: "__top_divider_".concat(index),
|
|
779
|
+
disabled: "",
|
|
780
|
+
"class": "pro-layout__top-menu-divider",
|
|
781
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(function () {}, ["prevent", "stop"]))
|
|
782
|
+
}, {
|
|
783
|
+
"default": withCtx(function () {
|
|
784
|
+
return _toConsumableArray(_cache[7] || (_cache[7] = [createElementVNode("span", {
|
|
785
|
+
"class": "pro-layout__top-menu-divider-line",
|
|
786
|
+
"aria-hidden": "true"
|
|
787
|
+
}, null, -1 /* CACHED */)]));
|
|
788
|
+
}),
|
|
789
|
+
_: 1 /* STABLE */
|
|
790
|
+
}, 8 /* PROPS */, ["index"])) : !item.children || item.children.length === 0 ? (openBlock(), createBlock(unref(ElMenuItem), {
|
|
791
|
+
key: 1,
|
|
849
792
|
index: item.path || item.key,
|
|
793
|
+
"class": normalizeClass({
|
|
794
|
+
'pro-layout__top-menu-item--lead': isTopMenuLeadItem(index)
|
|
795
|
+
}),
|
|
850
796
|
onClick: function onClick($event) {
|
|
851
797
|
return handleTopMenuClick(item);
|
|
852
798
|
}
|
|
853
799
|
}, {
|
|
854
800
|
"default": withCtx(function () {
|
|
855
|
-
return [createElementVNode("span",
|
|
801
|
+
return [createElementVNode("span", _hoisted_7, [item.icon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
856
802
|
key: 0,
|
|
803
|
+
"class": "pro-layout__top-menu-item-icon"
|
|
804
|
+
}, {
|
|
805
|
+
"default": withCtx(function () {
|
|
806
|
+
return [(openBlock(), createBlock(resolveDynamicComponent(item.icon)))];
|
|
807
|
+
}),
|
|
808
|
+
_: 2 /* DYNAMIC */
|
|
809
|
+
}, 1024 /* DYNAMIC_SLOTS */)) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_8, toDisplayString(item.title || item.label), 1 /* TEXT */), item.badge ? (openBlock(), createBlock(unref(ElBadge), {
|
|
810
|
+
key: 1,
|
|
857
811
|
value: item.badge,
|
|
858
812
|
"class": "pro-layout__top-menu-item-badge",
|
|
859
813
|
type: item.badgeType || 'danger'
|
|
860
814
|
}, null, 8 /* PROPS */, ["value", "type"])) : createCommentVNode("v-if", true)])];
|
|
861
815
|
}),
|
|
862
816
|
_: 2 /* DYNAMIC */
|
|
863
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index", "onClick"])) : (openBlock(), createBlock(unref(ElSubMenu), {
|
|
864
|
-
key:
|
|
865
|
-
index: item.path || item.key
|
|
817
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index", "class", "onClick"])) : (openBlock(), createBlock(unref(ElSubMenu), {
|
|
818
|
+
key: 2,
|
|
819
|
+
index: item.path || item.key,
|
|
820
|
+
"class": normalizeClass({
|
|
821
|
+
'pro-layout__top-menu-item--lead': isTopMenuLeadItem(index)
|
|
822
|
+
})
|
|
866
823
|
}, {
|
|
867
824
|
title: withCtx(function () {
|
|
868
|
-
return [createElementVNode("span",
|
|
825
|
+
return [createElementVNode("span", _hoisted_9, [item.icon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
869
826
|
key: 0,
|
|
827
|
+
"class": "pro-layout__top-menu-item-icon"
|
|
828
|
+
}, {
|
|
829
|
+
"default": withCtx(function () {
|
|
830
|
+
return [(openBlock(), createBlock(resolveDynamicComponent(item.icon)))];
|
|
831
|
+
}),
|
|
832
|
+
_: 2 /* DYNAMIC */
|
|
833
|
+
}, 1024 /* DYNAMIC_SLOTS */)) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_10, toDisplayString(item.title || item.label), 1 /* TEXT */), item.badge ? (openBlock(), createBlock(unref(ElBadge), {
|
|
834
|
+
key: 1,
|
|
870
835
|
value: item.badge,
|
|
871
836
|
"class": "pro-layout__top-menu-item-badge",
|
|
872
837
|
type: item.badgeType || 'danger'
|
|
@@ -889,14 +854,14 @@ var script = {
|
|
|
889
854
|
}), 128 /* KEYED_FRAGMENT */))];
|
|
890
855
|
}),
|
|
891
856
|
_: 2 /* DYNAMIC */
|
|
892
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index"]))], 64 /* STABLE_FRAGMENT */);
|
|
857
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index", "class"]))], 64 /* STABLE_FRAGMENT */);
|
|
893
858
|
}), 128 /* KEYED_FRAGMENT */))];
|
|
894
859
|
}),
|
|
895
860
|
_: 1 /* STABLE */
|
|
896
|
-
}, 8 /* PROPS */, ["default-active"
|
|
861
|
+
}, 8 /* PROPS */, ["default-active"])])])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_11, [__props.showHeaderSearch ? (openBlock(), createBlock(unref(ElInput), {
|
|
897
862
|
key: 0,
|
|
898
863
|
modelValue: headerSearchText.value,
|
|
899
|
-
"onUpdate:modelValue": _cache[
|
|
864
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
|
|
900
865
|
return headerSearchText.value = $event;
|
|
901
866
|
}),
|
|
902
867
|
placeholder: __props.headerSearchPlaceholder,
|
|
@@ -919,7 +884,7 @@ var script = {
|
|
|
919
884
|
text: "",
|
|
920
885
|
circle: "",
|
|
921
886
|
"class": "pro-layout__header-action-btn",
|
|
922
|
-
onClick: _cache[
|
|
887
|
+
onClick: _cache[3] || (_cache[3] = function ($event) {
|
|
923
888
|
return _ctx.$emit('phone-click');
|
|
924
889
|
})
|
|
925
890
|
}, {
|
|
@@ -937,7 +902,7 @@ var script = {
|
|
|
937
902
|
text: "",
|
|
938
903
|
circle: "",
|
|
939
904
|
"class": "pro-layout__header-action-btn",
|
|
940
|
-
onClick: _cache[
|
|
905
|
+
onClick: _cache[4] || (_cache[4] = function ($event) {
|
|
941
906
|
return _ctx.$emit('bell-click');
|
|
942
907
|
})
|
|
943
908
|
}, {
|
|
@@ -950,17 +915,17 @@ var script = {
|
|
|
950
915
|
})];
|
|
951
916
|
}),
|
|
952
917
|
_: 1 /* STABLE */
|
|
953
|
-
})) : createCommentVNode("v-if", true), createElementVNode("div",
|
|
918
|
+
})) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_12, [renderSlot(_ctx.$slots, "header-right", {
|
|
954
919
|
collapsed: collapsed.value
|
|
955
920
|
})])])])];
|
|
956
921
|
}),
|
|
957
922
|
_: 3 /* FORWARDED */
|
|
958
|
-
}, 8 /* PROPS */, ["height", "class"])) : createCommentVNode("v-if", true),
|
|
923
|
+
}, 8 /* PROPS */, ["height", "class"])) : createCommentVNode("v-if", true), createVNode(unref(ElContainer), {
|
|
959
924
|
"class": "pro-layout__body",
|
|
960
925
|
style: normalizeStyle(bodyStyle.value)
|
|
961
926
|
}, {
|
|
962
927
|
"default": withCtx(function () {
|
|
963
|
-
return [
|
|
928
|
+
return [__props.showSider ? (openBlock(), createBlock(unref(ElAside), {
|
|
964
929
|
key: 0,
|
|
965
930
|
width: collapsed.value ? __props.siderCollapsedWidth : __props.siderWidth,
|
|
966
931
|
"class": normalizeClass(["pro-layout__sider", {
|
|
@@ -968,12 +933,12 @@ var script = {
|
|
|
968
933
|
}])
|
|
969
934
|
}, {
|
|
970
935
|
"default": withCtx(function () {
|
|
971
|
-
return [
|
|
936
|
+
return [unref(slots)['sider-header'] ? (openBlock(), createElementBlock("div", _hoisted_13, [renderSlot(_ctx.$slots, "sider-header", {
|
|
972
937
|
collapsed: collapsed.value
|
|
973
|
-
})])) : createCommentVNode("v-if", true),
|
|
938
|
+
})])) : createCommentVNode("v-if", true), __props.showMenuSearch ? (openBlock(), createElementBlock("div", _hoisted_14, [!collapsed.value ? (openBlock(), createBlock(unref(ElInput), {
|
|
974
939
|
key: 0,
|
|
975
940
|
modelValue: menuSearchText.value,
|
|
976
|
-
"onUpdate:modelValue": _cache[
|
|
941
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
|
|
977
942
|
return menuSearchText.value = $event;
|
|
978
943
|
}),
|
|
979
944
|
placeholder: __props.menuSearchPlaceholder,
|
|
@@ -1006,19 +971,19 @@ var script = {
|
|
|
1006
971
|
})];
|
|
1007
972
|
}),
|
|
1008
973
|
_: 1 /* STABLE */
|
|
1009
|
-
}))])) : createCommentVNode("v-if", true),
|
|
974
|
+
}))])) : createCommentVNode("v-if", true), createVNode(unref(ElScrollbar), {
|
|
1010
975
|
"class": "pro-layout__menu-scrollbar"
|
|
1011
976
|
}, {
|
|
1012
977
|
"default": withCtx(function () {
|
|
1013
|
-
return [
|
|
978
|
+
return [(openBlock(true), createElementBlock(Fragment, null, renderList(menuGroups.value, function (group, groupIndex) {
|
|
1014
979
|
return openBlock(), createElementBlock(Fragment, {
|
|
1015
980
|
key: "".concat(group.type, "-").concat(groupIndex)
|
|
1016
|
-
}, [group.items && group.items.length > 0 ? (openBlock(), createElementBlock("div",
|
|
981
|
+
}, [group.items && group.items.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_15, [__props.showCommonMenus || menuGroups.value.length > 1 ? (openBlock(), createElementBlock("div", {
|
|
1017
982
|
key: 0,
|
|
1018
983
|
"class": normalizeClass(["pro-layout__menu-group-header", {
|
|
1019
984
|
'pro-layout__menu-group-header--collapsed': collapsed.value
|
|
1020
985
|
}])
|
|
1021
|
-
}, [createElementVNode("div",
|
|
986
|
+
}, [createElementVNode("div", _hoisted_16, [!collapsed.value ? (openBlock(), createBlock(unref(ElIcon), {
|
|
1022
987
|
key: 0,
|
|
1023
988
|
"class": "pro-layout__menu-group-toggle",
|
|
1024
989
|
onClick: function onClick($event) {
|
|
@@ -1029,7 +994,7 @@ var script = {
|
|
|
1029
994
|
return [(openBlock(), createBlock(resolveDynamicComponent(isMenuGroupExpanded(groupIndex) ? unref(FoldIcon) : unref(ExpandIcon))))];
|
|
1030
995
|
}),
|
|
1031
996
|
_: 2 /* DYNAMIC */
|
|
1032
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])) : createCommentVNode("v-if", true), !collapsed.value ? (openBlock(), createElementBlock("span",
|
|
997
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])) : createCommentVNode("v-if", true), !collapsed.value ? (openBlock(), createElementBlock("span", _hoisted_17, toDisplayString(group.title), 1 /* TEXT */)) : (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(getFirstChar(group.title)), 1 /* TEXT */))]), !collapsed.value ? (openBlock(), createElementBlock("div", _hoisted_19, [group.type === 'common' && commonMenusCount.value > 0 ? (openBlock(), createElementBlock("span", _hoisted_20, [createElementVNode("span", _hoisted_21, toDisplayString(commonMenusCount.value), 1 /* TEXT */), createElementVNode("span", _hoisted_22, "/" + toDisplayString(__props.commonMenusMax), 1 /* TEXT */)])) : createCommentVNode("v-if", true), group.type === 'common' && commonMenusCount.value > 0 ? (openBlock(), createElementBlock("span", {
|
|
1033
998
|
key: 1,
|
|
1034
999
|
"class": "pro-layout__menu-group-edit",
|
|
1035
1000
|
onClick: toggleEditMode
|
|
@@ -1094,7 +1059,7 @@ var script = {
|
|
|
1094
1059
|
return [(openBlock(), createBlock(resolveDynamicComponent(item.icon)))];
|
|
1095
1060
|
}),
|
|
1096
1061
|
_: 2 /* DYNAMIC */
|
|
1097
|
-
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !item.icon ? (openBlock(), createElementBlock("span",
|
|
1062
|
+
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !item.icon ? (openBlock(), createElementBlock("span", _hoisted_23, toDisplayString(getFirstChar(item.title || item.label)), 1 /* TEXT */)) : createCommentVNode("v-if", true)];
|
|
1098
1063
|
}),
|
|
1099
1064
|
_: 2 /* DYNAMIC */
|
|
1100
1065
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index", "disabled", "class"])) : (openBlock(), createBlock(unref(ElSubMenu), {
|
|
@@ -1110,7 +1075,7 @@ var script = {
|
|
|
1110
1075
|
return [(openBlock(), createBlock(resolveDynamicComponent(item.icon)))];
|
|
1111
1076
|
}),
|
|
1112
1077
|
_: 2 /* DYNAMIC */
|
|
1113
|
-
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !item.icon ? (openBlock(), createElementBlock("span",
|
|
1078
|
+
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !item.icon ? (openBlock(), createElementBlock("span", _hoisted_24, toDisplayString(getFirstChar(item.title || item.label)), 1 /* TEXT */)) : createCommentVNode("v-if", true), !collapsed.value ? (openBlock(), createBlock(unref(ElTooltip), {
|
|
1114
1079
|
key: 2,
|
|
1115
1080
|
content: item.title || item.label,
|
|
1116
1081
|
placement: "right",
|
|
@@ -1161,7 +1126,7 @@ var script = {
|
|
|
1161
1126
|
return [(openBlock(), createBlock(resolveDynamicComponent(child.icon)))];
|
|
1162
1127
|
}),
|
|
1163
1128
|
_: 2 /* DYNAMIC */
|
|
1164
|
-
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !child.icon ? (openBlock(), createElementBlock("span",
|
|
1129
|
+
}, 1024 /* DYNAMIC_SLOTS */)) : collapsed.value && !child.icon ? (openBlock(), createElementBlock("span", _hoisted_25, toDisplayString(getFirstChar(child.title || child.label)), 1 /* TEXT */)) : createCommentVNode("v-if", true)];
|
|
1165
1130
|
}),
|
|
1166
1131
|
_: 2 /* DYNAMIC */
|
|
1167
1132
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index", "disabled"]);
|
|
@@ -1183,17 +1148,17 @@ var script = {
|
|
|
1183
1148
|
})];
|
|
1184
1149
|
}),
|
|
1185
1150
|
_: 3 /* FORWARDED */
|
|
1186
|
-
}, 8 /* PROPS */, ["width", "class"])) : createCommentVNode("v-if", true),
|
|
1151
|
+
}, 8 /* PROPS */, ["width", "class"])) : createCommentVNode("v-if", true), __props.showSider && __props.showCollapse ? (openBlock(), createBlock(unref(ElButton), {
|
|
1187
1152
|
key: 1,
|
|
1188
1153
|
icon: collapsed.value ? unref(ArrowRight) : unref(ArrowLeft),
|
|
1189
1154
|
"class": "pro-layout__sider-collapse-btn",
|
|
1190
1155
|
style: normalizeStyle(collapseBtnStyle.value),
|
|
1191
1156
|
onClick: toggleCollapse
|
|
1192
|
-
}, null, 8 /* PROPS */, ["icon", "style"])) : createCommentVNode("v-if", true),
|
|
1157
|
+
}, null, 8 /* PROPS */, ["icon", "style"])) : createCommentVNode("v-if", true), createVNode(unref(ElContainer), {
|
|
1193
1158
|
"class": "pro-layout__content-wrapper"
|
|
1194
1159
|
}, {
|
|
1195
1160
|
"default": withCtx(function () {
|
|
1196
|
-
return [
|
|
1161
|
+
return [__props.showTagsView ? (openBlock(), createElementBlock("div", {
|
|
1197
1162
|
key: 0,
|
|
1198
1163
|
"class": "pro-layout__tags-view",
|
|
1199
1164
|
style: normalizeStyle({
|
|
@@ -1208,25 +1173,27 @@ var script = {
|
|
|
1208
1173
|
onSelect: handleTagMenuSelect
|
|
1209
1174
|
}, {
|
|
1210
1175
|
"default": withCtx(function () {
|
|
1211
|
-
return [(
|
|
1176
|
+
return [createVNode(unref(ElMenuItem), {
|
|
1177
|
+
index: tagsViewHomePath.value,
|
|
1178
|
+
"class": "pro-layout__tag-item pro-layout__tag-item--affix"
|
|
1179
|
+
}, {
|
|
1180
|
+
title: withCtx(function () {
|
|
1181
|
+
return [createElementVNode("span", _hoisted_26, [createVNode(unref(ElIcon), null, {
|
|
1182
|
+
"default": withCtx(function () {
|
|
1183
|
+
return [(openBlock(), createBlock(resolveDynamicComponent(unref(HouseIcon))))];
|
|
1184
|
+
}),
|
|
1185
|
+
_: 1 /* STABLE */
|
|
1186
|
+
})])];
|
|
1187
|
+
}),
|
|
1188
|
+
_: 1 /* STABLE */
|
|
1189
|
+
}, 8 /* PROPS */, ["index"]), (openBlock(true), createElementBlock(Fragment, null, renderList(otherVisitedTags.value, function (tag) {
|
|
1212
1190
|
return openBlock(), createBlock(unref(ElMenuItem), {
|
|
1213
1191
|
key: tag.path,
|
|
1214
1192
|
index: tag.path,
|
|
1215
1193
|
"class": "pro-layout__tag-item"
|
|
1216
1194
|
}, {
|
|
1217
1195
|
title: withCtx(function () {
|
|
1218
|
-
return [createElementVNode("span",
|
|
1219
|
-
"class": "pro-layout__tag-icon",
|
|
1220
|
-
onClick: withModifiers(function ($event) {
|
|
1221
|
-
return handleTagRefresh(tag);
|
|
1222
|
-
}, ["stop"])
|
|
1223
|
-
}, {
|
|
1224
|
-
"default": withCtx(function () {
|
|
1225
|
-
return [(openBlock(), createBlock(resolveDynamicComponent(unref(RefreshRightIcon))))];
|
|
1226
|
-
}),
|
|
1227
|
-
_: 1 /* STABLE */
|
|
1228
|
-
}, 8 /* PROPS */, ["onClick"]), visitedTags.value.length > 1 ? (openBlock(), createBlock(unref(ElIcon), {
|
|
1229
|
-
key: 0,
|
|
1196
|
+
return [createElementVNode("span", _hoisted_27, toDisplayString(tag.title), 1 /* TEXT */), createElementVNode("div", _hoisted_28, [createVNode(unref(ElIcon), {
|
|
1230
1197
|
"class": "pro-layout__tag-icon",
|
|
1231
1198
|
onClick: withModifiers(function ($event) {
|
|
1232
1199
|
return handleTagClose(tag);
|
|
@@ -1236,21 +1203,21 @@ var script = {
|
|
|
1236
1203
|
return [(openBlock(), createBlock(resolveDynamicComponent(unref(CloseIcon))))];
|
|
1237
1204
|
}),
|
|
1238
1205
|
_: 1 /* STABLE */
|
|
1239
|
-
}, 8 /* PROPS */, ["onClick"])
|
|
1206
|
+
}, 8 /* PROPS */, ["onClick"])])];
|
|
1240
1207
|
}),
|
|
1241
1208
|
_: 2 /* DYNAMIC */
|
|
1242
1209
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["index"]);
|
|
1243
1210
|
}), 128 /* KEYED_FRAGMENT */))];
|
|
1244
1211
|
}),
|
|
1245
1212
|
_: 1 /* STABLE */
|
|
1246
|
-
}, 8 /* PROPS */, ["default-active"]))], 4 /* STYLE */)) : createCommentVNode("v-if", true),
|
|
1213
|
+
}, 8 /* PROPS */, ["default-active"]))], 4 /* STYLE */)) : createCommentVNode("v-if", true), createVNode(unref(ElMain), {
|
|
1247
1214
|
"class": "pro-layout__content"
|
|
1248
1215
|
}, {
|
|
1249
1216
|
"default": withCtx(function () {
|
|
1250
1217
|
return [renderSlot(_ctx.$slots, "default")];
|
|
1251
1218
|
}),
|
|
1252
1219
|
_: 3 /* FORWARDED */
|
|
1253
|
-
}),
|
|
1220
|
+
}), __props.showFooter ? (openBlock(), createBlock(unref(ElFooter), {
|
|
1254
1221
|
key: 1,
|
|
1255
1222
|
height: __props.footerHeight,
|
|
1256
1223
|
"class": "pro-layout__footer"
|