yc-pro-components 0.0.13 → 0.0.15

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 (78) hide show
  1. package/es/components/dialog/src/index.vue2.mjs +17 -4
  2. package/es/components/dialog-form/src/index.vue2.mjs +19 -5
  3. package/es/components/drawer-form/src/index.vue2.mjs +15 -5
  4. package/es/components/form/src/index.vue2.mjs +15 -5
  5. package/es/components/popover/src/index.vue2.mjs +15 -5
  6. package/es/components/yc-drawer/src/index.vue.mjs +1 -1
  7. package/es/components/yc-drawer/src/index.vue2.mjs +3 -1
  8. package/es/components/yc-plus-tree/src/index.vue.mjs +1 -1
  9. package/es/components/yc-plus-tree/src/index.vue2.mjs +16 -4
  10. package/es/components/yc-status-dialog/src/index.vue.mjs +1 -1
  11. package/es/components/yc-status-dialog/src/index.vue2.mjs +14 -4
  12. package/es/index.css +4 -4
  13. package/index.css +65 -53
  14. package/index.js +112 -37
  15. package/index.min.css +4 -4
  16. package/index.min.js +7 -7
  17. package/index.min.mjs +7 -7
  18. package/index.mjs +112 -37
  19. package/lib/components/dialog/src/index.vue2.js +17 -4
  20. package/lib/components/dialog-form/src/index.vue2.js +19 -5
  21. package/lib/components/drawer-form/src/index.vue2.js +15 -5
  22. package/lib/components/form/src/index.vue2.js +15 -5
  23. package/lib/components/popover/src/index.vue2.js +14 -4
  24. package/lib/components/yc-drawer/src/index.vue.js +1 -1
  25. package/lib/components/yc-drawer/src/index.vue2.js +3 -1
  26. package/lib/components/yc-plus-tree/src/index.vue.js +1 -1
  27. package/lib/components/yc-plus-tree/src/index.vue2.js +16 -4
  28. package/lib/components/yc-status-dialog/src/index.vue.js +1 -1
  29. package/lib/components/yc-status-dialog/src/index.vue2.js +13 -3
  30. package/lib/index.css +4 -4
  31. package/locale/en.js +1 -1
  32. package/locale/en.min.js +1 -1
  33. package/locale/en.min.mjs +1 -1
  34. package/locale/en.mjs +1 -1
  35. package/locale/ja.js +1 -1
  36. package/locale/ja.min.js +1 -1
  37. package/locale/ja.min.mjs +1 -1
  38. package/locale/ja.mjs +1 -1
  39. package/locale/ko.js +1 -1
  40. package/locale/ko.min.js +1 -1
  41. package/locale/ko.min.mjs +1 -1
  42. package/locale/ko.mjs +1 -1
  43. package/locale/zh-cn.js +1 -1
  44. package/locale/zh-cn.min.js +1 -1
  45. package/locale/zh-cn.min.mjs +1 -1
  46. package/locale/zh-cn.mjs +1 -1
  47. package/locale/zh-tw.js +1 -1
  48. package/locale/zh-tw.min.js +1 -1
  49. package/locale/zh-tw.min.mjs +1 -1
  50. package/locale/zh-tw.mjs +1 -1
  51. package/package.json +1 -1
  52. package/theme-chalk/index.css +1 -1
  53. package/theme-chalk/plus-yc-plus-tree.css +1 -1
  54. package/theme-chalk/src/yc-plus-tree.scss +12 -0
  55. package/es/components/dialog-form/index.d.ts +0 -1154
  56. package/es/components/dialog-form/src/index.vue.d.ts +0 -493
  57. package/es/components/drawer-form/index.d.ts +0 -3467
  58. package/es/components/drawer-form/src/index.vue.d.ts +0 -1254
  59. package/es/components/form/index.d.ts +0 -1669
  60. package/es/components/form/src/index.vue.d.ts +0 -652
  61. package/es/components/page/index.d.ts +0 -15386
  62. package/es/components/page/src/index.vue.d.ts +0 -5306
  63. package/es/components/search/index.d.ts +0 -4514
  64. package/es/components/search/src/index.vue.d.ts +0 -1539
  65. package/es/components/yc-plus-page/src/index.vue.d.ts +0 -12804
  66. package/es/hooks/usePlusFormReset.d.ts +0 -9925
  67. package/lib/components/dialog-form/index.d.ts +0 -1154
  68. package/lib/components/dialog-form/src/index.vue.d.ts +0 -493
  69. package/lib/components/drawer-form/index.d.ts +0 -3467
  70. package/lib/components/drawer-form/src/index.vue.d.ts +0 -1254
  71. package/lib/components/form/index.d.ts +0 -1669
  72. package/lib/components/form/src/index.vue.d.ts +0 -652
  73. package/lib/components/page/index.d.ts +0 -15386
  74. package/lib/components/page/src/index.vue.d.ts +0 -5306
  75. package/lib/components/search/index.d.ts +0 -4514
  76. package/lib/components/search/src/index.vue.d.ts +0 -1539
  77. package/lib/components/yc-plus-page/src/index.vue.d.ts +0 -12804
  78. package/lib/hooks/usePlusFormReset.d.ts +0 -9925
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! yc-pro-components v0.0.13 */
1
+ /*! yc-pro-components v0.0.15 */
2
2
  import { unref, isRef, ref, inject, isReactive, watch, computed, shallowRef, provide, onMounted, nextTick, onBeforeUnmount, defineComponent, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, useAttrs, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, getCurrentInstance, resolveComponent, toRefs, useSlots, onUnmounted, resolveDirective, pushScopeId, popScopeId, onBeforeMount, getCurrentScope, onScopeDispose, toRef, mergeModels, useModel, vShow } from 'vue';
