3h1-ui 2.14.93 → 2.14.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -4071,9 +4071,16 @@ const _sfc_main$1q = defineComponent({
4071
4071
  return prev;
4072
4072
  }, []);
4073
4073
  });
4074
- watchEffect(() => {
4075
- props2.immediate && !props2.alwaysLoad && fetch();
4076
- });
4074
+ watch(
4075
+ () => props2.immediate && !props2.alwaysLoad,
4076
+ (val) => {
4077
+ if (val)
4078
+ fetch();
4079
+ },
4080
+ {
4081
+ immediate: true
4082
+ }
4083
+ );
4077
4084
  watch(
4078
4085
  () => state.value,
4079
4086
  (v) => {
@@ -4132,8 +4139,9 @@ const _sfc_main$1q = defineComponent({
4132
4139
  function emitChange() {
4133
4140
  emit("options-change", unref(getOptions));
4134
4141
  }
4135
- function handleChange(_, ...args) {
4142
+ function handleChange(val, ...args) {
4136
4143
  emitData.value = args;
4144
+ emit("update:value", val);
4137
4145
  }
4138
4146
  const filterOption = (input, option) => {
4139
4147
  var _a2, _b, _c;
@@ -7618,6 +7626,10 @@ const _hoisted_5$3 = {
7618
7626
  const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7619
7627
  __name: "Table",
7620
7628
  props: {
7629
+ rowKey: {
7630
+ type: String,
7631
+ default: () => "uuid"
7632
+ },
7621
7633
  columns: {
7622
7634
  type: Array,
7623
7635
  default: () => []
@@ -7647,20 +7659,27 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7647
7659
  width: 50,
7648
7660
  align: "center"
7649
7661
  };
7650
- return [indexColumn, ...props2.columns];
7662
+ return [
7663
+ indexColumn,
7664
+ ...props2.columns.map((item) => ({
7665
+ ...item,
7666
+ type: item.type ? item.type : "input"
7667
+ }))
7668
+ ];
7651
7669
  });
7652
7670
  const plusClickEvent = () => {
7653
- state.value = [{ uuid: buildUUID() }, ...state.value];
7671
+ state.value = [{ [props2.rowKey]: buildUUID() }, ...state.value];
7654
7672
  emit("add", state.value);
7655
7673
  };
7656
7674
  const rowClickEvent = (index2) => {
7657
7675
  const tempState = state.value.filter((item) => {
7658
- return item["uuid"] !== index2;
7676
+ return item[props2.rowKey] !== index2;
7659
7677
  });
7660
- tempState.forEach((item) => item["uuid"] = buildUUID());
7678
+ tempState.forEach((item) => item[props2.rowKey] = buildUUID());
7661
7679
  state.value = [...tempState];
7662
7680
  emit("remove", state.value, index2);
7663
7681
  };
7682
+ const getPopupContainer2 = () => document.body;
7664
7683
  const loadKv = () => {
7665
7684
  const columns = props2.columns;
7666
7685
  let dicData = [];
@@ -7680,7 +7699,6 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7680
7699
  {
7681
7700
  deep: true
7682
7701
  }
7683
- // { immediate: true }
7684
7702
  );
7685
7703
  const validate = async () => {
7686
7704
  try {
@@ -7702,26 +7720,29 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7702
7720
  class: "table-children",
7703
7721
  align: "center"
7704
7722
  }, {
7705
- headerCell: withCtx(({ column }) => [
7706
- column.dataIndex === "index" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7707
- __props.isShowAction ? (openBlock(), createElementBlock("div", {
7708
- key: 0,
7709
- class: "shy-table-edit-icon-plus",
7710
- onClick: plusClickEvent
7711
- }, [
7712
- createVNode(unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
7713
- ])) : (openBlock(), createElementBlock("div", _hoisted_1$t, "序号"))
7714
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7715
- column.required ? (openBlock(), createElementBlock("span", _hoisted_2$9, "*")) : createCommentVNode("", true),
7716
- createElementVNode("span", null, toDisplayString(column.title), 1)
7717
- ], 64))
7718
- ]),
7719
- bodyCell: withCtx(({ column, record, index: index2 }) => [
7720
- column.dataIndex !== "index" ? (openBlock(), createBlock(unref(FormItem), {
7723
+ headerCell: withCtx(({ column }) => {
7724
+ var _a2;
7725
+ return [
7726
+ column.dataIndex === "index" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7727
+ __props.isShowAction ? (openBlock(), createElementBlock("div", {
7728
+ key: 0,
7729
+ class: "shy-table-edit-icon-plus",
7730
+ onClick: plusClickEvent
7731
+ }, [
7732
+ createVNode(unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
7733
+ ])) : (openBlock(), createElementBlock("div", _hoisted_1$t, "序号"))
7734
+ ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7735
+ column.required || ((_a2 = column == null ? void 0 : column.rules) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("span", _hoisted_2$9, "*")) : createCommentVNode("", true),
7736
+ createElementVNode("span", null, toDisplayString(column.title), 1)
7737
+ ], 64))
7738
+ ];
7739
+ }),
7740
+ bodyCell: withCtx(({ column, record, index: index2, ...args }) => [
7741
+ column.dataIndex !== "index" && column.type !== "text" ? (openBlock(), createBlock(unref(FormItem), {
7721
7742
  required: column.required,
7722
7743
  rules: (column == null ? void 0 : column.rules) || [],
7723
7744
  name: [_ctx.$attrs.codeField, index2, column.dataIndex],
7724
- key: record["uuid"]
7745
+ key: record[__props.rowKey]
7725
7746
  }, {
7726
7747
  default: withCtx(() => [
7727
7748
  column.type === "select" ? (openBlock(), createBlock(unref(Select), {
@@ -7744,35 +7765,47 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
7744
7765
  min: column.min,
7745
7766
  max: column.max,
7746
7767
  precision: column.precision ?? 2
7747
- }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : (openBlock(), createBlock(unref(Input), {
7768
+ }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : column.type === "input" ? (openBlock(), createBlock(unref(Input), {
7748
7769
  key: 3,
7749
7770
  value: record[column.dataIndex],
7750
7771
  "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7751
7772
  disabled: !props2.isShowAction
7752
- }, null, 8, ["value", "onUpdate:value", "disabled"]))
7773
+ }, null, 8, ["value", "onUpdate:value", "disabled"])) : (openBlock(), createBlock(resolveDynamicComponent(unref(componentMap$2).get(column.type)), mergeProps(
7774
+ {
7775
+ key: 4,
7776
+ allowClear: "",
7777
+ getPopupContainer: getPopupContainer2,
7778
+ style: { width: "100%" }
7779
+ },
7780
+ unref(isFunction$4)(column.componentProps) ? column.componentProps({ record, column, index: index2, ...args }) : column.componentProps,
7781
+ {
7782
+ value: record[column.dataIndex],
7783
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event
7784
+ }
7785
+ ), null, 16, ["value", "onUpdate:value"]))
7753
7786
  ]),
7754
7787
  _: 2
7755
- }, 1032, ["required", "rules", "name"])) : (openBlock(), createElementBlock("div", {
7788
+ }, 1032, ["required", "rules", "name"])) : column.dataIndex === "index" ? (openBlock(), createElementBlock("div", {
7756
7789
  class: "table-children-delete-wrapper",
7757
- key: record["uuid"]
7790
+ key: record[__props.rowKey]
7758
7791
  }, [
7759
7792
  __props.isShowAction ? (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
7760
7793
  __props.isShowAction ? (openBlock(), createElementBlock("div", {
7761
7794
  key: 1,
7762
7795
  class: "table-children-delete-item",
7763
- onClick: ($event) => rowClickEvent(record["uuid"])
7796
+ onClick: ($event) => rowClickEvent(record[__props.rowKey])
7764
7797
  }, [
7765
7798
  createVNode(unref(DeleteFilled$1), { style: { color: "#fff" } })
7766
7799
  ], 8, _hoisted_4$4)) : (openBlock(), createElementBlock("span", _hoisted_5$3, toDisplayString(index2 + 1), 1))
7767
- ]))
7800
+ ])) : createCommentVNode("", true)
7768
7801
  ]),
7769
7802
  _: 1
7770
7803
  }, 8, ["columns", "data-source"]);
7771
7804
  };
7772
7805
  }
7773
7806
  });
7774
- const Table_vue_vue_type_style_index_0_scoped_9368e785_lang = "";
7775
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-9368e785"]]);
7807
+ const Table_vue_vue_type_style_index_0_scoped_9c0270cf_lang = "";
7808
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-9c0270cf"]]);
7776
7809
  const modal = "";
7777
7810
  useI18n$1();
7778
7811
  const modalProps = {
@@ -14829,7 +14862,22 @@ function useColumns$1(propsRef, getPaginationRef, tableAction, wrapRef) {
14829
14862
  return columns.filter((column) => {
14830
14863
  return hasPermission(column.auth) && isIfShow(column);
14831
14864
  }).map((column) => {
14832
- const { slots, customRender, format, edit, editRow, flag } = column;
14865
+ var _a2, _b;
14866
+ const isSummaryCol = unref(propsRef).showSummaryTotal && ((_b = (_a2 = unref(propsRef).summaryTotalFields) == null ? void 0 : _a2.includes) == null ? void 0 : _b.call(
14867
+ _a2,
14868
+ column.dataIndex
14869
+ ));
14870
+ const summaryFormat = (text) => {
14871
+ return text ? isNumber$2(+text) && !isNaN(+text) ? Number.parseFloat((+text).toFixed(2)).toLocaleString("en-US") : text : "";
14872
+ };
14873
+ const {
14874
+ slots,
14875
+ customRender,
14876
+ format = isSummaryCol ? summaryFormat : void 0,
14877
+ edit,
14878
+ editRow,
14879
+ flag
14880
+ } = column;
14833
14881
  if (!slots || !(slots == null ? void 0 : slots.title)) {
14834
14882
  column.customTitle = column.title;
14835
14883
  Reflect.deleteProperty(column, "title");
@@ -15015,7 +15063,7 @@ function useDataSource(propsRef, {
15015
15063
  const obj = {};
15016
15064
  summaryTotalFields.forEach((field) => {
15017
15065
  const total = dataSourceRef.value.reduce((acc, cur) => {
15018
- return acc + (cur[field] || 0);
15066
+ return +acc + (+cur[field] || 0);
15019
15067
  }, 0);
15020
15068
  obj[field] = Number.parseFloat(total.toFixed(2)).toLocaleString("en-US");
15021
15069
  });
@@ -15031,7 +15079,9 @@ function useDataSource(propsRef, {
15031
15079
  immediate: true
15032
15080
  }
15033
15081
  );
15082
+ let oldSortInfoRef;
15034
15083
  function handleTableChange(pagination, filters, sorter) {
15084
+ const isChangeSorter = !eq(oldSortInfoRef, sorter.order);
15035
15085
  const { clearSelectOnPageChange, sortFn, filterFn } = unref(propsRef);
15036
15086
  if (clearSelectOnPageChange) {
15037
15087
  clearSelectedRowKeys();
@@ -15049,6 +15099,10 @@ function useDataSource(propsRef, {
15049
15099
  searchState.filterInfo = filterInfo;
15050
15100
  params.filterInfo = filterInfo;
15051
15101
  }
15102
+ if (isChangeSorter && !unref(propsRef).isSortFetch) {
15103
+ oldSortInfoRef = sorter.order;
15104
+ return;
15105
+ }
15052
15106
  fetch(params);
15053
15107
  }
15054
15108
  function setTableKey(items) {
@@ -15558,6 +15612,19 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef, getDa
15558
15612
  nextTick(() => {
15559
15613
  debounceRedoHeight();
15560
15614
  });
15615
+ const table2 = unref(tableElRef);
15616
+ if (!table2)
15617
+ return;
15618
+ const tableEl = table2.$el;
15619
+ if (!tableEl)
15620
+ return;
15621
+ const bodyEl2 = tableEl.querySelector(".ant-table-tbody");
15622
+ if (!bodyEl2)
15623
+ return;
15624
+ new Sortablejs(bodyEl2, {
15625
+ ghostClass: "bg-gray-100",
15626
+ draggable: ".ant-table-row"
15627
+ });
15561
15628
  });
15562
15629
  const getScrollX = computed(() => {
15563
15630
  var _a2;
@@ -17282,6 +17349,7 @@ const basicProps$3 = reactive({
17282
17349
  }
17283
17350
  },
17284
17351
  inset: Boolean,
17352
+ isSortFetch: { type: Boolean, default: true },
17285
17353
  sortFn: {
17286
17354
  type: Function,
17287
17355
  default: DEFAULT_SORT_FN
package/es/style.css CHANGED
@@ -265,6 +265,10 @@ ul {
265
265
  max-width: 1600px;
266
266
  }
267
267
  }
268
+ .bg-gray-100 {
269
+ --tw-bg-opacity: 1;
270
+ background-color: rgba(243, 244, 246, var(--tw-bg-opacity));
271
+ }
268
272
  .border-primary {
269
273
  --tw-border-opacity: 1;
270
274
  border-color: rgba(24, 144, 255, var(--tw-border-opacity));
@@ -24871,40 +24875,40 @@ span.iconify {
24871
24875
  .shy-tinymce-container textarea {
24872
24876
  z-index: -1;
24873
24877
  visibility: hidden;
24874
- }.shy-table-edit-icon-plus[data-v-9368e785] {
24878
+ }.shy-table-edit-icon-plus[data-v-9c0270cf] {
24875
24879
  width: 30px;
24876
24880
  height: 30px;
24877
24881
  font-size: 30px;
24878
24882
  cursor: pointer;
24879
24883
  display: flex;
24880
24884
  }
24881
- .table-children[data-v-9368e785] .ant-form-item {
24885
+ .table-children[data-v-9c0270cf] .ant-form-item {
24882
24886
  margin-bottom: 0 !important;
24883
24887
  }
24884
- .table-children-required[data-v-9368e785] {
24888
+ .table-children-required[data-v-9c0270cf] {
24885
24889
  color: #ff4d4f;
24886
24890
  margin-right: 4px;
24887
24891
  }
24888
- .table-children[data-v-9368e785] .ant-table-cell {
24892
+ .table-children[data-v-9c0270cf] .ant-table-cell {
24889
24893
  padding: 8px !important;
24890
24894
  }
24891
- .table-children[data-v-9368e785] .ant-table-cell .ant-form-item-explain {
24895
+ .table-children[data-v-9c0270cf] .ant-table-cell .ant-form-item-explain {
24892
24896
  display: none;
24893
24897
  }
24894
- .table-children-delete-wrapper[data-v-9368e785] {
24898
+ .table-children-delete-wrapper[data-v-9c0270cf] {
24895
24899
  display: flex;
24896
24900
  height: 100%;
24897
24901
  justify-content: center;
24898
24902
  }
24899
- .table-children-delete-wrapper:hover .table-children-delete-item[data-v-9368e785] {
24903
+ .table-children-delete-wrapper:hover .table-children-delete-item[data-v-9c0270cf] {
24900
24904
  display: flex;
24901
24905
  justify-content: center;
24902
24906
  align-items: center;
24903
24907
  }
24904
- .table-children-delete-wrapper:hover .table-children-delete-index[data-v-9368e785] {
24908
+ .table-children-delete-wrapper:hover .table-children-delete-index[data-v-9c0270cf] {
24905
24909
  display: none;
24906
24910
  }
24907
- .table-children-delete-item[data-v-9368e785] {
24911
+ .table-children-delete-item[data-v-9c0270cf] {
24908
24912
  background-color: red;
24909
24913
  border-radius: 50%;
24910
24914
  width: 30px;
@@ -24913,7 +24917,7 @@ span.iconify {
24913
24917
  display: none;
24914
24918
  cursor: pointer;
24915
24919
  }
24916
- .table-children-delete-index[data-v-9368e785] {
24920
+ .table-children-delete-index[data-v-9c0270cf] {
24917
24921
  user-select: none;
24918
24922
  display: inline-block;
24919
24923
  }@media screen and (max-height: 600px) {
package/lib/index.js CHANGED
@@ -4095,9 +4095,16 @@ const _sfc_main$1q = vue.defineComponent({
4095
4095
  return prev;
4096
4096
  }, []);
4097
4097
  });
4098
- vue.watchEffect(() => {
4099
- props2.immediate && !props2.alwaysLoad && fetch();
4100
- });
4098
+ vue.watch(
4099
+ () => props2.immediate && !props2.alwaysLoad,
4100
+ (val) => {
4101
+ if (val)
4102
+ fetch();
4103
+ },
4104
+ {
4105
+ immediate: true
4106
+ }
4107
+ );
4101
4108
  vue.watch(
4102
4109
  () => state.value,
4103
4110
  (v) => {
@@ -4156,8 +4163,9 @@ const _sfc_main$1q = vue.defineComponent({
4156
4163
  function emitChange() {
4157
4164
  emit("options-change", vue.unref(getOptions));
4158
4165
  }
4159
- function handleChange(_, ...args) {
4166
+ function handleChange(val, ...args) {
4160
4167
  emitData.value = args;
4168
+ emit("update:value", val);
4161
4169
  }
4162
4170
  const filterOption = (input, option) => {
4163
4171
  var _a2, _b, _c;
@@ -7642,6 +7650,10 @@ const _hoisted_5$3 = {
7642
7650
  const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
7643
7651
  __name: "Table",
7644
7652
  props: {
7653
+ rowKey: {
7654
+ type: String,
7655
+ default: () => "uuid"
7656
+ },
7645
7657
  columns: {
7646
7658
  type: Array,
7647
7659
  default: () => []
@@ -7671,20 +7683,27 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
7671
7683
  width: 50,
7672
7684
  align: "center"
7673
7685
  };
7674
- return [indexColumn, ...props2.columns];
7686
+ return [
7687
+ indexColumn,
7688
+ ...props2.columns.map((item) => ({
7689
+ ...item,
7690
+ type: item.type ? item.type : "input"
7691
+ }))
7692
+ ];
7675
7693
  });
7676
7694
  const plusClickEvent = () => {
7677
- state.value = [{ uuid: utils.buildUUID() }, ...state.value];
7695
+ state.value = [{ [props2.rowKey]: utils.buildUUID() }, ...state.value];
7678
7696
  emit("add", state.value);
7679
7697
  };
7680
7698
  const rowClickEvent = (index2) => {
7681
7699
  const tempState = state.value.filter((item) => {
7682
- return item["uuid"] !== index2;
7700
+ return item[props2.rowKey] !== index2;
7683
7701
  });
7684
- tempState.forEach((item) => item["uuid"] = utils.buildUUID());
7702
+ tempState.forEach((item) => item[props2.rowKey] = utils.buildUUID());
7685
7703
  state.value = [...tempState];
7686
7704
  emit("remove", state.value, index2);
7687
7705
  };
7706
+ const getPopupContainer2 = () => document.body;
7688
7707
  const loadKv = () => {
7689
7708
  const columns = props2.columns;
7690
7709
  let dicData = [];
@@ -7704,7 +7723,6 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
7704
7723
  {
7705
7724
  deep: true
7706
7725
  }
7707
- // { immediate: true }
7708
7726
  );
7709
7727
  const validate = async () => {
7710
7728
  try {
@@ -7726,26 +7744,29 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
7726
7744
  class: "table-children",
7727
7745
  align: "center"
7728
7746
  }, {
7729
- headerCell: vue.withCtx(({ column }) => [
7730
- column.dataIndex === "index" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
7731
- __props.isShowAction ? (vue.openBlock(), vue.createElementBlock("div", {
7732
- key: 0,
7733
- class: "shy-table-edit-icon-plus",
7734
- onClick: plusClickEvent
7735
- }, [
7736
- vue.createVNode(vue.unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
7737
- ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, "序号"))
7738
- ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
7739
- column.required ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9, "*")) : vue.createCommentVNode("", true),
7740
- vue.createElementVNode("span", null, vue.toDisplayString(column.title), 1)
7741
- ], 64))
7742
- ]),
7743
- bodyCell: vue.withCtx(({ column, record, index: index2 }) => [
7744
- column.dataIndex !== "index" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), {
7747
+ headerCell: vue.withCtx(({ column }) => {
7748
+ var _a2;
7749
+ return [
7750
+ column.dataIndex === "index" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
7751
+ __props.isShowAction ? (vue.openBlock(), vue.createElementBlock("div", {
7752
+ key: 0,
7753
+ class: "shy-table-edit-icon-plus",
7754
+ onClick: plusClickEvent
7755
+ }, [
7756
+ vue.createVNode(vue.unref(PlusCircleFilled$1), { style: { color: "#006eff" } })
7757
+ ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$t, "序号"))
7758
+ ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
7759
+ column.required || ((_a2 = column == null ? void 0 : column.rules) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9, "*")) : vue.createCommentVNode("", true),
7760
+ vue.createElementVNode("span", null, vue.toDisplayString(column.title), 1)
7761
+ ], 64))
7762
+ ];
7763
+ }),
7764
+ bodyCell: vue.withCtx(({ column, record, index: index2, ...args }) => [
7765
+ column.dataIndex !== "index" && column.type !== "text" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.FormItem), {
7745
7766
  required: column.required,
7746
7767
  rules: (column == null ? void 0 : column.rules) || [],
7747
7768
  name: [_ctx.$attrs.codeField, index2, column.dataIndex],
7748
- key: record["uuid"]
7769
+ key: record[__props.rowKey]
7749
7770
  }, {
7750
7771
  default: vue.withCtx(() => [
7751
7772
  column.type === "select" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Select), {
@@ -7768,35 +7789,47 @@ const _sfc_main$15 = /* @__PURE__ */ vue.defineComponent({
7768
7789
  min: column.min,
7769
7790
  max: column.max,
7770
7791
  precision: column.precision ?? 2
7771
- }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
7792
+ }, null, 8, ["value", "onUpdate:value", "min", "max", "precision"])) : column.type === "input" ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Input), {
7772
7793
  key: 3,
7773
7794
  value: record[column.dataIndex],
7774
7795
  "onUpdate:value": ($event) => record[column.dataIndex] = $event,
7775
7796
  disabled: !props2.isShowAction
7776
- }, null, 8, ["value", "onUpdate:value", "disabled"]))
7797
+ }, null, 8, ["value", "onUpdate:value", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(componentMap$2).get(column.type)), vue.mergeProps(
7798
+ {
7799
+ key: 4,
7800
+ allowClear: "",
7801
+ getPopupContainer: getPopupContainer2,
7802
+ style: { width: "100%" }
7803
+ },
7804
+ vue.unref(utils.isFunction)(column.componentProps) ? column.componentProps({ record, column, index: index2, ...args }) : column.componentProps,
7805
+ {
7806
+ value: record[column.dataIndex],
7807
+ "onUpdate:value": ($event) => record[column.dataIndex] = $event
7808
+ }
7809
+ ), null, 16, ["value", "onUpdate:value"]))
7777
7810
  ]),
7778
7811
  _: 2
7779
- }, 1032, ["required", "rules", "name"])) : (vue.openBlock(), vue.createElementBlock("div", {
7812
+ }, 1032, ["required", "rules", "name"])) : column.dataIndex === "index" ? (vue.openBlock(), vue.createElementBlock("div", {
7780
7813
  class: "table-children-delete-wrapper",
7781
- key: record["uuid"]
7814
+ key: record[__props.rowKey]
7782
7815
  }, [
7783
7816
  __props.isShowAction ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$6, vue.toDisplayString(index2 + 1), 1)) : vue.createCommentVNode("", true),
7784
7817
  __props.isShowAction ? (vue.openBlock(), vue.createElementBlock("div", {
7785
7818
  key: 1,
7786
7819
  class: "table-children-delete-item",
7787
- onClick: ($event) => rowClickEvent(record["uuid"])
7820
+ onClick: ($event) => rowClickEvent(record[__props.rowKey])
7788
7821
  }, [
7789
7822
  vue.createVNode(vue.unref(DeleteFilled$1), { style: { color: "#fff" } })
7790
7823
  ], 8, _hoisted_4$4)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$3, vue.toDisplayString(index2 + 1), 1))
7791
- ]))
7824
+ ])) : vue.createCommentVNode("", true)
7792
7825
  ]),
7793
7826
  _: 1
7794
7827
  }, 8, ["columns", "data-source"]);
7795
7828
  };
7796
7829
  }
7797
7830
  });
7798
- const Table_vue_vue_type_style_index_0_scoped_9368e785_lang = "";
7799
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-9368e785"]]);
7831
+ const Table_vue_vue_type_style_index_0_scoped_9c0270cf_lang = "";
7832
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-9c0270cf"]]);
7800
7833
  const modal = "";
7801
7834
  use.useI18n();
7802
7835
  const modalProps = {
@@ -14853,7 +14886,22 @@ function useColumns$1(propsRef, getPaginationRef, tableAction, wrapRef) {
14853
14886
  return columns.filter((column) => {
14854
14887
  return hasPermission(column.auth) && isIfShow(column);
14855
14888
  }).map((column) => {
14856
- const { slots, customRender, format, edit, editRow, flag } = column;
14889
+ var _a2, _b;
14890
+ const isSummaryCol = vue.unref(propsRef).showSummaryTotal && ((_b = (_a2 = vue.unref(propsRef).summaryTotalFields) == null ? void 0 : _a2.includes) == null ? void 0 : _b.call(
14891
+ _a2,
14892
+ column.dataIndex
14893
+ ));
14894
+ const summaryFormat = (text) => {
14895
+ return text ? utils.isNumber(+text) && !isNaN(+text) ? Number.parseFloat((+text).toFixed(2)).toLocaleString("en-US") : text : "";
14896
+ };
14897
+ const {
14898
+ slots,
14899
+ customRender,
14900
+ format = isSummaryCol ? summaryFormat : void 0,
14901
+ edit,
14902
+ editRow,
14903
+ flag
14904
+ } = column;
14857
14905
  if (!slots || !(slots == null ? void 0 : slots.title)) {
14858
14906
  column.customTitle = column.title;
14859
14907
  Reflect.deleteProperty(column, "title");
@@ -15039,7 +15087,7 @@ function useDataSource(propsRef, {
15039
15087
  const obj = {};
15040
15088
  summaryTotalFields.forEach((field) => {
15041
15089
  const total = dataSourceRef.value.reduce((acc, cur) => {
15042
- return acc + (cur[field] || 0);
15090
+ return +acc + (+cur[field] || 0);
15043
15091
  }, 0);
15044
15092
  obj[field] = Number.parseFloat(total.toFixed(2)).toLocaleString("en-US");
15045
15093
  });
@@ -15055,7 +15103,9 @@ function useDataSource(propsRef, {
15055
15103
  immediate: true
15056
15104
  }
15057
15105
  );
15106
+ let oldSortInfoRef;
15058
15107
  function handleTableChange(pagination, filters, sorter) {
15108
+ const isChangeSorter = !eq(oldSortInfoRef, sorter.order);
15059
15109
  const { clearSelectOnPageChange, sortFn, filterFn } = vue.unref(propsRef);
15060
15110
  if (clearSelectOnPageChange) {
15061
15111
  clearSelectedRowKeys();
@@ -15073,6 +15123,10 @@ function useDataSource(propsRef, {
15073
15123
  searchState.filterInfo = filterInfo;
15074
15124
  params.filterInfo = filterInfo;
15075
15125
  }
15126
+ if (isChangeSorter && !vue.unref(propsRef).isSortFetch) {
15127
+ oldSortInfoRef = sorter.order;
15128
+ return;
15129
+ }
15076
15130
  fetch(params);
15077
15131
  }
15078
15132
  function setTableKey(items) {
@@ -15582,6 +15636,19 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef, getDa
15582
15636
  vue.nextTick(() => {
15583
15637
  debounceRedoHeight();
15584
15638
  });
15639
+ const table2 = vue.unref(tableElRef);
15640
+ if (!table2)
15641
+ return;
15642
+ const tableEl = table2.$el;
15643
+ if (!tableEl)
15644
+ return;
15645
+ const bodyEl2 = tableEl.querySelector(".ant-table-tbody");
15646
+ if (!bodyEl2)
15647
+ return;
15648
+ new Sortablejs(bodyEl2, {
15649
+ ghostClass: "bg-gray-100",
15650
+ draggable: ".ant-table-row"
15651
+ });
15585
15652
  });
15586
15653
  const getScrollX = vue.computed(() => {
15587
15654
  var _a2;
@@ -17306,6 +17373,7 @@ const basicProps$3 = vue.reactive({
17306
17373
  }
17307
17374
  },
17308
17375
  inset: Boolean,
17376
+ isSortFetch: { type: Boolean, default: true },
17309
17377
  sortFn: {
17310
17378
  type: Function,
17311
17379
  default: DEFAULT_SORT_FN
package/lib/style.css CHANGED
@@ -265,6 +265,10 @@ ul {
265
265
  max-width: 1600px;
266
266
  }
267
267
  }
268
+ .bg-gray-100 {
269
+ --tw-bg-opacity: 1;
270
+ background-color: rgba(243, 244, 246, var(--tw-bg-opacity));
271
+ }
268
272
  .border-primary {
269
273
  --tw-border-opacity: 1;
270
274
  border-color: rgba(24, 144, 255, var(--tw-border-opacity));
@@ -24871,40 +24875,40 @@ span.iconify {
24871
24875
  .shy-tinymce-container textarea {
24872
24876
  z-index: -1;
24873
24877
  visibility: hidden;
24874
- }.shy-table-edit-icon-plus[data-v-9368e785] {
24878
+ }.shy-table-edit-icon-plus[data-v-9c0270cf] {
24875
24879
  width: 30px;
24876
24880
  height: 30px;
24877
24881
  font-size: 30px;
24878
24882
  cursor: pointer;
24879
24883
  display: flex;
24880
24884
  }
24881
- .table-children[data-v-9368e785] .ant-form-item {
24885
+ .table-children[data-v-9c0270cf] .ant-form-item {
24882
24886
  margin-bottom: 0 !important;
24883
24887
  }
24884
- .table-children-required[data-v-9368e785] {
24888
+ .table-children-required[data-v-9c0270cf] {
24885
24889
  color: #ff4d4f;
24886
24890
  margin-right: 4px;
24887
24891
  }
24888
- .table-children[data-v-9368e785] .ant-table-cell {
24892
+ .table-children[data-v-9c0270cf] .ant-table-cell {
24889
24893
  padding: 8px !important;
24890
24894
  }
24891
- .table-children[data-v-9368e785] .ant-table-cell .ant-form-item-explain {
24895
+ .table-children[data-v-9c0270cf] .ant-table-cell .ant-form-item-explain {
24892
24896
  display: none;
24893
24897
  }
24894
- .table-children-delete-wrapper[data-v-9368e785] {
24898
+ .table-children-delete-wrapper[data-v-9c0270cf] {
24895
24899
  display: flex;
24896
24900
  height: 100%;
24897
24901
  justify-content: center;
24898
24902
  }
24899
- .table-children-delete-wrapper:hover .table-children-delete-item[data-v-9368e785] {
24903
+ .table-children-delete-wrapper:hover .table-children-delete-item[data-v-9c0270cf] {
24900
24904
  display: flex;
24901
24905
  justify-content: center;
24902
24906
  align-items: center;
24903
24907
  }
24904
- .table-children-delete-wrapper:hover .table-children-delete-index[data-v-9368e785] {
24908
+ .table-children-delete-wrapper:hover .table-children-delete-index[data-v-9c0270cf] {
24905
24909
  display: none;
24906
24910
  }
24907
- .table-children-delete-item[data-v-9368e785] {
24911
+ .table-children-delete-item[data-v-9c0270cf] {
24908
24912
  background-color: red;
24909
24913
  border-radius: 50%;
24910
24914
  width: 30px;
@@ -24913,7 +24917,7 @@ span.iconify {
24913
24917
  display: none;
24914
24918
  cursor: pointer;
24915
24919
  }
24916
- .table-children-delete-index[data-v-9368e785] {
24920
+ .table-children-delete-index[data-v-9c0270cf] {
24917
24921
  user-select: none;
24918
24922
  display: inline-block;
24919
24923
  }@media screen and (max-height: 600px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "2.14.93",
3
+ "version": "2.14.95",
4
4
  "description": "",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",