@dt-frames/ui 2.0.6 → 2.0.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.
- package/es/components/curd/index.js +42 -67
- package/es/components/curd/src/components/Curd.d.ts +2 -8
- package/es/components/curd/src/hooks/useCurd.d.ts +3 -3
- package/es/components/curd/src/props.d.ts +1 -4
- package/es/components/curd/src/types/curd.type.d.ts +3 -9
- package/es/components/form/index.d.ts +30 -54
- package/es/components/form/index.js +87 -65
- package/es/components/form/index.less +1 -0
- package/es/components/form/src/components/FormButtons.d.ts +3 -3
- package/es/components/form/src/components/FormItem.d.ts +5 -8
- package/es/components/form/src/components/formIcon.d.ts +4 -4
- package/es/components/form/src/components/formInputUseDialog.d.ts +3 -3
- package/es/components/form/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form/src/index.d.ts +24 -42
- package/es/components/form/src/props.d.ts +5 -8
- package/es/components/modal/index.js +3 -6
- package/es/components/modal/src/components/ModalFooter.d.ts +3 -3
- package/es/components/modal/src/index.d.ts +9 -9
- package/es/components/source/hooks/useSource.d.ts +14 -13
- package/es/components/source/index.js +62 -36
- package/es/components/table/index.js +151 -158
- package/es/components/table/src/index.d.ts +18 -54
- package/es/components/table/src/props.d.ts +6 -18
- package/es/components/table/src/types/table.type.d.ts +1 -4
- package/es/theme/index.d.ts +2 -2
- package/es/theme/index.js +299 -294
- package/es/theme/src/components/sider/index.d.ts +2 -1
- package/es/theme/src/components/sider/mix-sider.d.ts +2 -1
- package/es/theme/src/hooks/useMenu.d.ts +1 -1
- package/es/theme/src/index.d.ts +2 -1
- package/es/theme/src/types/theme.type.d.ts +0 -1
- package/index.js +3 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import "ant-design-vue/es/form/style";
|
|
|
3
3
|
import "ant-design-vue/es/row/style";
|
|
4
4
|
import { toRaw, unref, computed, getCurrentInstance, reactive, readonly, watchEffect, nextTick, 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
5
|
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn } 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 } from "ant-design-vue";
|
|
8
8
|
import { defineStore } from "pinia";
|
|
9
9
|
import "ant-design-vue/es/radio/style";
|
|
@@ -89,7 +89,7 @@ const defaultThemeConf = {
|
|
|
89
89
|
},
|
|
90
90
|
routeReuse: {
|
|
91
91
|
show: true,
|
|
92
|
-
cache:
|
|
92
|
+
cache: false,
|
|
93
93
|
canDrag: true,
|
|
94
94
|
showQuick: true,
|
|
95
95
|
showRedo: true,
|
|
@@ -99,7 +99,7 @@ const defaultThemeConf = {
|
|
|
99
99
|
const useThemeStore = defineStore({
|
|
100
100
|
id: "dt-theme",
|
|
101
101
|
state: () => ({
|
|
102
|
-
themeConf: DtCache.getLocal(CacheKey.THEME) ?? defaultThemeConf,
|
|
102
|
+
themeConf: DtCache.getLocal(CacheKey.THEME) ?? cloneDeep(defaultThemeConf),
|
|
103
103
|
pageLoading: false,
|
|
104
104
|
mixSiderHasSubMenu: false
|
|
105
105
|
}),
|
|
@@ -134,14 +134,22 @@ const useThemeStore = defineStore({
|
|
|
134
134
|
},
|
|
135
135
|
setMixSiderIsHasMenu(val) {
|
|
136
136
|
this.mixSiderHasSubMenu = val;
|
|
137
|
+
},
|
|
138
|
+
resetState() {
|
|
139
|
+
DtCache.removeLocal(CacheKey.THEME);
|
|
140
|
+
this.themeConf = cloneDeep(defaultThemeConf);
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
143
|
});
|
|
144
|
+
function handleGotoPage(router) {
|
|
145
|
+
const go = useGo(router);
|
|
146
|
+
go(unref(router.currentRoute).path, true);
|
|
147
|
+
}
|
|
140
148
|
defineStore({
|
|
141
149
|
id: "route-reuse",
|
|
142
150
|
state: () => ({
|
|
143
151
|
cacheTabList: /* @__PURE__ */ new Set(),
|
|
144
|
-
tabList: DtCache.getLocal(CacheKey.
|
|
152
|
+
tabList: DtCache.getLocal(CacheKey.ROUTE_REUSE) || [],
|
|
145
153
|
lastDragEndIndex: 0
|
|
146
154
|
}),
|
|
147
155
|
getters: {
|
|
@@ -177,9 +185,9 @@ defineStore({
|
|
|
177
185
|
}
|
|
178
186
|
this.updateCacheTab();
|
|
179
187
|
},
|
|
180
|
-
closeTab(
|
|
188
|
+
closeTab(route, router) {
|
|
181
189
|
const go = useGo(router);
|
|
182
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
190
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
183
191
|
let page;
|
|
184
192
|
if (index === 0) {
|
|
185
193
|
if (this.tabList.length !== 1) {
|
|
@@ -188,9 +196,9 @@ defineStore({
|
|
|
188
196
|
} else {
|
|
189
197
|
page = this.tabList[index - 1];
|
|
190
198
|
}
|
|
191
|
-
this.bulkCloseTabs([path]);
|
|
199
|
+
this.bulkCloseTabs([route.path]);
|
|
192
200
|
this.updateCacheTab();
|
|
193
|
-
path === router.currentRoute.value.path && go(page.path);
|
|
201
|
+
route.path === router.currentRoute.value.path && go(page.path);
|
|
194
202
|
},
|
|
195
203
|
closeAllTab(currentRoute, router) {
|
|
196
204
|
const go = useGo(router);
|
|
@@ -200,8 +208,8 @@ defineStore({
|
|
|
200
208
|
this.updateCacheTab();
|
|
201
209
|
go(route.path);
|
|
202
210
|
},
|
|
203
|
-
closeLeftTabs(
|
|
204
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
211
|
+
closeLeftTabs(route, router) {
|
|
212
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
205
213
|
if (index > 0) {
|
|
206
214
|
const leftTabs = this.tabList.slice(0, index);
|
|
207
215
|
const pathList = [];
|
|
@@ -214,9 +222,10 @@ defineStore({
|
|
|
214
222
|
this.bulkCloseTabs(pathList);
|
|
215
223
|
}
|
|
216
224
|
this.updateCacheTab();
|
|
225
|
+
handleGotoPage(router);
|
|
217
226
|
},
|
|
218
|
-
closeRightTabs(
|
|
219
|
-
const index = this.tabList.findIndex((item) => item.path === path);
|
|
227
|
+
closeRightTabs(route, router) {
|
|
228
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
220
229
|
if (index >= 0 && index < this.tabList.length - 1) {
|
|
221
230
|
const rightTabs = this.tabList.slice(index + 1, this.tabList.length);
|
|
222
231
|
const pathList = [];
|
|
@@ -229,24 +238,40 @@ defineStore({
|
|
|
229
238
|
this.bulkCloseTabs(pathList);
|
|
230
239
|
}
|
|
231
240
|
this.updateCacheTab();
|
|
241
|
+
handleGotoPage(router);
|
|
232
242
|
},
|
|
233
|
-
closeOtherTabs(
|
|
243
|
+
closeOtherTabs(route, router) {
|
|
234
244
|
const pathList = [];
|
|
235
245
|
for (let item of this.tabList) {
|
|
236
246
|
const affix = item?.meta?.affix ?? false;
|
|
237
|
-
if (item.path !== path && !affix) {
|
|
247
|
+
if (item.path !== route.path && !affix) {
|
|
238
248
|
pathList.push(item.path);
|
|
239
249
|
}
|
|
240
250
|
}
|
|
241
251
|
this.bulkCloseTabs(pathList);
|
|
242
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);
|
|
243
269
|
},
|
|
244
270
|
bulkCloseTabs(pathList) {
|
|
245
271
|
this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath));
|
|
246
272
|
},
|
|
247
273
|
updateCacheTab() {
|
|
248
|
-
|
|
249
|
-
cacheTab && DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
274
|
+
DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
250
275
|
const cacheMap = /* @__PURE__ */ new Set();
|
|
251
276
|
for (const tab of this.tabList) {
|
|
252
277
|
if (tab.meta?.hideTab) {
|
|
@@ -270,42 +295,46 @@ defineStore({
|
|
|
270
295
|
this.tabList.splice(oldIndex, 1);
|
|
271
296
|
this.tabList.splice(newIndex, 0, currentTab);
|
|
272
297
|
this.lastDragEndIndex = this.lastDragEndIndex + 1;
|
|
298
|
+
},
|
|
299
|
+
resetState() {
|
|
300
|
+
this.tabList = [];
|
|
301
|
+
this.updateCacheTab();
|
|
273
302
|
}
|
|
274
303
|
}
|
|
275
304
|
});
|
|
276
305
|
function useMenu() {
|
|
277
|
-
const {
|
|
278
|
-
const getCollapsedShowTitle = computed(() => getMenuConf.collapsedShowTitle);
|
|
279
|
-
const getIsSidebarType = computed(() => getMenuConf.type === MenuType.SIDE);
|
|
280
|
-
const getMenuFixed = computed(() => getMenuConf.fixed);
|
|
281
|
-
const getShowMenu = computed(() => getMenuConf.show);
|
|
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);
|
|
282
311
|
const getShowSidebar = computed(() => {
|
|
283
312
|
return unref(getSplit) || unref(getShowMenu) && unref(getMenuMode) !== MenuMode.HORIZONTAL;
|
|
284
313
|
});
|
|
285
|
-
const getMenuHidden = computed(() => getMenuConf.hidden);
|
|
286
|
-
const getMenuTheme = computed(() => getMenuConf.theme);
|
|
287
|
-
const getTrigger = computed(() => getMenuConf.trigger);
|
|
288
|
-
const getCanDrag = computed(() => getMenuConf.canDrag);
|
|
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);
|
|
289
318
|
const getIsMixMode = computed(() => {
|
|
290
319
|
return unref(getMenuMode) === MenuMode.INLINE && unref(getMenuType) === MenuType.MIX;
|
|
291
320
|
});
|
|
292
321
|
const getIsMixSidebar = computed(() => unref(getMenuType) === MenuType.MIX_SIDEBAR);
|
|
293
322
|
const getMenuWidth = computed(() => {
|
|
294
323
|
if (unref(getIsMixMode)) {
|
|
295
|
-
return Number(getMenuConf.menuWidth) - 40;
|
|
324
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 40;
|
|
296
325
|
} else if (unref(getIsMixSidebar)) {
|
|
297
|
-
return Number(getMenuConf.menuWidth) - 10;
|
|
326
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 10;
|
|
298
327
|
} else {
|
|
299
|
-
return Number(getMenuConf.menuWidth);
|
|
328
|
+
return Number(useThemeStore().getMenuConf.menuWidth);
|
|
300
329
|
}
|
|
301
330
|
});
|
|
302
|
-
const getMixSideTrigger = computed(() => getMenuConf.mixSideTrigger);
|
|
303
|
-
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : getMenuConf.menuWidth);
|
|
304
|
-
const getMenuType = computed(() => getMenuConf.type);
|
|
331
|
+
const getMixSideTrigger = computed(() => useThemeStore().getMenuConf.mixSideTrigger);
|
|
332
|
+
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : useThemeStore().getMenuConf.menuWidth);
|
|
333
|
+
const getMenuType = computed(() => useThemeStore().getMenuConf.type);
|
|
305
334
|
const getIsTopMenu = computed(() => unref(getMenuType) === MenuType.TOP_MENU);
|
|
306
|
-
const getMenuMode = computed(() => getMenuConf.mode);
|
|
307
|
-
const getSplit = computed(() => getMenuConf.split);
|
|
308
|
-
const getCollapsed = computed(() => getMenuConf.collapsed);
|
|
335
|
+
const getMenuMode = computed(() => useThemeStore().getMenuConf.mode);
|
|
336
|
+
const getSplit = computed(() => useThemeStore().getMenuConf.split);
|
|
337
|
+
const getCollapsed = computed(() => useThemeStore().getMenuConf.collapsed);
|
|
309
338
|
const getIsHorizontal = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL);
|
|
310
339
|
const setThemeStore = (conf = {}) => setThemeConf(conf);
|
|
311
340
|
const toggleCollapsed = () => setThemeStore({
|
|
@@ -313,7 +342,7 @@ function useMenu() {
|
|
|
313
342
|
collapsed: !unref(getCollapsed)
|
|
314
343
|
}
|
|
315
344
|
});
|
|
316
|
-
const getMiniWidthNumber = computed(() => getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
345
|
+
const getMiniWidthNumber = computed(() => useThemeStore().getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
317
346
|
const getRealWidth = computed(() => {
|
|
318
347
|
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
|
|
319
348
|
});
|
|
@@ -601,14 +630,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
601
630
|
};
|
|
602
631
|
}
|
|
603
632
|
});
|
|
604
|
-
const _export_sfc = (sfc, props) => {
|
|
605
|
-
const target = sfc.__vccOpts || sfc;
|
|
606
|
-
for (const [key, val] of props) {
|
|
607
|
-
target[key] = val;
|
|
608
|
-
}
|
|
609
|
-
return target;
|
|
610
|
-
};
|
|
611
|
-
const RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/radioButton.vue"]]);
|
|
612
633
|
const _hoisted_1$1 = { class: "input-with-dialog" };
|
|
613
634
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
614
635
|
__name: "formInputUseDialog",
|
|
@@ -644,15 +665,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
644
665
|
key: 0,
|
|
645
666
|
class: "i mdi:close-circle",
|
|
646
667
|
onClick: clearProps
|
|
647
|
-
})) : createCommentVNode("
|
|
668
|
+
})) : createCommentVNode("", true)
|
|
648
669
|
]);
|
|
649
670
|
};
|
|
650
671
|
}
|
|
651
672
|
});
|
|
652
|
-
const DtFormInputDialog = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/formInputUseDialog.vue"]]);
|
|
653
673
|
const components = {
|
|
654
674
|
Input,
|
|
655
|
-
InputWithDialog:
|
|
675
|
+
InputWithDialog: _sfc_main$3,
|
|
656
676
|
InputTextArea: Input.TextArea,
|
|
657
677
|
InputSearch: Input.Search,
|
|
658
678
|
InputGroup: Input.Group,
|
|
@@ -661,7 +681,7 @@ const components = {
|
|
|
661
681
|
TreeSelect,
|
|
662
682
|
Radio,
|
|
663
683
|
RadioGroup: Radio.Group,
|
|
664
|
-
RadioButtonGroup,
|
|
684
|
+
RadioButtonGroup: _sfc_main$4,
|
|
665
685
|
Checkbox,
|
|
666
686
|
CheckboxGroup: Checkbox.Group,
|
|
667
687
|
AutoComplete,
|
|
@@ -907,9 +927,15 @@ const _sfc_main$2 = {
|
|
|
907
927
|
_disabled = disabled(unref(getValues).model);
|
|
908
928
|
return _disabled;
|
|
909
929
|
});
|
|
930
|
+
const getSize = () => {
|
|
931
|
+
if (component === "Switch" && unref(getUiSize) === UiSize.LARGE) {
|
|
932
|
+
return "default";
|
|
933
|
+
}
|
|
934
|
+
return unref(getUiSize) === UiSize.MIDDLE ? "default" : unref(getUiSize);
|
|
935
|
+
};
|
|
910
936
|
const itemProps = {
|
|
911
937
|
allowClear: _sProps?.allowClear ?? appConf.ui.form.allowClear,
|
|
912
|
-
size:
|
|
938
|
+
size: getSize(),
|
|
913
939
|
...unref(getComponentProps),
|
|
914
940
|
disabled: unref(getDisable)
|
|
915
941
|
};
|
|
@@ -1046,7 +1072,6 @@ const _sfc_main$2 = {
|
|
|
1046
1072
|
};
|
|
1047
1073
|
}
|
|
1048
1074
|
};
|
|
1049
|
-
const DtFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/FormItem.vue"]]);
|
|
1050
1075
|
const _hoisted_1 = {
|
|
1051
1076
|
key: 0,
|
|
1052
1077
|
className: "preIcon pr-1"
|
|
@@ -1169,18 +1194,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1169
1194
|
icon: withCtx(() => [
|
|
1170
1195
|
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1, null, 512)), [
|
|
1171
1196
|
[_directive_icon, button.preIcon]
|
|
1172
|
-
]) : createCommentVNode("
|
|
1197
|
+
]) : createCommentVNode("", true)
|
|
1173
1198
|
]),
|
|
1174
1199
|
default: withCtx(() => [
|
|
1175
1200
|
createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
|
|
1176
1201
|
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2, null, 512)), [
|
|
1177
1202
|
[_directive_icon, button.postIcon]
|
|
1178
|
-
]) : createCommentVNode("
|
|
1203
|
+
]) : createCommentVNode("", true)
|
|
1179
1204
|
]),
|
|
1180
1205
|
_: 2
|
|
1181
1206
|
}, 1032, ["type", "class", "loading", "disabled", "onClick"])), [
|
|
1182
1207
|
[_directive_auth, button.auth]
|
|
1183
|
-
]) : createCommentVNode("
|
|
1208
|
+
]) : createCommentVNode("", true)
|
|
1184
1209
|
], 64);
|
|
1185
1210
|
}), 256)),
|
|
1186
1211
|
unref(showAdvanceRef) ? (openBlock(), createBlock(_component_AButton, {
|
|
@@ -1190,24 +1215,22 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1190
1215
|
onClick: toggleAdvanced
|
|
1191
1216
|
}, {
|
|
1192
1217
|
default: withCtx(() => [
|
|
1193
|
-
createCommentVNode(" \u6536\u8D77 | \u5C55\u5F00 "),
|
|
1194
1218
|
createElementVNode("span", _hoisted_3, toDisplayString(advancedRef.value ? unref(t)("UI.ADVANCED") : unref(t)("UI.EXPAND")), 1),
|
|
1195
1219
|
createElementVNode("span", {
|
|
1196
1220
|
class: normalizeClass(unref(getAdvanceClass))
|
|
1197
1221
|
}, _hoisted_5, 2)
|
|
1198
1222
|
]),
|
|
1199
1223
|
_: 1
|
|
1200
|
-
})) : createCommentVNode("
|
|
1224
|
+
})) : createCommentVNode("", true)
|
|
1201
1225
|
]),
|
|
1202
1226
|
_: 1
|
|
1203
1227
|
}, 8, ["style"])
|
|
1204
1228
|
]),
|
|
1205
1229
|
_: 1
|
|
1206
|
-
}, 16)) : createCommentVNode("
|
|
1230
|
+
}, 16)) : createCommentVNode("", true);
|
|
1207
1231
|
};
|
|
1208
1232
|
}
|
|
1209
1233
|
});
|
|
1210
|
-
const DtFormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/FormButtons.vue"]]);
|
|
1211
1234
|
const SEARCH_BTN_NAME = "UI.SEARCH";
|
|
1212
1235
|
const RESET_BTN_NAME = "UI.RESET";
|
|
1213
1236
|
const SEARCH_BTNS = [
|
|
@@ -1333,7 +1356,10 @@ function useFormEvents({
|
|
|
1333
1356
|
});
|
|
1334
1357
|
}
|
|
1335
1358
|
async function validateFields(nameList) {
|
|
1336
|
-
|
|
1359
|
+
try {
|
|
1360
|
+
await unref(formElRef)?.validateFields(nameList);
|
|
1361
|
+
} catch (err) {
|
|
1362
|
+
}
|
|
1337
1363
|
}
|
|
1338
1364
|
function setFormValues(values) {
|
|
1339
1365
|
if (!values || !Object.keys(values).length) {
|
|
@@ -1617,10 +1643,7 @@ const BasicProps = {
|
|
|
1617
1643
|
loading: {
|
|
1618
1644
|
type: Object,
|
|
1619
1645
|
default: () => {
|
|
1620
|
-
return {
|
|
1621
|
-
onSearch: ref(false),
|
|
1622
|
-
onReset: ref(false)
|
|
1623
|
-
};
|
|
1646
|
+
return {};
|
|
1624
1647
|
}
|
|
1625
1648
|
},
|
|
1626
1649
|
onSearch: {
|
|
@@ -1831,7 +1854,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1831
1854
|
} }), {
|
|
1832
1855
|
default: withCtx(() => [
|
|
1833
1856
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
|
|
1834
|
-
return openBlock(), createBlock(unref(
|
|
1857
|
+
return openBlock(), createBlock(unref(_sfc_main$2), {
|
|
1835
1858
|
key: schema.name,
|
|
1836
1859
|
schema,
|
|
1837
1860
|
formProps: unref(getProps),
|
|
@@ -1850,7 +1873,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1850
1873
|
})
|
|
1851
1874
|
]), 1032, ["schema", "formProps", "formModel", "defaultValues"]);
|
|
1852
1875
|
}), 128)),
|
|
1853
|
-
unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(
|
|
1876
|
+
unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("", true)
|
|
1854
1877
|
]),
|
|
1855
1878
|
_: 3
|
|
1856
1879
|
}, 16)
|
|
@@ -1860,7 +1883,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1860
1883
|
};
|
|
1861
1884
|
}
|
|
1862
1885
|
});
|
|
1863
|
-
const Forms = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/index.vue"]]);
|
|
1864
1886
|
function useForm(props) {
|
|
1865
1887
|
const formRef = ref(null);
|
|
1866
1888
|
const loadedRef = ref(false);
|
|
@@ -1937,7 +1959,7 @@ const withInstall = (comp) => {
|
|
|
1937
1959
|
};
|
|
1938
1960
|
return comp;
|
|
1939
1961
|
};
|
|
1940
|
-
const DtForm = withInstall(
|
|
1962
|
+
const DtForm = withInstall(_sfc_main);
|
|
1941
1963
|
export {
|
|
1942
1964
|
DtForm,
|
|
1943
1965
|
useForm
|
|
@@ -79,10 +79,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
79
79
|
"onHandle-method"?: (...args: any[]) => any;
|
|
80
80
|
}, {
|
|
81
81
|
mode: "search" | "dialog";
|
|
82
|
-
show: boolean;
|
|
83
|
-
showAdvancedButton: boolean;
|
|
84
82
|
minShowColumn: number;
|
|
85
|
-
|
|
83
|
+
showAdvancedButton: boolean;
|
|
84
|
+
show: boolean;
|
|
86
85
|
isAdvanced: boolean;
|
|
86
|
+
buttonList: ButtonProps[];
|
|
87
87
|
}>;
|
|
88
88
|
export default _sfc_main;
|
|
@@ -25,7 +25,7 @@ declare const _sfc_main: {
|
|
|
25
25
|
default: () => {};
|
|
26
26
|
};
|
|
27
27
|
layout: {
|
|
28
|
-
type: PropType<"vertical" | "
|
|
28
|
+
type: PropType<"vertical" | "inline" | "horizontal">;
|
|
29
29
|
default: string;
|
|
30
30
|
};
|
|
31
31
|
labelWidth: {
|
|
@@ -50,8 +50,8 @@ declare const _sfc_main: {
|
|
|
50
50
|
};
|
|
51
51
|
rowProps: {
|
|
52
52
|
type: PropType<Partial<import("vue").ExtractPropTypes<{
|
|
53
|
-
align: PropType<"
|
|
54
|
-
justify: PropType<"
|
|
53
|
+
align: PropType<"stretch" | "bottom" | "top" | "middle">;
|
|
54
|
+
justify: PropType<"space-around" | "space-between" | "center" | "end" | "start">;
|
|
55
55
|
prefixCls: StringConstructor;
|
|
56
56
|
gutter: {
|
|
57
57
|
type: PropType<import("ant-design-vue/lib/grid/Row").Gutter | [import("ant-design-vue/lib/grid/Row").Gutter, import("ant-design-vue/lib/grid/Row").Gutter]>;
|
|
@@ -69,7 +69,7 @@ declare const _sfc_main: {
|
|
|
69
69
|
default: () => {};
|
|
70
70
|
};
|
|
71
71
|
size: {
|
|
72
|
-
type: PropType<"
|
|
72
|
+
type: PropType<"middle" | "small" | "large">;
|
|
73
73
|
default: string;
|
|
74
74
|
};
|
|
75
75
|
disabled: {
|
|
@@ -112,10 +112,7 @@ declare const _sfc_main: {
|
|
|
112
112
|
type: PropType<{
|
|
113
113
|
[key: string]: Ref<boolean>;
|
|
114
114
|
}>;
|
|
115
|
-
default: () => {
|
|
116
|
-
onSearch: Ref<boolean>;
|
|
117
|
-
onReset: Ref<boolean>;
|
|
118
|
-
};
|
|
115
|
+
default: () => {};
|
|
119
116
|
};
|
|
120
117
|
onSearch: {
|
|
121
118
|
type: PropType<(params: Recordable<any>) => void>;
|
|
@@ -143,7 +143,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
143
143
|
'onUpdate:value': import("vue").PropType<(val: string) => void>;
|
|
144
144
|
valueModifiers: ObjectConstructor;
|
|
145
145
|
hidden: BooleanConstructor;
|
|
146
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
|
146
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "value" | "disabled" | "allowClear" | "loading" | "hidden" | "readonly" | "autofocus" | "lazy" | "bordered">;
|
|
147
147
|
$attrs: {
|
|
148
148
|
[x: string]: unknown;
|
|
149
149
|
};
|
|
@@ -457,7 +457,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
457
457
|
inputPrefixCls: StringConstructor;
|
|
458
458
|
enterButton: import("vue-types").VueTypeValidableDef<any>;
|
|
459
459
|
onSearch: {
|
|
460
|
-
type: import("vue").PropType<(value: string, event?:
|
|
460
|
+
type: import("vue").PropType<(value: string, event?: import("ant-design-vue/lib/_util/EventInterface").ChangeEvent | MouseEvent | KeyboardEvent) => void>;
|
|
461
461
|
};
|
|
462
462
|
id: StringConstructor;
|
|
463
463
|
prefixCls: StringConstructor;
|
|
@@ -529,7 +529,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
529
529
|
inputPrefixCls: StringConstructor;
|
|
530
530
|
enterButton: import("vue-types").VueTypeValidableDef<any>;
|
|
531
531
|
onSearch: {
|
|
532
|
-
type: import("vue").PropType<(value: string, event?:
|
|
532
|
+
type: import("vue").PropType<(value: string, event?: import("ant-design-vue/lib/_util/EventInterface").ChangeEvent | MouseEvent | KeyboardEvent) => void>;
|
|
533
533
|
};
|
|
534
534
|
id: StringConstructor;
|
|
535
535
|
prefixCls: StringConstructor;
|
|
@@ -1014,7 +1014,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1014
1014
|
onMousedown: {
|
|
1015
1015
|
type: import("vue").PropType<(event: MouseEvent) => void>;
|
|
1016
1016
|
};
|
|
1017
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
|
1017
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "disabled" | "loading" | "block" | "htmlType" | "ghost" | "danger">;
|
|
1018
1018
|
$attrs: {
|
|
1019
1019
|
[x: string]: unknown;
|
|
1020
1020
|
};
|
|
@@ -96,7 +96,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
96
96
|
'onUpdate:value': import("vue").PropType<(val: string) => void>;
|
|
97
97
|
valueModifiers: ObjectConstructor;
|
|
98
98
|
hidden: BooleanConstructor;
|
|
99
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
|
99
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "value" | "disabled" | "allowClear" | "loading" | "hidden" | "readonly" | "autofocus" | "lazy" | "bordered">;
|
|
100
100
|
$attrs: {
|
|
101
101
|
[x: string]: unknown;
|
|
102
102
|
};
|
|
@@ -410,7 +410,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
410
410
|
inputPrefixCls: StringConstructor;
|
|
411
411
|
enterButton: import("vue-types").VueTypeValidableDef<any>;
|
|
412
412
|
onSearch: {
|
|
413
|
-
type: import("vue").PropType<(value: string, event?:
|
|
413
|
+
type: import("vue").PropType<(value: string, event?: import("ant-design-vue/lib/_util/EventInterface").ChangeEvent | MouseEvent | KeyboardEvent) => void>;
|
|
414
414
|
};
|
|
415
415
|
id: StringConstructor;
|
|
416
416
|
prefixCls: StringConstructor;
|
|
@@ -482,7 +482,7 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
|
|
|
482
482
|
inputPrefixCls: StringConstructor;
|
|
483
483
|
enterButton: import("vue-types").VueTypeValidableDef<any>;
|
|
484
484
|
onSearch: {
|
|
485
|
-
type: import("vue").PropType<(value: string, event?:
|
|
485
|
+
type: import("vue").PropType<(value: string, event?: import("ant-design-vue/lib/_util/EventInterface").ChangeEvent | MouseEvent | KeyboardEvent) => void>;
|
|
486
486
|
};
|
|
487
487
|
id: StringConstructor;
|
|
488
488
|
prefixCls: StringConstructor;
|
|
@@ -18,7 +18,7 @@ export declare function useFormEvents({ emits, getSchema, formModel, defaultValu
|
|
|
18
18
|
clearValidate: (name?: string | string[]) => Promise<void>;
|
|
19
19
|
resetForms: () => void;
|
|
20
20
|
removeFormByName: (names: string | string[]) => void;
|
|
21
|
-
validateFields: (nameList: (string | number)[]) => Promise<
|
|
21
|
+
validateFields: (nameList: (string | number)[]) => Promise<void>;
|
|
22
22
|
setFormValues: (values: Recordable | null) => Promise<void>;
|
|
23
23
|
validate: (nameList: (string | number)[]) => Promise<any>;
|
|
24
24
|
appendFormItems: (schema: FormSchema[], prefixName?: string, first?: boolean) => void;
|