3
3
  import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, ElRate, ElSelect, ElOption, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElSelectV2, ElText, ElDivider, ElFormItem, ElOptionGroup, ElRow, ElCol, ElForm, ElCard, ElMessage, ElImage, ElProgress, ElAvatar, ElPopover, ElTable, vLoading, ElDescriptions, ElDescriptionsItem, ElDrawer, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop } from 'element-plus';
4
4
 
@@ -11,8 +11,6 @@ const makeInstaller = (components = []) => {
11
11
  };
12
12
  };
13
13
 
14
- const version$2 = "2.6.3";
15
-
16
14
  /** Detect free variable `global` from Node.js. */
17
15
  var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
18
16
 
@@ -4640,6 +4638,8 @@ function set(object, path, value) {
4640
4638
  return object == null ? object : baseSet(object, path, value);
4641
4639
  }
4642
4640
 
4641
+ const version$2 = "2.6.3";
4642
+
4643
4643
  const objectToString = Object.prototype.toString;
4644
4644
  const toTypeString = (value) => objectToString.call(value);
4645
4645
  const toRawType = (value) => {
@@ -8615,9 +8615,21 @@ var _sfc_main$K = /* @__PURE__ */ defineComponent({
8615
8615
  watchEffect(() => {
8616
8616
  subVisible.value = props.modelValue;
8617
8617
  });
8618
- const handleConfirm = () => {
8618
+ const isSubmitting = ref(false);
8619
+ const computedLoading = computed(() => props.confirmLoading || isSubmitting.value);
8620
+ const doConfirm = () => {
8621
+ isSubmitting.value = true;
8619
8622
  emit("confirm");
8623
+ setTimeout(() => {
8624
+ isSubmitting.value = false;
8625
+ }, 300);
8620
8626
  };
8627
+ const handleConfirm = debounce(doConfirm, 300, {
8628
+ leading: true,
8629
+ // 立即执行第一次
8630
+ trailing: false
8631
+ // 不执行最后一次
8632
+ });
8621
8633
  const handleCancel = () => {
8622
8634
  emit("update:modelValue", false);
8623
8635
  emit("cancel");
@@ -8674,8 +8686,8 @@ var _sfc_main$K = /* @__PURE__ */ defineComponent({
8674
8686
  }),
8675
8687
  createVNode(unref(ElButton), {
8676
8688
  type: "primary",
8677
- loading: _ctx.confirmLoading,
8678
- onClick: handleConfirm
8689
+ loading: computedLoading.value,
8690
+ onClick: unref(handleConfirm)
8679
8691
  }, {
8680
8692
  default: withCtx(() => [
8681
8693
  createTextVNode(
@@ -8686,7 +8698,7 @@ var _sfc_main$K = /* @__PURE__ */ defineComponent({
8686
8698
  ]),
8687
8699
  _: 1
8688
8700
  /* STABLE */
8689
- }, 8, ["loading"])
8701
+ }, 8, ["loading", "onClick"])
8690
8702
  ])
8691
8703
  ],
8692
8704
  4
@@ -16782,8 +16794,11 @@ var _sfc_main$A = /* @__PURE__ */ defineComponent({
16782
16794
  var _a;
16783
16795
  (_a = formInstance.value) == null ? void 0 : _a.clearValidate();
16784
16796
  };
16785
- const handleSubmit = async () => {
16797
+ const isSubmitting = ref(false);
16798
+ const computedLoading = computed(() => props.submitLoading || isSubmitting.value);
16799
+ const doSubmit = async () => {
16786
16800
  var _a, _b, _c;
16801
+ isSubmitting.value = true;
16787
16802
  try {
16788
16803
  const valid = await ((_a = formInstance.value) == null ? void 0 : _a.validate());
16789
16804
  if (valid) {
@@ -16801,6 +16816,12 @@ var _sfc_main$A = /* @__PURE__ */ defineComponent({
16801
16816
  }
16802
16817
  return false;
16803
16818
  };
16819
+ const handleSubmit = debounce(doSubmit, 300, {
16820
+ leading: true,
16821
+ // 立即执行第一次
16822
+ trailing: false
16823
+ // 不执行最后一次
16824
+ });
16804
16825
  const handleReset = () => {
16805
16826
  clearValidate();
16806
16827
  values.value = { ...props.defaultValues };
@@ -16949,7 +16970,7 @@ var _sfc_main$A = /* @__PURE__ */ defineComponent({
16949
16970
  style: normalizeStyle(style.value)
16950
16971
  },
16951
16972
  [
16952
- renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ handleReset, handleSubmit })), () => [
16973
+ renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({ handleReset, handleSubmit: unref(handleSubmit) })), () => [
16953
16974
  _ctx.hasReset ? (openBlock(), createBlock(unref(ElButton), {
16954
16975
  key: 0,
16955
16976
  onClick: handleReset
@@ -16967,8 +16988,8 @@ var _sfc_main$A = /* @__PURE__ */ defineComponent({
16967
16988
  })) : createCommentVNode("v-if", true),
16968
16989
  createVNode(unref(ElButton), {
16969
16990
  type: "primary",
16970
- loading: _ctx.submitLoading,
16971
- onClick: handleSubmit
16991
+ loading: computedLoading.value,
16992
+ onClick: unref(handleSubmit)
16972
16993
  }, {
16973
16994
  default: withCtx(() => [
16974
16995
  createCommentVNode(" \u63D0\u4EA4 "),
@@ -16980,7 +17001,7 @@ var _sfc_main$A = /* @__PURE__ */ defineComponent({
16980
17001
  ]),
16981
17002
  _: 1
16982
17003
  /* STABLE */
16983
- }, 8, ["loading"])
17004
+ }, 8, ["loading", "onClick"])
16984
17005
  ])
16985
17006
  ],
16986
17007
  4
@@ -18084,10 +18105,19 @@ var _sfc_main$v = /* @__PURE__ */ defineComponent({
18084
18105
  subVisible.value = false;
18085
18106
  emit("cancel");
18086
18107
  };
18087
- const handleConfirmPopover = () => {
18108
+ const isSubmitting = ref(false);
18109
+ const computedLoading = computed(() => props.confirmLoading || isSubmitting.value);
18110
+ const doConfirm = () => {
18111
+ isSubmitting.value = true;
18088
18112
  subVisible.value = false;
18089
18113
  emit("confirm");
18090
18114
  };
18115
+ const handleConfirmPopover = debounce(doConfirm, 300, {
18116
+ leading: true,
18117
+ // 立即执行第一次
18118
+ trailing: false
18119
+ // 不执行最后一次
18120
+ });
18091
18121
  return (_ctx, _cache) => {
18092
18122
  return openBlock(), createBlock(unref(ElPopover), mergeProps({
18093
18123
  visible: subVisible.value,
@@ -18119,8 +18149,8 @@ var _sfc_main$v = /* @__PURE__ */ defineComponent({
18119
18149
  createVNode(unref(ElButton), {
18120
18150
  size: "small",
18121
18151
  type: "primary",
18122
- loading: _ctx.confirmLoading,
18123
- onClick: handleConfirmPopover
18152
+ loading: computedLoading.value,
18153
+ onClick: unref(handleConfirmPopover)
18124
18154
  }, {
18125
18155
  default: withCtx(() => [
18126
18156
  createTextVNode(
@@ -18131,7 +18161,7 @@ var _sfc_main$v = /* @__PURE__ */ defineComponent({
18131
18161
  ]),
18132
18162
  _: 1
18133
18163
  /* STABLE */
18134
- }, 8, ["loading"])
18164
+ }, 8, ["loading", "onClick"])
18135
18165
  ])) : createCommentVNode("v-if", true)
18136
18166
  ]),
18137
18167
  _: 3
@@ -19568,8 +19598,10 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
19568
19598
  emit("update:modelValue", values);
19569
19599
  emit("change", values, column);
19570
19600
  };
19571
- const handleConfirm = async () => {
19601
+ const isSubmitting = ref(false);
19602
+ const doConfirm = async () => {
19572
19603
  var _a, _b, _c;
19604
+ isSubmitting.value = true;
19573
19605
  try {
19574
19606
  const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
19575
19607
  if (valid) {
@@ -19583,8 +19615,18 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
19583
19615
  ElMessage.warning(message || t("plus.form.errorTip"));
19584
19616
  }
19585
19617
  emit("confirmError", errors);
19618
+ } finally {
19619
+ setTimeout(() => {
19620
+ isSubmitting.value = false;
19621
+ }, 300);
19586
19622
  }
19587
19623
  };
19624
+ const handleConfirm = debounce(doConfirm, 300, {
19625
+ leading: true,
19626
+ // 立即执行第一次
19627
+ trailing: false
19628
+ // 不执行最后一次
19629
+ });
19588
19630
  const handleCancel = () => {
19589
19631
  subVisible.value = false;
19590
19632
  emit("update:visible", subVisible.value);
@@ -19606,11 +19648,12 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
19606
19648
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => subVisible.value = $event),
19607
19649
  width: "800px",
19608
19650
  top: "10vh",
19609
- title: unref(t)("plus.dialogForm.title")
19651
+ title: unref(t)("plus.dialogForm.title"),
19652
+ "confirm-loading": isSubmitting.value
19610
19653
  }, _ctx.dialog, {
19611
19654
  onClose: handleClose,
19612
19655
  onCancel: handleCancel,
19613
- onConfirm: handleConfirm
19656
+ onConfirm: unref(handleConfirm)
19614
19657
  }), createSlots({
19615
19658
  default: withCtx(() => [
19616
19659
  createVNode(unref(PlusForm), mergeProps({
@@ -19661,11 +19704,11 @@ var _sfc_main$q = /* @__PURE__ */ defineComponent({
19661
19704
  _ctx.$slots["dialog-footer"] ? {
19662
19705
  name: "footer",
19663
19706
  fn: withCtx(() => [
19664
- renderSlot(_ctx.$slots, "dialog-footer", normalizeProps(guardReactiveProps({ handleConfirm, handleCancel })))
19707
+ renderSlot(_ctx.$slots, "dialog-footer", normalizeProps(guardReactiveProps({ handleConfirm: unref(handleConfirm), handleCancel })))
19665
19708
  ]),
19666
19709
  key: "1"
19667
19710
  } : void 0
19668
- ]), 1040, ["modelValue", "title"]);
19711
+ ]), 1040, ["modelValue", "title", "confirm-loading", "onConfirm"]);
19669
19712
  };
19670
19713
  }
19671
19714
  });
@@ -19727,8 +19770,11 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
19727
19770
  emit("update:modelValue", values);
19728
19771
  emit("change", values, column);
19729
19772
  };
19730
- const handleConfirm = async () => {
19773
+ const isSubmitting = ref(false);
19774
+ const computedLoading = computed(() => props.confirmLoading || isSubmitting.value);
19775
+ const doConfirm = async () => {
19731
19776
  var _a, _b, _c;
19777
+ isSubmitting.value = true;
19732
19778
  try {
19733
19779
  const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
19734
19780
  if (valid) {
@@ -19744,6 +19790,12 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
19744
19790
  emit("confirmError", errors);
19745
19791
  }
19746
19792
  };
19793
+ const handleConfirm = debounce(doConfirm, 300, {
19794
+ leading: true,
19795
+ // 立即执行第一次
19796
+ trailing: false
19797
+ // 不执行最后一次
19798
+ });
19747
19799
  const handleClose = () => {
19748
19800
  handleCancel();
19749
19801
  emit("update:visible", subVisible.value);
@@ -19817,7 +19869,7 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
19817
19869
  name: "footer",
19818
19870
  fn: withCtx(() => [
19819
19871
  createElementVNode("div", _hoisted_1$d, [
19820
- renderSlot(_ctx.$slots, "drawer-footer", normalizeProps(guardReactiveProps({ handleConfirm, handleCancel })), () => [
19872
+ renderSlot(_ctx.$slots, "drawer-footer", normalizeProps(guardReactiveProps({ handleConfirm: unref(handleConfirm), handleCancel })), () => [
19821
19873
  createVNode(unref(ElButton), { onClick: handleCancel }, {
19822
19874
  default: withCtx(() => [
19823
19875
  createTextVNode(
@@ -19831,8 +19883,8 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
19831
19883
  }),
19832
19884
  createVNode(unref(ElButton), {
19833
19885
  type: "primary",
19834
- loading: _ctx.confirmLoading,
19835
- onClick: handleConfirm
19886
+ loading: computedLoading.value,
19887
+ onClick: unref(handleConfirm)
19836
19888
  }, {
19837
19889
  default: withCtx(() => [
19838
19890
  createTextVNode(
@@ -19843,7 +19895,7 @@ var _sfc_main$p = /* @__PURE__ */ defineComponent({
19843
19895
  ]),
19844
19896
  _: 1
19845
19897
  /* STABLE */
19846
- }, 8, ["loading"])
19898
+ }, 8, ["loading", "onClick"])
19847
19899
  ])
19848
19900
  ])
19849
19901
  ]),
@@ -57292,6 +57344,7 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
57292
57344
  });
57293
57345
  return (_ctx, _cache) => {
57294
57346
  const _component_el_input = resolveComponent("el-input");
57347
+ const _component_el_tooltip = resolveComponent("el-tooltip");
57295
57348
  const _component_el_divider = resolveComponent("el-divider");
57296
57349
  const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
57297
57350
  const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
@@ -57412,10 +57465,21 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
57412
57465
  }, () => [
57413
57466
  createElementVNode("span", _hoisted_4$3, [
57414
57467
  createCommentVNode(" \u9ED8\u8BA4\u8282\u70B9\u6807\u7B7E\u6587\u672C "),
57415
- createElementVNode("span", {
57416
- class: "label-text",
57417
- innerHTML: highlightKeyword(node.label, props.searchMode === "local" ? filterText.value : "")
57418
- }, null, 8, _hoisted_5$3)
57468
+ createVNode(_component_el_tooltip, {
57469
+ content: node.label,
57470
+ placement: "top",
57471
+ disabled: !node.label || node.label.length <= 20,
57472
+ "show-after": 500
57473
+ }, {
57474
+ default: withCtx(() => [
57475
+ createElementVNode("span", {
57476
+ class: "label-text",
57477
+ innerHTML: highlightKeyword(node.label, props.searchMode === "local" ? filterText.value : "")
57478
+ }, null, 8, _hoisted_5$3)
57479
+ ]),
57480
+ _: 2
57481
+ /* DYNAMIC */
57482
+ }, 1032, ["content", "disabled"])
57419
57483
  ])
57420
57484
  ], true),
57421
57485
  createCommentVNode(" \u8282\u70B9\u64CD\u4F5C\u533A\u57DF\uFF08\u72EC\u7ACB\u4E8E\u81EA\u5B9A\u4E49 slot\uFF09 "),
@@ -57526,7 +57590,7 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
57526
57590
  }
57527
57591
  });
57528
57592
 
57529
- var YcPlusTreeComponent = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-fa0eccd0"], ["__file", "index.vue"]]);
57593
+ var YcPlusTreeComponent = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-0043eed3"], ["__file", "index.vue"]]);
57530
57594
 
57531
57595
  const YcPlusTree = l(YcPlusTreeComponent);
57532
57596
  const RePlusTree = YcPlusTree;
@@ -57661,7 +57725,7 @@ const closeAllDrawer = () => {
57661
57725
  drawerStore.value = [];
57662
57726
  };
57663
57727
 
57664
- const _withScopeId$1 = (n) => (pushScopeId("data-v-e306ac1f"), n = n(), popScopeId(), n);
57728
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-f8ad9f74"), n = n(), popScopeId(), n);
57665
57729
  const _hoisted_1$4 = { class: "custom-drawer-header" };
57666
57730
  const _hoisted_2$4 = { class: "header-content" };
57667
57731
  const _hoisted_3$4 = ["id"];
@@ -57704,7 +57768,9 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
57704
57768
  bg: true,
57705
57769
  popConfirm: options == null ? void 0 : options.popConfirm,
57706
57770
  btnClick: ({ drawer: { options: options2, index } }) => {
57771
+ var _a;
57707
57772
  if (!options2 || index === void 0) return;
57773
+ if ((_a = sureBtnMap.value[index]) == null ? void 0 : _a.loading) return;
57708
57774
  if (options2 == null ? void 0 : options2.sureBtnLoading) {
57709
57775
  sureBtnMap.value[index] = Object.assign({}, sureBtnMap.value[index] || {}, {
57710
57776
  loading: true
@@ -57883,7 +57949,7 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
57883
57949
  }
57884
57950
  });
57885
57951
 
57886
- var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-e306ac1f"], ["__file", "index.vue"]]);
57952
+ var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f8ad9f74"], ["__file", "index.vue"]]);
57887
57953
 
57888
57954
  const YcDrawer = YcDrawerComponent;
57889
57955
  const ReDrawer = YcDrawerComponent;
@@ -57967,10 +58033,18 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
57967
58033
  if (props.confirmText) return props.confirmText;
57968
58034
  return props.status === "delete" ? "\u5220\u9664" : "\u786E\u5B9A";
57969
58035
  });
57970
- const handleConfirm = () => {
58036
+ const isSubmitting = ref(false);
58037
+ const doConfirm = () => {
58038
+ isSubmitting.value = true;
57971
58039
  emit("confirm");
57972
58040
  dialogVisible.value = false;
57973
58041
  };
58042
+ const handleConfirm = debounce(doConfirm, 300, {
58043
+ leading: true,
58044
+ // 立即执行第一次
58045
+ trailing: false
58046
+ // 不执行最后一次
58047
+ });
57974
58048
  const handleCancel = () => {
57975
58049
  emit("cancel");
57976
58050
  dialogVisible.value = false;
@@ -58029,7 +58103,8 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
58029
58103
  })) : createCommentVNode("v-if", true),
58030
58104
  createVNode(unref(ElButton), {
58031
58105
  type: currentStatusConfig.value.confirmButtonType,
58032
- onClick: handleConfirm
58106
+ loading: isSubmitting.value,
58107
+ onClick: unref(handleConfirm)
58033
58108
  }, {
58034
58109
  default: withCtx(() => [
58035
58110
  createTextVNode(
@@ -58040,7 +58115,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
58040
58115
  ]),
58041
58116
  _: 1
58042
58117
  /* STABLE */
58043
- }, 8, ["type"])
58118
+ }, 8, ["type", "loading", "onClick"])
58044
58119
  ], true)
58045
58120
  ])
58046
58121
  ]),
@@ -58064,7 +58139,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
58064
58139
  }
58065
58140
  });
