@dt-frames/ui 2.0.14 → 2.0.16

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.
Files changed (99) hide show
  1. package/es/assets/imgs/tree/forder-open.svg +1 -0
  2. package/es/assets/imgs/tree/forder.svg +1 -0
  3. package/es/assets/locales/zh.ts +1 -1
  4. package/es/components/curd/index.js +28 -8
  5. package/es/components/curd/src/components/Curd.d.ts +10 -0
  6. package/es/components/curd/src/hooks/useCurd.d.ts +2 -4
  7. package/es/components/curd/src/props.d.ts +5 -1
  8. package/es/components/drawer/index.js +25 -24
  9. package/es/components/form/index.js +56 -40
  10. package/es/components/form/index.less +44 -3
  11. package/es/components/form/src/props.d.ts +3 -3
  12. package/es/components/modal/index.js +8 -143
  13. package/es/components/modal/index.less +23 -0
  14. package/es/components/modal/src/index.d.ts +2 -84
  15. package/es/components/table/index.js +72 -88
  16. package/es/components/table/src/components/TableAction.d.ts +6 -0
  17. package/es/components/table/src/index.d.ts +4 -4
  18. package/es/components/table/src/props.d.ts +1 -1
  19. package/es/components/tree/index.js +197 -93
  20. package/es/components/tree/index.less +75 -13
  21. package/es/components/tree/src/basicProps.d.ts +46 -7
  22. package/es/components/tree/src/components/TreeHeader.d.ts +2 -2
  23. package/es/components/tree/src/hooks/useTree.d.ts +3 -2
  24. package/es/components/tree/src/index.d.ts +120 -29
  25. package/es/components/upload/index.js +79 -75
  26. package/es/components/upload/index.less +19 -5
  27. package/es/components/upload/src/basicProps.d.ts +1 -1
  28. package/es/components/upload/src/index.d.ts +6 -6
  29. package/es/components/upload/src/utils/upload.d.ts +1 -1
  30. package/es/theme/index.js +387 -431
  31. package/es/theme/index.less +24 -0
  32. package/es/theme/src/components/header/components/lock/Lockscreen.d.ts +34 -3
  33. package/es/theme/src/components/header/components/lock/index.d.ts +1 -2
  34. package/es/theme/src/components/header/components/lock/useTime.d.ts +7 -0
  35. package/es/theme/src/components/header/components/size.d.ts +5 -5
  36. package/es/theme/src/components/header/components/user-info.d.ts +7 -0
  37. package/es/theme/src/components/header/index.d.ts +12 -5
  38. package/es/theme/src/components/header/multiple-header.d.ts +12 -5
  39. package/es/theme/src/index.d.ts +63 -13
  40. package/es/theme/src/stores/lockscreen.store.d.ts +7 -0
  41. package/manualContentPath.js +10 -0
  42. package/package.json +1 -1
  43. package/tsconfig.json +1 -1
  44. package/es/packages/ui/src/assets/locales/en.d.ts +0 -103
  45. package/es/packages/ui/src/assets/locales/index.d.ts +0 -2
  46. package/es/packages/ui/src/assets/locales/zh.d.ts +0 -104
  47. package/es/packages/ui/src/components/form/index.d.ts +0 -7
  48. package/es/packages/ui/src/components/form/src/components/FormButtons.d.ts +0 -105
  49. package/es/packages/ui/src/components/form/src/components/FormItem.d.ts +0 -159
  50. package/es/packages/ui/src/components/form/src/components/componentMap.d.ts +0 -4
  51. package/es/packages/ui/src/components/form/src/components/formIcon.d.ts +0 -1223
  52. package/es/packages/ui/src/components/form/src/components/formInputUseDialog.d.ts +0 -911
  53. package/es/packages/ui/src/components/form/src/components/index.d.ts +0 -4
  54. package/es/packages/ui/src/components/form/src/components/radioButton.d.ts +0 -34
  55. package/es/packages/ui/src/components/form/src/enums/index.d.ts +0 -7
  56. package/es/packages/ui/src/components/form/src/hooks/helper.d.ts +0 -14
  57. package/es/packages/ui/src/components/form/src/hooks/useForm.d.ts +0 -6
  58. package/es/packages/ui/src/components/form/src/hooks/useFormActions.d.ts +0 -12
  59. package/es/packages/ui/src/components/form/src/hooks/useFormEvent.d.ts +0 -25
  60. package/es/packages/ui/src/components/form/src/hooks/useFormValue.d.ts +0 -3
  61. package/es/packages/ui/src/components/form/src/hooks/useFormValues.d.ts +0 -11
  62. package/es/packages/ui/src/components/form/src/hooks/useLabelWidth.d.ts +0 -6
  63. package/es/packages/ui/src/components/form/src/props.d.ts +0 -127
  64. package/es/packages/ui/src/components/form/src/types/actions.type.d.ts +0 -15
  65. package/es/packages/ui/src/components/form/src/types/form.type.d.ts +0 -79
  66. package/es/packages/ui/src/components/form/src/types/items.type.d.ts +0 -409
  67. package/es/packages/ui/src/components/iframe/index.d.ts +0 -2
  68. package/es/packages/ui/src/components/modal/index.d.ts +0 -4
  69. package/es/packages/ui/src/components/modal/src/hooks/useModal.d.ts +0 -5
  70. package/es/packages/ui/src/components/modal/src/props.d.ts +0 -101
  71. package/es/packages/ui/src/components/modal/src/types/modal.type.d.ts +0 -17
  72. package/es/packages/ui/src/components/upload/index.d.ts +0 -4
  73. package/es/packages/ui/src/components/upload/src/basicProps.d.ts +0 -87
  74. package/es/packages/ui/src/components/upload/src/components/PdfView.d.ts +0 -9
  75. package/es/packages/ui/src/components/upload/src/components/WordView.d.ts +0 -6
  76. package/es/packages/ui/src/components/upload/src/hooks/useFile.d.ts +0 -16
  77. package/es/packages/ui/src/components/upload/src/index.d.ts +0 -242
  78. package/es/packages/ui/src/components/upload/src/type/file.d.ts +0 -10
  79. package/es/packages/ui/src/components/upload/src/utils/upload.d.ts +0 -2
  80. package/es/packages/ui/src/global.d.ts +0 -7
  81. package/es/packages/ui/src/theme/index.d.ts +0 -12
  82. package/es/packages/ui/src/theme/src/components/header/helper/menu-tree.d.ts +0 -4
  83. package/es/packages/ui/src/theme/src/enums/index.d.ts +0 -1
  84. package/es/packages/ui/src/theme/src/enums/theme.enum.d.ts +0 -34
  85. package/es/packages/ui/src/theme/src/hooks/index.d.ts +0 -6
  86. package/es/packages/ui/src/theme/src/hooks/useDragLine.d.ts +0 -2
  87. package/es/packages/ui/src/theme/src/hooks/useHeader.d.ts +0 -25
  88. package/es/packages/ui/src/theme/src/hooks/useMenu.d.ts +0 -29
  89. package/es/packages/ui/src/theme/src/hooks/useMultifyTab.d.ts +0 -8
  90. package/es/packages/ui/src/theme/src/hooks/useOpenKeys.d.ts +0 -7
  91. package/es/packages/ui/src/theme/src/hooks/useTheme.d.ts +0 -9
  92. package/es/packages/ui/src/theme/src/setting/theme.setting.d.ts +0 -2
  93. package/es/packages/ui/src/theme/src/stores/index.d.ts +0 -3
  94. package/es/packages/ui/src/theme/src/stores/routeReuse.store.d.ts +0 -25
  95. package/es/packages/ui/src/theme/src/stores/theme.store.d.ts +0 -19
  96. package/es/packages/ui/src/theme/src/types/index.d.ts +0 -3
  97. package/es/packages/ui/src/theme/src/types/menu.type.d.ts +0 -15
  98. package/es/packages/ui/src/theme/src/types/theme.type.d.ts +0 -62
  99. 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>
