@dt-frames/ui 2.0.4 → 2.0.6
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/es/assets/locales/en.d.ts +2 -0
- package/es/assets/locales/en.ts +2 -0
- package/es/assets/locales/zh.d.ts +1 -0
- package/es/assets/locales/zh.ts +6 -5
- package/es/components/curd/index.js +117 -62
- package/es/components/curd/src/components/Curd.d.ts +0 -8
- package/es/components/curd/src/props.d.ts +0 -4
- package/es/components/form/index.d.ts +20 -53
- package/es/components/form/index.js +5 -3
- package/es/components/form/index.less +8 -3
- package/es/components/form/src/index.d.ts +16 -41
- package/es/components/source/index.js +8 -5
- package/es/components/source/types/source.type.d.ts +1 -0
- package/es/components/table/index.js +145 -95
- package/es/components/table/index.less +26 -5
- package/es/components/table/src/components/TableAction.d.ts +1 -1
- package/es/components/table/src/index.d.ts +10 -0
- package/es/components/table/src/props.d.ts +4 -0
- package/es/components/tree/index.d.ts +2 -0
- package/es/components/tree/index.js +1087 -0
- package/es/components/tree/index.less +119 -0
- package/es/components/tree/src/basicProps.d.ts +146 -0
- package/es/components/tree/src/components/ContextMenu.d.ts +64 -0
- package/es/components/tree/src/components/TreeHeader.d.ts +98 -0
- package/es/components/tree/src/enums/index.d.ts +6 -0
- package/es/components/tree/src/hooks/useContextMenu.d.ts +2 -0
- package/es/components/tree/src/hooks/useTree.d.ts +14 -0
- package/es/components/tree/src/index.d.ts +6526 -0
- package/es/components/tree/src/type/menu.d.ts +33 -0
- package/es/components/tree/src/type/tree.d.ts +55 -0
- package/es/components/tree/src/utils/tree.d.ts +5 -0
- package/es/theme/index.d.ts +2 -1
- package/es/theme/index.js +829 -699
- package/es/theme/index.less +56 -0
- package/es/theme/src/components/content/index.d.ts +6 -4
- package/es/theme/src/components/header/components/logo.d.ts +22 -0
- package/es/theme/src/components/header/index.d.ts +110 -0
- package/es/theme/src/components/header/multiple-header.d.ts +154 -20
- package/es/theme/src/components/sider/index.d.ts +22 -0
- package/es/theme/src/components/sider/mix-sider.d.ts +22 -0
- package/es/theme/src/components/tabs/components/TabContent.d.ts +33 -3
- package/es/theme/src/components/tabs/components/TabRedo.d.ts +6 -4
- package/es/theme/src/components/tabs/hooks/useTabDropdown.d.ts +6 -4
- package/es/theme/src/components/tabs/hooks/useTabs.d.ts +10 -0
- package/es/theme/src/components/tabs/index.d.ts +43 -20
- package/es/theme/src/hooks/useMenu.d.ts +1 -1
- package/es/theme/src/hooks/useMultifyTab.d.ts +1 -0
- package/es/theme/src/index.d.ts +293 -24
- package/es/theme/src/stores/routeReuse.store.d.ts +6 -4
- package/es/theme/src/stores/theme.store.d.ts +1 -0
- package/es/theme/src/types/theme.type.d.ts +2 -0
- package/index.d.ts +2 -1
- package/index.js +6 -2
- package/package.json +4 -2
- package/tsconfig.json +1 -0
- package/vite.config.ts +1 -0
|
@@ -35,6 +35,7 @@ export declare const EN: {
|
|
|
35
35
|
FIXED_TO_LEFT: string;
|
|
36
36
|
FIXED_TO_RIGHT: string;
|
|
37
37
|
EXPORT: string;
|
|
38
|
+
DOWNLOAD_TEMPLATE: string;
|
|
38
39
|
EXPORT_CURRENT_PAGE: string;
|
|
39
40
|
EXPORT_SELECT_COLUMN: string;
|
|
40
41
|
EXPORT_ALL: string;
|
|
@@ -71,6 +72,7 @@ export declare const EN: {
|
|
|
71
72
|
SMALL_SIZE: string;
|
|
72
73
|
MODIFY_PASSWORD: string;
|
|
73
74
|
LOGIN_OUT: string;
|
|
75
|
+
REFRESH: string;
|
|
74
76
|
CLOSE_CURRENT_TAG: string;
|
|
75
77
|
CLOSE_LEFT_TAGS: string;
|
|
76
78
|
CLOSE_RIGHT_TAGS: string;
|
package/es/assets/locales/en.ts
CHANGED
|
@@ -35,6 +35,7 @@ export const EN = {
|
|
|
35
35
|
"FIXED_TO_LEFT": "Fixed to the left",
|
|
36
36
|
"FIXED_TO_RIGHT": "Fixed to the right",
|
|
37
37
|
"EXPORT": "Export",
|
|
38
|
+
"DOWNLOAD_TEMPLATE": "Download Template",
|
|
38
39
|
"EXPORT_CURRENT_PAGE": "Export the current page",
|
|
39
40
|
"EXPORT_SELECT_COLUMN": "Export Selected columns",
|
|
40
41
|
"EXPORT_ALL": "Export all columns",
|
|
@@ -71,6 +72,7 @@ export const EN = {
|
|
|
71
72
|
"SMALL_SIZE": "Small Size",
|
|
72
73
|
"MODIFY_PASSWORD": "Modify Password",
|
|
73
74
|
"LOGIN_OUT": "Log out",
|
|
75
|
+
"REFRESH": "Refresh",
|
|
74
76
|
"CLOSE_CURRENT_TAG": "Close the current tab",
|
|
75
77
|
"CLOSE_LEFT_TAGS": "Close the left tab",
|
|
76
78
|
"CLOSE_RIGHT_TAGS": "Close the right tab",
|
package/es/assets/locales/zh.ts
CHANGED
|
@@ -72,11 +72,12 @@ export const ZH = {
|
|
|
72
72
|
"SMALL_SIZE": "小尺寸",
|
|
73
73
|
"MODIFY_PASSWORD": "修改密码",
|
|
74
74
|
"LOGIN_OUT": "退出系统",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
75
|
+
"REFRESH": "重新加载",
|
|
76
|
+
"CLOSE_CURRENT_TAG": "关闭当前",
|
|
77
|
+
"CLOSE_LEFT_TAGS": "关闭左侧",
|
|
78
|
+
"CLOSE_RIGHT_TAGS": "关闭右侧",
|
|
79
|
+
"CLOSE_OTHER_TAGS": "关闭其他",
|
|
80
|
+
"CLOSE_ALL_TAGE": "关闭全部",
|
|
80
81
|
"SETTING_THEME": "风格设置",
|
|
81
82
|
"PROJECT_SETTING": "项目配置",
|
|
82
83
|
"NAV_MODE": "导航栏模式",
|
|
@@ -3,7 +3,7 @@ import { RadioButton, RadioGroup, Button, FormItem as FormItem$1, Col as Col$1,
|
|
|
3
3
|
import "ant-design-vue/es/form/style";
|
|
4
4
|
import "ant-design-vue/es/row/style";
|
|
5
5
|
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn, useApp, off, on, windowResizeFn, useMessage } from "@dt-frames/core";
|
|
6
|
-
import { isEqual, omit,
|
|
6
|
+
import { cloneDeep, isEqual, omit, upperFirst, uniqBy, set } from "lodash-es";
|
|
7
7
|
import { Input, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem, Modal as Modal$1 } from "ant-design-vue";
|
|
8
8
|
import { defineStore } from "pinia";
|
|
9
9
|
import "ant-design-vue/es/radio/style";
|
|
@@ -29,6 +29,7 @@ var MenuType = /* @__PURE__ */ ((MenuType2) => {
|
|
|
29
29
|
MenuType2["SIDE"] = "sidebar";
|
|
30
30
|
MenuType2["TOP_MENU"] = "top-menu";
|
|
31
31
|
MenuType2["MIX"] = "mix";
|
|
32
|
+
MenuType2["MIX_SIDEBAR"] = "mix-sidebar";
|
|
32
33
|
return MenuType2;
|
|
33
34
|
})(MenuType || {});
|
|
34
35
|
var MenuMode = /* @__PURE__ */ ((MenuMode2) => {
|
|
@@ -49,6 +50,7 @@ var UiSize = /* @__PURE__ */ ((UiSize2) => {
|
|
|
49
50
|
return UiSize2;
|
|
50
51
|
})(UiSize || {});
|
|
51
52
|
const defaultThemeConf = {
|
|
53
|
+
cache: false,
|
|
52
54
|
content: {
|
|
53
55
|
contentMode: ContentMode.FULL
|
|
54
56
|
},
|
|
@@ -80,7 +82,8 @@ const defaultThemeConf = {
|
|
|
80
82
|
menuWidth: 240,
|
|
81
83
|
trigger: true,
|
|
82
84
|
type: MenuType.SIDE,
|
|
83
|
-
mode: MenuMode.INLINE
|
|
85
|
+
mode: MenuMode.INLINE,
|
|
86
|
+
mixSideTrigger: "hover"
|
|
84
87
|
},
|
|
85
88
|
footerOptions: {
|
|
86
89
|
show: false,
|
|
@@ -90,7 +93,7 @@ const defaultThemeConf = {
|
|
|
90
93
|
},
|
|
91
94
|
routeReuse: {
|
|
92
95
|
show: true,
|
|
93
|
-
cache:
|
|
96
|
+
cache: false,
|
|
94
97
|
canDrag: true,
|
|
95
98
|
showQuick: true,
|
|
96
99
|
showRedo: true,
|
|
@@ -100,8 +103,9 @@ const defaultThemeConf = {
|
|
|
100
103
|
const useThemeStore = defineStore({
|
|
101
104
|
id: "dt-theme",
|
|
102
105
|
state: () => ({
|
|
103
|
-
themeConf: DtCache.getLocal(CacheKey.THEME) ?? defaultThemeConf,
|
|
104
|
-
pageLoading: false
|
|
106
|
+
themeConf: DtCache.getLocal(CacheKey.THEME) ?? cloneDeep(defaultThemeConf),
|
|
107
|
+
pageLoading: false,
|
|
108
|
+
mixSiderHasSubMenu: false
|
|
105
109
|
}),
|
|
106
110
|
getters: {
|
|
107
111
|
getThemeConf() {
|
|
@@ -121,16 +125,29 @@ const useThemeStore = defineStore({
|
|
|
121
125
|
},
|
|
122
126
|
getPageLoading() {
|
|
123
127
|
return this.pageLoading;
|
|
128
|
+
},
|
|
129
|
+
getMixSiderIsHasMenu() {
|
|
130
|
+
return this.mixSiderHasSubMenu;
|
|
124
131
|
}
|
|
125
132
|
},
|
|
126
133
|
actions: {
|
|
127
134
|
setThemeConf(options = {}) {
|
|
128
|
-
|
|
129
|
-
this.themeConf = deepMerge(defaultThemeConf, newThemeConf);
|
|
135
|
+
this.themeConf = deepMerge(this.themeConf, options);
|
|
130
136
|
DtCache.setLocal(CacheKey.THEME, this.themeConf);
|
|
137
|
+
},
|
|
138
|
+
setMixSiderIsHasMenu(val) {
|
|
139
|
+
this.mixSiderHasSubMenu = val;
|
|
140
|
+
},
|
|
141
|
+
resetState() {
|
|
142
|
+
DtCache.removeLocal(CacheKey.THEME);
|
|
143
|
+
this.themeConf = cloneDeep(defaultThemeConf);
|
|
131
144
|
}
|
|
132
145
|
}
|
|
133
146
|
});
|
|
147
|
+
function handleGotoPage(router) {
|
|
148
|
+
const go = useGo(router);
|
|
149
|
+
go(unref(router.currentRoute).path, true);
|
|
150
|
+
}
|
|
134
151
|
defineStore({
|
|
135
152
|
id: "route-reuse",
|
|
136
153
|
state: () => ({
|
|
@@ -171,9 +188,9 @@ defineStore({
|
|
|
171
188
|
}
|
|
172
189
|
this.updateCacheTab();
|
|
173
190
|
},
|
|
174
|
-
closeTab(
|
|
191
|
+
closeTab(route, router) {
|
|
175
192
|
const go = useGo(router);
|
|
176
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
193
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
177
194
|
let page;
|
|
178
195
|
if (index === 0) {
|
|
179
196
|
if (this.tabList.length !== 1) {
|
|
@@ -182,9 +199,9 @@ defineStore({
|
|
|
182
199
|
} else {
|
|
183
200
|
page = this.tabList[index - 1];
|
|
184
201
|
}
|
|
185
|
-
this.bulkCloseTabs([path]);
|
|
202
|
+
this.bulkCloseTabs([route.path]);
|
|
186
203
|
this.updateCacheTab();
|
|
187
|
-
path === router.currentRoute.value.path && go(page.path);
|
|
204
|
+
route.path === router.currentRoute.value.path && go(page.path);
|
|
188
205
|
},
|
|
189
206
|
closeAllTab(currentRoute, router) {
|
|
190
207
|
const go = useGo(router);
|
|
@@ -194,8 +211,8 @@ defineStore({
|
|
|
194
211
|
this.updateCacheTab();
|
|
195
212
|
go(route.path);
|
|
196
213
|
},
|
|
197
|
-
closeLeftTabs(
|
|
198
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
214
|
+
closeLeftTabs(route, router) {
|
|
215
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
199
216
|
if (index > 0) {
|
|
200
217
|
const leftTabs = this.tabList.slice(0, index);
|
|
201
218
|
const pathList = [];
|
|
@@ -208,9 +225,10 @@ defineStore({
|
|
|
208
225
|
this.bulkCloseTabs(pathList);
|
|
209
226
|
}
|
|
210
227
|
this.updateCacheTab();
|
|
228
|
+
handleGotoPage(router);
|
|
211
229
|
},
|
|
212
|
-
closeRightTabs(
|
|
213
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
230
|
+
closeRightTabs(route, router) {
|
|
231
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
214
232
|
if (index >= 0 && index < this.tabList.length - 1) {
|
|
215
233
|
const rightTabs = this.tabList.slice(index + 1, this.tabList.length);
|
|
216
234
|
const pathList = [];
|
|
@@ -223,24 +241,40 @@ defineStore({
|
|
|
223
241
|
this.bulkCloseTabs(pathList);
|
|
224
242
|
}
|
|
225
243
|
this.updateCacheTab();
|
|
244
|
+
handleGotoPage(router);
|
|
226
245
|
},
|
|
227
|
-
closeOtherTabs(
|
|
246
|
+
closeOtherTabs(route, router) {
|
|
228
247
|
const pathList = [];
|
|
229
248
|
for (let item of this.tabList) {
|
|
230
249
|
const affix = item?.meta?.affix ?? false;
|
|
231
|
-
if (item.path !== path && !affix) {
|
|
250
|
+
if (item.path !== route.path && !affix) {
|
|
232
251
|
pathList.push(item.path);
|
|
233
252
|
}
|
|
234
253
|
}
|
|
235
254
|
this.bulkCloseTabs(pathList);
|
|
236
255
|
this.updateCacheTab();
|
|
256
|
+
handleGotoPage(router);
|
|
257
|
+
},
|
|
258
|
+
closeTabByKey(path, router) {
|
|
259
|
+
const go = useGo(router);
|
|
260
|
+
const index = this.tabList.findIndex((item) => item.path === path);
|
|
261
|
+
let page;
|
|
262
|
+
if (index === 0) {
|
|
263
|
+
if (this.tabList.length !== 1) {
|
|
264
|
+
page = this.tabList[index + 1];
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
page = this.tabList[index - 1];
|
|
268
|
+
}
|
|
269
|
+
this.bulkCloseTabs([path]);
|
|
270
|
+
this.updateCacheTab();
|
|
271
|
+
path === router.currentRoute.value.path && go(page.path);
|
|
237
272
|
},
|
|
238
273
|
bulkCloseTabs(pathList) {
|
|
239
274
|
this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath));
|
|
240
275
|
},
|
|
241
276
|
updateCacheTab() {
|
|
242
|
-
|
|
243
|
-
cacheTab && DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
277
|
+
DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
244
278
|
const cacheMap = /* @__PURE__ */ new Set();
|
|
245
279
|
for (const tab of this.tabList) {
|
|
246
280
|
if (tab.meta?.hideTab) {
|
|
@@ -264,32 +298,46 @@ defineStore({
|
|
|
264
298
|
this.tabList.splice(oldIndex, 1);
|
|
265
299
|
this.tabList.splice(newIndex, 0, currentTab);
|
|
266
300
|
this.lastDragEndIndex = this.lastDragEndIndex + 1;
|
|
301
|
+
},
|
|
302
|
+
resetState() {
|
|
303
|
+
this.tabList = [];
|
|
304
|
+
this.updateCacheTab();
|
|
267
305
|
}
|
|
268
306
|
}
|
|
269
307
|
});
|
|
270
308
|
function useMenu() {
|
|
271
|
-
const {
|
|
272
|
-
const getCollapsedShowTitle = computed(() => getMenuConf.collapsedShowTitle);
|
|
273
|
-
const getIsSidebarType = computed(() => getMenuConf.type === MenuType.SIDE);
|
|
274
|
-
const getMenuFixed = computed(() => getMenuConf.fixed);
|
|
275
|
-
const getShowMenu = computed(() => getMenuConf.show);
|
|
309
|
+
const { setThemeConf } = useThemeStore();
|
|
310
|
+
const getCollapsedShowTitle = computed(() => useThemeStore().getMenuConf.collapsedShowTitle);
|
|
311
|
+
const getIsSidebarType = computed(() => useThemeStore().getMenuConf.type === MenuType.SIDE);
|
|
312
|
+
const getMenuFixed = computed(() => useThemeStore().getMenuConf.fixed);
|
|
313
|
+
const getShowMenu = computed(() => useThemeStore().getMenuConf.show);
|
|
276
314
|
const getShowSidebar = computed(() => {
|
|
277
315
|
return unref(getSplit) || unref(getShowMenu) && unref(getMenuMode) !== MenuMode.HORIZONTAL;
|
|
278
316
|
});
|
|
279
|
-
const getMenuHidden = computed(() => getMenuConf.hidden);
|
|
280
|
-
const getMenuTheme = computed(() => getMenuConf.theme);
|
|
281
|
-
const getTrigger = computed(() => getMenuConf.trigger);
|
|
282
|
-
const getCanDrag = computed(() => getMenuConf.canDrag);
|
|
317
|
+
const getMenuHidden = computed(() => useThemeStore().getMenuConf.hidden);
|
|
318
|
+
const getMenuTheme = computed(() => useThemeStore().getMenuConf.theme);
|
|
319
|
+
const getTrigger = computed(() => useThemeStore().getMenuConf.trigger);
|
|
320
|
+
const getCanDrag = computed(() => useThemeStore().getMenuConf.canDrag);
|
|
283
321
|
const getIsMixMode = computed(() => {
|
|
284
322
|
return unref(getMenuMode) === MenuMode.INLINE && unref(getMenuType) === MenuType.MIX;
|
|
285
323
|
});
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
|
|
324
|
+
const getIsMixSidebar = computed(() => unref(getMenuType) === MenuType.MIX_SIDEBAR);
|
|
325
|
+
const getMenuWidth = computed(() => {
|
|
326
|
+
if (unref(getIsMixMode)) {
|
|
327
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 40;
|
|
328
|
+
} else if (unref(getIsMixSidebar)) {
|
|
329
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 10;
|
|
330
|
+
} else {
|
|
331
|
+
return Number(useThemeStore().getMenuConf.menuWidth);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
const getMixSideTrigger = computed(() => useThemeStore().getMenuConf.mixSideTrigger);
|
|
335
|
+
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : useThemeStore().getMenuConf.menuWidth);
|
|
336
|
+
const getMenuType = computed(() => useThemeStore().getMenuConf.type);
|
|
289
337
|
const getIsTopMenu = computed(() => unref(getMenuType) === MenuType.TOP_MENU);
|
|
290
|
-
const getMenuMode = computed(() => getMenuConf.mode);
|
|
291
|
-
const getSplit = computed(() => getMenuConf.split);
|
|
292
|
-
const getCollapsed = computed(() => getMenuConf.collapsed);
|
|
338
|
+
const getMenuMode = computed(() => useThemeStore().getMenuConf.mode);
|
|
339
|
+
const getSplit = computed(() => useThemeStore().getMenuConf.split);
|
|
340
|
+
const getCollapsed = computed(() => useThemeStore().getMenuConf.collapsed);
|
|
293
341
|
const getIsHorizontal = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL);
|
|
294
342
|
const setThemeStore = (conf = {}) => setThemeConf(conf);
|
|
295
343
|
const toggleCollapsed = () => setThemeStore({
|
|
@@ -297,7 +345,7 @@ function useMenu() {
|
|
|
297
345
|
collapsed: !unref(getCollapsed)
|
|
298
346
|
}
|
|
299
347
|
});
|
|
300
|
-
const getMiniWidthNumber = computed(() => getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
348
|
+
const getMiniWidthNumber = computed(() => useThemeStore().getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
301
349
|
const getRealWidth = computed(() => {
|
|
302
350
|
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
|
|
303
351
|
});
|
|
@@ -326,7 +374,9 @@ function useMenu() {
|
|
|
326
374
|
getRealWidth,
|
|
327
375
|
getCalcContentWidth,
|
|
328
376
|
getIsMixMode,
|
|
377
|
+
getIsMixSidebar,
|
|
329
378
|
getCanDrag,
|
|
379
|
+
getMixSideTrigger,
|
|
330
380
|
toggleCollapsed,
|
|
331
381
|
setThemeStore
|
|
332
382
|
};
|
|
@@ -335,12 +385,14 @@ function useMultipleTab() {
|
|
|
335
385
|
const { getRouteReuseConf } = useThemeStore();
|
|
336
386
|
const getShowMultipleTab = computed(() => getRouteReuseConf.show);
|
|
337
387
|
const getShowQuick = computed(() => getRouteReuseConf.showQuick);
|
|
388
|
+
const getMultipleTabPosIsTop = computed(() => getRouteReuseConf.position === "top");
|
|
338
389
|
const getShowRedo = computed(() => getRouteReuseConf.showRedo);
|
|
339
390
|
const getCanCache = computed(() => getRouteReuseConf.cache);
|
|
340
391
|
const getCanDrag = computed(() => getRouteReuseConf.canDrag);
|
|
341
392
|
return {
|
|
342
393
|
getShowMultipleTab,
|
|
343
394
|
getShowQuick,
|
|
395
|
+
getMultipleTabPosIsTop,
|
|
344
396
|
getShowRedo,
|
|
345
397
|
getCanCache,
|
|
346
398
|
getCanDrag
|
|
@@ -359,12 +411,12 @@ function useHeader() {
|
|
|
359
411
|
getMenuMode,
|
|
360
412
|
getSplit,
|
|
361
413
|
getIsTopMenu,
|
|
362
|
-
|
|
414
|
+
getIsMixSidebar
|
|
363
415
|
} = useMenu();
|
|
364
|
-
const { getShowMultipleTab } = useMultipleTab();
|
|
416
|
+
const { getShowMultipleTab, getMultipleTabPosIsTop } = useMultipleTab();
|
|
365
417
|
const getHeaderTheme = computed(() => getHeaderConf.theme);
|
|
366
418
|
const getFixed = computed(() => getHeaderConf.fixed);
|
|
367
|
-
const getShowHeaderLogo = computed(() => unref(getShowLogo) && !unref(getIsSidebarType));
|
|
419
|
+
const getShowHeaderLogo = computed(() => unref(getShowLogo) && !unref(getIsSidebarType) && !unref(getIsMixSidebar));
|
|
368
420
|
const getShowSearch = computed(() => getHeaderConf.showSearch);
|
|
369
421
|
const getShowHeaderTrigger = computed(() => {
|
|
370
422
|
if (unref(getMenuType) === MenuType.TOP_MENU || !unref(getShowMenu) || unref(getMenuHidden)) {
|
|
@@ -382,19 +434,19 @@ function useHeader() {
|
|
|
382
434
|
const getShowLocale = computed(() => getHeaderConf.showLocaleSwitch);
|
|
383
435
|
const getShowSettingTheme = computed(() => getHeaderConf.showSettingTheme);
|
|
384
436
|
const getShowFullHeaderRef = computed(() => {
|
|
385
|
-
return !unref(getIsSidebarType) && !unref(getIsTopMenu);
|
|
437
|
+
return !unref(getIsSidebarType) && !unref(getIsMixSidebar) && !unref(getIsTopMenu);
|
|
386
438
|
});
|
|
387
439
|
const getHeaderHeight = computed(() => {
|
|
388
440
|
let height = 0;
|
|
389
441
|
height += HEADER_HEIGHT;
|
|
390
|
-
if (unref(getShowMultipleTab) && !unref(getSplit)) {
|
|
442
|
+
if (unref(getShowMultipleTab) && !unref(getSplit) && !unref(getMultipleTabPosIsTop)) {
|
|
391
443
|
height += TABS_HEIGHT;
|
|
392
444
|
}
|
|
393
445
|
return height;
|
|
394
446
|
});
|
|
395
447
|
const getTabsHeight = computed(() => TABS_HEIGHT);
|
|
396
448
|
const getShowInsetHeaderRef = computed(() => {
|
|
397
|
-
return unref(getIsSidebarType) || unref(getIsTopMenu);
|
|
449
|
+
return unref(getIsSidebarType) || unref(getIsTopMenu) || unref(getIsMixSidebar);
|
|
398
450
|
});
|
|
399
451
|
const getShowBackToTop = computed(() => getHeaderConf.showBackToTop);
|
|
400
452
|
const getIsZH = computed(() => {
|
|
@@ -1139,8 +1191,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1139
1191
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.buttonList, (button) => {
|
|
1140
1192
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1141
1193
|
(button.show === void 0 ? true : button.show) ? withDirectives((openBlock(), createBlock(_component_AButton, {
|
|
1194
|
+
class: normalizeClass(["items-center", button.class]),
|
|
1142
1195
|
type: button.type,
|
|
1143
|
-
class: normalizeClass(button.class),
|
|
1144
1196
|
loading: button.loading,
|
|
1145
1197
|
disabled: button.disabled,
|
|
1146
1198
|
key: unref(key),
|
|
@@ -1152,7 +1204,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1152
1204
|
]) : createCommentVNode("v-if", true)
|
|
1153
1205
|
]),
|
|
1154
1206
|
default: withCtx(() => [
|
|
1155
|
-
createTextVNode(" " + toDisplayString(unref(t)(button.
|
|
1207
|
+
createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
|
|
1156
1208
|
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2, null, 512)), [
|
|
1157
1209
|
[_directive_icon, button.postIcon]
|
|
1158
1210
|
]) : createCommentVNode("v-if", true)
|
|
@@ -1191,8 +1243,8 @@ const DtFormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "D:/d
|
|
|
1191
1243
|
const SEARCH_BTN_NAME = "UI.SEARCH";
|
|
1192
1244
|
const RESET_BTN_NAME = "UI.RESET";
|
|
1193
1245
|
const SEARCH_BTNS = [
|
|
1194
|
-
{
|
|
1195
|
-
{
|
|
1246
|
+
{ label: SEARCH_BTN_NAME, preIcon: "mdi:magnify", type: "primary" },
|
|
1247
|
+
{ label: RESET_BTN_NAME, preIcon: "mdi:refresh", type: "default" }
|
|
1196
1248
|
];
|
|
1197
1249
|
function useFormEvents({
|
|
1198
1250
|
emits,
|
|
@@ -1478,22 +1530,29 @@ function useFormActions(opt) {
|
|
|
1478
1530
|
const { getProps, defaultValue, updateSchema, getFormValues, setFormValues } = opt;
|
|
1479
1531
|
const { appConf } = useAppStore();
|
|
1480
1532
|
function handleAdvanced(isAdvanced) {
|
|
1481
|
-
const {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1533
|
+
const {
|
|
1534
|
+
schemas,
|
|
1535
|
+
minShowColumn = appConf.ui.form?.minShowColumn || 2,
|
|
1536
|
+
showAdvancedButton = true
|
|
1537
|
+
} = unref(getProps);
|
|
1538
|
+
let schema = [...schemas];
|
|
1539
|
+
if (showAdvancedButton) {
|
|
1540
|
+
schema = schemas.reduce((t, it, index) => {
|
|
1541
|
+
if (index > minShowColumn - 1)
|
|
1542
|
+
it.isAdvanced = isAdvanced;
|
|
1543
|
+
t.push(it);
|
|
1544
|
+
return t;
|
|
1545
|
+
}, []);
|
|
1546
|
+
}
|
|
1488
1547
|
updateSchema(schema);
|
|
1489
1548
|
}
|
|
1490
1549
|
function handleMethod(params) {
|
|
1491
1550
|
const { onSearch, onReset } = unref(getProps);
|
|
1492
1551
|
if (isBoolean(params)) {
|
|
1493
1552
|
handleAdvanced(params);
|
|
1494
|
-
} else if (params.
|
|
1553
|
+
} else if (params.label === SEARCH_BTN_NAME) {
|
|
1495
1554
|
onSearch(getFormValues());
|
|
1496
|
-
} else if (params.
|
|
1555
|
+
} else if (params.label === RESET_BTN_NAME) {
|
|
1497
1556
|
setFormValues(toRaw(defaultValue.value));
|
|
1498
1557
|
onReset(getFormValues());
|
|
1499
1558
|
} else {
|
|
@@ -1567,10 +1626,6 @@ const BasicProps = {
|
|
|
1567
1626
|
type: Boolean,
|
|
1568
1627
|
default: true
|
|
1569
1628
|
},
|
|
1570
|
-
alwaysShowLines: {
|
|
1571
|
-
type: Boolean,
|
|
1572
|
-
default: false
|
|
1573
|
-
},
|
|
1574
1629
|
minShowColumn: {
|
|
1575
1630
|
type: Number,
|
|
1576
1631
|
default: 2
|
|
@@ -2122,7 +2177,6 @@ function useDragMove(context) {
|
|
|
2122
2177
|
const screenHeight = document.documentElement.clientHeight;
|
|
2123
2178
|
const dragDomWidth = dragDom.offsetWidth;
|
|
2124
2179
|
const dragDomheight = dragDom.offsetHeight;
|
|
2125
|
-
console.log(dragDomWidth, dragDomheight, screenHeight, screenWidth);
|
|
2126
2180
|
const minDragDomLeft = dragDom.offsetLeft;
|
|
2127
2181
|
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
|
2128
2182
|
const minDragDomTop = dragDom.offsetTop;
|
|
@@ -2702,8 +2756,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2702
2756
|
if (props.buttons && props.buttons.length)
|
|
2703
2757
|
return props.buttons;
|
|
2704
2758
|
let buttonActions = [
|
|
2705
|
-
{ t: "\u4FDD\u5B58",
|
|
2706
|
-
{ t: "\u5173\u95ED",
|
|
2759
|
+
{ t: "\u4FDD\u5B58", label: props.okText || t("SAVE"), preIcon: "mdi:content-save", type: "primary", flag: "OK" },
|
|
2760
|
+
{ t: "\u5173\u95ED", label: props.cancelText || t("CLOSE"), preIcon: "mdi:close", flag: "CANCEL" }
|
|
2707
2761
|
];
|
|
2708
2762
|
if (!props.showSave)
|
|
2709
2763
|
buttonActions = buttonActions.filter((btn) => btn.flag !== "OK");
|
|
@@ -3001,7 +3055,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3001
3055
|
"formProps",
|
|
3002
3056
|
"schemas"
|
|
3003
3057
|
]),
|
|
3004
|
-
destroyOnClose: true
|
|
3058
|
+
destroyOnClose: true,
|
|
3059
|
+
maskClosable: false
|
|
3005
3060
|
});
|
|
3006
3061
|
function handleSave() {
|
|
3007
3062
|
props?.onSave();
|
|
@@ -100,10 +100,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
100
100
|
type: BooleanConstructor;
|
|
101
101
|
default: boolean;
|
|
102
102
|
};
|
|
103
|
-
alwaysShowLines: {
|
|
104
|
-
type: BooleanConstructor;
|
|
105
|
-
default: boolean;
|
|
106
|
-
};
|
|
107
103
|
minShowColumn: {
|
|
108
104
|
type: NumberConstructor;
|
|
109
105
|
default: number;
|
|
@@ -1152,10 +1148,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1152
1148
|
type: BooleanConstructor;
|
|
1153
1149
|
default: boolean;
|
|
1154
1150
|
};
|
|
1155
|
-
alwaysShowLines: {
|
|
1156
|
-
type: BooleanConstructor;
|
|
1157
|
-
default: boolean;
|
|
1158
|
-
};
|
|
1159
1151
|
minShowColumn: {
|
|
1160
1152
|
type: NumberConstructor;
|
|
1161
1153
|
default: number;
|