58066
58141
 
58067
- var YcStatusDialog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-ce588855"], ["__file", "index.vue"]]);
58142
+ var YcStatusDialog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a1851fcd"], ["__file", "index.vue"]]);
58068
58143
 
58069
58144
  var _sfc_main$5 = /* @__PURE__ */ defineComponent({
58070
58145
  ...{
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
+ var lodashEs = require('lodash-es');
7
8
  var useLocale = require('../../../hooks/useLocale.js');
8
9
  require('sortablejs');
9
10
 
@@ -37,9 +38,21 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
37
38
  vue.watchEffect(() => {
38
39
  subVisible.value = props.modelValue;
39
40
  });
40
- const handleConfirm = () => {
41
+ const isSubmitting = vue.ref(false);
42
+ const computedLoading = vue.computed(() => props.confirmLoading || isSubmitting.value);
43
+ const doConfirm = () => {
44
+ isSubmitting.value = true;
41
45
  emit("confirm");
46
+ setTimeout(() => {
47
+ isSubmitting.value = false;
48
+ }, 300);
42
49
  };
50
+ const handleConfirm = lodashEs.debounce(doConfirm, 300, {
51
+ leading: true,
52
+ // 立即执行第一次
53
+ trailing: false
54
+ // 不执行最后一次
55
+ });
43
56
  const handleCancel = () => {
44
57
  emit("update:modelValue", false);
45
58
  emit("cancel");
@@ -96,8 +109,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
96
109
  }),
97
110
  vue.createVNode(vue.unref(elementPlus.ElButton), {
98
111
  type: "primary",
99
- loading: _ctx.confirmLoading,
100
- onClick: handleConfirm
112
+ loading: computedLoading.value,
113
+ onClick: vue.unref(handleConfirm)
101
114
  }, {
102
115
  default: vue.withCtx(() => [
103
116
  vue.createTextVNode(
@@ -108,7 +121,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
108
121
  ]),
109
122
  _: 1
110
123
  /* STABLE */
111
- }, 8, ["loading"])
124
+ }, 8, ["loading", "onClick"])
112
125
  ])
