@dt-frames/ui 2.0.15 → 2.0.17
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/imgs/tree/forder-open.svg +1 -0
- package/es/assets/imgs/tree/forder.svg +1 -0
- package/es/assets/locales/zh.ts +1 -1
- package/es/components/curd/index.js +28 -8
- package/es/components/curd/src/components/Curd.d.ts +10 -0
- package/es/components/curd/src/hooks/useCurd.d.ts +2 -4
- package/es/components/curd/src/props.d.ts +5 -1
- package/es/components/drawer/index.js +25 -24
- package/es/components/form/index.js +75 -40
- package/es/components/form/index.less +16 -0
- package/es/components/form/src/props.d.ts +3 -3
- package/es/components/modal/index.js +8 -143
- package/es/components/modal/index.less +23 -0
- package/es/components/modal/src/index.d.ts +2 -84
- package/es/components/table/index.js +61 -134
- package/es/components/table/index.less +25 -0
- package/es/components/table/src/components/editTable/EditTableCell.d.ts +1 -0
- package/es/components/table/src/index.d.ts +0 -10
- package/es/components/table/src/props.d.ts +0 -4
- package/es/components/table/src/types/table.type.d.ts +8 -0
- package/es/components/tree/index.js +203 -89
- package/es/components/tree/index.less +88 -13
- package/es/components/tree/src/basicProps.d.ts +55 -11
- package/es/components/tree/src/components/ContextMenu.d.ts +6 -0
- package/es/components/tree/src/components/TreeHeader.d.ts +2 -2
- package/es/components/tree/src/hooks/useTree.d.ts +3 -2
- package/es/components/tree/src/index.d.ts +131 -40
- package/es/components/tree/src/type/menu.d.ts +3 -0
- package/es/components/tree/src/type/tree.d.ts +0 -1
- package/es/components/upload/index.js +112 -65
- package/es/components/upload/index.less +17 -1
- package/es/components/upload/src/components/WordView.d.ts +1 -0
- package/es/components/upload/src/index.d.ts +2 -1
- package/es/components/upload/src/utils/upload.d.ts +1 -1
- package/es/theme/index.js +314 -309
- 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/manualContentPath.js +10 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/es/packages/ui/src/assets/locales/en.d.ts +0 -103
- package/es/packages/ui/src/assets/locales/index.d.ts +0 -2
- package/es/packages/ui/src/assets/locales/zh.d.ts +0 -104
- package/es/packages/ui/src/components/form/index.d.ts +0 -7
- package/es/packages/ui/src/components/form/src/components/FormButtons.d.ts +0 -105
- package/es/packages/ui/src/components/form/src/components/FormItem.d.ts +0 -159
- package/es/packages/ui/src/components/form/src/components/componentMap.d.ts +0 -4
- package/es/packages/ui/src/components/form/src/components/formIcon.d.ts +0 -1223
- package/es/packages/ui/src/components/form/src/components/formInputUseDialog.d.ts +0 -911
- package/es/packages/ui/src/components/form/src/components/index.d.ts +0 -4
- package/es/packages/ui/src/components/form/src/components/radioButton.d.ts +0 -34
- package/es/packages/ui/src/components/form/src/enums/index.d.ts +0 -7
- package/es/packages/ui/src/components/form/src/hooks/helper.d.ts +0 -14
- package/es/packages/ui/src/components/form/src/hooks/useForm.d.ts +0 -6
- package/es/packages/ui/src/components/form/src/hooks/useFormActions.d.ts +0 -12
- package/es/packages/ui/src/components/form/src/hooks/useFormEvent.d.ts +0 -25
- package/es/packages/ui/src/components/form/src/hooks/useFormValue.d.ts +0 -3
- package/es/packages/ui/src/components/form/src/hooks/useFormValues.d.ts +0 -11
- package/es/packages/ui/src/components/form/src/hooks/useLabelWidth.d.ts +0 -6
- package/es/packages/ui/src/components/form/src/props.d.ts +0 -127
- package/es/packages/ui/src/components/form/src/types/actions.type.d.ts +0 -15
- package/es/packages/ui/src/components/form/src/types/form.type.d.ts +0 -79
- package/es/packages/ui/src/components/form/src/types/items.type.d.ts +0 -409
- package/es/packages/ui/src/components/iframe/index.d.ts +0 -2
- package/es/packages/ui/src/components/modal/index.d.ts +0 -4
- package/es/packages/ui/src/components/modal/src/hooks/useModal.d.ts +0 -5
- package/es/packages/ui/src/components/modal/src/props.d.ts +0 -101
- package/es/packages/ui/src/components/modal/src/types/modal.type.d.ts +0 -17
- package/es/packages/ui/src/components/upload/index.d.ts +0 -4
- package/es/packages/ui/src/components/upload/src/basicProps.d.ts +0 -87
- package/es/packages/ui/src/components/upload/src/components/PdfView.d.ts +0 -9
- package/es/packages/ui/src/components/upload/src/components/WordView.d.ts +0 -6
- package/es/packages/ui/src/components/upload/src/hooks/useFile.d.ts +0 -16
- package/es/packages/ui/src/components/upload/src/index.d.ts +0 -242
- package/es/packages/ui/src/components/upload/src/type/file.d.ts +0 -10
- package/es/packages/ui/src/components/upload/src/utils/upload.d.ts +0 -2
- package/es/packages/ui/src/global.d.ts +0 -7
- package/es/packages/ui/src/theme/index.d.ts +0 -12
- package/es/packages/ui/src/theme/src/components/header/helper/menu-tree.d.ts +0 -4
- package/es/packages/ui/src/theme/src/enums/index.d.ts +0 -1
- package/es/packages/ui/src/theme/src/enums/theme.enum.d.ts +0 -34
- package/es/packages/ui/src/theme/src/hooks/index.d.ts +0 -6
- package/es/packages/ui/src/theme/src/hooks/useDragLine.d.ts +0 -2
- package/es/packages/ui/src/theme/src/hooks/useHeader.d.ts +0 -25
- package/es/packages/ui/src/theme/src/hooks/useMenu.d.ts +0 -29
- package/es/packages/ui/src/theme/src/hooks/useMultifyTab.d.ts +0 -8
- package/es/packages/ui/src/theme/src/hooks/useOpenKeys.d.ts +0 -7
- package/es/packages/ui/src/theme/src/hooks/useTheme.d.ts +0 -9
- package/es/packages/ui/src/theme/src/setting/theme.setting.d.ts +0 -2
- package/es/packages/ui/src/theme/src/stores/index.d.ts +0 -3
- package/es/packages/ui/src/theme/src/stores/routeReuse.store.d.ts +0 -25
- package/es/packages/ui/src/theme/src/stores/theme.store.d.ts +0 -19
- package/es/packages/ui/src/theme/src/types/index.d.ts +0 -3
- package/es/packages/ui/src/theme/src/types/menu.type.d.ts +0 -15
- package/es/packages/ui/src/theme/src/types/theme.type.d.ts +0 -62
- package/es/packages/ui/src/utils/withInstall.d.ts +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="64 64 896 896" fill="currentColor" width="1em" height="1em" data-icon="folder-open" aria-hidden="true"><path d="M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="64 64 896 896" fill="currentColor" width="1em" height="1em" data-icon="folder" aria-hidden="true"><path d="M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"></path></svg>
|
package/es/assets/locales/zh.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, toRaw, openBlock, createBlock, unref, withCtx, renderSlot, ref, h, createVNode, mergeProps,
|
|
1
|
+
import { defineComponent, toRaw, openBlock, createBlock, unref, withCtx, renderSlot, ref, useSlots, h, createVNode, mergeProps, isVNode } from "vue";
|
|
2
2
|
import { useForm, DtForm } from "../form";
|
|
3
|
-
import { useModal, DtModal, useModalOut } from "../modal";
|
|
3
|
+
import { useModal, DtModal as DtModal$1, useModalOut } from "../modal";
|
|
4
4
|
import { omit } from "lodash-es";
|
|
5
|
-
import { useMessage, useI18n, isFunction,
|
|
5
|
+
import { useMessage, useI18n, isFunction, error } from "@dt-frames/core";
|
|
6
6
|
const basicProps = {
|
|
7
7
|
t: {
|
|
8
8
|
type: String
|
|
@@ -41,6 +41,10 @@ const basicProps = {
|
|
|
41
41
|
type: String,
|
|
42
42
|
default: "id"
|
|
43
43
|
},
|
|
44
|
+
afterOpened: {
|
|
45
|
+
type: Function,
|
|
46
|
+
default: (modalMethods) => ({})
|
|
47
|
+
},
|
|
44
48
|
onSave: {
|
|
45
49
|
type: Function,
|
|
46
50
|
default: () => ({})
|
|
@@ -65,20 +69,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
69
|
props: basicProps,
|
|
66
70
|
setup(__props) {
|
|
67
71
|
const props = __props;
|
|
68
|
-
const [registerDialog] = useModal({
|
|
72
|
+
const [registerDialog, modalMethods] = useModal({
|
|
69
73
|
...omit(toRaw(props), [
|
|
70
74
|
"curd",
|
|
71
75
|
"formProps",
|
|
72
76
|
"schemas"
|
|
73
77
|
]),
|
|
78
|
+
wrapClassName: "dt-curd-modal__wrap",
|
|
74
79
|
destroyOnClose: true,
|
|
75
80
|
maskClosable: false
|
|
81
|
+
}, () => {
|
|
82
|
+
props.afterOpened(modalMethods);
|
|
76
83
|
});
|
|
77
84
|
function handleSave() {
|
|
78
85
|
props?.onSave();
|
|
79
86
|
}
|
|
80
87
|
return (_ctx, _cache) => {
|
|
81
|
-
return openBlock(), createBlock(unref(DtModal), {
|
|
88
|
+
return openBlock(), createBlock(unref(DtModal$1), {
|
|
82
89
|
onRegister: unref(registerDialog),
|
|
83
90
|
onSave: _cache[0] || (_cache[0] = ($event) => handleSave())
|
|
84
91
|
}, {
|
|
@@ -90,6 +97,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
90
97
|
};
|
|
91
98
|
}
|
|
92
99
|
});
|
|
100
|
+
const _export_sfc = (sfc, props) => {
|
|
101
|
+
const target = sfc.__vccOpts || sfc;
|
|
102
|
+
for (const [key, val] of props) {
|
|
103
|
+
target[key] = val;
|
|
104
|
+
}
|
|
105
|
+
return target;
|
|
106
|
+
};
|
|
107
|
+
const DtModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/curd/src/components/Curd.vue"]]);
|
|
108
|
+
function _isSlot(s) {
|
|
109
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
110
|
+
}
|
|
93
111
|
function useCurd(curdOpt) {
|
|
94
112
|
const [register, {
|
|
95
113
|
openModal,
|
|
@@ -115,15 +133,18 @@ function useCurd(curdOpt) {
|
|
|
115
133
|
mode: "dialog"
|
|
116
134
|
});
|
|
117
135
|
const DtCurdModal = () => {
|
|
136
|
+
const slots = useSlots();
|
|
118
137
|
return h(createVNode("div", {
|
|
119
138
|
"class": "dt-curd-modal"
|
|
120
|
-
}, [createVNode(
|
|
139
|
+
}, [createVNode(DtModal, mergeProps(curdOpt, {
|
|
121
140
|
"title": title,
|
|
122
141
|
"onRegister": register
|
|
123
142
|
}), {
|
|
124
143
|
default: () => [createVNode(DtForm, {
|
|
125
144
|
"onRegister": registerForm
|
|
126
|
-
},
|
|
145
|
+
}, _isSlot(slots) ? slots : {
|
|
146
|
+
default: () => [slots]
|
|
147
|
+
})]
|
|
127
148
|
})]));
|
|
128
149
|
};
|
|
129
150
|
function openAddDialog() {
|
|
@@ -149,7 +170,6 @@ function useCurd(curdOpt) {
|
|
|
149
170
|
if (onQueryById && isFunction(onQueryById)) {
|
|
150
171
|
onQueryById(row[primaryKey]).then((rsp) => {
|
|
151
172
|
curdFormMethods.setFormValues(rsp);
|
|
152
|
-
nextTick(() => dispatchResize());
|
|
153
173
|
});
|
|
154
174
|
}
|
|
155
175
|
}
|
|
@@ -158,6 +158,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
158
158
|
type: import("vue").PropType<String | Number>;
|
|
159
159
|
default: string;
|
|
160
160
|
};
|
|
161
|
+
afterOpened: {
|
|
162
|
+
type: import("vue").PropType<(modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods) => void>;
|
|
163
|
+
default: (modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods) => {};
|
|
164
|
+
};
|
|
161
165
|
onSave: {
|
|
162
166
|
type: import("vue").PropType<() => void>;
|
|
163
167
|
default: () => {};
|
|
@@ -179,6 +183,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
179
183
|
}, {
|
|
180
184
|
props: any;
|
|
181
185
|
registerDialog: import("../../../modal/src/types/modal.type").RegisterFn;
|
|
186
|
+
modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods;
|
|
182
187
|
handleSave: () => void;
|
|
183
188
|
readonly DtModal: import("vue").DefineComponent<{}, {}, any, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
184
189
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -341,6 +346,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
341
346
|
type: import("vue").PropType<String | Number>;
|
|
342
347
|
default: string;
|
|
343
348
|
};
|
|
349
|
+
afterOpened: {
|
|
350
|
+
type: import("vue").PropType<(modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods) => void>;
|
|
351
|
+
default: (modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods) => {};
|
|
352
|
+
};
|
|
344
353
|
onSave: {
|
|
345
354
|
type: import("vue").PropType<() => void>;
|
|
346
355
|
default: () => {};
|
|
@@ -367,6 +376,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
367
376
|
showClosable: boolean;
|
|
368
377
|
formProps: {};
|
|
369
378
|
primaryKey: String | Number;
|
|
379
|
+
afterOpened: (modalMethods: import("../../../modal/src/types/modal.type").ReturnInnerMethods) => void;
|
|
370
380
|
onSave: () => void;
|
|
371
381
|
onDeletes: (keys: import("ant-design-vue/es/table/interface").Key[]) => void;
|
|
372
382
|
onQueryById: (id: import("ant-design-vue/es/table/interface").Key) => Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Recordable } from "@dt-frames/core";
|
|
2
|
-
import { ExtractPropTypes, PropType } from "vue";
|
|
2
|
+
import { ExtractPropTypes, PropType, FunctionalComponent } from "vue";
|
|
3
3
|
import { basicProps } from "../props";
|
|
4
4
|
export declare function useCurd(curdOpt: Partial<ExtractPropTypes<typeof basicProps>>): {
|
|
5
5
|
openAddDialog: () => void;
|
|
@@ -106,7 +106,5 @@ export declare function useCurd(curdOpt: Partial<ExtractPropTypes<typeof basicPr
|
|
|
106
106
|
afterClose: FunctionConstructor;
|
|
107
107
|
}>>) => void;
|
|
108
108
|
curdFormMethods: import('../../../form').FormActionType;
|
|
109
|
-
DtCurdModal:
|
|
110
|
-
[key: string]: any;
|
|
111
|
-
}>;
|
|
109
|
+
DtCurdModal: FunctionalComponent<{}, {}>;
|
|
112
110
|
};
|
|
@@ -2,7 +2,7 @@ import { ButtonProps, FormSchema } from '../../form/src/types/form.type';
|
|
|
2
2
|
import { Key } from "ant-design-vue/es/table/interface";
|
|
3
3
|
import { ComputedRef, PropType, Ref } from "vue";
|
|
4
4
|
import { CurdActionType } from "./types/curd.type";
|
|
5
|
-
import { RegisterFn } from '../../modal/src/types/modal.type';
|
|
5
|
+
import { RegisterFn, ReturnInnerMethods } from '../../modal/src/types/modal.type';
|
|
6
6
|
export declare const basicProps: {
|
|
7
7
|
t: {
|
|
8
8
|
type: StringConstructor;
|
|
@@ -163,6 +163,10 @@ export declare const basicProps: {
|
|
|
163
163
|
type: PropType<String | Number>;
|
|
164
164
|
default: string;
|
|
165
165
|
};
|
|
166
|
+
afterOpened: {
|
|
167
|
+
type: PropType<(modalMethods: ReturnInnerMethods) => void>;
|
|
168
|
+
default: (modalMethods: ReturnInnerMethods) => {};
|
|
169
|
+
};
|
|
166
170
|
onSave: {
|
|
167
171
|
type: PropType<() => void>;
|
|
168
172
|
default: () => {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Drawer } from "ant-design-vue/es";
|
|
1
|
+
import { Drawer as Drawer$1 } from "ant-design-vue/es";
|
|
2
2
|
import "ant-design-vue/es/drawer/style";
|
|
3
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, computed, createVNode, unref, useAttrs, ref, toRaw, getCurrentInstance, watch, createBlock, mergeProps, createSlots, withCtx,
|
|
3
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, computed, createVNode, unref, useAttrs, ref, toRaw, getCurrentInstance, watch, createBlock, mergeProps, createSlots, withCtx, renderList, normalizeProps, guardReactiveProps, reactive, watchEffect, nextTick, onUnmounted } from "vue";
|
|
4
4
|
import { useI18n, DtCache, CacheKey, deepMerge, isUnDef, isFunction, useApp, isObject, error } from "@dt-frames/core";
|
|
5
|
-
import { DtScrollContainer } from "../container";
|
|
6
5
|
import { DtFormButtons } from "../form";
|
|
7
6
|
const _hoisted_1$1 = { class: "flex h-full items-center" };
|
|
8
7
|
const _hoisted_2 = { class: "pr-12" };
|
|
@@ -24,6 +23,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
});
|
|
26
|
+
const _export_sfc = (sfc, props) => {
|
|
27
|
+
const target = sfc.__vccOpts || sfc;
|
|
28
|
+
for (const [key, val] of props) {
|
|
29
|
+
target[key] = val;
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
const DrawerHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerHeader.vue"]]);
|
|
27
34
|
const _hoisted_1 = {
|
|
28
35
|
class: "flex items-center",
|
|
29
36
|
style: { gap: "10px" }
|
|
@@ -79,6 +86,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
79
86
|
};
|
|
80
87
|
}
|
|
81
88
|
});
|
|
89
|
+
const DrawerFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/components/DrawerFooter.vue"]]);
|
|
82
90
|
const basicProps = {
|
|
83
91
|
t: {
|
|
84
92
|
type: String
|
|
@@ -170,12 +178,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
170
178
|
}
|
|
171
179
|
return opt;
|
|
172
180
|
});
|
|
173
|
-
const getScrollContentStyle = computed(() => {
|
|
174
|
-
return {
|
|
175
|
-
position: "relative",
|
|
176
|
-
height: `100%`
|
|
177
|
-
};
|
|
178
|
-
});
|
|
179
181
|
function handleSave() {
|
|
180
182
|
emits("save");
|
|
181
183
|
}
|
|
@@ -211,7 +213,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
211
213
|
{ immediate: false }
|
|
212
214
|
);
|
|
213
215
|
return (_ctx, _cache) => {
|
|
214
|
-
const _component_ADrawer = Drawer;
|
|
216
|
+
const _component_ADrawer = Drawer$1;
|
|
215
217
|
return openBlock(), createBlock(_component_ADrawer, mergeProps({
|
|
216
218
|
class: "dt-drawer",
|
|
217
219
|
onClose: handleCancel
|
|
@@ -221,21 +223,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
221
223
|
}
|
|
222
224
|
}), createSlots({
|
|
223
225
|
default: withCtx(() => [
|
|
224
|
-
|
|
225
|
-
style: normalizeStyle(unref(getScrollContentStyle))
|
|
226
|
-
}, {
|
|
227
|
-
default: withCtx(() => [
|
|
228
|
-
renderSlot(_ctx.$slots, "default")
|
|
229
|
-
]),
|
|
230
|
-
_: 3
|
|
231
|
-
}, 8, ["style"])
|
|
226
|
+
renderSlot(_ctx.$slots, "default")
|
|
232
227
|
]),
|
|
233
228
|
_: 2
|
|
234
229
|
}, [
|
|
235
230
|
!_ctx.$slots.title ? {
|
|
236
231
|
name: "title",
|
|
237
232
|
fn: withCtx(() => [
|
|
238
|
-
createVNode(
|
|
233
|
+
createVNode(DrawerHeader, {
|
|
239
234
|
title: unref(getProps).title
|
|
240
235
|
}, {
|
|
241
236
|
titleToolbar: withCtx(() => [
|
|
@@ -255,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
255
250
|
unref(getshowFooter) ? {
|
|
256
251
|
name: "footer",
|
|
257
252
|
fn: withCtx(() => [
|
|
258
|
-
createVNode(
|
|
253
|
+
createVNode(DrawerFooter, {
|
|
259
254
|
buttons: propsRef.value?.footer,
|
|
260
255
|
showSave: unref(getProps).showOkBtn,
|
|
261
256
|
showCancel: unref(getProps).showCancelBtn,
|
|
@@ -280,6 +275,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
280
275
|
};
|
|
281
276
|
}
|
|
282
277
|
});
|
|
278
|
+
const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/drawer/src/index.vue"]]);
|
|
283
279
|
const orgDialogProp = reactive({});
|
|
284
280
|
const cbTransfer = reactive({});
|
|
285
281
|
const dataTransfer = reactive({});
|
|
@@ -343,6 +339,7 @@ function useDrawer(props, setModalData) {
|
|
|
343
339
|
const drawerInstanceRef = ref(null);
|
|
344
340
|
const currentInstance = getCurrentInstance();
|
|
345
341
|
const uidRef = ref("");
|
|
342
|
+
const isFirstRegister = ref(true);
|
|
346
343
|
const { isProd } = useApp();
|
|
347
344
|
const getInstance = () => {
|
|
348
345
|
const instance = unref(drawerInstanceRef);
|
|
@@ -362,13 +359,17 @@ function useDrawer(props, setModalData) {
|
|
|
362
359
|
drawerInstance.setDrawerProps(props);
|
|
363
360
|
}
|
|
364
361
|
watchEffect(() => {
|
|
365
|
-
|
|
366
|
-
if (!data)
|
|
362
|
+
if (!unref(uidRef))
|
|
367
363
|
return;
|
|
364
|
+
const data = dataTransfer[unref(uidRef)];
|
|
368
365
|
if (!setModalData || !isFunction(setModalData))
|
|
369
366
|
return;
|
|
370
367
|
nextTick(() => {
|
|
371
|
-
|
|
368
|
+
if (unref(isFirstRegister)) {
|
|
369
|
+
isFirstRegister.value = false;
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
setModalData(data ?? {});
|
|
372
373
|
});
|
|
373
374
|
});
|
|
374
375
|
const methods = {
|
|
@@ -392,7 +393,7 @@ const withInstall = (comp) => {
|
|
|
392
393
|
};
|
|
393
394
|
return comp;
|
|
394
395
|
};
|
|
395
|
-
const DtDrawer = withInstall(
|
|
396
|
+
const DtDrawer = withInstall(Drawer);
|
|
396
397
|
export {
|
|
397
398
|
DtDrawer,
|
|
398
399
|
useDrawer,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { RadioButton, RadioGroup, Button, FormItem as FormItem$1, Col as Col$1, Row, Form as Form$1 } from "ant-design-vue/es";
|
|
1
|
+
import { RadioButton, RadioGroup, Input, 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
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
5
|
import { useAppStore, isNumber, useI18n, isString, isFunction, error, useSlots, isArray, isUnDef, isBoolean, isNull, dispatchResize, isObject, deepMerge, isNullAndUnDef, useTimeoutFn } from "@dt-frames/core";
|
|
6
6
|
import { merge, isEqual, omit, cloneDeep, upperFirst, uniqBy, set } from "lodash-es";
|
|
7
|
-
import { Input, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem } from "ant-design-vue";
|
|
7
|
+
import { Input as Input$1, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Tooltip, Form, FormItem } from "ant-design-vue";
|
|
8
8
|
import { useHeader, UiSize } from "../../theme";
|
|
9
9
|
import "ant-design-vue/es/radio/style";
|
|
10
|
+
import "ant-design-vue/es/input/style";
|
|
10
11
|
import "ant-design-vue/es/cascader/style";
|
|
11
12
|
import "ant-design-vue/es/input-number/style";
|
|
12
13
|
import "ant-design-vue/es/switch/style";
|
|
@@ -168,6 +169,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
});
|
|
172
|
+
const _export_sfc = (sfc, props) => {
|
|
173
|
+
const target = sfc.__vccOpts || sfc;
|
|
174
|
+
for (const [key, val] of props) {
|
|
175
|
+
target[key] = val;
|
|
176
|
+
}
|
|
177
|
+
return target;
|
|
178
|
+
};
|
|
179
|
+
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"]]);
|
|
171
180
|
const _hoisted_1$1 = { class: "input-with-dialog" };
|
|
172
181
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
173
182
|
__name: "formInputUseDialog",
|
|
@@ -195,31 +204,33 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
195
204
|
[...schema.extraName, schema.name].forEach((it) => model[it] = null);
|
|
196
205
|
}
|
|
197
206
|
return (_ctx, _cache) => {
|
|
207
|
+
const _component_AInput = Input;
|
|
198
208
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
199
209
|
createElementVNode("div", { onClick: onClickInput }, [
|
|
200
|
-
createVNode(
|
|
210
|
+
createVNode(_component_AInput, normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
|
|
201
211
|
]),
|
|
202
212
|
unref(attrs).formValues?.schema?.extraName?.length ? (openBlock(), createElementBlock("i", {
|
|
203
213
|
key: 0,
|
|
204
214
|
class: "i mdi:close-circle",
|
|
205
215
|
onClick: clearProps
|
|
206
|
-
})) : createCommentVNode("", true)
|
|
216
|
+
})) : createCommentVNode("v-if", true)
|
|
207
217
|
]);
|
|
208
218
|
};
|
|
209
219
|
}
|
|
210
220
|
});
|
|
221
|
+
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"]]);
|
|
211
222
|
const components = {
|
|
212
|
-
Input,
|
|
213
|
-
InputWithDialog:
|
|
214
|
-
InputTextArea: Input.TextArea,
|
|
215
|
-
InputSearch: Input.Search,
|
|
216
|
-
InputGroup: Input.Group,
|
|
217
|
-
InputPassword: Input.Password,
|
|
223
|
+
Input: Input$1,
|
|
224
|
+
InputWithDialog: DtFormInputDialog,
|
|
225
|
+
InputTextArea: Input$1.TextArea,
|
|
226
|
+
InputSearch: Input$1.Search,
|
|
227
|
+
InputGroup: Input$1.Group,
|
|
228
|
+
InputPassword: Input$1.Password,
|
|
218
229
|
Select,
|
|
219
230
|
TreeSelect,
|
|
220
231
|
Radio,
|
|
221
232
|
RadioGroup: Radio.Group,
|
|
222
|
-
RadioButtonGroup
|
|
233
|
+
RadioButtonGroup,
|
|
223
234
|
Checkbox,
|
|
224
235
|
CheckboxGroup: Checkbox.Group,
|
|
225
236
|
AutoComplete,
|
|
@@ -413,9 +424,7 @@ const _sfc_main$2 = {
|
|
|
413
424
|
}
|
|
414
425
|
function renderFormItem() {
|
|
415
426
|
const {
|
|
416
|
-
|
|
417
|
-
formModel,
|
|
418
|
-
formActionType
|
|
427
|
+
formModel
|
|
419
428
|
} = props;
|
|
420
429
|
const {
|
|
421
430
|
component,
|
|
@@ -488,7 +497,7 @@ const _sfc_main$2 = {
|
|
|
488
497
|
itemProps.optionFilterProp = "label";
|
|
489
498
|
}
|
|
490
499
|
}
|
|
491
|
-
if (
|
|
500
|
+
if (component !== "RangePicker") {
|
|
492
501
|
itemProps.placeholder = unref(getComponentProps)?.placeholder || createPlaceholder(component);
|
|
493
502
|
}
|
|
494
503
|
if (["DatePicker", "MonthPicker", "RangePicker"].includes(component)) {
|
|
@@ -639,6 +648,7 @@ const _sfc_main$2 = {
|
|
|
639
648
|
};
|
|
640
649
|
}
|
|
641
650
|
};
|
|
651
|
+
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"]]);
|
|
642
652
|
const _hoisted_1 = {
|
|
643
653
|
key: 0,
|
|
644
654
|
className: "preIcon pr-1"
|
|
@@ -684,6 +694,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
684
694
|
},
|
|
685
695
|
colspan: {
|
|
686
696
|
type: Object
|
|
697
|
+
},
|
|
698
|
+
style: {
|
|
699
|
+
type: Object,
|
|
700
|
+
default: () => {
|
|
701
|
+
}
|
|
687
702
|
}
|
|
688
703
|
},
|
|
689
704
|
emits: ["handle-method"],
|
|
@@ -707,11 +722,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
707
722
|
let style = {
|
|
708
723
|
textAlign: "right"
|
|
709
724
|
};
|
|
725
|
+
let gStyle = props.style ?? {};
|
|
710
726
|
if (props.mode === "dialog") {
|
|
711
727
|
Object.assign(style, {
|
|
712
728
|
display: "inline-block"
|
|
713
729
|
});
|
|
714
|
-
return {
|
|
730
|
+
return {
|
|
731
|
+
style: {
|
|
732
|
+
...gStyle,
|
|
733
|
+
...style
|
|
734
|
+
}
|
|
735
|
+
};
|
|
715
736
|
} else if (props.mode === null) {
|
|
716
737
|
Object.assign(style, {
|
|
717
738
|
display: "flex",
|
|
@@ -719,11 +740,19 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
719
740
|
marginBottom: "20px"
|
|
720
741
|
});
|
|
721
742
|
return {
|
|
722
|
-
style
|
|
743
|
+
style: {
|
|
744
|
+
...gStyle,
|
|
745
|
+
...style
|
|
746
|
+
},
|
|
723
747
|
span: 24
|
|
724
748
|
};
|
|
725
749
|
}
|
|
726
|
-
return {
|
|
750
|
+
return {
|
|
751
|
+
style: {
|
|
752
|
+
...props.style,
|
|
753
|
+
...style
|
|
754
|
+
}
|
|
755
|
+
};
|
|
727
756
|
});
|
|
728
757
|
const getAdvanceClass = computed(() => {
|
|
729
758
|
return [
|
|
@@ -786,18 +815,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
786
815
|
icon: withCtx(() => [
|
|
787
816
|
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1, null, 512)), [
|
|
788
817
|
[_directive_icon, button.preIcon]
|
|
789
|
-
]) : createCommentVNode("", true)
|
|
818
|
+
]) : createCommentVNode("v-if", true)
|
|
790
819
|
]),
|
|
791
820
|
default: withCtx(() => [
|
|
792
821
|
createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
|
|
793
822
|
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2, null, 512)), [
|
|
794
823
|
[_directive_icon, button.postIcon]
|
|
795
|
-
]) : createCommentVNode("", true)
|
|
824
|
+
]) : createCommentVNode("v-if", true)
|
|
796
825
|
]),
|
|
797
826
|
_: 2
|
|
798
827
|
}, 1032, ["type", "class", "loading", "disabled", "onClick"])), [
|
|
799
828
|
[_directive_auth, getAuth(button.auth)]
|
|
800
|
-
]) : createCommentVNode("", true)
|
|
829
|
+
]) : createCommentVNode("v-if", true)
|
|
801
830
|
], 64);
|
|
802
831
|
}), 256)),
|
|
803
832
|
unref(showAdvanceRef) ? (openBlock(), createBlock(_component_AButton, {
|
|
@@ -807,22 +836,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
807
836
|
onClick: toggleAdvanced
|
|
808
837
|
}, {
|
|
809
838
|
default: withCtx(() => [
|
|
839
|
+
createCommentVNode(" \u6536\u8D77 | \u5C55\u5F00 "),
|
|
810
840
|
createElementVNode("span", _hoisted_3, toDisplayString(advancedRef.value ? unref(t)("UI.ADVANCED") : unref(t)("UI.EXPAND")), 1),
|
|
811
841
|
createElementVNode("span", {
|
|
812
842
|
class: normalizeClass(unref(getAdvanceClass))
|
|
813
843
|
}, _hoisted_5, 2)
|
|
814
844
|
]),
|
|
815
845
|
_: 1
|
|
816
|
-
})) : createCommentVNode("", true)
|
|
846
|
+
})) : createCommentVNode("v-if", true)
|
|
817
847
|
]),
|
|
818
848
|
_: 1
|
|
819
849
|
}, 8, ["style"])
|
|
820
850
|
]),
|
|
821
851
|
_: 1
|
|
822
|
-
}, 16)) : createCommentVNode("", true);
|
|
852
|
+
}, 16)) : createCommentVNode("v-if", true);
|
|
823
853
|
};
|
|
824
854
|
}
|
|
825
855
|
});
|
|
856
|
+
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"]]);
|
|
826
857
|
const SEARCH_BTN_NAME = "UI.SEARCH";
|
|
827
858
|
const RESET_BTN_NAME = "UI.RESET";
|
|
828
859
|
const SEARCH_BTNS = [
|
|
@@ -923,22 +954,22 @@ function useFormEvents({
|
|
|
923
954
|
schemaRef.value = schemaList;
|
|
924
955
|
}
|
|
925
956
|
function _removeSchemaByName(name, schemaList) {
|
|
926
|
-
const
|
|
927
|
-
if (
|
|
957
|
+
const index2 = schemaList.findIndex((schema) => schema.name === name);
|
|
958
|
+
if (index2 !== -1) {
|
|
928
959
|
delete formModel[name];
|
|
929
|
-
schemaList.splice(
|
|
960
|
+
schemaList.splice(index2, 1);
|
|
930
961
|
}
|
|
931
962
|
}
|
|
932
963
|
function appendFormItems(schema, prefixName, first = false) {
|
|
933
964
|
const schemaList = cloneDeep(unref(getSchema));
|
|
934
|
-
const
|
|
935
|
-
if (!prefixName ||
|
|
965
|
+
const index2 = schemaList.findIndex((schema2) => schema2.name === prefixName);
|
|
966
|
+
if (!prefixName || index2 === -1 || first) {
|
|
936
967
|
first ? schemaList.unshift(...schema) : schemaList.push(...schema);
|
|
937
968
|
schemaRef.value = schemaList;
|
|
938
969
|
return;
|
|
939
970
|
}
|
|
940
|
-
if (
|
|
941
|
-
schemaList.splice(
|
|
971
|
+
if (index2 !== -1) {
|
|
972
|
+
schemaList.splice(index2 + 1, 0, ...schema);
|
|
942
973
|
}
|
|
943
974
|
schemaRef.value = schemaList;
|
|
944
975
|
}
|
|
@@ -1067,7 +1098,7 @@ function useFormValues({
|
|
|
1067
1098
|
if (isArray(defaultValue2)) {
|
|
1068
1099
|
let vals = defaultValue2.map((it) => format ? dayjs(it, format) : dayjs(it));
|
|
1069
1100
|
if (names.length > 1) {
|
|
1070
|
-
names.map((key,
|
|
1101
|
+
names.map((key, index2) => obj[key] = vals[index2] ?? null);
|
|
1071
1102
|
} else {
|
|
1072
1103
|
obj[names[0]] = vals;
|
|
1073
1104
|
}
|
|
@@ -1076,11 +1107,11 @@ function useFormValues({
|
|
|
1076
1107
|
}
|
|
1077
1108
|
} else {
|
|
1078
1109
|
if (names.length > 1) {
|
|
1079
|
-
names.forEach((key,
|
|
1080
|
-
if (!defaultValue2 || defaultValue2.length - 1 <
|
|
1110
|
+
names.forEach((key, index2) => {
|
|
1111
|
+
if (!defaultValue2 || defaultValue2.length - 1 < index2) {
|
|
1081
1112
|
obj[key] = null;
|
|
1082
1113
|
} else {
|
|
1083
|
-
obj[key] = defaultValue2[
|
|
1114
|
+
obj[key] = defaultValue2[index2];
|
|
1084
1115
|
}
|
|
1085
1116
|
});
|
|
1086
1117
|
} else {
|
|
@@ -1118,8 +1149,8 @@ function useFormActions(opt) {
|
|
|
1118
1149
|
} = unref(getProps);
|
|
1119
1150
|
let schema = [...schemas];
|
|
1120
1151
|
if (showAdvancedButton) {
|
|
1121
|
-
schema = schemas.reduce((t, it,
|
|
1122
|
-
if (
|
|
1152
|
+
schema = schemas.reduce((t, it, index2) => {
|
|
1153
|
+
if (index2 > minShowColumn - 1)
|
|
1123
1154
|
it.isAdvanced = isAdvanced;
|
|
1124
1155
|
t.push(it);
|
|
1125
1156
|
return t;
|
|
@@ -1387,6 +1418,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1387
1418
|
}
|
|
1388
1419
|
return {
|
|
1389
1420
|
colspan,
|
|
1421
|
+
style: {
|
|
1422
|
+
marginLeft: "auto"
|
|
1423
|
+
},
|
|
1390
1424
|
...{
|
|
1391
1425
|
showAdvancedButton,
|
|
1392
1426
|
buttonList
|
|
@@ -1449,7 +1483,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1449
1483
|
} }), {
|
|
1450
1484
|
default: withCtx(() => [
|
|
1451
1485
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
|
|
1452
|
-
return openBlock(), createBlock(unref(
|
|
1486
|
+
return openBlock(), createBlock(unref(DtFormItem), {
|
|
1453
1487
|
key: schema.name,
|
|
1454
1488
|
schema,
|
|
1455
1489
|
formProps: unref(getProps),
|
|
@@ -1468,7 +1502,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1468
1502
|
})
|
|
1469
1503
|
]), 1032, ["schema", "formProps", "formModel", "defaultValues"]);
|
|
1470
1504
|
}), 128)),
|
|
1471
|
-
unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(
|
|
1505
|
+
unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(DtFormButtons), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("v-if", true)
|
|
1472
1506
|
]),
|
|
1473
1507
|
_: 3
|
|
1474
1508
|
}, 16)
|
|
@@ -1478,6 +1512,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1478
1512
|
};
|
|
1479
1513
|
}
|
|
1480
1514
|
});
|
|
1515
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/index.vue"]]);
|
|
1481
1516
|
function useForm(props) {
|
|
1482
1517
|
const formRef = ref(null);
|
|
1483
1518
|
const loadedRef = ref(false);
|
|
@@ -1549,7 +1584,7 @@ function useForm(props) {
|
|
|
1549
1584
|
return [register, methods];
|
|
1550
1585
|
}
|
|
1551
1586
|
export {
|
|
1552
|
-
|
|
1553
|
-
|
|
1587
|
+
index as DtForm,
|
|
1588
|
+
DtFormButtons,
|
|
1554
1589
|
useForm
|
|
1555
1590
|
};
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
height: 100%;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
textarea.ant-input{
|
|
33
|
+
padding-top: 4px;
|
|
34
|
+
padding-bottom: 4px;
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
&__compact {
|
|
33
38
|
.ant-form-item-control-input-content .ant-form-item {
|
|
34
39
|
margin-bottom: 0;
|
|
@@ -342,6 +347,17 @@
|
|
|
342
347
|
.anticon-swap-right{
|
|
343
348
|
display: block;
|
|
344
349
|
}
|
|
350
|
+
|
|
351
|
+
.ant-input-affix-wrapper-input-with-clear-btn{
|
|
352
|
+
.ant-input-clear-icon{
|
|
353
|
+
display: none;
|
|
354
|
+
}
|
|
355
|
+
&:hover, .ant-input:focus + .ant-input-suffix{
|
|
356
|
+
.ant-input-clear-icon{
|
|
357
|
+
display: block;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
345
361
|
}
|
|
346
362
|
|
|
347
363
|
.basic-arrow{
|