@@ -45,7 +45,7 @@ export const ZH = {
45
45
  "NUMBER": "序号",
46
46
  "ACTIONS": "操作",
47
47
  "TOTAL_PAGE": "总共{total}条",
48
- "FILTER": "过滤",
48
+ "FILTER": "搜索...",
49
49
  "EXPAND_ALL": "展开全部",
50
50
  "COLLAPSE_ALL": "折叠全部",
51
51
  "SELECT_ALL1": "选择全部",
@@ -1,8 +1,8 @@
1
- import { defineComponent, toRaw, openBlock, createBlock, unref, withCtx, renderSlot, ref, h, createVNode, mergeProps, nextTick } from "vue";
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, dispatchResize, error } from "@dt-frames/core";
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(_sfc_main, mergeProps(curdOpt, {
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
- }, null)]
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: () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
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, normalizeStyle, renderList, normalizeProps, guardReactiveProps, reactive, watchEffect, onUnmounted } from "vue";
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
- createVNode(unref(DtScrollContainer), {
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(_sfc_main$2, {
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(_sfc_main$1, {
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
- const data = dataTransfer[unref(uidRef)];
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
- setModalData(data);
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(_sfc_main);
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";
@@ -56,7 +57,7 @@ function createPlaceholder(component) {
56
57
  if (component.includes("Input") || component.includes("Complete")) {
57
58
  return t("PLEASE_INPUT");
58
59
  }
59
- if (component.includes("Picker") || component.includes("Select") || component.includes("Cascader") || component.includes("Checkbox") || component.includes("Radio") || component.includes("Switch")) {
60
+ if (component.includes("Picker") || component.includes("Select") || component.includes("Cascader") || component.includes("Checkbox") || component.includes("Radio") || component.includes("Switch") || component.includes("Upload")) {
60
61
  return t("PLEASE_SELECT");
61
62
  }
62
63
  if (component.includes("Icon")) {
@@ -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(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
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: _sfc_main$3,
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: _sfc_main$4,
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
- schema: schema2,
417
- formModel,
418
- formActionType
427
+ formModel
419
428
  } = props;
420
429
  const {
421
430
  component,
@@ -423,7 +432,8 @@ const _sfc_main$2 = {
423
432
  changeEvent = "change",
424
433
  valueField,
425
434
  renderComponent,
426
- props: sProps
435
+ props: sProps,
436
+ extraName
427
437
  } = props.schema;
428
438
  const isCheck = component && ["Switch", "Checkbox"].includes(component);
429
439
  const eventKey = `on${upperFirst(changeEvent)}`;
@@ -487,13 +497,15 @@ const _sfc_main$2 = {
487
497
  itemProps.optionFilterProp = "label";
488
498
  }
489
499
  }
490
- if (!itemProps.disabled && component !== "RangePicker") {
500
+ if (component !== "RangePicker") {
491
501
  itemProps.placeholder = unref(getComponentProps)?.placeholder || createPlaceholder(component);
492
502
  }
493
503
  if (["DatePicker", "MonthPicker", "RangePicker"].includes(component)) {
494
504
  itemProps.defaultValue = props.formModel[name];
495
505
  }
496
- itemProps.codeName = name;
506
+ if (component === "Upload" && !itemProps.defaultFiles && extraName?.length) {
507
+ itemProps.defaultFiles = unref(getValues).values?.[extraName[0]];
508
+ }
497
509
  itemProps.formValues = unref(getValues);
498
510
  if (["Select", "DatePicker", "MonthPicker", "WeekPicker", "RangePicker"].includes(component)) {
499
511
  itemProps.dropdownClassName += ` ${unref(getUiSize)}`;
@@ -636,6 +648,7 @@ const _sfc_main$2 = {
636
648
  };
637
649
  }
638
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"]]);
639
652
  const _hoisted_1 = {
640
653
  key: 0,
641
654
  className: "preIcon pr-1"
@@ -783,18 +796,18 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
783
796
  icon: withCtx(() => [
784
797
  button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1, null, 512)), [
785
798
  [_directive_icon, button.preIcon]
786
- ]) : createCommentVNode("", true)
799
+ ]) : createCommentVNode("v-if", true)
787
800
  ]),
788
801
  default: withCtx(() => [
789
802
  createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
790
803
  button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2, null, 512)), [
791
804
  [_directive_icon, button.postIcon]
792
- ]) : createCommentVNode("", true)
805
+ ]) : createCommentVNode("v-if", true)
793
806
  ]),
794
807
  _: 2
795
808
  }, 1032, ["type", "class", "loading", "disabled", "onClick"])), [
796
809
  [_directive_auth, getAuth(button.auth)]
797
- ]) : createCommentVNode("", true)
810
+ ]) : createCommentVNode("v-if", true)
798
811
  ], 64);
