@dt-frames/ui 1.0.12 → 1.0.13

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 (37) hide show
  1. package/es/components/curd/src/components/dialog.d.ts +20 -15
  2. package/es/components/curd/src/components/props.d.ts +4 -4
  3. package/es/components/curd/src/types/curd.type.d.ts +3 -2
  4. package/es/components/forms/src/components/formIcon.d.ts +10 -5
  5. package/es/components/index.d.ts +1 -1
  6. package/es/components/modal/src/components/modal.d.ts +2 -2
  7. package/es/components/modal/src/components/modalFooter.d.ts +9 -4
  8. package/es/components/modal/src/index.d.ts +10 -5
  9. package/es/components/modal/src/props.d.ts +2 -1
  10. package/es/components/table/src/hooks/useTable.d.ts +2 -2
  11. package/es/components/table/src/types/table.type.d.ts +2 -2
  12. package/es/components/upload/index.d.ts +1 -2
  13. package/es/components/upload/src/helper.d.ts +1 -0
  14. package/es/components/upload/src/index.d.ts +13 -9
  15. package/es/components/upload/src/props.d.ts +4 -1
  16. package/es/components/upload/src/upload.d.ts +18 -6
  17. package/es/index.js +220 -204
  18. package/es/style/components/upload/index.less +3 -11
  19. package/package.json +1 -1
  20. package/src/components/curd/src/components/dialog.vue +0 -1
  21. package/src/components/curd/src/components/props.ts +4 -4
  22. package/src/components/curd/src/hooks/useCurd.tsx +1 -1
  23. package/src/components/curd/src/types/curd.type.ts +3 -2
  24. package/src/components/index.ts +1 -2
  25. package/src/components/modal/src/components/modalFooter.vue +10 -2
  26. package/src/components/modal/src/index.vue +18 -7
  27. package/src/components/modal/src/props.ts +3 -2
  28. package/src/components/table/src/hooks/useRowSelection.ts +1 -1
  29. package/src/components/table/src/hooks/useTable.ts +1 -1
  30. package/src/components/table/src/hooks/useTableHeader.ts +2 -2
  31. package/src/components/table/src/types/table.type.ts +2 -2
  32. package/src/components/upload/index.less +3 -11
  33. package/src/components/upload/index.ts +0 -2
  34. package/src/components/upload/src/helper.ts +29 -1
  35. package/src/components/upload/src/props.ts +4 -1
  36. package/src/components/upload/src/upload.vue +88 -63
  37. package/src/components/upload/src/index.vue +0 -38
package/es/index.js CHANGED
@@ -14,15 +14,15 @@ var _export_sfc = (sfc, props) => {
14
14
  }
15
15
  return target;
16
16
  };
17
- const _sfc_main$Z = defineComponent({
17
+ const _sfc_main$Y = defineComponent({
18
18
  name: "dt-base-router"
19
19
  });
20
20
  function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
21
21
  const _component_router_view = resolveComponent("router-view");
22
22
  return openBlock(), createBlock(_component_router_view);
23
23
  }
24
- var DtBaseRouter = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$8]]);
25
- const _sfc_main$Y = defineComponent({
24
+ var DtBaseRouter = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$8]]);
25
+ const _sfc_main$X = defineComponent({
26
26
  props: {
27
27
  iconClass: {
28
28
  type: String,
@@ -90,7 +90,7 @@ const _sfc_main$Y = defineComponent({
90
90
  };
91
91
  }
92
92
  });
93
- const _hoisted_1$x = ["xlink:href", "fill"];
93
+ const _hoisted_1$w = ["xlink:href", "fill"];
94
94
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
95
95
  return _ctx.isSvgIcon ? (openBlock(), createElementBlock("svg", {
96
96
  key: 0,
@@ -105,7 +105,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
105
105
  createElementVNode("use", {
106
106
  "xlink:href": _ctx.iconName,
107
107
  fill: _ctx.color
108
- }, null, 8, _hoisted_1$x)
108
+ }, null, 8, _hoisted_1$w)
109
109
  ], 6)) : (openBlock(), createElementBlock("i", {
110
110
  key: 1,
111
111
  class: normalizeClass(["dt-icon i", [_ctx.iconName, _ctx.clsName]]),
@@ -115,7 +115,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
115
115
  })
116
116
  }, null, 6));
117
117
  }
118
- var DtIcon = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$7]]);
118
+ var DtIcon = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$7]]);
119
119
  const Actions = [
120
120
  "ic:baseline-save",
121
121
  "ic:baseline-save-all",
@@ -1874,9 +1874,9 @@ const Icons = [
1874
1874
  children: Other
1875
1875
  }
1876
1876
  ];
1877
- const _hoisted_1$w = ["onClick"];
1878
- const _hoisted_2$l = ["onClick"];
1879
- const _sfc_main$X = /* @__PURE__ */ defineComponent({
1877
+ const _hoisted_1$v = ["onClick"];
1878
+ const _hoisted_2$k = ["onClick"];
1879
+ const _sfc_main$W = /* @__PURE__ */ defineComponent({
1880
1880
  __name: "pick-icon",
1881
1881
  emits: ["chooseIcon"],
1882
1882
  setup(__props, { emit: emits }) {
@@ -1943,7 +1943,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1943
1943
  createTextVNode(toDisplayString(menu.type), 1),
1944
1944
  createElementVNode("span", null, "(" + toDisplayString(menu.total) + ")", 1)
1945
1945
  ])
1946
- ], 10, _hoisted_1$w);
1946
+ ], 10, _hoisted_1$v);
1947
1947
  }), 128))
1948
1948
  ], 2),
1949
1949
  createElementVNode("div", {
@@ -1980,7 +1980,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1980
1980
  ]),
1981
1981
  _: 2
1982
1982
  }, 1024)
1983
- ], 10, _hoisted_2$l);
1983
+ ], 10, _hoisted_2$k);
1984
1984
  }), 128))
1985
1985
  ], 2)
1986
1986
  ], 1024))
@@ -2384,8 +2384,8 @@ var Bar = defineComponent({
2384
2384
  }));
2385
2385
  }
2386
2386
  });