113
126
  ],
114
127
  4
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashEs = require('lodash-es');
6
7
  var useLocale = require('../../../hooks/useLocale.js');
7
8
  require('sortablejs');
8
9
  var index$1 = require('../../form/index.js');
@@ -56,8 +57,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
56
57
  emit("update:modelValue", values);
57
58
  emit("change", values, column);
58
59
  };
59
- const handleConfirm = async () => {
60
+ const isSubmitting = vue.ref(false);
61
+ const doConfirm = async () => {
60
62
  var _a, _b, _c;
63
+ isSubmitting.value = true;
61
64
  try {
62
65
  const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
63
66
  if (valid) {
@@ -71,8 +74,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
71
74
  elementPlus.ElMessage.warning(message || t("plus.form.errorTip"));
72
75
  }
73
76
  emit("confirmError", errors);
77
+ } finally {
78
+ setTimeout(() => {
79
+ isSubmitting.value = false;
80
+ }, 300);
74
81
  }
75
82
  };
83
+ const handleConfirm = lodashEs.debounce(doConfirm, 300, {
84
+ leading: true,
85
+ // 立即执行第一次
86
+ trailing: false
87
+ // 不执行最后一次
88
+ });
76
89
  const handleCancel = () => {
77
90
  subVisible.value = false;
78
91
  emit("update:visible", subVisible.value);
@@ -94,11 +107,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
94
107
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => subVisible.value = $event),
95
108
  width: "800px",
96
109
  top: "10vh",
97
- title: vue.unref(t)("plus.dialogForm.title")
110
+ title: vue.unref(t)("plus.dialogForm.title"),
111
+ "confirm-loading": isSubmitting.value
98
112
  }, _ctx.dialog, {
99
113
  onClose: handleClose,
100
114
  onCancel: handleCancel,
101
- onConfirm: handleConfirm
115
+ onConfirm: vue.unref(handleConfirm)
102
116
  }), vue.createSlots({
103
117
  default: vue.withCtx(() => [
104
118
  vue.createVNode(vue.unref(index$1.PlusForm), vue.mergeProps({
@@ -149,11 +163,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
149
163
  _ctx.$slots["dialog-footer"] ? {
150
164
  name: "footer",
151
165
  fn: vue.withCtx(() => [
152
- vue.renderSlot(_ctx.$slots, "dialog-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm, handleCancel })))
166
+ vue.renderSlot(_ctx.$slots, "dialog-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm: vue.unref(handleConfirm), handleCancel })))
153
167
  ]),
154
168
  key: "1"
155
169
  } : void 0
156
- ]), 1040, ["modelValue", "title"]);
170
+ ]), 1040, ["modelValue", "title", "confirm-loading", "onConfirm"]);
157
171
  };
158
172
  }
159
173
  });
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashEs = require('lodash-es');
6
7
  var index = require('../../form/index.js');