799
812
  }), 256)),
800
813
  unref(showAdvanceRef) ? (openBlock(), createBlock(_component_AButton, {
@@ -804,22 +817,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
804
817
  onClick: toggleAdvanced
805
818
  }, {
806
819
  default: withCtx(() => [
820
+ createCommentVNode(" \u6536\u8D77 | \u5C55\u5F00 "),
807
821
  createElementVNode("span", _hoisted_3, toDisplayString(advancedRef.value ? unref(t)("UI.ADVANCED") : unref(t)("UI.EXPAND")), 1),
808
822
  createElementVNode("span", {
809
823
  class: normalizeClass(unref(getAdvanceClass))
810
824
  }, _hoisted_5, 2)
811
825
  ]),
812
826
  _: 1
813
- })) : createCommentVNode("", true)
827
+ })) : createCommentVNode("v-if", true)
814
828
  ]),
815
829
  _: 1
816
830
  }, 8, ["style"])
817
831
  ]),
818
832
  _: 1
819
- }, 16)) : createCommentVNode("", true);
833
+ }, 16)) : createCommentVNode("v-if", true);
820
834
  };
821
835
  }
822
836
  });
837
+ 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"]]);
823
838
  const SEARCH_BTN_NAME = "UI.SEARCH";
824
839
  const RESET_BTN_NAME = "UI.RESET";