2387
- const _hoisted_1$v = { class: "scrollbar" };
2388
- const _sfc_main$W = /* @__PURE__ */ defineComponent({
2387
+ const _hoisted_1$u = { class: "scrollbar" };
2388
+ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2389
2389
  __name: "scroll-bar",
2390
2390
  props: {
2391
2391
  wrapClass: {
@@ -2462,7 +2462,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
2462
2462
  }
2463
2463
  });
2464
2464
  return (_ctx, _cache) => {
2465
- return openBlock(), createElementBlock("div", _hoisted_1$v, [
2465
+ return openBlock(), createElementBlock("div", _hoisted_1$u, [
2466
2466
  createElementVNode("div", {
2467
2467
  ref_key: "wrap",
2468
2468
  ref: wrap,
@@ -2497,12 +2497,12 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
2497
2497
  };
2498
2498
  }
2499
2499
  });
2500
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
2500
+ const _sfc_main$U = /* @__PURE__ */ defineComponent({
2501
2501
  __name: "scroll-container",
2502
2502
  setup(__props) {
2503
2503
  const scrollbarRef = ref(null);
2504
2504
  return (_ctx, _cache) => {
2505
- return openBlock(), createBlock(_sfc_main$W, mergeProps({
2505
+ return openBlock(), createBlock(_sfc_main$V, mergeProps({
2506
2506
  ref_key: "scrollbarRef",
2507
2507
  ref: scrollbarRef,
2508
2508
  class: "scroll-container"
@@ -2515,7 +2515,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2515
2515
  };
2516
2516
  }
2517
2517
  });
2518
- const _sfc_main$U = /* @__PURE__ */ defineComponent({
2518
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
2519
2519
  __name: "modal-wrap",
2520
2520
  props: {
2521
2521
  loading: { type: Boolean },
@@ -2603,7 +2603,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
2603
2603
  }
2604
2604
  });
2605
2605
  return (_ctx, _cache) => {
2606
- return openBlock(), createBlock(unref(_sfc_main$V), {
2606
+ return openBlock(), createBlock(unref(_sfc_main$U), {
2607
2607
  ref_key: "wrapperRef",
2608
2608
  ref: wrapperRef
2609
2609
  }, {
@@ -2689,7 +2689,7 @@ function useFormValue(props, key = "value", changeEvent = "change", emitData) {
2689
2689
  });
2690
2690
  return [state, setState, defaultState];
2691
2691
  }
2692
- const _sfc_main$T = defineComponent({
2692
+ const _sfc_main$S = defineComponent({
2693
2693
  name: "radio-button",
2694
2694
  props: {
2695
2695
  value: {
@@ -2747,8 +2747,8 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
2747
2747
  _: 1
2748
2748
  }, 16, ["value"]);
2749
2749
  }
2750
- var RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$6]]);
2751
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
2750
+ var RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$6]]);
2751
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
2752
2752
  __name: "formIcon",
2753
2753
  props: {
2754
2754
  value: String,
@@ -2798,9 +2798,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
2798
2798
  ]),
2799
2799
  _: 1
2800
2800
  }),
2801
- createVNode(unref(_sfc_main$L), { onRegister: unref(register) }, {
2801
+ createVNode(unref(_sfc_main$K), { onRegister: unref(register) }, {
2802
2802
  default: withCtx(() => [
2803
- createVNode(unref(_sfc_main$X), {
2803
+ createVNode(unref(_sfc_main$W), {
2804
2804
  onChooseIcon: _cache[2] || (_cache[2] = ($event) => chooseIcon($event))
2805
2805
  })
2806
2806
  ]),
@@ -2810,8 +2810,8 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
2810
2810
  };
2811
2811
  }
2812
2812
  });
2813
- const _hoisted_1$u = { class: "input-with-dialog" };
2814
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
2813
+ const _hoisted_1$t = { class: "input-with-dialog" };
2814
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
2815
2815
  __name: "formInputUseDialog",
2816
2816
  setup(__props) {
2817
2817
  const attrs = useAttrs$1();
@@ -2836,7 +2836,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
2836
2836
  [...schema.linkProps, schema.name].forEach((it) => model[it] = null);
2837
2837
  }
2838
2838
  return (_ctx, _cache) => {
2839
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
2839
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
2840
2840
  createElementVNode("div", { onClick: onClickInput }, [
2841
2841
  createVNode(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
2842
2842
  ]),
@@ -2850,7 +2850,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
2850
2850
  });
2851
2851
  const components = {
2852
2852
  Input,
2853
- InputWithDialog: _sfc_main$R,
2853
+ InputWithDialog: _sfc_main$Q,
2854
2854
  InputTextArea: Input.TextArea,
2855
2855
  InputSearch: Input.Search,
2856
2856
  InputGroup: Input.Group,
@@ -2874,7 +2874,7 @@ const components = {
2874
2874
  Slider,
2875
2875
  Rate,
2876
2876
  Divider,
2877
- Icon: _sfc_main$S
2877
+ Icon: _sfc_main$R
2878
2878
  };
2879
2879
  const componentMap$1 = /* @__PURE__ */ new Map();
2880
2880
  for (let item in components) {
@@ -2982,7 +2982,7 @@ const FormItemProps = {
2982
2982
  function _isSlot(s) {
2983
2983
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
2984
2984
  }
2985
- var _sfc_main$Q = defineComponent({
2985
+ var _sfc_main$P = defineComponent({
2986
2986
  name: "FormItem",
2987
2987
  inheritAttrs: false,
2988
2988
  props: FormItemProps,
@@ -3369,7 +3369,7 @@ function initDirectives() {
3369
3369
  }
3370
3370
  };
3371
3371
  }
3372
- const _sfc_main$P = defineComponent({
3372
+ const _sfc_main$O = defineComponent({
3373
3373
  name: "form-buttons",
3374
3374
  props: {
3375
3375
  mode: {
@@ -3456,11 +3456,11 @@ const _sfc_main$P = defineComponent({
3456
3456
  };
3457
3457
  }
3458
3458
  });
3459
- const _hoisted_1$t = {
3459
+ const _hoisted_1$s = {
3460
3460
  key: 0,
3461
3461
  className: "preIcon"
3462
3462
  };
3463
- const _hoisted_2$k = {
3463
+ const _hoisted_2$j = {
3464
3464
  key: 0,
3465
3465
  className: "preIcon"
3466
3466
  };
@@ -3492,13 +3492,13 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3492
3492
  onClick: ($event) => _ctx.handleBtnClick(button)
3493
3493
  }, {
3494
3494
  icon: withCtx(() => [
3495
- button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$t, null, 512)), [
3495
+ button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$s, null, 512)), [
3496
3496
  [_directive_icon, button.preIcon]
3497
3497
  ]) : createCommentVNode("", true)
3498
3498
  ]),
3499
3499
  default: withCtx(() => [
3500
3500
  createTextVNode(" " + toDisplayString(button.name) + " ", 1),
3501
- button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$k, null, 512)), [
3501
+ button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$j, null, 512)), [
3502
3502
  [_directive_icon, button.postIcon]
3503
3503
  ]) : createCommentVNode("", true)
3504
3504
  ]),
@@ -3532,7 +3532,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3532
3532
  _: 1
3533
3533
  }, 16)) : createCommentVNode("", true);
3534
3534
  }
3535
- var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$5]]);
3535
+ var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$5]]);
3536
3536
  const isArray = Array.isArray;
3537
3537
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3538
3538
  var dayjs_min = { exports: {} };
@@ -4005,12 +4005,12 @@ function useFormActions(opt) {
4005
4005
  }
4006
4006
  return [handleMethod];
4007
4007
  }
4008
- const _sfc_main$O = defineComponent({
4008
+ const _sfc_main$N = defineComponent({
4009
4009
  name: "dt-form",
4010
4010
  components: {
4011
4011
  Form,
4012
4012
  Row,
4013
- FormItem: _sfc_main$Q,
4013
+ FormItem: _sfc_main$P,
4014
4014
  FormButtons
4015
4015
  },
4016
4016
  props: BasicProps$1,
@@ -4239,7 +4239,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
4239
4239
  _: 3
4240
4240
  }, 16, ["class", "model", "layout"]);
4241
4241
  }
4242
- var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$4]]);
4242
+ var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$4]]);
4243
4243
  function useForm(props) {
4244
4244
  const formRef = ref(null);
4245
4245
  const loadedRef = ref(false);
@@ -4312,9 +4312,10 @@ function useForm(props) {
4312
4312
  };
4313
4313
  return [registerForm, methods];
4314
4314
  }
