@dt-frames/ui 2.0.9 → 2.0.10
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 +69 -77
- package/es/components/curd/index.less +2 -0
- package/es/components/curd/src/components/Curd.d.ts +16 -8
- package/es/components/curd/src/hooks/useCurd.d.ts +1 -1
- package/es/components/curd/src/props.d.ts +0 -1
- package/es/components/form/index.js +50 -21
- 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/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 +3 -3
- package/es/components/form/src/types/items.type.d.ts +12 -5
- package/es/components/modal/index.js +22 -2
- package/es/components/modal/src/components/Modal.d.ts +1 -1
- package/es/components/modal/src/components/ModalFooter.d.ts +10 -0
- package/es/components/modal/src/index.d.ts +14 -4
- package/es/components/modal/src/props.d.ts +2 -1
- package/es/components/table/index.js +33 -54
- package/es/components/table/index.less +3 -3
- package/es/components/table/src/components/tableSetting/DownloadCtrl.d.ts +15 -5
- package/es/theme/index.js +144 -88
- 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/index.d.ts +10 -10
- package/es/theme/transition.less +105 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { toRaw, unref, computed, getCurrentInstance, reactive, readonly, watchEffect, nextTick, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString,
|
|
1
|
+
import { toRaw, unref, computed, getCurrentInstance, reactive, readonly, watchEffect, nextTick, defineComponent, useAttrs, openBlock, createBlock, mergeProps, isRef, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, toRefs, createVNode, isVNode, ref, watch, resolveDirective, normalizeProps, normalizeStyle, withDirectives, normalizeClass, createCommentVNode, createElementVNode, onMounted, withKeys, createSlots, renderSlot, guardReactiveProps, onUnmounted, inject, h, provide, onBeforeUnmount, resolveDynamicComponent } from "vue";
|
|
2
2
|
import { RadioButton, RadioGroup, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1, Tooltip as Tooltip$1, Spin } from "ant-design-vue/es";
|
|
3
3
|
import "ant-design-vue/es/form/style";
|
|
4
4
|
import "ant-design-vue/es/row/style";
|
|
5
|
-
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString,
|
|
6
|
-
import { cloneDeep,
|
|
5
|
+
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, useSlots, isArray, isFunction, error, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn, useApp, off, on, windowResizeFn, useMessage } from "@dt-frames/core";
|
|
6
|
+
import { cloneDeep, merge, isEqual, upperFirst, uniqBy, set, omit } 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 } from "ant-design-vue";
|
|
8
8
|
import { defineStore } from "pinia";
|
|
9
9
|
import "ant-design-vue/es/radio/style";
|
|
@@ -498,18 +498,20 @@ function useLabelWidth(schemaItemRef, propsRef) {
|
|
|
498
498
|
layout = appConf.ui.form.layout
|
|
499
499
|
} = unref(propsRef);
|
|
500
500
|
let width = (unref(getIsZH) ? labelWidth ?? gLabelWidth : enLabelWidth ?? gEnLabelWidth) ?? labelWidth ?? gLabelWidth ?? 0;
|
|
501
|
-
const labelcol = {
|
|
502
|
-
const wrapcol = {
|
|
501
|
+
const labelcol = merge({}, glabelCol, labelCol);
|
|
502
|
+
const wrapcol = merge({}, gwrapperCol, wrapperCol);
|
|
503
503
|
width = isNumber(width) ? `${width}px` : width;
|
|
504
504
|
return {
|
|
505
|
-
labelCol:
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
505
|
+
labelCol: merge(
|
|
506
|
+
{},
|
|
507
|
+
{ style: { width } },
|
|
508
|
+
labelcol
|
|
509
|
+
),
|
|
510
|
+
wrapperCol: merge(
|
|
511
|
+
{},
|
|
512
|
+
{ style: { width: layout === "vertical" ? "100%" : `calc(100% - ${width})` } },
|
|
513
|
+
wrapcol
|
|
514
|
+
)
|
|
513
515
|
};
|
|
514
516
|
});
|
|
515
517
|
}
|
|
@@ -582,7 +584,7 @@ function useFormValue(props, key = "value", changeEvent = "change", emitData) {
|
|
|
582
584
|
});
|
|
583
585
|
return [state, setState, defaultState];
|
|
584
586
|
}
|
|
585
|
-
const _sfc_main$
|
|
587
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
586
588
|
__name: "radioButton",
|
|
587
589
|
props: {
|
|
588
590
|
value: {
|
|
@@ -633,49 +635,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
633
635
|
};
|
|
634
636
|
}
|
|
635
637
|
});
|
|
636
|
-
const _hoisted_1$2 = { class: "input-with-dialog" };
|
|
637
|
-
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
638
|
-
__name: "formInputUseDialog",
|
|
639
|
-
setup(__props) {
|
|
640
|
-
const { t } = useI18n("UI");
|
|
641
|
-
const attrs = useAttrs();
|
|
642
|
-
const bindProps = computed(() => {
|
|
643
|
-
return {
|
|
644
|
-
...omit(attrs, [
|
|
645
|
-
"formValues"
|
|
646
|
-
]),
|
|
647
|
-
disabled: true
|
|
648
|
-
};
|
|
649
|
-
});
|
|
650
|
-
function onClickInput() {
|
|
651
|
-
const { model, schema = {} } = attrs.formValues;
|
|
652
|
-
if (!schema.openDialog || !isFunction(schema.openDialog)) {
|
|
653
|
-
error(t("MUSE_FUNCTION"));
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
schema.openDialog(model);
|
|
657
|
-
}
|
|
658
|
-
function clearProps() {
|
|
659
|
-
const { model, schema = {} } = attrs.formValues;
|
|
660
|
-
[...schema.linkProps, schema.name].forEach((it) => model[it] = null);
|
|
661
|
-
}
|
|
662
|
-
return (_ctx, _cache) => {
|
|
663
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
664
|
-
createElementVNode("div", { onClick: onClickInput }, [
|
|
665
|
-
createVNode(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
|
|
666
|
-
]),
|
|
667
|
-
unref(attrs).formValues?.schema?.linkProps?.length ? (openBlock(), createElementBlock("i", {
|
|
668
|
-
key: 0,
|
|
669
|
-
class: "i mdi:close-circle",
|
|
670
|
-
onClick: clearProps
|
|
671
|
-
})) : createCommentVNode("", true)
|
|
672
|
-
]);
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
});
|
|
676
638
|
const components = {
|
|
677
639
|
Input,
|
|
678
|
-
InputWithDialog: _sfc_main$c,
|
|
679
640
|
InputTextArea: Input.TextArea,
|
|
680
641
|
InputSearch: Input.Search,
|
|
681
642
|
InputGroup: Input.Group,
|
|
@@ -684,7 +645,7 @@ const components = {
|
|
|
684
645
|
TreeSelect,
|
|
685
646
|
Radio,
|
|
686
647
|
RadioGroup: Radio.Group,
|
|
687
|
-
RadioButtonGroup: _sfc_main$
|
|
648
|
+
RadioButtonGroup: _sfc_main$c,
|
|
688
649
|
Checkbox,
|
|
689
650
|
CheckboxGroup: Checkbox.Group,
|
|
690
651
|
AutoComplete,
|
|
@@ -820,7 +781,7 @@ const _sfc_main$b = {
|
|
|
820
781
|
const getContent = () => {
|
|
821
782
|
const value = unref(getValues);
|
|
822
783
|
let _con = slot ? getSlot(slots, slot, value.model) : render ? render(value.model) : renderFormItem();
|
|
823
|
-
return component === "InputGroup"
|
|
784
|
+
return component === "InputGroup" ? createVNode(FormItem, {
|
|
824
785
|
"class": "m-0"
|
|
825
786
|
}, _isSlot$1(_con) ? _con : {
|
|
826
787
|
default: () => [_con]
|
|
@@ -931,10 +892,13 @@ const _sfc_main$b = {
|
|
|
931
892
|
return _disabled;
|
|
932
893
|
});
|
|
933
894
|
const getSize = () => {
|
|
934
|
-
|
|
895
|
+
const {
|
|
896
|
+
size = unref(getUiSize)
|
|
897
|
+
} = props.formProps;
|
|
898
|
+
if (component === "Switch" && size === UiSize.LARGE) {
|
|
935
899
|
return "default";
|
|
936
900
|
}
|
|
937
|
-
return
|
|
901
|
+
return size === UiSize.MIDDLE ? "default" : size;
|
|
938
902
|
};
|
|
939
903
|
const itemProps = {
|
|
940
904
|
allowClear: _sProps?.allowClear ?? appConf.ui.form.allowClear,
|
|
@@ -1049,7 +1013,7 @@ const _sfc_main$b = {
|
|
|
1049
1013
|
let _colProps = colProps || gColProps || (mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan);
|
|
1050
1014
|
const values = unref(getValues);
|
|
1051
1015
|
if (!component) {
|
|
1052
|
-
if (!render && !renderCol && !slot) {
|
|
1016
|
+
if (!render && !renderCol && !slot && !colSlot) {
|
|
1053
1017
|
error(t("NEED_RENDER"));
|
|
1054
1018
|
return;
|
|
1055
1019
|
}
|
|
@@ -1114,6 +1078,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1114
1078
|
isAdvanced: {
|
|
1115
1079
|
type: Boolean,
|
|
1116
1080
|
default: true
|
|
1081
|
+
},
|
|
1082
|
+
colspan: {
|
|
1083
|
+
type: Object
|
|
1117
1084
|
}
|
|
1118
1085
|
},
|
|
1119
1086
|
emits: ["handle-method"],
|
|
@@ -1133,6 +1100,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1133
1100
|
Object.assign(style, {
|
|
1134
1101
|
display: "inline-block"
|
|
1135
1102
|
});
|
|
1103
|
+
return { style };
|
|
1104
|
+
} else if (props.mode === null) {
|
|
1105
|
+
Object.assign(style, {
|
|
1106
|
+
display: "flex",
|
|
1107
|
+
justifyContent: "center",
|
|
1108
|
+
marginBottom: "20px"
|
|
1109
|
+
});
|
|
1110
|
+
return {
|
|
1111
|
+
style,
|
|
1112
|
+
span: 24
|
|
1113
|
+
};
|
|
1136
1114
|
}
|
|
1137
1115
|
return { style };
|
|
1138
1116
|
});
|
|
@@ -1155,7 +1133,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1155
1133
|
}
|
|
1156
1134
|
}
|
|
1157
1135
|
watch(() => props.isAdvanced, (v) => {
|
|
1158
|
-
if (v) {
|
|
1136
|
+
if (v || props.mode !== "search") {
|
|
1159
1137
|
nextTick(() => toggleAdvanced());
|
|
1160
1138
|
}
|
|
1161
1139
|
}, {
|
|
@@ -1462,14 +1440,12 @@ function useFormValues({
|
|
|
1462
1440
|
function initDefault() {
|
|
1463
1441
|
const schema = unref(getSchema), obj = {};
|
|
1464
1442
|
schema.forEach((item) => {
|
|
1465
|
-
const { props = {}, name, component, defaultValue: gDefaultValue
|
|
1443
|
+
const { props = {}, name, component, defaultValue: gDefaultValue } = item;
|
|
1466
1444
|
const { defaultValue: itemDefaultValue, mode, format, treeCheckable } = isFunction(props) ? props(formModel) : props;
|
|
1467
1445
|
if (!name)
|
|
1468
1446
|
return;
|
|
1469
1447
|
let names = [];
|
|
1470
|
-
if (
|
|
1471
|
-
names = [name, ...extraName];
|
|
1472
|
-
} else if (isArray(name)) {
|
|
1448
|
+
if (isArray(name)) {
|
|
1473
1449
|
names = name;
|
|
1474
1450
|
} else {
|
|
1475
1451
|
names = [name];
|
|
@@ -1601,8 +1577,7 @@ const BasicProps = {
|
|
|
1601
1577
|
default: () => ({})
|
|
1602
1578
|
},
|
|
1603
1579
|
size: {
|
|
1604
|
-
type: String
|
|
1605
|
-
default: "small"
|
|
1580
|
+
type: String
|
|
1606
1581
|
},
|
|
1607
1582
|
disabled: {
|
|
1608
1583
|
type: Boolean,
|
|
@@ -1720,7 +1695,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1720
1695
|
formModel[key] = value;
|
|
1721
1696
|
const { validateTrigger } = unref(getBindValue);
|
|
1722
1697
|
if (!validateTrigger || validateTrigger === "change") {
|
|
1723
|
-
validateFields([key])
|
|
1698
|
+
validateFields([key]).catch((err) => {
|
|
1699
|
+
});
|
|
1724
1700
|
}
|
|
1725
1701
|
}
|
|
1726
1702
|
function handleEnterPress() {
|
|
@@ -1790,8 +1766,19 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1790
1766
|
});
|
|
1791
1767
|
}
|
|
1792
1768
|
let colspan = mode === "search" ? getAppConf.ui.form.searchColspan : getAppConf.ui.form.dialogColspan;
|
|
1769
|
+
if (mode !== "search") {
|
|
1770
|
+
return {
|
|
1771
|
+
colspan,
|
|
1772
|
+
...{
|
|
1773
|
+
mode,
|
|
1774
|
+
showAdvancedButton: false,
|
|
1775
|
+
isAdvanced: false,
|
|
1776
|
+
buttonList
|
|
1777
|
+
}
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1793
1780
|
return {
|
|
1794
|
-
|
|
1781
|
+
colspan,
|
|
1795
1782
|
...{
|
|
1796
1783
|
showAdvancedButton,
|
|
1797
1784
|
buttonList
|
|
@@ -1953,13 +1940,6 @@ function useForm(props) {
|
|
|
1953
1940
|
};
|
|
1954
1941
|
return [register, methods];
|
|
1955
1942
|
}
|
|
1956
|
-
const withInstall = (comp) => {
|
|
1957
|
-
comp.install = (app) => {
|
|
1958
|
-
app.component(comp.name, comp);
|
|
1959
|
-
};
|
|
1960
|
-
return comp;
|
|
1961
|
-
};
|
|
1962
|
-
const DtForm = withInstall(_sfc_main$9);
|
|
1963
1943
|
const orgDialogProp = reactive({});
|
|
1964
1944
|
const cbTransfer = reactive({});
|
|
1965
1945
|
const dataTransfer = reactive({});
|
|
@@ -2051,6 +2031,12 @@ function useModal(props, setModalData) {
|
|
|
2051
2031
|
return;
|
|
2052
2032
|
nextTick(() => {
|
|
2053
2033
|
setModalData(data);
|
|
2034
|
+
if (!data)
|
|
2035
|
+
return;
|
|
2036
|
+
if (props?.title && isFunction(props?.title)) {
|
|
2037
|
+
let title = props.title(data);
|
|
2038
|
+
methods.setModalProps({ title });
|
|
2039
|
+
}
|
|
2054
2040
|
});
|
|
2055
2041
|
});
|
|
2056
2042
|
const methods = {
|
|
@@ -2610,6 +2596,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2610
2596
|
};
|
|
2611
2597
|
}
|
|
2612
2598
|
});
|
|
2599
|
+
const withInstall = (comp) => {
|
|
2600
|
+
comp.install = (app) => {
|
|
2601
|
+
app.component(comp.name, comp);
|
|
2602
|
+
};
|
|
2603
|
+
return comp;
|
|
2604
|
+
};
|
|
2613
2605
|
const DtScrollContainer = withInstall(_sfc_main$5);
|
|
2614
2606
|
withInstall(_sfc_main$4);
|
|
2615
2607
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
@@ -3085,7 +3077,7 @@ function useCurd(curdOpt) {
|
|
|
3085
3077
|
"title": title,
|
|
3086
3078
|
"onRegister": register
|
|
3087
3079
|
}), {
|
|
3088
|
-
default: () => [createVNode(
|
|
3080
|
+
default: () => [createVNode(_sfc_main$9, {
|
|
3089
3081
|
"onRegister": registerForm
|
|
3090
3082
|
}, null)]
|
|
3091
3083
|
})]));
|
|
@@ -82,7 +82,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
82
82
|
};
|
|
83
83
|
size: {
|
|
84
84
|
type: import("vue").PropType<"small" | "middle" | "large">;
|
|
85
|
-
default: string;
|
|
86
85
|
};
|
|
87
86
|
disabled: {
|
|
88
87
|
type: BooleanConstructor;
|
|
@@ -215,7 +214,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
215
214
|
default: boolean;
|
|
216
215
|
};
|
|
217
216
|
title: {
|
|
218
|
-
type: import("vue").PropType<String | import("vue").ComputedRef<String
|
|
217
|
+
type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
|
|
219
218
|
};
|
|
220
219
|
loading: {
|
|
221
220
|
type: BooleanConstructor;
|
|
@@ -316,7 +315,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
316
315
|
default: boolean;
|
|
317
316
|
};
|
|
318
317
|
title: {
|
|
319
|
-
type: import("vue").PropType<String | import("vue").ComputedRef<String
|
|
318
|
+
type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
|
|
320
319
|
};
|
|
321
320
|
loading: {
|
|
322
321
|
type: BooleanConstructor;
|
|
@@ -425,7 +424,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
425
424
|
default: boolean;
|
|
426
425
|
};
|
|
427
426
|
title: {
|
|
428
|
-
type: import("vue").PropType<String | import("vue").ComputedRef<String
|
|
427
|
+
type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
|
|
429
428
|
};
|
|
430
429
|
loading: {
|
|
431
430
|
type: BooleanConstructor;
|
|
@@ -529,7 +528,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
529
528
|
default: boolean;
|
|
530
529
|
};
|
|
531
530
|
title: {
|
|
532
|
-
type: import("vue").PropType<String | import("vue").ComputedRef<String
|
|
531
|
+
type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
|
|
533
532
|
};
|
|
534
533
|
loading: {
|
|
535
534
|
type: BooleanConstructor;
|
|
@@ -839,6 +838,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
839
838
|
type: BooleanConstructor;
|
|
840
839
|
default: boolean;
|
|
841
840
|
};
|
|
841
|
+
colspan: {
|
|
842
|
+
type: ObjectConstructor;
|
|
843
|
+
};
|
|
842
844
|
}, {
|
|
843
845
|
props: any;
|
|
844
846
|
emits: (event: "handle-method", ...args: any[]) => void;
|
|
@@ -857,6 +859,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
857
859
|
showAdvanceRef: import("vue").ComputedRef<boolean>;
|
|
858
860
|
colOpt: import("vue").ComputedRef<{
|
|
859
861
|
style: import("@dt-frames/core").Recordable<any>;
|
|
862
|
+
span?: undefined;
|
|
863
|
+
} | {
|
|
864
|
+
style: import("@dt-frames/core").Recordable<any>;
|
|
865
|
+
span: number;
|
|
860
866
|
}>;
|
|
861
867
|
getAdvanceClass: import("vue").ComputedRef<(string | {
|
|
862
868
|
'basic-arrow--active': boolean;
|
|
@@ -888,6 +894,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
888
894
|
type: BooleanConstructor;
|
|
889
895
|
default: boolean;
|
|
890
896
|
};
|
|
897
|
+
colspan: {
|
|
898
|
+
type: ObjectConstructor;
|
|
899
|
+
};
|
|
891
900
|
}>> & {
|
|
892
901
|
"onHandle-method"?: (...args: any[]) => any;
|
|
893
902
|
}, {
|
|
@@ -960,7 +969,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
960
969
|
default: boolean;
|
|
961
970
|
};
|
|
962
971
|
title: {
|
|
963
|
-
type: import("vue").PropType<String | import("vue").ComputedRef<String
|
|
972
|
+
type: import("vue").PropType<String | import("vue").ComputedRef<String> | ((data: import("@dt-frames/core").Recordable<any>) => String)>;
|
|
964
973
|
};
|
|
965
974
|
loading: {
|
|
966
975
|
type: BooleanConstructor;
|
|
@@ -1029,6 +1038,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1029
1038
|
loading: boolean;
|
|
1030
1039
|
visible: boolean;
|
|
1031
1040
|
mask: boolean;
|
|
1041
|
+
keyboard: boolean;
|
|
1032
1042
|
closable: boolean;
|
|
1033
1043
|
destroyOnClose: boolean;
|
|
1034
1044
|
scrollTop: boolean;
|
|
@@ -1041,7 +1051,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1041
1051
|
showOkBtn: boolean;
|
|
1042
1052
|
showCancelBtn: boolean;
|
|
1043
1053
|
maskClosable: boolean;
|
|
1044
|
-
keyboard: boolean;
|
|
1045
1054
|
}>;
|
|
1046
1055
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1047
1056
|
title: {
|
|
@@ -1127,7 +1136,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1127
1136
|
};
|
|
1128
1137
|
size: {
|
|
1129
1138
|
type: import("vue").PropType<"small" | "middle" | "large">;
|
|
1130
|
-
default: string;
|
|
1131
1139
|
};
|
|
1132
1140
|
disabled: {
|
|
1133
1141
|
type: BooleanConstructor;
|
|
@@ -46,7 +46,7 @@ export declare function useCurd(curdOpt: Partial<ExtractPropTypes<typeof basicPr
|
|
|
46
46
|
default: boolean;
|
|
47
47
|
};
|
|
48
48
|
title: {
|
|
49
|
-
type: PropType<String | import("vue").ComputedRef<String
|
|
49
|
+
type: PropType<String | import("vue").ComputedRef<String> | ((data: Recordable<any>) => String)>;
|
|
50
50
|
};
|
|
51
51
|
loading: {
|
|
52
52
|
type: BooleanConstructor;
|
|
@@ -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, toRefs, createVNode, isVNode, ref, watch, resolveDirective, normalizeProps, normalizeStyle, withDirectives, normalizeClass, createCommentVNode, createElementVNode, onMounted, withKeys, createSlots, renderSlot, guardReactiveProps } from "vue";
|
|
5
5
|
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, isNumber, useI18n, isString, useSlots, isArray, isFunction, error, isBoolean, isNull, dispatchResize, isObject, isNullAndUnDef, isEmpty, useTimeoutFn } from "@dt-frames/core";
|
|
6
|
-
import { cloneDeep, isEqual, upperFirst, uniqBy, set } from "lodash-es";
|
|
6
|
+
import { cloneDeep, merge, isEqual, 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";
|
|
@@ -495,18 +495,20 @@ function useLabelWidth(schemaItemRef, propsRef) {
|
|
|
495
495
|
layout = appConf.ui.form.layout
|
|
496
496
|
} = unref(propsRef);
|
|
497
497
|
let width = (unref(getIsZH) ? labelWidth ?? gLabelWidth : enLabelWidth ?? gEnLabelWidth) ?? labelWidth ?? gLabelWidth ?? 0;
|
|
498
|
-
const labelcol = {
|
|
499
|
-
const wrapcol = {
|
|
498
|
+
const labelcol = merge({}, glabelCol, labelCol);
|
|
499
|
+
const wrapcol = merge({}, gwrapperCol, wrapperCol);
|
|
500
500
|
width = isNumber(width) ? `${width}px` : width;
|
|
501
501
|
return {
|
|
502
|
-
labelCol:
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
502
|
+
labelCol: merge(
|
|
503
|
+
{},
|
|
504
|
+
{ style: { width } },
|
|
505
|
+
labelcol
|
|
506
|
+
),
|
|
507
|
+
wrapperCol: merge(
|
|
508
|
+
{},
|
|
509
|
+
{ style: { width: layout === "vertical" ? "100%" : `calc(100% - ${width})` } },
|
|
510
|
+
wrapcol
|
|
511
|
+
)
|
|
510
512
|
};
|
|
511
513
|
});
|
|
512
514
|
}
|
|
@@ -887,10 +889,13 @@ const _sfc_main$2 = {
|
|
|
887
889
|
return _disabled;
|
|
888
890
|
});
|
|
889
891
|
const getSize = () => {
|
|
890
|
-
|
|
892
|
+
const {
|
|
893
|
+
size = unref(getUiSize)
|
|
894
|
+
} = props.formProps;
|
|
895
|
+
if (component === "Switch" && size === UiSize.LARGE) {
|
|
891
896
|
return "default";
|
|
892
897
|
}
|
|
893
|
-
return
|
|
898
|
+
return size === UiSize.MIDDLE ? "default" : size;
|
|
894
899
|
};
|
|
895
900
|
const itemProps = {
|
|
896
901
|
allowClear: _sProps?.allowClear ?? appConf.ui.form.allowClear,
|
|
@@ -1005,7 +1010,7 @@ const _sfc_main$2 = {
|
|
|
1005
1010
|
let _colProps = colProps || gColProps || (mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan);
|
|
1006
1011
|
const values = unref(getValues);
|
|
1007
1012
|
if (!component) {
|
|
1008
|
-
if (!render && !renderCol && !slot) {
|
|
1013
|
+
if (!render && !renderCol && !slot && !colSlot) {
|
|
1009
1014
|
error(t("NEED_RENDER"));
|
|
1010
1015
|
return;
|
|
1011
1016
|
}
|
|
@@ -1070,6 +1075,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1070
1075
|
isAdvanced: {
|
|
1071
1076
|
type: Boolean,
|
|
1072
1077
|
default: true
|
|
1078
|
+
},
|
|
1079
|
+
colspan: {
|
|
1080
|
+
type: Object
|
|
1073
1081
|
}
|
|
1074
1082
|
},
|
|
1075
1083
|
emits: ["handle-method"],
|
|
@@ -1089,6 +1097,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1089
1097
|
Object.assign(style, {
|
|
1090
1098
|
display: "inline-block"
|
|
1091
1099
|
});
|
|
1100
|
+
return { style };
|
|
1101
|
+
} else if (props.mode === null) {
|
|
1102
|
+
Object.assign(style, {
|
|
1103
|
+
display: "flex",
|
|
1104
|
+
justifyContent: "center",
|
|
1105
|
+
marginBottom: "20px"
|
|
1106
|
+
});
|
|
1107
|
+
return {
|
|
1108
|
+
style,
|
|
1109
|
+
span: 24
|
|
1110
|
+
};
|
|
1092
1111
|
}
|
|
1093
1112
|
return { style };
|
|
1094
1113
|
});
|
|
@@ -1111,8 +1130,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1111
1130
|
}
|
|
1112
1131
|
}
|
|
1113
1132
|
watch(() => props.isAdvanced, (v) => {
|
|
1114
|
-
if (v) {
|
|
1115
|
-
|
|
1133
|
+
if (v || props.mode !== "search") {
|
|
1134
|
+
requestAnimationFrame(toggleAdvanced);
|
|
1116
1135
|
}
|
|
1117
1136
|
}, {
|
|
1118
1137
|
immediate: true
|
|
@@ -1418,7 +1437,7 @@ function useFormValues({
|
|
|
1418
1437
|
function initDefault() {
|
|
1419
1438
|
const schema = unref(getSchema), obj = {};
|
|
1420
1439
|
schema.forEach((item) => {
|
|
1421
|
-
const { props = {}, name, component, defaultValue: gDefaultValue
|
|
1440
|
+
const { props = {}, name, component, defaultValue: gDefaultValue } = item;
|
|
1422
1441
|
const { defaultValue: itemDefaultValue, mode, format, treeCheckable } = isFunction(props) ? props(formModel) : props;
|
|
1423
1442
|
if (!name)
|
|
1424
1443
|
return;
|
|
@@ -1482,7 +1501,7 @@ function useFormActions(opt) {
|
|
|
1482
1501
|
schemas,
|
|
1483
1502
|
minShowColumn = appConf.ui.form?.minShowColumn || 2,
|
|
1484
1503
|
showAdvancedButton = true
|
|
1485
|
-
} = unref(getProps);
|
|
1504
|
+
} = unref(opt.getProps);
|
|
1486
1505
|
let schema = [...schemas];
|
|
1487
1506
|
if (showAdvancedButton) {
|
|
1488
1507
|
schema = schemas.reduce((t, it, index) => {
|
|
@@ -1555,8 +1574,7 @@ const BasicProps = {
|
|
|
1555
1574
|
default: () => ({})
|
|
1556
1575
|
},
|
|
1557
1576
|
size: {
|
|
1558
|
-
type: String
|
|
1559
|
-
default: "small"
|
|
1577
|
+
type: String
|
|
1560
1578
|
},
|
|
1561
1579
|
disabled: {
|
|
1562
1580
|
type: Boolean,
|
|
@@ -1745,8 +1763,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1745
1763
|
});
|
|
1746
1764
|
}
|
|
1747
1765
|
let colspan = mode === "search" ? getAppConf.ui.form.searchColspan : getAppConf.ui.form.dialogColspan;
|
|
1766
|
+
if (mode !== "search") {
|
|
1767
|
+
return {
|
|
1768
|
+
colspan,
|
|
1769
|
+
...{
|
|
1770
|
+
mode,
|
|
1771
|
+
showAdvancedButton: false,
|
|
1772
|
+
isAdvanced: false,
|
|
1773
|
+
buttonList
|
|
1774
|
+
}
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1748
1777
|
return {
|
|
1749
|
-
|
|
1778
|
+
colspan,
|
|
1750
1779
|
...{
|
|
1751
1780
|
showAdvancedButton,
|
|
1752
1781
|
buttonList
|
|
@@ -317,6 +317,24 @@
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
.basic-arrow{
|
|
321
|
+
display: inline-block;
|
|
322
|
+
cursor: pointer;
|
|
323
|
+
transform: rotate(180deg);
|
|
324
|
+
transition: all 0.3s ease 0.1s;
|
|
325
|
+
transform-origin: center center;
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
.dt-icon{
|
|
329
|
+
vertical-align: middle;
|
|
330
|
+
color: @primary-color !important;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&--active{
|
|
334
|
+
transform: rotate(0deg);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
320
338
|
.ant-select-dropdown.small .ant-select-item.ant-select-item-option {
|
|
321
339
|
font-size: 12px;
|
|
322
340
|
line-height: 20px;
|
|
@@ -26,6 +26,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
default: boolean;
|
|
28
28
|
};
|
|
29
|
+
colspan: {
|
|
30
|
+
type: ObjectConstructor;
|
|
31
|
+
};
|
|
29
32
|
}, {
|
|
30
33
|
props: any;
|
|
31
34
|
emits: (event: "handle-method", ...args: any[]) => void;
|
|
@@ -44,6 +47,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
44
47
|
showAdvanceRef: import("vue").ComputedRef<boolean>;
|
|
45
48
|
colOpt: import("vue").ComputedRef<{
|
|
46
49
|
style: Recordable<any>;
|
|
50
|
+
span?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
style: Recordable<any>;
|
|
53
|
+
span: number;
|
|
47
54
|
}>;
|
|
48
55
|
getAdvanceClass: import("vue").ComputedRef<(string | {
|
|
49
56
|
'basic-arrow--active': boolean;
|
|
@@ -75,14 +82,17 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
75
82
|
type: BooleanConstructor;
|
|
76
83
|
default: boolean;
|
|
77
84
|
};
|
|
85
|
+
colspan: {
|
|
86
|
+
type: ObjectConstructor;
|
|
87
|
+
};
|
|
78
88
|
}>> & {
|
|
79
89
|
"onHandle-method"?: (...args: any[]) => any;
|
|
80
90
|
}, {
|
|
81
91
|
mode: "search" | "dialog";
|
|
82
|
-
minShowColumn: number;
|
|
83
|
-
showAdvancedButton: boolean;
|
|
84
92
|
show: boolean;
|
|
85
|
-
|
|
93
|
+
showAdvancedButton: boolean;
|
|
94
|
+
minShowColumn: number;
|
|
86
95
|
buttonList: ButtonProps[];
|
|
96
|
+
isAdvanced: boolean;
|
|
87
97
|
}>;
|
|
88
98
|
export default _sfc_main;
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
2
|
import { FormProps, FormSchema } from "../types/form.type";
|
|
3
3
|
export declare function useLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<FormProps>): import("vue").ComputedRef<{
|
|
4
|
-
labelCol:
|
|
5
|
-
|
|
6
|
-
span?: string | number;
|
|
7
|
-
order?: string | number;
|
|
8
|
-
offset?: string | number;
|
|
9
|
-
md?: string | number;
|
|
10
|
-
xl?: string | number;
|
|
11
|
-
xxl?: string | number;
|
|
12
|
-
};
|
|
13
|
-
wrapperCol: {
|
|
14
|
-
style: any;
|
|
15
|
-
span?: string | number;
|
|
16
|
-
order?: string | number;
|
|
17
|
-
offset?: string | number;
|
|
18
|
-
md?: string | number;
|
|
19
|
-
xl?: string | number;
|
|
20
|
-
xxl?: string | number;
|
|
21
|
-
};
|
|
4
|
+
labelCol: any;
|
|
5
|
+
wrapperCol: any;
|
|
22
6
|
}>;
|