825
840
  const SEARCH_BTNS = [
@@ -920,22 +935,22 @@ function useFormEvents({
920
935
  schemaRef.value = schemaList;
921
936
  }
922
937
  function _removeSchemaByName(name, schemaList) {
923
- const index = schemaList.findIndex((schema) => schema.name === name);
924
- if (index !== -1) {
938
+ const index2 = schemaList.findIndex((schema) => schema.name === name);
939
+ if (index2 !== -1) {
925
940
  delete formModel[name];
926
- schemaList.splice(index, 1);
941
+ schemaList.splice(index2, 1);
927
942
  }
928
943
  }
929
944
  function appendFormItems(schema, prefixName, first = false) {
930
945
  const schemaList = cloneDeep(unref(getSchema));
931
- const index = schemaList.findIndex((schema2) => schema2.name === prefixName);
932
- if (!prefixName || index === -1 || first) {
946
+ const index2 = schemaList.findIndex((schema2) => schema2.name === prefixName);
947
+ if (!prefixName || index2 === -1 || first) {
933
948
  first ? schemaList.unshift(...schema) : schemaList.push(...schema);
934
949
  schemaRef.value = schemaList;
935
950
  return;
936
951
  }
937
- if (index !== -1) {
938
- schemaList.splice(index + 1, 0, ...schema);
952
+ if (index2 !== -1) {
953
+ schemaList.splice(index2 + 1, 0, ...schema);
939
954
  }
940
955
  schemaRef.value = schemaList;
941
956
  }
@@ -1064,7 +1079,7 @@ function useFormValues({
1064
1079
  if (isArray(defaultValue2)) {
1065
1080
  let vals = defaultValue2.map((it) => format ? dayjs(it, format) : dayjs(it));
1066
1081
  if (names.length > 1) {
1067
- names.map((key, index) => obj[key] = vals[index] ?? null);
1082
+ names.map((key, index2) => obj[key] = vals[index2] ?? null);
1068
1083
  } else {
1069
1084
  obj[names[0]] = vals;
1070
1085
  }
@@ -1073,11 +1088,11 @@ function useFormValues({
1073
1088
  }
1074
1089
  } else {
1075
1090
  if (names.length > 1) {
1076
- names.forEach((key, index) => {
1077
- if (!defaultValue2 || defaultValue2.length - 1 < index) {
1091
+ names.forEach((key, index2) => {
1092
+ if (!defaultValue2 || defaultValue2.length - 1 < index2) {
1078
1093
  obj[key] = null;
1079
1094
  } else {
1080
- obj[key] = defaultValue2[index];
1095
+ obj[key] = defaultValue2[index2];
1081
1096
  }
1082
1097
  });
1083
1098
  } else {
@@ -1115,8 +1130,8 @@ function useFormActions(opt) {
1115
1130
  } = unref(getProps);
1116
1131
  let schema = [...schemas];
1117
1132
  if (showAdvancedButton) {
1118
- schema = schemas.reduce((t, it, index) => {
1119
- if (index > minShowColumn - 1)
1133
+ schema = schemas.reduce((t, it, index2) => {
1134
+ if (index2 > minShowColumn - 1)
1120
1135
  it.isAdvanced = isAdvanced;
1121
1136
  t.push(it);
1122
1137
  return t;
@@ -1446,7 +1461,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1446
1461
  } }), {
1447
1462
  default: withCtx(() => [
1448
1463
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(getSchema), (schema) => {
1449
- return openBlock(), createBlock(unref(_sfc_main$2), {
1464
+ return openBlock(), createBlock(unref(DtFormItem), {
1450
1465
  key: schema.name,
1451
1466
  schema,
1452
1467
  formProps: unref(getProps),
@@ -1465,7 +1480,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1465
1480
  })
1466
1481
  ]), 1032, ["schema", "formProps", "formModel", "defaultValues"]);
1467
1482
  }), 128)),
1468
- unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(_sfc_main$1), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("", true)
1483
+ unref(getActionsProps).buttonList?.length ? (openBlock(), createBlock(unref(DtFormButtons), mergeProps({ key: 0 }, unref(getActionsProps), { onHandleMethod: unref(handleMethod) }), null, 16, ["onHandleMethod"])) : createCommentVNode("v-if", true)
1469
1484
  ]),
1470
1485
  _: 3
1471
1486
  }, 16)
@@ -1475,6 +1490,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1475
1490
  };
1476
1491
  }
1477
1492
  });
1493
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/index.vue"]]);
1478
1494
  function useForm(props) {
1479
1495
  const formRef = ref(null);
1480
1496
  const loadedRef = ref(false);
@@ -1546,7 +1562,7 @@ function useForm(props) {
1546
1562
  return [register, methods];
1547
1563
  }
1548
1564
  export {
1549
- _sfc_main as DtForm,
1550
- _sfc_main$1 as DtFormButtons,
1565
+ index as DtForm,
1566
+ DtFormButtons,
1551
1567
  useForm
1552
1568
  };