4315
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
4315
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4316
4316
  __name: "modalFooter",
4317
4317
  props: {
4318
+ buttons: Object,
4318
4319
  showSave: {
4319
4320
  type: Boolean,
4320
4321
  default: true
@@ -4325,10 +4326,16 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4325
4326
  "handleCancel"
4326
4327
  ],
4327
4328
  setup(__props, { emit: emits }) {
4329
+ const props = __props;
4328
4330
  const buttonActions = [
4329
4331
  { name: "\u4FDD\u5B58", preIcon: "mdi:content-save", type: "primary", flag: "OK" },
4330
4332
  { name: "\u5173\u95ED", preIcon: "mdi:close", flag: "CANCEL" }
4331
4333
  ];
4334
+ const buttonList = computed(() => {
4335
+ if (props.buttons && props.buttons.length)
4336
+ return props.buttons;
4337
+ return buttonActions;
4338
+ });
4332
4339
  function handleMethod(item) {
4333
4340
  switch (item.flag) {
4334
4341
  case "OK":
@@ -4344,14 +4351,14 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
4344
4351
  renderSlot(_ctx.$slots, "appendFooter"),
4345
4352
  createVNode(unref(FormButtons), {
4346
4353
  mode: "dialog",
4347
- buttonList: buttonActions,
4354
+ buttonList: unref(buttonList),
4348
4355
  onHandleMethod: _cache[0] || (_cache[0] = ($event) => handleMethod($event))
4349
- })
4356
+ }, null, 8, ["buttonList"])
4350
4357
  ], 64);
4351
4358
  };
4352
4359
  }
4353
4360
  });
4354
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
4361
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4355
4362
  __name: "close-icon",
4356
4363
  props: {
4357
4364
  canFullscreen: { type: Boolean, default: true },
@@ -4416,7 +4423,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
4416
4423
  };
4417
4424
  }
4418
4425
  });
4419
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
4426
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
4420
4427
  __name: "index",
4421
4428
  props: basicProps$1,
4422
4429
  emits: ["visible-change", "height-change", "cancel", "save", "register", "update:visible"],
@@ -4426,6 +4433,12 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4426
4433
  const propsRef = ref();
4427
4434
  const modalWrapperRef = ref(null);
4428
4435
  const extHeightRef = ref(0);
4436
+ const modalFooterHeight = computed(() => {
4437
+ if (isArray$1(props.footer)) {
4438
+ return unref(propsRef).footer.length ? 0 : void 0;
4439
+ }
4440
+ return props.footer !== void 0 && !props.footer ? 0 : void 0;
4441
+ });
4429
4442
  const modalMethods = {
4430
4443
  setModalProps,
4431
4444
  emitVisible: void 0,
@@ -4458,7 +4471,11 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4458
4471
  visible: unref(visibleRef),
4459
4472
  wrapClassName: unref(getWrapClassName)
4460
4473
  };
4461
- return omit(bindValue, unref(fullScreenRef) ? ["height", "title"] : "title");
4474
+ let omitArr = unref(fullScreenRef) ? ["height", "title"] : ["title"];
4475
+ if (isArray$1(unref(propsRef).footer)) {
4476
+ omitArr.push("footer");
4477
+ }
4478
+ return omit(bindValue, omitArr);
4462
4479
  });