7
8
  var elementPlus = require('element-plus');
8
9
  var useLocale = require('../../../hooks/useLocale.js');
@@ -62,8 +63,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
62
63
  emit("update:modelValue", values);
63
64
  emit("change", values, column);
64
65
  };
65
- const handleConfirm = async () => {
66
+ const isSubmitting = vue.ref(false);
67
+ const computedLoading = vue.computed(() => props.confirmLoading || isSubmitting.value);
68
+ const doConfirm = async () => {
66
69
  var _a, _b, _c;
70
+ isSubmitting.value = true;
67
71
  try {
68
72
  const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
69
73
  if (valid) {
@@ -79,6 +83,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
79
83
  emit("confirmError", errors);
80
84
  }
81
85
  };
86
+ const handleConfirm = lodashEs.debounce(doConfirm, 300, {
87
+ leading: true,
88
+ // 立即执行第一次
89
+ trailing: false
90
+ // 不执行最后一次
91
+ });
82
92
  const handleClose = () => {
83
93
  handleCancel();
84
94
  emit("update:visible", subVisible.value);
@@ -152,7 +162,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
152
162
  name: "footer",
153
163
  fn: vue.withCtx(() => [
154
164
  vue.createElementVNode("div", _hoisted_1, [
155
- vue.renderSlot(_ctx.$slots, "drawer-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm, handleCancel })), () => [
165
+ vue.renderSlot(_ctx.$slots, "drawer-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm: vue.unref(handleConfirm), handleCancel })), () => [
156
166
  vue.createVNode(vue.unref(elementPlus.ElButton), { onClick: handleCancel }, {
157
167
  default: vue.withCtx(() => [
158
168
  vue.createTextVNode(
@@ -166,8 +176,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
166
176
  }),
167
177
  vue.createVNode(vue.unref(elementPlus.ElButton), {
168
178
  type: "primary",
169
- loading: _ctx.confirmLoading,
170
- onClick: handleConfirm
179
+ loading: computedLoading.value,
180
+ onClick: vue.unref(handleConfirm)
171
181
  }, {
172
182
  default: vue.withCtx(() => [
173
183
  vue.createTextVNode(
@@ -178,7 +188,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
178
188
  ]),
179
189
  _: 1
180
190
  /* STABLE */
181
- }, 8, ["loading"])
191
+ }, 8, ["loading", "onClick"])
182
192
  ])
183
193
  ])
184
194
  ]),
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashEs = require('lodash-es');
6
7
  var elementPlus = require('element-plus');
7
8
  var index = require('../../utils/index.js');
8
9
  var useLocale = require('../../../hooks/useLocale.js');
@@ -94,8 +95,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
94
95
  var _a;
95
96
  (_a = formInstance.value) == null ? void 0 : _a.clearValidate();
96
97
  };
97
- const handleSubmit = async () => {
98
+ const isSubmitting = vue.ref(false);
99
+ const computedLoading = vue.computed(() => props.submitLoading || isSubmitting.value);
100
+ const doSubmit = async () => {
98
101
  var _a, _b, _c;
102
+ isSubmitting.value = true;
99
103
  try {
100
104
  const valid = await ((_a = formInstance.value) == null ? void 0 : _a.validate());
101
105
  if (valid) {
@@ -113,6 +117,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
113
117
  }
114
118
  return false;
115
119
  };
120
+ const handleSubmit = lodashEs.debounce(doSubmit, 300, {
121
+ leading: true,
122
+ // 立即执行第一次
123
+ trailing: false
124
+ // 不执行最后一次
125
+ });
116
126
  const handleReset = () => {
117
127
  clearValidate();
118
128
  values.value = { ...props.defaultValues };
@@ -261,7 +271,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
261
271
  style: vue.normalizeStyle(style.value)
262
272
  },
263
273
  [
264
- vue.renderSlot(_ctx.$slots, "footer", vue.normalizeProps(vue.guardReactiveProps({ handleReset, handleSubmit })), () => [
274
+ vue.renderSlot(_ctx.$slots, "footer", vue.normalizeProps(vue.guardReactiveProps({ handleReset, handleSubmit: vue.unref(handleSubmit) })), () => [
265
275
  _ctx.hasReset ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
266
276
  key: 0,
267
277
  onClick: handleReset
@@ -279,8 +289,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
279
289
  })) : vue.createCommentVNode("v-if", true),
280
290
  vue.createVNode(vue.unref(elementPlus.ElButton), {
281
291
  type: "primary",
282
- loading: _ctx.submitLoading,
283
- onClick: handleSubmit
292
+ loading: computedLoading.value,
293
+ onClick: vue.unref(handleSubmit)
284
294
  }, {
285
295
  default: vue.withCtx(() => [
286
296
  vue.createCommentVNode(" \u63D0\u4EA4 "),
@@ -292,7 +302,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
292
302
  ]),
293
303
  _: 1
294
304
  /* STABLE */
295
- }, 8, ["loading"])
305
+ }, 8, ["loading", "onClick"])
296
306
  ])
297
307
  ],
298
308
  4