@dt-frames/ui 2.0.9 → 2.0.11
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/components/curd/index.js +6 -2973
- package/es/components/curd/src/components/Curd.d.ts +13 -881
- package/es/components/curd/src/hooks/useCurd.d.ts +3 -3
- package/es/components/curd/src/props.d.ts +3 -4
- package/es/components/curd/src/types/curd.type.d.ts +2 -2
- package/es/components/drawer/index.d.ts +9 -166
- package/es/components/drawer/index.js +20 -458
- package/es/components/drawer/src/components/DrawerFooter.d.ts +1 -84
- package/es/components/drawer/src/index.d.ts +9 -166
- package/es/components/drawer/src/types/index.type.d.ts +1 -1
- package/es/components/form/index.d.ts +5 -1
- package/es/components/form/index.js +97 -491
- package/es/components/form/index.less +18 -0
- package/es/components/form/src/components/FormButtons.d.ts +13 -3
- package/es/components/form/src/components/FormItem.d.ts +0 -1
- package/es/components/form/src/components/formIcon.d.ts +3 -3
- package/es/components/form/src/components/formInputUseDialog.d.ts +2 -2
- package/es/components/form/src/hooks/useLabelWidth.d.ts +2 -18
- package/es/components/form/src/props.d.ts +3 -4
- package/es/components/form/src/types/form.type.d.ts +5 -3
- package/es/components/form/src/types/items.type.d.ts +12 -5
- package/es/components/modal/index.d.ts +2 -1
- package/es/components/modal/index.js +19 -456
- package/es/components/modal/src/components/Modal.d.ts +2 -2
- package/es/components/modal/src/components/ModalFooter.d.ts +2 -85
- package/es/components/modal/src/components/ModalWrap.d.ts +1 -75
- package/es/components/modal/src/index.d.ts +14 -171
- package/es/components/modal/src/props.d.ts +2 -1
- package/es/components/table/index.js +47 -1849
- package/es/components/table/index.less +3 -3
- package/es/components/table/src/components/TableAction.d.ts +1 -1
- package/es/components/table/src/components/editTable/EditTableCell.d.ts +1 -1
- package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +1 -867
- package/es/components/table/src/index.d.ts +10 -10
- package/es/components/tree/index.js +29 -39
- package/es/components/tree/src/components/TreeHeader.d.ts +1 -1
- package/es/components/tree/src/index.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -0
- package/es/components/upload/index.js +16 -0
- package/es/components/upload/index.less +0 -0
- package/es/components/upload/src/index.d.ts +2 -0
- package/es/theme/index.d.ts +2 -1
- package/es/theme/index.js +11 -4
- package/es/theme/index.less +1 -0
- package/es/theme/src/components/header/components/size.d.ts +5 -5
- package/es/theme/src/components/header/index.d.ts +5 -5
- package/es/theme/src/components/header/multiple-header.d.ts +5 -5
- package/es/theme/src/hooks/useMenu.d.ts +1 -1
- package/es/theme/src/index.d.ts +10 -10
- package/es/theme/transition.less +105 -0
- package/index.js +21 -1
- package/manualContentPath.js +110 -0
- package/package.json +5 -2
- package/vite.config.ts +16 -4
- package/vite.config.ts.timestamp-1678694558071.mjs +59 -0
- package/vite.config.ts.timestamp-1678700851971.mjs +61 -0
- package/es/components/form/src/index.d.ts +0 -2922
- package/es/components/table/src/components/TableHeader.d.ts +0 -1136
- package/es/components/table/src/components/tableSetting/Download.d.ts +0 -922
- package/es/components/table/src/components/tableSetting/index.d.ts +0 -1030
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RadioButton, RadioGroup, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1 } from "ant-design-vue/es";
|
|
2
2
|
import "ant-design-vue/es/form/style";
|
|
3
3
|
import "ant-design-vue/es/row/style";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { computed, unref, getCurrentInstance, reactive, readonly, watchEffect, nextTick, toRaw, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createElementVNode, createVNode, normalizeProps, guardReactiveProps, createCommentVNode, toRefs, isVNode, ref, watch, resolveDirective, normalizeStyle, withDirectives, normalizeClass, onMounted, withKeys, createSlots, renderSlot } from "vue";
|
|
5
|
+
import { useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isBoolean, isNull, dispatchResize, isObject, deepMerge, isNullAndUnDef, isEmpty, useTimeoutFn } from "@dt-frames/core";
|
|
6
|
+
import { merge, isEqual, omit, cloneDeep, 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 } from "ant-design-vue";
|
|
8
|
-
import {
|
|
8
|
+
import { useHeader, UiSize } from "../../theme";
|
|
9
9
|
import "ant-design-vue/es/radio/style";
|
|
10
10
|
import "ant-design-vue/es/cascader/style";
|
|
11
11
|
import "ant-design-vue/es/input-number/style";
|
|
@@ -17,471 +17,6 @@ import "ant-design-vue/es/date-picker/style";
|
|
|
17
17
|
import "ant-design-vue/es/col/style";
|
|
18
18
|
import "ant-design-vue/es/button/style";
|
|
19
19
|
import dayjs from "dayjs";
|
|
20
|
-
var Theme = /* @__PURE__ */ ((Theme2) => {
|
|
21
|
-
Theme2["DARK"] = "dark";
|
|
22
|
-
Theme2["LIGHT"] = "light";
|
|
23
|
-
return Theme2;
|
|
24
|
-
})(Theme || {});
|
|
25
|
-
var MenuType = /* @__PURE__ */ ((MenuType2) => {
|
|
26
|
-
MenuType2["SIDE"] = "sidebar";
|
|
27
|
-
MenuType2["TOP_MENU"] = "top-menu";
|
|
28
|
-
MenuType2["MIX"] = "mix";
|
|
29
|
-
MenuType2["MIX_SIDEBAR"] = "mix-sidebar";
|
|
30
|
-
return MenuType2;
|
|
31
|
-
})(MenuType || {});
|
|
32
|
-
var MenuMode = /* @__PURE__ */ ((MenuMode2) => {
|
|
33
|
-
MenuMode2["INLINE"] = "inline";
|
|
34
|
-
MenuMode2["HORIZONTAL"] = "horizontal";
|
|
35
|
-
MenuMode2["VERTICAL"] = "vertical";
|
|
36
|
-
return MenuMode2;
|
|
37
|
-
})(MenuMode || {});
|
|
38
|
-
var ContentMode = /* @__PURE__ */ ((ContentMode2) => {
|
|
39
|
-
ContentMode2["FULL"] = "full";
|
|
40
|
-
ContentMode2["FIXED"] = "fixed";
|
|
41
|
-
return ContentMode2;
|
|
42
|
-
})(ContentMode || {});
|
|
43
|
-
var UiSize = /* @__PURE__ */ ((UiSize2) => {
|
|
44
|
-
UiSize2["LARGE"] = "large";
|
|
45
|
-
UiSize2["MIDDLE"] = "middle";
|
|
46
|
-
UiSize2["SMALL"] = "small";
|
|
47
|
-
return UiSize2;
|
|
48
|
-
})(UiSize || {});
|
|
49
|
-
const defaultThemeConf = {
|
|
50
|
-
content: {
|
|
51
|
-
contentMode: ContentMode.FULL
|
|
52
|
-
},
|
|
53
|
-
headOptions: {
|
|
54
|
-
fixed: true,
|
|
55
|
-
theme: Theme.LIGHT,
|
|
56
|
-
showLogo: true,
|
|
57
|
-
showBackToTop: true,
|
|
58
|
-
useLockPage: true,
|
|
59
|
-
size: UiSize.SMALL,
|
|
60
|
-
showSize: true,
|
|
61
|
-
showBreadCrumb: true,
|
|
62
|
-
showFullScreen: true,
|
|
63
|
-
showSearch: true,
|
|
64
|
-
showNotice: true,
|
|
65
|
-
showLocaleSwitch: true,
|
|
66
|
-
showSettingTheme: true,
|
|
67
|
-
showLoginOut: true
|
|
68
|
-
},
|
|
69
|
-
menuOptions: {
|
|
70
|
-
fixed: true,
|
|
71
|
-
theme: Theme.DARK,
|
|
72
|
-
collapsed: false,
|
|
73
|
-
collapsedShowTitle: false,
|
|
74
|
-
canDrag: true,
|
|
75
|
-
show: true,
|
|
76
|
-
hidden: false,
|
|
77
|
-
split: false,
|
|
78
|
-
menuWidth: 240,
|
|
79
|
-
trigger: true,
|
|
80
|
-
type: MenuType.SIDE,
|
|
81
|
-
mode: MenuMode.INLINE,
|
|
82
|
-
mixSideTrigger: "hover"
|
|
83
|
-
},
|
|
84
|
-
footerOptions: {
|
|
85
|
-
show: false,
|
|
86
|
-
height: 48,
|
|
87
|
-
title: "Copyright(C) 2021 by www.ithinkdt.com. All rights reserved.",
|
|
88
|
-
subTitle: "Privacy Statement"
|
|
89
|
-
},
|
|
90
|
-
routeReuse: {
|
|
91
|
-
show: true,
|
|
92
|
-
cache: false,
|
|
93
|
-
canDrag: true,
|
|
94
|
-
showQuick: true,
|
|
95
|
-
showRedo: true,
|
|
96
|
-
showFold: true
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const useThemeStore = defineStore({
|
|
100
|
-
id: "dt-theme",
|
|
101
|
-
state: () => ({
|
|
102
|
-
themeConf: DtCache.getLocal(CacheKey.THEME) ?? cloneDeep(defaultThemeConf),
|
|
103
|
-
pageLoading: false,
|
|
104
|
-
mixSiderHasSubMenu: false
|
|
105
|
-
}),
|
|
106
|
-
getters: {
|
|
107
|
-
getThemeConf() {
|
|
108
|
-
return this.themeConf;
|
|
109
|
-
},
|
|
110
|
-
getHeaderConf() {
|
|
111
|
-
return this.themeConf.headOptions;
|
|
112
|
-
},
|
|
113
|
-
getMenuConf() {
|
|
114
|
-
return this.themeConf.menuOptions;
|
|
115
|
-
},
|
|
116
|
-
getFooterConf() {
|
|
117
|
-
return this.themeConf.footerOptions;
|
|
118
|
-
},
|
|
119
|
-
getRouteReuseConf() {
|
|
120
|
-
return this.themeConf.routeReuse;
|
|
121
|
-
},
|
|
122
|
-
getPageLoading() {
|
|
123
|
-
return this.pageLoading;
|
|
124
|
-
},
|
|
125
|
-
getMixSiderIsHasMenu() {
|
|
126
|
-
return this.mixSiderHasSubMenu;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
actions: {
|
|
130
|
-
setThemeConf(options = {}) {
|
|
131
|
-
let newThemeConf = deepMerge(this.themeConf, options);
|
|
132
|
-
this.themeConf = deepMerge(defaultThemeConf, newThemeConf);
|
|
133
|
-
DtCache.setLocal(CacheKey.THEME, this.themeConf);
|
|
134
|
-
},
|
|
135
|
-
setMixSiderIsHasMenu(val) {
|
|
136
|
-
this.mixSiderHasSubMenu = val;
|
|
137
|
-
},
|
|
138
|
-
resetState() {
|
|
139
|
-
DtCache.removeLocal(CacheKey.THEME);
|
|
140
|
-
this.themeConf = cloneDeep(defaultThemeConf);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
function handleGotoPage(router) {
|
|
145
|
-
const go = useGo(router);
|
|
146
|
-
go(unref(router.currentRoute).path, true);
|
|
147
|
-
}
|
|
148
|
-
defineStore({
|
|
149
|
-
id: "route-reuse",
|
|
150
|
-
state: () => ({
|
|
151
|
-
cacheTabList: /* @__PURE__ */ new Set(),
|
|
152
|
-
tabList: DtCache.getLocal(CacheKey.ROUTE_REUSE) || [],
|
|
153
|
-
lastDragEndIndex: 0
|
|
154
|
-
}),
|
|
155
|
-
getters: {
|
|
156
|
-
getTabList() {
|
|
157
|
-
return this.tabList;
|
|
158
|
-
},
|
|
159
|
-
getCachedTabList() {
|
|
160
|
-
return Array.from(this.cacheTabList);
|
|
161
|
-
},
|
|
162
|
-
getLastDragEndIndex() {
|
|
163
|
-
return this.lastDragEndIndex;
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
actions: {
|
|
167
|
-
async addTab(route) {
|
|
168
|
-
const { path, name, fullPath, params, query, meta } = route;
|
|
169
|
-
if (path === Pages.NOT_FOUND || path === Pages.LOGIN || path === Pages.BASE_PAGE) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
let updateIndex = -1;
|
|
173
|
-
const tabHasExits = this.tabList.some((tab, index) => {
|
|
174
|
-
updateIndex = index;
|
|
175
|
-
return (tab.fullPath || tab.path) === (fullPath || path);
|
|
176
|
-
});
|
|
177
|
-
if (tabHasExits) {
|
|
178
|
-
const curTab = toRaw(this.tabList)[updateIndex];
|
|
179
|
-
curTab.params = params || curTab.params;
|
|
180
|
-
curTab.query = query || curTab.query;
|
|
181
|
-
curTab.fullPath = fullPath || curTab.fullPath;
|
|
182
|
-
this.tabList.splice(updateIndex, 1, curTab);
|
|
183
|
-
} else {
|
|
184
|
-
this.tabList.push(JSON.parse(JSON.stringify(route)));
|
|
185
|
-
}
|
|
186
|
-
this.updateCacheTab();
|
|
187
|
-
},
|
|
188
|
-
closeTab(route, router) {
|
|
189
|
-
const go = useGo(router);
|
|
190
|
-
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
191
|
-
let page;
|
|
192
|
-
if (index === 0) {
|
|
193
|
-
if (this.tabList.length !== 1) {
|
|
194
|
-
page = this.tabList[index + 1];
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
page = this.tabList[index - 1];
|
|
198
|
-
}
|
|
199
|
-
this.bulkCloseTabs([route.path]);
|
|
200
|
-
this.updateCacheTab();
|
|
201
|
-
route.path === router.currentRoute.value.path && go(page.path);
|
|
202
|
-
},
|
|
203
|
-
closeAllTab(currentRoute, router) {
|
|
204
|
-
const go = useGo(router);
|
|
205
|
-
let filterTabList = this.tabList.filter((item) => item?.meta?.affix ?? false);
|
|
206
|
-
const route = filterTabList.length > 0 ? filterTabList[filterTabList.length - 1] : unref(currentRoute);
|
|
207
|
-
this.tabList = [route];
|
|
208
|
-
this.updateCacheTab();
|
|
209
|
-
go(route.path);
|
|
210
|
-
},
|
|
211
|
-
closeLeftTabs(route, router) {
|
|
212
|
-
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
213
|
-
if (index > 0) {
|
|
214
|
-
const leftTabs = this.tabList.slice(0, index);
|
|
215
|
-
const pathList = [];
|
|
216
|
-
for (const item of leftTabs) {
|
|
217
|
-
const affix = item?.meta?.affix ?? false;
|
|
218
|
-
if (!affix) {
|
|
219
|
-
pathList.push(item.fullPath);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
this.bulkCloseTabs(pathList);
|
|
223
|
-
}
|
|
224
|
-
this.updateCacheTab();
|
|
225
|
-
handleGotoPage(router);
|
|
226
|
-
},
|
|
227
|
-
closeRightTabs(route, router) {
|
|
228
|
-
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
229
|
-
if (index >= 0 && index < this.tabList.length - 1) {
|
|
230
|
-
const rightTabs = this.tabList.slice(index + 1, this.tabList.length);
|
|
231
|
-
const pathList = [];
|
|
232
|
-
for (const item of rightTabs) {
|
|
233
|
-
const affix = item?.meta?.affix ?? false;
|
|
234
|
-
if (!affix) {
|
|
235
|
-
pathList.push(item.fullPath);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
this.bulkCloseTabs(pathList);
|
|
239
|
-
}
|
|
240
|
-
this.updateCacheTab();
|
|
241
|
-
handleGotoPage(router);
|
|
242
|
-
},
|
|
243
|
-
closeOtherTabs(route, router) {
|
|
244
|
-
const pathList = [];
|
|
245
|
-
for (let item of this.tabList) {
|
|
246
|
-
const affix = item?.meta?.affix ?? false;
|
|
247
|
-
if (item.path !== route.path && !affix) {
|
|
248
|
-
pathList.push(item.path);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
this.bulkCloseTabs(pathList);
|
|
252
|
-
this.updateCacheTab();
|
|
253
|
-
handleGotoPage(router);
|
|
254
|
-
},
|
|
255
|
-
closeTabByKey(path, router) {
|
|
256
|
-
const go = useGo(router);
|
|
257
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
258
|
-
let page;
|
|
259
|
-
if (index === 0) {
|
|
260
|
-
if (this.tabList.length !== 1) {
|
|
261
|
-
page = this.tabList[index + 1];
|
|
262
|
-
}
|
|
263
|
-
} else {
|
|
264
|
-
page = this.tabList[index - 1];
|
|
265
|
-
}
|
|
266
|
-
this.bulkCloseTabs([path]);
|
|
267
|
-
this.updateCacheTab();
|
|
268
|
-
path === router.currentRoute.value.path && go(page.path);
|
|
269
|
-
},
|
|
270
|
-
bulkCloseTabs(pathList) {
|
|
271
|
-
this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath));
|
|
272
|
-
},
|
|
273
|
-
updateCacheTab() {
|
|
274
|
-
DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
275
|
-
const cacheMap = /* @__PURE__ */ new Set();
|
|
276
|
-
for (const tab of this.tabList) {
|
|
277
|
-
if (tab.meta?.hideTab) {
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
const name = tab.name;
|
|
281
|
-
cacheMap.add(name);
|
|
282
|
-
}
|
|
283
|
-
this.cacheTabList = cacheMap;
|
|
284
|
-
},
|
|
285
|
-
async refreshPage(router) {
|
|
286
|
-
const findTab = this.getCachedTabList.find((item) => item === unref(router.currentRoute).name);
|
|
287
|
-
if (findTab) {
|
|
288
|
-
this.cacheTabList.delete(findTab.toString());
|
|
289
|
-
}
|
|
290
|
-
const redo = useRedo(router);
|
|
291
|
-
await redo();
|
|
292
|
-
},
|
|
293
|
-
sortTabs(oldIndex, newIndex) {
|
|
294
|
-
const currentTab = this.tabList[oldIndex];
|
|
295
|
-
this.tabList.splice(oldIndex, 1);
|
|
296
|
-
this.tabList.splice(newIndex, 0, currentTab);
|
|
297
|
-
this.lastDragEndIndex = this.lastDragEndIndex + 1;
|
|
298
|
-
},
|
|
299
|
-
resetState() {
|
|
300
|
-
this.tabList = [];
|
|
301
|
-
this.updateCacheTab();
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
function useMenu() {
|
|
306
|
-
const { setThemeConf } = useThemeStore();
|
|
307
|
-
const getCollapsedShowTitle = computed(() => useThemeStore().getMenuConf.collapsedShowTitle);
|
|
308
|
-
const getIsSidebarType = computed(() => useThemeStore().getMenuConf.type === MenuType.SIDE);
|
|
309
|
-
const getMenuFixed = computed(() => useThemeStore().getMenuConf.fixed);
|
|
310
|
-
const getShowMenu = computed(() => useThemeStore().getMenuConf.show);
|
|
311
|
-
const getShowSidebar = computed(() => {
|
|
312
|
-
return unref(getSplit) || unref(getShowMenu) && unref(getMenuMode) !== MenuMode.HORIZONTAL;
|
|
313
|
-
});
|
|
314
|
-
const getMenuHidden = computed(() => useThemeStore().getMenuConf.hidden);
|
|
315
|
-
const getMenuTheme = computed(() => useThemeStore().getMenuConf.theme);
|
|
316
|
-
const getTrigger = computed(() => useThemeStore().getMenuConf.trigger);
|
|
317
|
-
const getCanDrag = computed(() => useThemeStore().getMenuConf.canDrag);
|
|
318
|
-
const getIsMixMode = computed(() => {
|
|
319
|
-
return unref(getMenuMode) === MenuMode.INLINE && unref(getMenuType) === MenuType.MIX;
|
|
320
|
-
});
|
|
321
|
-
const getIsMixSidebar = computed(() => unref(getMenuType) === MenuType.MIX_SIDEBAR);
|
|
322
|
-
const getMenuWidth = computed(() => {
|
|
323
|
-
if (unref(getIsMixMode)) {
|
|
324
|
-
return Number(useThemeStore().getMenuConf.menuWidth) - 40;
|
|
325
|
-
} else if (unref(getIsMixSidebar)) {
|
|
326
|
-
return Number(useThemeStore().getMenuConf.menuWidth) - 10;
|
|
327
|
-
} else {
|
|
328
|
-
return Number(useThemeStore().getMenuConf.menuWidth);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
const getMixSideTrigger = computed(() => useThemeStore().getMenuConf.mixSideTrigger);
|
|
332
|
-
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : useThemeStore().getMenuConf.menuWidth);
|
|
333
|
-
const getMenuType = computed(() => useThemeStore().getMenuConf.type);
|
|
334
|
-
const getIsTopMenu = computed(() => unref(getMenuType) === MenuType.TOP_MENU);
|
|
335
|
-
const getMenuMode = computed(() => useThemeStore().getMenuConf.mode);
|
|
336
|
-
const getSplit = computed(() => useThemeStore().getMenuConf.split);
|
|
337
|
-
const getCollapsed = computed(() => useThemeStore().getMenuConf.collapsed);
|
|
338
|
-
const getIsHorizontal = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL);
|
|
339
|
-
const setThemeStore = (conf = {}) => setThemeConf(conf);
|
|
340
|
-
const toggleCollapsed = () => setThemeStore({
|
|
341
|
-
menuOptions: {
|
|
342
|
-
collapsed: !unref(getCollapsed)
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
const getMiniWidthNumber = computed(() => useThemeStore().getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
346
|
-
const getRealWidth = computed(() => {
|
|
347
|
-
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
|
|
348
|
-
});
|
|
349
|
-
const getCalcContentWidth = computed(() => {
|
|
350
|
-
const width = unref(getIsTopMenu) || !unref(getShowMenu) || unref(getSplit) && unref(getMenuHidden) ? 0 : unref(getRealWidth);
|
|
351
|
-
return `calc(100% - ${unref(width)}px)`;
|
|
352
|
-
});
|
|
353
|
-
return {
|
|
354
|
-
getCollapsedShowTitle,
|
|
355
|
-
getIsSidebarType,
|
|
356
|
-
getMenuFixed,
|
|
357
|
-
getShowMenu,
|
|
358
|
-
getShowSidebar,
|
|
359
|
-
getMenuHidden,
|
|
360
|
-
getMenuTheme,
|
|
361
|
-
getTrigger,
|
|
362
|
-
getMenuWidth,
|
|
363
|
-
getLogoWidth,
|
|
364
|
-
getMenuType,
|
|
365
|
-
getIsTopMenu,
|
|
366
|
-
getMenuMode,
|
|
367
|
-
getSplit,
|
|
368
|
-
getCollapsed,
|
|
369
|
-
getIsHorizontal,
|
|
370
|
-
getMiniWidthNumber,
|
|
371
|
-
getRealWidth,
|
|
372
|
-
getCalcContentWidth,
|
|
373
|
-
getIsMixMode,
|
|
374
|
-
getIsMixSidebar,
|
|
375
|
-
getCanDrag,
|
|
376
|
-
getMixSideTrigger,
|
|
377
|
-
toggleCollapsed,
|
|
378
|
-
setThemeStore
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
function useMultipleTab() {
|
|
382
|
-
const { getRouteReuseConf } = useThemeStore();
|
|
383
|
-
const getShowMultipleTab = computed(() => getRouteReuseConf.show);
|
|
384
|
-
const getShowQuick = computed(() => getRouteReuseConf.showQuick);
|
|
385
|
-
const getMultipleTabPosIsTop = computed(() => getRouteReuseConf.position === "top");
|
|
386
|
-
const getShowRedo = computed(() => getRouteReuseConf.showRedo);
|
|
387
|
-
const getCanCache = computed(() => getRouteReuseConf.cache);
|
|
388
|
-
const getCanDrag = computed(() => getRouteReuseConf.canDrag);
|
|
389
|
-
return {
|
|
390
|
-
getShowMultipleTab,
|
|
391
|
-
getShowQuick,
|
|
392
|
-
getMultipleTabPosIsTop,
|
|
393
|
-
getShowRedo,
|
|
394
|
-
getCanCache,
|
|
395
|
-
getCanDrag
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
function useHeader() {
|
|
399
|
-
const HEADER_HEIGHT = 48;
|
|
400
|
-
const TABS_HEIGHT = 33;
|
|
401
|
-
const { getHeaderConf = {} } = useThemeStore();
|
|
402
|
-
const {
|
|
403
|
-
getIsSidebarType,
|
|
404
|
-
getMenuType,
|
|
405
|
-
getShowMenu,
|
|
406
|
-
getMenuHidden,
|
|
407
|
-
getTrigger,
|
|
408
|
-
getMenuMode,
|
|
409
|
-
getSplit,
|
|
410
|
-
getIsTopMenu,
|
|
411
|
-
getIsMixSidebar
|
|
412
|
-
} = useMenu();
|
|
413
|
-
const { getShowMultipleTab, getMultipleTabPosIsTop } = useMultipleTab();
|
|
414
|
-
const getHeaderTheme = computed(() => getHeaderConf.theme);
|
|
415
|
-
const getFixed = computed(() => getHeaderConf.fixed);
|
|
416
|
-
const getShowHeaderLogo = computed(() => unref(getShowLogo) && !unref(getIsSidebarType) && !unref(getIsMixSidebar));
|
|
417
|
-
const getShowSearch = computed(() => getHeaderConf.showSearch);
|
|
418
|
-
const getShowHeaderTrigger = computed(() => {
|
|
419
|
-
if (unref(getMenuType) === MenuType.TOP_MENU || !unref(getShowMenu) || unref(getMenuHidden)) {
|
|
420
|
-
return false;
|
|
421
|
-
}
|
|
422
|
-
return unref(getTrigger);
|
|
423
|
-
});
|
|
424
|
-
const getShowBreadCrumb = computed(() => getHeaderConf.showBreadCrumb);
|
|
425
|
-
const getShowBread = computed(
|
|
426
|
-
() => unref(getMenuMode) !== MenuMode.HORIZONTAL && !unref(getSplit) && unref(getShowBreadCrumb)
|
|
427
|
-
);
|
|
428
|
-
const getShowTopMenu = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL || unref(getSplit));
|
|
429
|
-
const getShowNotice = computed(() => getHeaderConf.showNotice);
|
|
430
|
-
const getShowFullScreen = computed(() => getHeaderConf.showFullScreen);
|
|
431
|
-
const getShowLocale = computed(() => getHeaderConf.showLocaleSwitch);
|
|
432
|
-
const getShowSettingTheme = computed(() => getHeaderConf.showSettingTheme);
|
|
433
|
-
const getShowFullHeaderRef = computed(() => {
|
|
434
|
-
return !unref(getIsSidebarType) && !unref(getIsMixSidebar) && !unref(getIsTopMenu);
|
|
435
|
-
});
|
|
436
|
-
const getHeaderHeight = computed(() => {
|
|
437
|
-
let height = 0;
|
|
438
|
-
height += HEADER_HEIGHT;
|
|
439
|
-
if (unref(getShowMultipleTab) && !unref(getSplit) && !unref(getMultipleTabPosIsTop)) {
|
|
440
|
-
height += TABS_HEIGHT;
|
|
441
|
-
}
|
|
442
|
-
return height;
|
|
443
|
-
});
|
|
444
|
-
const getTabsHeight = computed(() => TABS_HEIGHT);
|
|
445
|
-
const getShowInsetHeaderRef = computed(() => {
|
|
446
|
-
return unref(getIsSidebarType) || unref(getIsTopMenu) || unref(getIsMixSidebar);
|
|
447
|
-
});
|
|
448
|
-
const getShowBackToTop = computed(() => getHeaderConf.showBackToTop);
|
|
449
|
-
const getIsZH = computed(() => {
|
|
450
|
-
let local = DtCache.getLocal(CacheKey.LOCALE);
|
|
451
|
-
if (!local)
|
|
452
|
-
return true;
|
|
453
|
-
return local === Language.ZH;
|
|
454
|
-
});
|
|
455
|
-
const getUiSize = computed(() => getHeaderConf?.size ?? UiSize.SMALL);
|
|
456
|
-
const getShowUiSize = computed(() => getHeaderConf?.showSize);
|
|
457
|
-
const getShowLogo = computed(() => getHeaderConf.showLogo);
|
|
458
|
-
const getShowLoginOut = computed(() => getHeaderConf.showLoginOut);
|
|
459
|
-
const loginOutClick = getHeaderConf.logoutClick;
|
|
460
|
-
return {
|
|
461
|
-
getHeaderTheme,
|
|
462
|
-
getFixed,
|
|
463
|
-
getShowSearch,
|
|
464
|
-
getShowHeaderLogo,
|
|
465
|
-
getShowHeaderTrigger,
|
|
466
|
-
getShowBread,
|
|
467
|
-
getShowTopMenu,
|
|
468
|
-
getShowFullScreen,
|
|
469
|
-
getShowLocale,
|
|
470
|
-
getShowSettingTheme,
|
|
471
|
-
getShowNotice,
|
|
472
|
-
getShowFullHeaderRef,
|
|
473
|
-
getHeaderHeight,
|
|
474
|
-
getTabsHeight,
|
|
475
|
-
getShowInsetHeaderRef,
|
|
476
|
-
getShowBackToTop,
|
|
477
|
-
getIsZH,
|
|
478
|
-
getUiSize,
|
|
479
|
-
getShowLogo,
|
|
480
|
-
getShowLoginOut,
|
|
481
|
-
getShowUiSize,
|
|
482
|
-
loginOutClick
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
20
|
function useLabelWidth(schemaItemRef, propsRef) {
|
|
486
21
|
const { getIsZH } = useHeader();
|
|
487
22
|
const { appConf } = useAppStore();
|
|
@@ -495,18 +30,20 @@ function useLabelWidth(schemaItemRef, propsRef) {
|
|
|
495
30
|
layout = appConf.ui.form.layout
|
|
496
31
|
} = unref(propsRef);
|
|
497
32
|
let width = (unref(getIsZH) ? labelWidth ?? gLabelWidth : enLabelWidth ?? gEnLabelWidth) ?? labelWidth ?? gLabelWidth ?? 0;
|
|
498
|
-
const labelcol = {
|
|
499
|
-
const wrapcol = {
|
|
33
|
+
const labelcol = merge({}, glabelCol, labelCol);
|
|
34
|
+
const wrapcol = merge({}, gwrapperCol, wrapperCol);
|
|
500
35
|
width = isNumber(width) ? `${width}px` : width;
|
|
501
36
|
return {
|
|
502
|
-
labelCol:
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
37
|
+
labelCol: merge(
|
|
38
|
+
{},
|
|
39
|
+
{ style: { width } },
|
|
40
|
+
labelcol
|
|
41
|
+
),
|
|
42
|
+
wrapperCol: merge(
|
|
43
|
+
{},
|
|
44
|
+
{ style: { width: layout === "vertical" ? "100%" : `calc(100% - ${width})` } },
|
|
45
|
+
wrapcol
|
|
46
|
+
)
|
|
510
47
|
};
|
|
511
48
|
});
|
|
512
49
|
}
|
|
@@ -579,7 +116,7 @@ function useFormValue(props, key = "value", changeEvent = "change", emitData) {
|
|
|
579
116
|
});
|
|
580
117
|
return [state, setState, defaultState];
|
|
581
118
|
}
|
|
582
|
-
const _sfc_main$
|
|
119
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
583
120
|
__name: "radioButton",
|
|
584
121
|
props: {
|
|
585
122
|
value: {
|
|
@@ -630,8 +167,49 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
630
167
|
};
|
|
631
168
|
}
|
|
632
169
|
});
|
|
170
|
+
const _hoisted_1$1 = { class: "input-with-dialog" };
|
|
171
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
172
|
+
__name: "formInputUseDialog",
|
|
173
|
+
setup(__props) {
|
|
174
|
+
const { t } = useI18n("UI");
|
|
175
|
+
const attrs = useAttrs();
|
|
176
|
+
const bindProps = computed(() => {
|
|
177
|
+
return {
|
|
178
|
+
...omit(attrs, [
|
|
179
|
+
"formValues"
|
|
180
|
+
]),
|
|
181
|
+
disabled: true
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
function onClickInput() {
|
|
185
|
+
const { model, schema = {} } = attrs.formValues;
|
|
186
|
+
if (!schema.openDialog || !isFunction(schema.openDialog)) {
|
|
187
|
+
error(t("MUSE_FUNCTION"));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
schema.openDialog(model);
|
|
191
|
+
}
|
|
192
|
+
function clearProps() {
|
|
193
|
+
const { model, schema = {} } = attrs.formValues;
|
|
194
|
+
[...schema.extraName, schema.name].forEach((it) => model[it] = null);
|
|
195
|
+
}
|
|
196
|
+
return (_ctx, _cache) => {
|
|
197
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
198
|
+
createElementVNode("div", { onClick: onClickInput }, [
|
|
199
|
+
createVNode(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
|
|
200
|
+
]),
|
|
201
|
+
unref(attrs).formValues?.schema?.extraName?.length ? (openBlock(), createElementBlock("i", {
|
|
202
|
+
key: 0,
|
|
203
|
+
class: "i mdi:close-circle",
|
|
204
|
+
onClick: clearProps
|
|
205
|
+
})) : createCommentVNode("", true)
|
|
206
|
+
]);
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
});
|
|
633
210
|
const components = {
|
|
634
211
|
Input,
|
|
212
|
+
InputWithDialog: _sfc_main$3,
|
|
635
213
|
InputTextArea: Input.TextArea,
|
|
636
214
|
InputSearch: Input.Search,
|
|
637
215
|
InputGroup: Input.Group,
|
|
@@ -640,7 +218,7 @@ const components = {
|
|
|
640
218
|
TreeSelect,
|
|
641
219
|
Radio,
|
|
642
220
|
RadioGroup: Radio.Group,
|
|
643
|
-
RadioButtonGroup: _sfc_main$
|
|
221
|
+
RadioButtonGroup: _sfc_main$4,
|
|
644
222
|
Checkbox,
|
|
645
223
|
CheckboxGroup: Checkbox.Group,
|
|
646
224
|
AutoComplete,
|
|
@@ -887,10 +465,13 @@ const _sfc_main$2 = {
|
|
|
887
465
|
return _disabled;
|
|
888
466
|
});
|
|
889
467
|
const getSize = () => {
|
|
890
|
-
|
|
468
|
+
const {
|
|
469
|
+
size = unref(getUiSize)
|
|
470
|
+
} = props.formProps;
|
|
471
|
+
if (component === "Switch" && size === UiSize.LARGE) {
|
|
891
472
|
return "default";
|
|
892
473
|
}
|
|
893
|
-
return
|
|
474
|
+
return size === UiSize.MIDDLE ? "default" : size;
|
|
894
475
|
};
|
|
895
476
|
const itemProps = {
|
|
896
477
|
allowClear: _sProps?.allowClear ?? appConf.ui.form.allowClear,
|
|
@@ -1005,7 +586,7 @@ const _sfc_main$2 = {
|
|
|
1005
586
|
let _colProps = colProps || gColProps || (mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan);
|
|
1006
587
|
const values = unref(getValues);
|
|
1007
588
|
if (!component) {
|
|
1008
|
-
if (!render && !renderCol && !slot) {
|
|
589
|
+
if (!render && !renderCol && !slot && !colSlot) {
|
|
1009
590
|
error(t("NEED_RENDER"));
|
|
1010
591
|
return;
|
|
1011
592
|
}
|
|
@@ -1070,6 +651,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1070
651
|
isAdvanced: {
|
|
1071
652
|
type: Boolean,
|
|
1072
653
|
default: true
|
|
654
|
+
},
|
|
655
|
+
colspan: {
|
|
656
|
+
type: Object
|
|
1073
657
|
}
|
|
1074
658
|
},
|
|
1075
659
|
emits: ["handle-method"],
|
|
@@ -1089,6 +673,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1089
673
|
Object.assign(style, {
|
|
1090
674
|
display: "inline-block"
|
|
1091
675
|
});
|
|
676
|
+
return { style };
|
|
677
|
+
} else if (props.mode === null) {
|
|
678
|
+
Object.assign(style, {
|
|
679
|
+
display: "flex",
|
|
680
|
+
justifyContent: "center",
|
|
681
|
+
marginBottom: "20px"
|
|
682
|
+
});
|
|
683
|
+
return {
|
|
684
|
+
style,
|
|
685
|
+
span: 24
|
|
686
|
+
};
|
|
1092
687
|
}
|
|
1093
688
|
return { style };
|
|
1094
689
|
});
|
|
@@ -1111,8 +706,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1111
706
|
}
|
|
1112
707
|
}
|
|
1113
708
|
watch(() => props.isAdvanced, (v) => {
|
|
1114
|
-
if (v) {
|
|
1115
|
-
|
|
709
|
+
if (v || props.mode !== "search") {
|
|
710
|
+
requestAnimationFrame(toggleAdvanced);
|
|
1116
711
|
}
|
|
1117
712
|
}, {
|
|
1118
713
|
immediate: true
|
|
@@ -1418,7 +1013,7 @@ function useFormValues({
|
|
|
1418
1013
|
function initDefault() {
|
|
1419
1014
|
const schema = unref(getSchema), obj = {};
|
|
1420
1015
|
schema.forEach((item) => {
|
|
1421
|
-
const { props = {}, name, component, defaultValue: gDefaultValue
|
|
1016
|
+
const { props = {}, name, component, defaultValue: gDefaultValue } = item;
|
|
1422
1017
|
const { defaultValue: itemDefaultValue, mode, format, treeCheckable } = isFunction(props) ? props(formModel) : props;
|
|
1423
1018
|
if (!name)
|
|
1424
1019
|
return;
|
|
@@ -1555,8 +1150,7 @@ const BasicProps = {
|
|
|
1555
1150
|
default: () => ({})
|
|
1556
1151
|
},
|
|
1557
1152
|
size: {
|
|
1558
|
-
type: String
|
|
1559
|
-
default: "small"
|
|
1153
|
+
type: String
|
|
1560
1154
|
},
|
|
1561
1155
|
disabled: {
|
|
1562
1156
|
type: Boolean,
|
|
@@ -1740,13 +1334,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1740
1334
|
buttonList = [...buttons];
|
|
1741
1335
|
} else if (mode === "search" && !buttons) {
|
|
1742
1336
|
SEARCH_BTNS.forEach((it) => {
|
|
1743
|
-
it.loading = it.
|
|
1337
|
+
it.loading = it.label === SEARCH_BTN_NAME ? loading?.onSearch : loading?.onReset;
|
|
1744
1338
|
buttonList.push(it);
|
|
1745
1339
|
});
|
|
1746
1340
|
}
|
|
1747
1341
|
let colspan = mode === "search" ? getAppConf.ui.form.searchColspan : getAppConf.ui.form.dialogColspan;
|
|
1342
|
+
if (mode !== "search") {
|
|
1343
|
+
return {
|
|
1344
|
+
colspan,
|
|
1345
|
+
...{
|
|
1346
|
+
mode,
|
|
1347
|
+
showAdvancedButton: false,
|
|
1348
|
+
isAdvanced: false,
|
|
1349
|
+
buttonList
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1748
1353
|
return {
|
|
1749
|
-
|
|
1354
|
+
colspan,
|
|
1750
1355
|
...{
|
|
1751
1356
|
showAdvancedButton,
|
|
1752
1357
|
buttonList
|
|
@@ -1910,5 +1515,6 @@ function useForm(props) {
|
|
|
1910
1515
|
}
|
|
1911
1516
|
export {
|
|
1912
1517
|
_sfc_main as DtForm,
|
|
1518
|
+
_sfc_main$1 as DtFormButtons,
|
|
1913
1519
|
useForm
|
|
1914
1520
|
};
|