4463
4480
  const getWrapperHeight = computed(() => {
4464
4481
  if (unref(fullScreenRef))
@@ -4518,7 +4535,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4518
4535
  return (_ctx, _cache) => {
4519
4536
  return openBlock(), createBlock(unref(Modal), mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
4520
4537
  default: withCtx(() => [
4521
- createVNode(_sfc_main$U, mergeProps({
4538
+ createVNode(_sfc_main$T, mergeProps({
4522
4539
  useWrapper: unref(getBindValue).useWrapper,
4523
4540
  footerOffset: _ctx.wrapperFooterOffset,
4524
4541
  fullScreen: unref(fullScreenRef),
@@ -4529,7 +4546,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4529
4546
  minHeight: unref(getBindValue).minHeight,
4530
4547
  height: unref(getWrapperHeight),
4531
4548
  visible: visibleRef.value,
4532
- modalFooterHeight: _ctx.footer !== void 0 && !_ctx.footer ? 0 : void 0
4549
+ modalFooterHeight: unref(modalFooterHeight)
4533
4550
  }, unref(omit)(unref(getBindValue).wrapperProps, "visible", "height", "modalFooterHeight"), {
4534
4551
  onExtHeight: handleExtHeight,
4535
4552
  onHeightChange: handleHeightChange
@@ -4545,7 +4562,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4545
4562
  !_ctx.$slots.closeIcon ? {
4546
4563
  name: "closeIcon",
4547
4564
  fn: withCtx(() => [
4548
- createVNode(_sfc_main$M, {
4565
+ createVNode(_sfc_main$L, {
4549
4566
  canFullscreen: unref(getBindValue).canFullscreen,
4550
4567
  fullScreen: unref(fullScreenRef),
4551
4568
  onCancel: handleCancel,
@@ -4562,7 +4579,8 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4562
4579
  !_ctx.$slots.footer ? {
4563
4580
  name: "footer",
4564
4581
  fn: withCtx(() => [
4565
- createVNode(_sfc_main$N, {
4582
+ createVNode(_sfc_main$M, {
4583
+ buttons: propsRef.value.footer,
4566
4584
  showSave: unref(getBindValue).showSave,
4567
4585
  onHandleSave: handleSave,
4568
4586
  onHandleCancel: handleCancel
@@ -4575,7 +4593,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
4575
4593
  ])
4576
4594
  };
4577
4595
  })
4578
- ]), 1032, ["showSave"])
4596
+ ]), 1032, ["buttons", "showSave"])
4579
4597
  ])
4580
4598
  } : void 0,
4581
4599
  renderList(Object.keys(unref(omit)(_ctx.$slots, "default")), (item) => {
@@ -5028,7 +5046,7 @@ function useRowSelection(propsRef, emit) {
5028
5046
  setSelectedRowKeys
5029
5047
  };
5030
5048
  }
5031
- var _sfc_main$K = defineComponent({
5049
+ var _sfc_main$J = defineComponent({
5032
5050
  name: "TableFormat",
5033
5051
  props: {
5034
5052
  column: {
@@ -5129,7 +5147,7 @@ const CellComponent = ({
5129
5147
  content: () => ruleMessage
5130
5148
  });
5131
5149
  };
5132
- var _sfc_main$J = defineComponent({
5150
+ var _sfc_main$I = defineComponent({
5133
5151
  name: "EditableCell",
5134
5152
  components: {
5135
5153
  Spin,
@@ -5275,11 +5293,11 @@ var _sfc_main$J = defineComponent({
5275
5293
  };
5276
5294
  }
5277
5295
  });
5278
- const _hoisted_1$s = { class: "editable-cell" };
5296
+ const _hoisted_1$r = { class: "editable-cell" };
5279
5297
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
5280
5298
  var _a;
5281
5299
  const _component_CellComponent = resolveComponent("CellComponent");
5282
- return openBlock(), createElementBlock("div", _hoisted_1$s, [
5300
+ return openBlock(), createElementBlock("div", _hoisted_1$r, [
5283
5301
  createVNode(_component_CellComponent, mergeProps({ ref: "elRef" }, _ctx.getComponentProps, {
5284
5302
  component: (_a = _ctx.column) == null ? void 0 : _a.editComponent,
5285
5303
  popoverVisible: _ctx.getRuleVisible,
@@ -5291,7 +5309,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
5291
5309
  }), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class", "onChange", "onOptionsChange"])
5292
5310
  ]);
5293
5311
  }
5294
- var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$3]]);
5312
+ var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$3]]);
5295
5313
  function renderEditCell(column) {
5296
5314
  return ({ text: value, record, index }) => {
5297
5315
  record.onValid = async () => {
@@ -5330,9 +5348,9 @@ function renderEditCell(column) {
5330
5348
  });
5331
5349
  };
5332
5350
  }
5333
- const _hoisted_1$r = { class: "dt-table-action-btn" };
5334
- const _hoisted_2$j = ["color", "onClick"];
5335
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
5351
+ const _hoisted_1$q = { class: "dt-table-action-btn" };
5352
+ const _hoisted_2$i = ["color", "onClick"];
5353
+ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5336
5354
  __name: "TableActions",
5337
5355
  props: {
5338
5356
  fixed: {
@@ -5388,7 +5406,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5388
5406
  return (_ctx, _cache) => {
5389
5407
  const _directive_icon = resolveDirective("icon");
5390
5408
  return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.btns, (item) => {
5391
- return openBlock(), createElementBlock("span", _hoisted_1$r, [
5409
+ return openBlock(), createElementBlock("span", _hoisted_1$q, [
5392
5410
  item.ifShow ? (openBlock(), createBlock(unref(Tooltip), {
5393
5411
  key: 0,
5394
5412
  placement: "bottom"
@@ -5400,7 +5418,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5400
5418
  withDirectives(createElementVNode("span", {
5401
5419
  color: item.color,
5402
5420
  onClick: ($event) => handleAction(item)
5403
- }, null, 8, _hoisted_2$j), [
5421
+ }, null, 8, _hoisted_2$i), [
5404
5422
  [_directive_icon, item.icon]
5405
5423
  ])
5406
5424
  ]),
@@ -5558,7 +5576,7 @@ function handleActionColumn(propsRef, columns) {
5558
5576
  columns.push({
5559
5577
  ...columnObj,
5560
5578
  customRender: ({ record, index }) => {
5561
- return h(_sfc_main$I, omit({
5579
+ return h(_sfc_main$H, omit({
5562
5580
  ...columnObj,
5563
5581
  record,
5564
5582
  index
@@ -5672,8 +5690,8 @@ function useColumns(propsRef, getPaginationRef) {
5672
5690
  getCacheColumns
5673
5691
  };
5674
5692
  }
5675
- const _hoisted_1$q = /* @__PURE__ */ createElementVNode("span", null, "\u5217\u63A7\u5236", -1);
5676
- const _hoisted_2$i = /* @__PURE__ */ createTextVNode(" \u5217\u5C55\u793A ");
5693
+ const _hoisted_1$p = /* @__PURE__ */ createElementVNode("span", null, "\u5217\u63A7\u5236", -1);
5694
+ const _hoisted_2$h = /* @__PURE__ */ createTextVNode(" \u5217\u5C55\u793A ");
5677
5695
  const _hoisted_3$b = /* @__PURE__ */ createTextVNode(" \u5E8F\u5217\u53F7 ");
5678
5696
  const _hoisted_4$8 = /* @__PURE__ */ createTextVNode(" \u590D\u9009\u6846 ");
5679
5697
  const _hoisted_5$5 = /* @__PURE__ */ createTextVNode("\u91CD\u7F6E");
@@ -5683,7 +5701,7 @@ const _hoisted_6$2 = {
5683
5701
  };
5684
5702
  const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u5DE6\u4FA7");
5685
5703
  const _hoisted_8$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u53F3\u4FA7");
5686
- const _sfc_main$H = /* @__PURE__ */ defineComponent({
5704
+ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5687
5705
  __name: "Column",
5688
5706
  emits: [
5689
5707
  "columns-change"
@@ -5862,7 +5880,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5862
5880
  const _directive_icon = resolveDirective("icon");
5863
5881
  return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
5864
5882
  title: withCtx(() => [
5865
- _hoisted_1$q
5883
+ _hoisted_1$p
5866
5884
  ]),
5867
5885
  default: withCtx(() => [
5868
5886
  createVNode(unref(Popover), {
@@ -5883,7 +5901,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
5883
5901
  onChange: onCheckAllChange
5884
5902
  }, {
5885
5903
  default: withCtx(() => [
5886
- _hoisted_2$i
5904
+ _hoisted_2$h
5887
5905
  ]),
5888
5906
  _: 1
5889
5907
  }, 8, ["indeterminate", "checked"]),
@@ -6015,10 +6033,10 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
6015
6033
  };
6016
6034
  }
6017
6035
  });
6018
- const _hoisted_1$p = { key: 0 };
6019
- const _hoisted_2$h = { key: 0 };
6036
+ const _hoisted_1$o = { key: 0 };
6037
+ const _hoisted_2$g = { key: 0 };
6020
6038
  const _hoisted_3$a = { key: 1 };
6021
- const _sfc_main$G = /* @__PURE__ */ defineComponent({
6039
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6022
6040
  __name: "Fullscreen",
6023
6041
  setup(__props) {
6024
6042
  const table = getTableInstance();
@@ -6041,13 +6059,13 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
6041
6059
  const _directive_icon = resolveDirective("icon");
6042
6060
  return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
6043
6061
  title: withCtx(() => [
6044
- !unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$p, "\u5168\u5C4F")) : createCommentVNode("", true)
6062
+ !unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$o, "\u5168\u5C4F")) : createCommentVNode("", true)
6045
6063
  ]),
6046
6064
  default: withCtx(() => [
6047
6065
  createElementVNode("span", {
6048
6066
  onClick: _cache[0] || (_cache[0] = (...args) => unref(toggle) && unref(toggle)(...args))
6049
6067
  }, [
6050
- !unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$h, null, 512)), [
6068
+ !unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$g, null, 512)), [
6051
6069
  [_directive_icon, "ic:baseline-fullscreen"]
6052
6070
  ]) : withDirectives((openBlock(), createElementBlock("span", _hoisted_3$a, null, 512)), [
6053
6071
  [_directive_icon, "ic:baseline-fullscreen-exit"]
@@ -6059,11 +6077,11 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
6059
6077
  };
6060
6078
  }
6061
6079
  });
6062
- const _hoisted_1$o = /* @__PURE__ */ createTextVNode("\u5BC6\u5EA6");
6063
- const _hoisted_2$g = /* @__PURE__ */ createElementVNode("span", null, "\u9ED8\u8BA4", -1);
6080
+ const _hoisted_1$n = /* @__PURE__ */ createTextVNode("\u5BC6\u5EA6");
6081
+ const _hoisted_2$f = /* @__PURE__ */ createElementVNode("span", null, "\u9ED8\u8BA4", -1);
6064
6082
  const _hoisted_3$9 = /* @__PURE__ */ createElementVNode("span", null, "\u4E2D\u7B49", -1);
6065
6083
  const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("span", null, "\u7D27\u51D1", -1);
6066
- const _sfc_main$F = /* @__PURE__ */ defineComponent({
6084
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6067
6085
  __name: "Size",
6068
6086
  setup(__props) {
6069
6087
  const table = getTableInstance();
@@ -6076,7 +6094,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6076
6094
  const _directive_icon = resolveDirective("icon");
6077
6095
  return openBlock(), createBlock(unref(Tooltip), null, {
6078
6096
  title: withCtx(() => [
6079
- _hoisted_1$o
6097
+ _hoisted_1$n
6080
6098
  ]),
6081
6099
  default: withCtx(() => [
6082
6100
  createVNode(unref(Dropdown), {
@@ -6094,7 +6112,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6094
6112
  default: withCtx(() => [
6095
6113
  createVNode(unref(MenuItem), { key: "default" }, {
6096
6114
  default: withCtx(() => [
6097
- _hoisted_2$g
6115
+ _hoisted_2$f
6098
6116
  ]),
6099
6117
  _: 1
6100
6118
  }),
@@ -6127,11 +6145,11 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6127
6145
  };
6128
6146
  }
6129
6147
  });
6130
- const _hoisted_1$n = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA", -1);
6131
- const _hoisted_2$f = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u5F53\u524D\u9875", -1);
6148
+ const _hoisted_1$m = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA", -1);
6149
+ const _hoisted_2$e = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u5F53\u524D\u9875", -1);
6132
6150
  const _hoisted_3$8 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u9009\u4E2D\u5217", -1);
6133
6151
  const _hoisted_4$6 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u6240\u6709\u5217", -1);
6134
- const _sfc_main$E = /* @__PURE__ */ defineComponent({
6152
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
6135
6153
  __name: "Download",
6136
6154
  setup(__props) {
6137
6155
  const table = getTableInstance();
@@ -6149,7 +6167,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6149
6167
  const _directive_icon = resolveDirective("icon");
6150
6168
  return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
6151
6169
  title: withCtx(() => [
6152
- _hoisted_1$n
6170
+ _hoisted_1$m
6153
6171
  ]),
6154
6172
  default: withCtx(() => [
6155
6173
  createVNode(unref(Dropdown), {
@@ -6162,7 +6180,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6162
6180
  default: withCtx(() => [
6163
6181
  createVNode(unref(MenuItem), { key: "current" }, {
6164
6182
  default: withCtx(() => [
6165
- _hoisted_2$f
6183
+ _hoisted_2$e
6166
6184
  ]),
6167
6185
  _: 1
6168
6186
  }),
@@ -6195,13 +6213,13 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
6195
6213
  };
6196
6214
  }
6197
6215
  });
6198
- const _sfc_main$D = defineComponent({
6216
+ const _sfc_main$C = defineComponent({
6199
6217
  name: "table-setting",
6200
6218
  components: {
6201
- ColumnSetting: _sfc_main$H,
6202
- FullscreenSetting: _sfc_main$G,
6203
- SizeSetting: _sfc_main$F,
6204
- Download: _sfc_main$E
6219
+ ColumnSetting: _sfc_main$G,
6220
+ FullscreenSetting: _sfc_main$F,
6221
+ SizeSetting: _sfc_main$E,
6222
+ Download: _sfc_main$D
6205
6223
  },
6206
6224
  props: {
6207
6225
  setting: {
@@ -6244,8 +6262,8 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
6244
6262
  _ctx.getSetting.fullscreen ? (openBlock(), createBlock(_component_FullscreenSetting, { key: 3 })) : createCommentVNode("", true)
6245
6263
  ], 64);
6246
6264
  }
6247
- var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$2]]);
6248
- const _sfc_main$C = defineComponent({
6265
+ var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$2]]);
6266
+ const _sfc_main$B = defineComponent({
6249
6267
  name: "table-header",
6250
6268
  components: {
6251
6269
  TableSettinCom,
@@ -6285,8 +6303,8 @@ const _sfc_main$C = defineComponent({
6285
6303
  };
6286
6304
  }
6287
6305
  });
6288
- const _hoisted_1$m = { class: "dt-table-header" };
6289
- const _hoisted_2$e = { class: "dt-table-header-actions" };
6306
+ const _hoisted_1$l = { class: "dt-table-header" };
6307
+ const _hoisted_2$d = { class: "dt-table-header-actions" };
6290
6308
  const _hoisted_3$7 = { class: "dt-table-header-actions__left" };
6291
6309
  const _hoisted_4$5 = {
6292
6310
  key: 0,
@@ -6299,8 +6317,8 @@ const _hoisted_5$4 = {
6299
6317
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
6300
6318
  const _component_FormButtons = resolveComponent("FormButtons");
6301
6319
  const _component_TableSettinCom = resolveComponent("TableSettinCom");
6302
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
6303
- createElementVNode("div", _hoisted_2$e, [
6320
+ return openBlock(), createElementBlock("div", _hoisted_1$l, [
6321
+ createElementVNode("div", _hoisted_2$d, [
6304
6322
  createElementVNode("div", _hoisted_3$7, [
6305
6323
  createVNode(_component_FormButtons, mergeProps(_ctx.getActionsProps, { onHandleMethod: _ctx.handleMethod }), null, 16, ["onHandleMethod"]),
6306
6324
  renderSlot(_ctx.$slots, "toolbar")
@@ -6317,12 +6335,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
6317
6335
  ])) : createCommentVNode("", true)
6318
6336
  ]);
6319
6337
  }
6320
- var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$1]]);
6338
+ var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$1]]);
6321
6339
  function useTableHeader(propsRef, slots, handlers) {
6322
6340
  const getHeaderProps = computed(() => {
6323
- const { tableSetting, toolbar = [] } = unref(propsRef);
6341
+ const { tableSetting, toolbar } = unref(propsRef);
6324
6342
  const { getSlot } = useSlots();
6325
- const hideTitle = !toolbar.length && !slots.toolbar && !slots.headerTop && !tableSetting;
6343
+ const hideTitle = !toolbar && !slots.toolbar && !slots.headerTop && !tableSetting;
6326
6344
  return {
6327
6345
  title: hideTitle ? null : () => h(TableHeader, {
6328
6346
  tableTools: tableSetting,
@@ -6561,12 +6579,12 @@ function useCustomRow(propsRef, { setSelectedRowKeys, getSelectRowKeys, clearSel
6561
6579
  customRow
6562
6580
  };
6563
6581
  }
6564
- const _sfc_main$B = defineComponent({
6582
+ const _sfc_main$A = defineComponent({
6565
6583
  name: "dt-table",
6566
6584
  props: TableProps,
6567
6585
  components: {
6568
6586
  Table,
6569
- TableRender: _sfc_main$K
6587
+ TableRender: _sfc_main$J
6570
6588
  },
6571
6589
  emits: [
6572
6590
  "register",
@@ -6710,7 +6728,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
6710
6728
  })
6711
6729
  ]), 1040, ["rowClassName", "onChange", "onResizeColumn"]);
6712
6730
  }
6713
- var DtTable = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render]]);
6731
+ var DtTable = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render]]);
6714
6732
  function useFetch(api, baseUrl = "") {
6715
6733
  function fetch(params) {
6716
6734
  let type, header = {}, model = {};
@@ -6924,9 +6942,9 @@ const basicProps = {
6924
6942
  type: Array,
6925
6943
  default: []
6926
6944
  },
6927
- actions: {
6945
+ footer: {
6928
6946
  type: Array,
6929
- default: []
6947
+ default: void 0
6930
6948
  },
6931
6949
  canFullscreen: {
6932
6950
  type: Boolean,
@@ -6940,7 +6958,7 @@ const basicProps = {
6940
6958
  type: Object
6941
6959
  }
6942
6960
  };
6943
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
6961
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
6944
6962
  __name: "dialog",
6945
6963
  props: {
6946
6964
  ...basicProps,
@@ -6959,7 +6977,6 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
6959
6977
  const props = __props;
6960
6978
  const [registerDialog, { closeModal }] = useModal({
6961
6979
  ...omit(toRaw(props), [
6962
- "actions",
6963
6980
  "curd",
6964
6981
  "formProps",
6965
6982
  "formsVal",
@@ -6987,7 +7004,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
6987
7004
  }
6988
7005
  }
6989
7006
  return (_ctx, _cache) => {
6990
- return openBlock(), createBlock(unref(_sfc_main$L), {
7007
+ return openBlock(), createBlock(unref(_sfc_main$K), {
6991
7008
  onRegister: unref(registerDialog),
6992
7009
  onSave: handleSave
6993
7010
  }, {
@@ -7002,8 +7019,6 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
7002
7019
  function useCurd(curdOpt) {
7003
7020
  const formsVal = ref();
7004
7021
  const [register, {
7005
- closeModal,
7006
- setModalProps,
7007
7022
  openModal
7008
7023
  }] = useModalOut();
7009
7024
  const {
@@ -7012,7 +7027,7 @@ function useCurd(curdOpt) {
7012
7027
  const DtCurdModal = () => {
7013
7028
  return h(createVNode("div", {
7014
7029
  "class": "curdModal"
7015
- }, [createVNode(_sfc_main$A, mergeProps(curdOpt, {
7030
+ }, [createVNode(_sfc_main$z, mergeProps(curdOpt, {
7016
7031
  "formsVal": formsVal,
7017
7032
  "formProps": curdOpt.formProps,
7018
7033
  "onRegister": register
@@ -7078,9 +7093,9 @@ function useCurd(curdOpt) {
7078
7093
  update
7079
7094
  };
7080
7095
  }
7081
- const _hoisted_1$l = { class: "iframe-page" };
7082
- const _hoisted_2$d = ["src"];
7083
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
7096
+ const _hoisted_1$k = { class: "iframe-page" };
7097
+ const _hoisted_2$c = ["src"];
7098
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7084
7099
  __name: "index",
7085
7100
  props: {
7086
7101
  showLoading: {
@@ -7102,7 +7117,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
7102
7117
  iframeWin.postMessage(props.postMsg, props.src);
7103
7118
  }
7104
7119
  return (_ctx, _cache) => {
7105
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
7120
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
7106
7121
  createVNode(unref(Spin), {
7107
7122
  spinning: loading.value,
7108
7123
  size: "large"
@@ -7114,7 +7129,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
7114
7129
  ref_key: "frameRef",
7115
7130
  ref: frameRef,
7116
7131
  onLoad: _cache[0] || (_cache[0] = ($event) => afterLoaded())
7117
- }, null, 40, _hoisted_2$d)
7132
+ }, null, 40, _hoisted_2$c)
7118
7133
  ]),
7119
7134
  _: 1
7120
7135
  }, 8, ["spinning"])
@@ -7145,8 +7160,7 @@ const basicUploadProps = {
7145
7160
  default: () => []
7146
7161
  },
7147
7162
  maxSize: {
7148
- type: Number,
7149
- default: 2
7163
+ type: Number
7150
7164
  },
7151
7165
  maxNumber: {
7152
7166
  type: Number,
@@ -7155,6 +7169,10 @@ const basicUploadProps = {
7155
7169
  defaultFiles: {
7156
7170
  type: Array,
7157
7171
  default: []
7172
+ },
7173
+ showView: {
7174
+ type: Boolean,
7175
+ default: false
7158
7176
  }
7159
7177
  };
7160
7178
  function useHelpers(acceptRef, helpTextRef, maxNumberRef, maxSizeRef) {
@@ -7173,8 +7191,29 @@ function useHelpers(acceptRef, helpTextRef, maxNumberRef, maxSizeRef) {
7173
7191
  return `.${item}`;
7174
7192
  }).join(",");
7175
7193
  });
7194
+ const getHelpText = computed(() => {
7195
+ const helpText = unref(helpTextRef);
7196
+ if (helpText) {
7197
+ return helpText;
7198
+ }
7199
+ const helpTexts = [];
7200
+ const accept = unref(acceptRef);
7201
+ if (accept.length > 0) {
7202
+ helpTexts.push(`\u652F\u6301${accept.join(",")}\u683C\u5F0F`);
7203
+ }
7204
+ const maxSize = unref(maxSizeRef);
7205
+ if (maxSize) {
7206
+ helpTexts.push(`\u4E0D\u8D85\u8FC7${maxSize}M`);
7207
+ }
7208
+ const maxNumber = unref(maxNumberRef);
7209
+ if (maxNumber && maxNumber !== Infinity) {
7210
+ helpTexts.push(`\u6700\u591A\u53EF\u9009\u62E9${maxNumber}\u4E2A\u6587\u4EF6`);
7211
+ }
7212
+ return helpTexts.join(",") || "\u8BF7\u4E0A\u4F20pptx\u3001doc\u3001jpg\u3001jpeg\u3001png\u3001bmp\u3001gif\u3001xls\u3001xlsx\u3001txt\u3001rar\u3001zip\u30017z\u3001tar\u3001gz\u683C\u5F0F\u6587\u4EF6";
7213
+ });
7176
7214
  return {
7177
- getStringAccept
7215
+ getStringAccept,
7216
+ getHelpText
7178
7217
  };
7179
7218
  }
7180
7219
  var sparkMd5 = { exports: {} };
@@ -7586,12 +7625,12 @@ var sparkMd5 = { exports: {} };
7586
7625
  return SparkMD5;
7587
7626
  });
7588
7627
  })(sparkMd5);
7589
- const _hoisted_1$k = { class: "file-header" };
7590
- const _hoisted_2$c = /* @__PURE__ */ createTextVNode(" \u6587\u4EF6\u4E0A\u4F20 ");
7591
- const _hoisted_3$6 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u4E0B\u8F7D ");
7592
- const _hoisted_4$4 = { class: "file-type-tips ant-alert-info" };
7593
- const _hoisted_5$3 = /* @__PURE__ */ createElementVNode("i", null, "\u8BF7\u4E0A\u4F20pptx\u3001doc\u3001jpg\u3001jpeg\u3001png\u3001bmp\u3001gif\u3001xls\u3001xlsx\u3001txt\u3001rar\u3001zip\u30017z\u3001tar\u3001gz\u683C\u5F0F\u6587\u4EF6", -1);
7594
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
7628
+ const _hoisted_1$j = { class: "dt-file" };
7629
+ const _hoisted_2$b = { class: "file-header" };
7630
+ const _hoisted_3$6 = /* @__PURE__ */ createTextVNode(" \u6587\u4EF6\u4E0A\u4F20 ");
7631
+ const _hoisted_4$4 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u4E0B\u8F7D ");
7632
+ const _hoisted_5$3 = { class: "file-type-tips ant-alert-info" };
7633
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
7595
7634
  __name: "upload",
7596
7635
  props: basicUploadProps,
7597
7636
  setup(__props, { expose }) {
@@ -7599,22 +7638,25 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7599
7638
  const { message } = useMessage();
7600
7639
  const filesRef = ref([]);
7601
7640
  const historyFilesRef = ref([]);
7602
- const allFilesRef = ref([]);
7641
+ const allFilesRef = computed(() => {
7642
+ return [...historyFilesRef.value, ...filesRef.value];
7643
+ });
7603
7644
  const imgVisable = ref(false);
7645
+ const imgSrcRef = ref();
7604
7646
  const setImgVisible = (value) => imgVisable.value = value;
7605
7647
  const { accept, helpText, maxNumber, maxSize } = toRefs(props);
7606
- const { getStringAccept } = useHelpers(accept);
7607
- const [registerTable, {}] = useTable({
7648
+ const {
7649
+ getStringAccept,
7650
+ getHelpText
7651
+ } = useHelpers(accept, helpText, maxNumber, maxSize);
7652
+ const isImage = (fileType) => ["pdf", "jpg", "jpeg", "png", "bmp", "gif"].includes(fileType);
7653
+ const [registerTable] = useTable({
7608
7654
  tableSetting: false,
7609
7655
  pagination: false,
7610
7656
  dataSource: allFilesRef,
7611
7657
  columns: [
7612
7658
  { title: "\u6587\u4EF6\u540D\u79F0", dataIndex: "fileName" },
7613
- { title: "\u4E0A\u4F20\u72B6\u6001", dataIndex: "fileStatue", render(row) {
7614
- return h("span", {
7615
- style: `color: ${row.status === 0 ? "orange" : "green"}`
7616
- }, row.fileStatue);
7617
- } }
7659
+ { title: "\u4E0A\u4F20\u72B6\u6001", dataIndex: "fileStatue", className: "orange" }
7618
7660
  ],
7619
7661
  operations: {
7620
7662
  expand: true,
@@ -7623,28 +7665,40 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7623
7665
  title: "\u9884\u89C8",
7624
7666
  icon: "ic:baseline-remove-red-eye",
7625
7667
  ifShow(row) {
7626
- const supportFileTypes = ["pdf", "jpg", "jpeg", "png", "bmp", "gif"];
7627
- return supportFileTypes.includes(row.fileName.split(".").pop());
7668
+ if (!props.showView)
7669
+ return false;
7670
+ return isImage(row.fileName.split(".").pop());
7628
7671
  },
7629
- action: () => {
7630
- setImgVisible(true);
7672
+ action: ({ row }) => {
7673
+ if (isImage(row.fileName.split(".").pop())) {
7674
+ setImgVisible(true);
7675
+ }
7631
7676
  }
7632
7677
  },
7633
- { title: "\u7F16\u8F91", icon: "mdi:text-box-edit-outline" },
7634
- { title: "\u5220\u9664", icon: "mdi:delete-outline" }
7678
+ { title: "\u5220\u9664", icon: "mdi:delete-outline", action: ({ row }) => {
7679
+ if (!row.status)
7680
+ historyFilesRef.value = historyFilesRef.value.filter((it) => it.fileId !== row.fileId);
7681
+ else {
7682
+ filesRef.value = filesRef.value.filter((it) => it.fileId !== row.fileId);
7683
+ }
7684
+ } }
7635
7685
  ]
7636
7686
  }
7637
7687
  });
7638
- watchEffect(() => {
7639
- historyFilesRef.value = props.defaultFiles.map((file) => {
7640
- return {
7641
- ...file,
7642
- fileName: file.fileName,
7643
- status: 0,
7644
- fileStatue: "\u5386\u53F2\u4E0A\u4F20"
7645
- };
7646
- });
7647
- allFilesRef.value = [...historyFilesRef.value, ...filesRef.value];
7688
+ watch(() => props.defaultFiles, (v) => {
7689
+ if (v) {
7690
+ historyFilesRef.value = props.defaultFiles.map((file, index) => {
7691
+ return {
7692
+ ...file,
7693
+ fileId: file.id || index,
7694
+ fileName: file.fileName,
7695
+ status: 0,
7696
+ fileStatue: "\u5386\u53F2\u4E0A\u4F20"
7697
+ };
7698
+ });
7699
+ }
7700
+ }, {
7701
+ immediate: true
7648
7702
  });
7649
7703
  function beforeUpload(file) {
7650
7704
  const { maxSize: maxSize2 } = props;
@@ -7664,13 +7718,19 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7664
7718
  if (currentChunk < chunks) {
7665
7719
  loadNext();
7666
7720
  } else {
7667
- filesRef.value.push({
7721
+ let fileObj = {
7668
7722
  fileName: file.name,
7669
7723
  fileId: spark.end(),
7670
7724
  file,
7671
7725
  status: 1,
7672
7726
  fileStatue: "\u5F85\u4E0A\u4F20"
7673
- });
7727
+ };
7728
+ if (props.multiple) {
7729
+ filesRef.value.push(fileObj);
7730
+ } else {
7731
+ historyFilesRef.value = [];
7732
+ filesRef.value = [fileObj];
7733
+ }
7674
7734
  }
7675
7735
  };
7676
7736
  function loadNext() {
@@ -7684,8 +7744,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7684
7744
  });
7685
7745
  return (_ctx, _cache) => {
7686
7746
  const _directive_icon = resolveDirective("icon");
7687
- return openBlock(), createElementBlock(Fragment, null, [
7688
- createElementVNode("div", _hoisted_1$k, [
7747
+ return openBlock(), createElementBlock("div", _hoisted_1$j, [
7748
+ createElementVNode("div", _hoisted_2$b, [
7689
7749
  createElementVNode("div", null, [
7690
7750
  createVNode(unref(Upload), {
7691
7751
  accept: unref(getStringAccept),
@@ -7699,7 +7759,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7699
7759
  withDirectives(createElementVNode("span", null, null, 512), [
7700
7760
  [_directive_icon, "ic:baseline-file-upload"]
7701
7761
  ]),
7702
- _hoisted_2$c
7762
+ _hoisted_3$6
7703
7763
  ]),
7704
7764
  _: 1
7705
7765
  })
@@ -7715,18 +7775,18 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7715
7775
  withDirectives(createElementVNode("span", null, null, 512), [
7716
7776
  [_directive_icon, "ic:baseline-file-download"]
7717
7777
  ]),
7718
- _hoisted_3$6
7778
+ _hoisted_4$4
7719
7779
  ]),
7720
7780
  _: 1
7721
7781
  }, 8, ["onClick"])) : createCommentVNode("", true)
7722
7782
  ]),
7723
7783
  renderSlot(_ctx.$slots, "default")
7724
7784
  ]),
7725
- createElementVNode("div", _hoisted_4$4, [
7785
+ createElementVNode("div", _hoisted_5$3, [
7726
7786
  withDirectives(createElementVNode("span", null, null, 512), [
7727
7787
  [_directive_icon, "ant-design:info-circle-outlined"]
7728
7788
  ]),
7729
- _hoisted_5$3
7789
+ createElementVNode("i", null, toDisplayString(unref(getHelpText)), 1)
7730
7790
  ]),
7731
7791
  createVNode(unref(DtTable), { onRegister: unref(registerTable) }, null, 8, ["onRegister"]),
7732
7792
  createVNode(unref(Image), {
@@ -7736,52 +7796,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
7736
7796
  visible: imgVisable.value,
7737
7797
  onVisibleChange: setImgVisible
7738
7798
  },
7739
- src: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
7740
- }, null, 8, ["preview"])
7741
- ], 64);
7742
- };
7743
- }
7744
- });
7745
- const _hoisted_1$j = { class: "dt-upload-wrap" };
7746
- const _hoisted_2$b = /* @__PURE__ */ createTextVNode(" 111 ");
7747
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
7748
- __name: "index",
7749
- emits: ["register"],
7750
- setup(__props, { emit: emites }) {
7751
- const uploadRef = ref(null);
7752
- const [register] = useModal({
7753
- width: "700px",
7754
- title: "\u6587\u4EF6\u4E0A\u4F20",
7755
- maskClosable: false
7756
- });
7757
- const defaultFiles = [
7758
- { fileName: "\u53EE\u549A\u53D1\u7968667.09.pdf", fileId: "1" }
7759
- ];
7760
- function handleSave() {
7761
- console.log(uploadRef.value.allFilesRef);
7762
- alert("s-s-s-");
7763
- }
7764
- return (_ctx, _cache) => {
7765
- return openBlock(), createBlock(unref(_sfc_main$L), {
7766
- onSave: _cache[0] || (_cache[0] = ($event) => handleSave()),
7767
- onRegister: unref(register)
7768
- }, {
7769
- default: withCtx(() => [
7770
- createElementVNode("div", _hoisted_1$j, [
7771
- createVNode(_sfc_main$y, {
7772
- ref_key: "uploadRef",
7773
- ref: uploadRef,
7774
- defaultFiles
7775
- }, {
7776
- default: withCtx(() => [
7777
- _hoisted_2$b
7778
- ]),
7779
- _: 1
7780
- }, 512)
7781
- ])
7782
- ]),
7783
- _: 1
7784
- }, 8, ["onRegister"]);
7799
+ src: imgSrcRef.value
7800
+ }, null, 8, ["preview", "src"])
7801
+ ]);
7785
7802
  };
7786
7803
  }
7787
7804
  });
@@ -8581,11 +8598,10 @@ var _sfc_main$v = /* @__PURE__ */ defineComponent({
8581
8598
  const dtComponents = [
8582
8599
  { name: "dt-base-router", component: DtBaseRouter },
8583
8600
  { name: "dt-icon", component: DtIcon },
8584
- { name: "dt-pick-icon", component: _sfc_main$X },
8585
- { name: "dt-modal", component: _sfc_main$L },
8601
+ { name: "dt-pick-icon", component: _sfc_main$W },
8602
+ { name: "dt-modal", component: _sfc_main$K },
8586
8603
  { name: "dt-form", component: DtForm },
8587
- { name: "dt-upload", component: _sfc_main$y },
8588
- { name: "dt-upload-modal", component: _sfc_main$x },
8604
+ { name: "dt-upload", component: _sfc_main$x },
8589
8605
  { name: "dt-tree", component: _sfc_main$v }
8590
8606
  ];
8591
8607
  function initComponents() {
@@ -9874,7 +9890,7 @@ var _sfc_main$b = defineComponent({
9874
9890
  }), null);
9875
9891
  }
9876
9892
  return () => {
9877
- return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$V, null, {
9893
+ return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$U, null, {
9878
9894
  default: () => renderMenu()
9879
9895
  }) : renderMenu()]);
9880
9896
  };
@@ -10718,7 +10734,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10718
10734
  }, {
10719
10735
  default: withCtx(() => [
10720
10736
  unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
10721
- createVNode(unref(_sfc_main$V), {
10737
+ createVNode(unref(_sfc_main$U), {
10722
10738
  ref_key: "wrapperRef",
10723
10739
  ref: wrapperRef,
10724
10740
  class: normalizeClass({ "fixedWrap": unref(getFixed) })
@@ -10751,4 +10767,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10751
10767
  };
10752
10768
  }
10753
10769
  });
10754
- export { DtBaseRouter, DtForm, DtIcon, _sfc_main$z as DtIframe, _sfc_main$L as DtModal, _sfc_main$X as DtPickIcon, DtTable, _sfc_main as DtTheme, _sfc_main$v as DtTree, _sfc_main$y as DtUpload, _sfc_main$x as DtUploadModal, FormButtons, authMounted, export2Excel, iconMounted, initComponents, initDirectives, useCurd, useForm, useModal, useModalOut, useSource, useTable };
10770
+ export { DtBaseRouter, DtForm, DtIcon, _sfc_main$y as DtIframe, _sfc_main$K as DtModal, _sfc_main$W as DtPickIcon, DtTable, _sfc_main as DtTheme, _sfc_main$v as DtTree, _sfc_main$x as DtUpload, FormButtons, authMounted, export2Excel, iconMounted, initComponents, initDirectives, useCurd, useForm, useModal, useModalOut, useSource, useTable };