@ecan-bi/datav 1.0.99 → 1.1.1

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/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! @ecan-bi/datav@1.0.99 */
1
+ /*! @ecan-bi/datav@1.1.1 */
2
2
  var _a, _b, _c, _d;
3
- import { watch, inject, computed, unref, watchEffect, defineComponent, shallowRef, toRefs, onMounted, onUnmounted, h, nextTick, createVNode, resolveComponent, openBlock, createElementBlock, createBlock, renderSlot, withCtx, ref, normalizeStyle, createCommentVNode, provide, toDisplayString, Fragment, renderList, createElementVNode, normalizeClass, pushScopeId, popScopeId, createSlots, resolveDynamicComponent, mergeProps, withModifiers, withDirectives, vShow } from "vue";
3
+ import { watch, inject, computed, unref, watchEffect, defineComponent, shallowRef, toRefs, onMounted, onUnmounted, h, nextTick, createVNode, resolveComponent, openBlock, createElementBlock, createBlock, renderSlot, withCtx, ref, normalizeStyle, createCommentVNode, provide, onBeforeUnmount, toDisplayString, Fragment, renderList, createElementVNode, normalizeClass, pushScopeId, popScopeId, createSlots, resolveDynamicComponent, mergeProps, withModifiers, withDirectives, vShow } from "vue";
4
4
  import { throttle, init, use, registerMap } from "echarts/core";
5
5
  import { addListener, removeListener } from "resize-detector";
6
6
  import { Spin as Spin$1, Skeleton as Skeleton$1, message, Progress, Input as Input$1, DatePicker as DatePicker$1, Select as Select$1, RangePicker as RangePicker$1, Button as Button$1, CheckboxGroup, Modal as Modal$1, Table as Table$1, TableSummary, TableSummaryRow, TableSummaryCell } from "ant-design-vue";
@@ -1560,13 +1560,11 @@ const BASE_URL = ((_c = window == null ? void 0 : window.config) == null ? void
1560
1560
  const ERD_URL = ((_d = window == null ? void 0 : window.config) == null ? void 0 : _d.erdURL) || "";
1561
1561
  const useOnEvent = (props2, events) => {
1562
1562
  watch(() => props2.id, (id, oldId) => {
1563
+ console.log(id, oldId);
1563
1564
  const eventBus = inject(EVENT_BUS, {
1564
1565
  onEvent: (i, e) => void 0,
1565
1566
  offEvent: (i) => void 0
1566
1567
  });
1567
- if (oldId != null && oldId !== "") {
1568
- eventBus.offEvent(oldId);
1569
- }
1570
1568
  if (id != null && id !== "") {
1571
1569
  eventBus.onEvent(id, events);
1572
1570
  }
@@ -2640,11 +2638,16 @@ const _sfc_main$o = defineComponent({
2640
2638
  setGlobalModel
2641
2639
  });
2642
2640
  const eventBus = mitt();
2641
+ const eventBusKeySet = /* @__PURE__ */ new Set();
2643
2642
  const onEvent = (key, events) => {
2643
+ if (eventBusKeySet.has(key)) {
2644
+ eventBus.off(key);
2645
+ }
2644
2646
  eventBus.on(key, (k) => {
2647
+ eventBusKeySet.add(key);
2645
2648
  return Object.prototype.toString.call(events[k]) === "[object Function]" && events[k]();
2646
2649
  });
2647
- onUnmounted(() => {
2650
+ onBeforeUnmount(() => {
2648
2651
  eventBus.off(key);
2649
2652
  });
2650
2653
  };
@@ -2667,14 +2670,16 @@ const _sfc_main$o = defineComponent({
2667
2670
  requestToken
2668
2671
  });
2669
2672
  const requestModel = /* @__PURE__ */ new Map();
2670
- const setRequest = (requestFn = () => {
2671
- }, sortNum = 0) => {
2673
+ const requestMap = /* @__PURE__ */ new Map();
2674
+ const setRequest = ({ requestFn = () => {
2675
+ }, sortNum = 0, id = "" }) => {
2672
2676
  if (requestModel.has(sortNum)) {
2673
2677
  const requestFnList = requestModel.get(sortNum);
2674
2678
  requestFnList == null ? void 0 : requestFnList.push(requestFn);
2675
2679
  } else {
2676
2680
  requestModel.set(sortNum, [requestFn]);
2677
2681
  }
2682
+ requestMap.set(id, requestFn);
2678
2683
  };
2679
2684
  const handleRequestFnList = (requestFnList) => {
2680
2685
  return new Promise((resolve, reject) => {
@@ -2696,22 +2701,29 @@ const _sfc_main$o = defineComponent({
2696
2701
  });
2697
2702
  config.indicatorToken = (_a2 = res.data.data) == null ? void 0 : _a2.token;
2698
2703
  };
2699
- const touchRequest = async () => {
2700
- const requestModelArr = Array.from(requestModel);
2701
- requestModelArr.sort((a, b) => b[0] - a[0]);
2702
- const len = requestModelArr.length;
2703
- try {
2704
- if (props2.pageMode !== "design" && unref(tokenNum) > 0) {
2705
- await queryUserToken();
2704
+ const touchRequest = async (id) => {
2705
+ if (!id) {
2706
+ const requestModelArr = Array.from(requestModel);
2707
+ requestModelArr.sort((a, b) => b[0] - a[0]);
2708
+ const len = requestModelArr.length;
2709
+ try {
2710
+ if (props2.pageMode !== "design" && unref(tokenNum) > 0) {
2711
+ await queryUserToken();
2712
+ }
2713
+ for (let i = 0; i < len; i++) {
2714
+ const requestFnList = requestModelArr[i][1];
2715
+ await handleRequestFnList(requestFnList);
2716
+ }
2717
+ } catch (e) {
2718
+ console.error(e);
2719
+ } finally {
2720
+ requestModel.clear();
2706
2721
  }
2707
- for (let i = 0; i < len; i++) {
2708
- const requestFnList = requestModelArr[i][1];
2709
- await handleRequestFnList(requestFnList);
2722
+ } else if (typeof id === "string") {
2723
+ const requestFn = requestMap.get(id);
2724
+ if (typeof requestFn === "function") {
2725
+ requestFn();
2710
2726
  }
2711
- } catch (e) {
2712
- console.error(e);
2713
- } finally {
2714
- requestModel.clear();
2715
2727
  }
2716
2728
  };
2717
2729
  provide(REQUEST_MODEL, {
@@ -2730,6 +2742,10 @@ const _sfc_main$o = defineComponent({
2730
2742
  eventBus.off(REFRESH_PAGE);
2731
2743
  });
2732
2744
  };
2745
+ onBeforeUnmount(() => {
2746
+ requestModel == null ? void 0 : requestModel.clear();
2747
+ requestMap == null ? void 0 : requestMap.clear();
2748
+ });
2733
2749
  expose({
2734
2750
  touchRequest,
2735
2751
  getGlobalModel,
@@ -2864,9 +2880,13 @@ const _sfc_main$n = defineComponent({
2864
2880
  refreshData
2865
2881
  });
2866
2882
  const { setRequest } = inject(REQUEST_MODEL, {
2867
- setRequest: (requestFn, sortNum) => void 0
2883
+ setRequest: ({ id, sortNum, requestFn }) => void 0
2884
+ });
2885
+ setRequest({
2886
+ id: props2.id,
2887
+ requestFn: refreshData,
2888
+ sortNum: props2.requestSort
2868
2889
  });
2869
- setRequest(refreshData, props2.requestSort);
2870
2890
  useOnEvent(props2, {
2871
2891
  refreshData
2872
2892
  });
@@ -2899,7 +2919,7 @@ const _sfc_main$n = defineComponent({
2899
2919
  };
2900
2920
  }
2901
2921
  });
2902
- const Text_vue_vue_type_style_index_0_scoped_8e727e41_lang = "";
2922
+ const Text_vue_vue_type_style_index_0_scoped_860fa6ea_lang = "";
2903
2923
  const _hoisted_1$8 = ["innerHTML"];
2904
2924
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2905
2925
  const _component_skeleton = resolveComponent("skeleton");
@@ -2917,7 +2937,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2917
2937
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2918
2938
  }, null, 12, _hoisted_1$8));
2919
2939
  }
2920
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-8e727e41"]]);
2940
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-860fa6ea"]]);
2921
2941
  const EcanText = withInstall(Text);
2922
2942
  const _sfc_main$m = defineComponent({
2923
2943
  name: "EcanScrollText",
@@ -3101,9 +3121,13 @@ const _sfc_main$k = defineComponent({
3101
3121
  refreshData
3102
3122
  });
3103
3123
  const { setRequest } = inject(REQUEST_MODEL, {
3104
- setRequest: (requestFn, sortNum) => void 0
3124
+ setRequest: ({ id, sortNum, requestFn }) => void 0
3125
+ });
3126
+ setRequest({
3127
+ id: props2.id,
3128
+ requestFn: handleRequestData,
3129
+ sortNum: props2.requestSort
3105
3130
  });
3106
- setRequest(handleRequestData, props2.requestSort);
3107
3131
  return {
3108
3132
  style: style2,
3109
3133
  formatFn,
@@ -3115,9 +3139,9 @@ const _sfc_main$k = defineComponent({
3115
3139
  };
3116
3140
  }
3117
3141
  });
3118
- const List_vue_vue_type_style_index_0_scoped_73ca0d93_lang = "";
3142
+ const List_vue_vue_type_style_index_0_scoped_baf2ff0c_lang = "";
3119
3143
  const List_vue_vue_type_style_index_1_lang = "";
3120
- const _withScopeId$1 = (n) => (pushScopeId("data-v-73ca0d93"), n = n(), popScopeId(), n);
3144
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-baf2ff0c"), n = n(), popScopeId(), n);
3121
3145
  const _hoisted_1$6 = {
3122
3146
  key: 0,
3123
3147
  class: "title"
@@ -3219,7 +3243,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
3219
3243
  }, 8, ["loading"])
3220
3244
  ], 4);
3221
3245
  }
3222
- const List = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-73ca0d93"]]);
3246
+ const List = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-baf2ff0c"]]);
3223
3247
  const EcanList = withInstall(List);
3224
3248
  const proportionProps = {
3225
3249
  ...props,
@@ -3374,9 +3398,13 @@ const _sfc_main$j = defineComponent({
3374
3398
  const click = emitEvent("click", () => {
3375
3399
  });
3376
3400
  const { setRequest } = inject(REQUEST_MODEL, {
3377
- setRequest: (requestFn, sortNum) => void 0
3401
+ setRequest: ({ id, sortNum, requestFn }) => void 0
3402
+ });
3403
+ setRequest({
3404
+ id: props2.id,
3405
+ requestFn: handleRequestData,
3406
+ sortNum: props2.requestSort
3378
3407
  });
3379
- setRequest(handleRequestData, props2.requestSort);
3380
3408
  return {
3381
3409
  style: style2,
3382
3410
  myWidth,
@@ -3387,7 +3415,7 @@ const _sfc_main$j = defineComponent({
3387
3415
  };
3388
3416
  }
3389
3417
  });
3390
- const Proportion_vue_vue_type_style_index_0_scoped_c6114322_lang = "";
3418
+ const Proportion_vue_vue_type_style_index_0_scoped_304d430d_lang = "";
3391
3419
  function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
3392
3420
  const _component_skeleton = resolveComponent("skeleton");
3393
3421
  const _component_a_progress = resolveComponent("a-progress");
@@ -3427,7 +3455,7 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
3427
3455
  }, 8, ["percent", "width", "type", "strokeColor", "strokeLinecap", "trailColor", "strokeWidth", "gapDegree", "onClick"])
3428
3456
  ], 4);
3429
3457
  }
3430
- const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-c6114322"]]);
3458
+ const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-304d430d"]]);
3431
3459
  const EcanProportion = withInstall(Proportion);
3432
3460
  const inputProps = {
3433
3461
  ...props,
@@ -3674,9 +3702,13 @@ const _sfc_main$g = defineComponent({
3674
3702
  selectChange
3675
3703
  });
3676
3704
  const { setRequest } = inject(REQUEST_MODEL, {
3677
- setRequest: (requestFn, sortNum) => void 0
3705
+ setRequest: ({ id, sortNum, requestFn }) => void 0
3706
+ });
3707
+ setRequest({
3708
+ id: props2.id,
3709
+ requestFn: handleRequestData,
3710
+ sortNum: props2.requestSort
3678
3711
  });
3679
- setRequest(handleRequestData, props2.requestSort);
3680
3712
  return {
3681
3713
  style: style2,
3682
3714
  getPopupContainer,
@@ -3688,7 +3720,7 @@ const _sfc_main$g = defineComponent({
3688
3720
  };
3689
3721
  }
3690
3722
  });
3691
- const Select_vue_vue_type_style_index_0_scoped_3e94d5e8_lang = "";
3723
+ const Select_vue_vue_type_style_index_0_scoped_dd2bcf63_lang = "";
3692
3724
  const Select_vue_vue_type_style_index_1_lang = "";
3693
3725
  function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
3694
3726
  const _component_a_select = resolveComponent("a-select");
@@ -3712,7 +3744,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
3712
3744
  }, null, 8, ["value", "options", "mode", "getPopupContainer", "field-names", "maxTagCount", "filter-option", "onChange", "loading"])
3713
3745
  ], 4);
3714
3746
  }
3715
- const Select = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-3e94d5e8"]]);
3747
+ const Select = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-dd2bcf63"]]);
3716
3748
  const EcanSelect = withInstall(Select);
3717
3749
  const rangePickerProps = {
3718
3750
  ...props,
@@ -3966,9 +3998,13 @@ const _sfc_main$d = defineComponent({
3966
3998
  setGlobalModel(id, { ...modal, RECORD: myValue });
3967
3999
  });
3968
4000
  const { setRequest } = inject(REQUEST_MODEL, {
3969
- setRequest: (requestFn, sortNum) => void 0
4001
+ setRequest: ({ id: id2, sortNum, requestFn }) => void 0
4002
+ });
4003
+ setRequest({
4004
+ id: props2.id,
4005
+ requestFn: handleRequestData,
4006
+ sortNum: props2.requestSort
3970
4007
  });
3971
- setRequest(handleRequestData, props2.requestSort);
3972
4008
  return {
3973
4009
  myOption,
3974
4010
  style: style2,
@@ -4315,9 +4351,13 @@ const _sfc_main$c = defineComponent({
4315
4351
  click
4316
4352
  });
4317
4353
  const { setRequest } = inject(REQUEST_MODEL, {
4318
- setRequest: (requestFn, sortNum) => void 0
4354
+ setRequest: ({ id, sortNum, requestFn }) => void 0
4355
+ });
4356
+ setRequest({
4357
+ id: props2.id,
4358
+ requestFn: chooseRequestOrDiagram,
4359
+ sortNum: props2.requestSort
4319
4360
  });
4320
- setRequest(chooseRequestOrDiagram, props2.requestSort);
4321
4361
  return {
4322
4362
  option,
4323
4363
  style: style2,
@@ -4725,9 +4765,13 @@ const _sfc_main$b = defineComponent({
4725
4765
  click
4726
4766
  });
4727
4767
  const { setRequest } = inject(REQUEST_MODEL, {
4728
- setRequest: (requestFn, sortNum) => void 0
4768
+ setRequest: ({ id, sortNum, requestFn }) => void 0
4769
+ });
4770
+ setRequest({
4771
+ id: props2.id,
4772
+ requestFn: chooseRequestOrDiagram,
4773
+ sortNum: props2.requestSort
4729
4774
  });
4730
- setRequest(chooseRequestOrDiagram, props2.requestSort);
4731
4775
  return {
4732
4776
  option,
4733
4777
  style: style2,
@@ -5170,9 +5214,13 @@ const _sfc_main$a = defineComponent({
5170
5214
  setGlobalModel(id, { ...modal, RECORD: e.data });
5171
5215
  });
5172
5216
  const { setRequest } = inject(REQUEST_MODEL, {
5173
- setRequest: (requestFn, sortNum) => void 0
5217
+ setRequest: ({ id, sortNum, requestFn }) => void 0
5218
+ });
5219
+ setRequest({
5220
+ id: props2.id,
5221
+ requestFn: refreshData,
5222
+ sortNum: props2.requestSort
5174
5223
  });
5175
- setRequest(refreshData, props2.requestSort);
5176
5224
  useOnEvent(props2, {
5177
5225
  refreshData,
5178
5226
  click
@@ -5494,9 +5542,13 @@ const _sfc_main$9 = defineComponent({
5494
5542
  click
5495
5543
  });
5496
5544
  const { setRequest } = inject(REQUEST_MODEL, {
5497
- setRequest: (requestFn, sortNum) => void 0
5545
+ setRequest: ({ id, sortNum, requestFn }) => void 0
5546
+ });
5547
+ setRequest({
5548
+ id: props2.id,
5549
+ requestFn: handleRequestData,
5550
+ sortNum: props2.requestSort
5498
5551
  });
5499
- setRequest(handleRequestData, props2.requestSort);
5500
5552
  return {
5501
5553
  option,
5502
5554
  style: style2,
@@ -6021,9 +6073,13 @@ const _sfc_main$7 = defineComponent({
6021
6073
  setGlobalModel(id, { ...modal, RECORD: e == null ? void 0 : e.data });
6022
6074
  });
6023
6075
  const { setRequest } = inject(REQUEST_MODEL, {
6024
- setRequest: (requestFn, sortNum) => void 0
6076
+ setRequest: ({ id, sortNum, requestFn }) => void 0
6077
+ });
6078
+ setRequest({
6079
+ id: props2.id,
6080
+ requestFn: chooseRequestOrDiagram,
6081
+ sortNum: props2.requestSort
6025
6082
  });
6026
- setRequest(chooseRequestOrDiagram, props2.requestSort);
6027
6083
  useOnEvent(props2, {
6028
6084
  refreshData,
6029
6085
  click
@@ -6759,7 +6815,7 @@ const _sfc_main$1 = defineComponent({
6759
6815
  const pageNum = ref(1);
6760
6816
  const pageSize = computed(() => props2.paginationPageSize);
6761
6817
  const handleChildrenColumns = (_columns) => {
6762
- if (Array.isArray(_columns)) {
6818
+ if (Array.isArray(_columns) && _columns.length > 0) {
6763
6819
  const len = _columns.length;
6764
6820
  const columnsFixedNum = props2.columnsFixedNum;
6765
6821
  for (let i = 0; i < len; i++) {
@@ -6771,9 +6827,11 @@ const _sfc_main$1 = defineComponent({
6771
6827
  }
6772
6828
  const {
6773
6829
  cellAlign = "center",
6774
- cellColor
6830
+ cellColor,
6831
+ dataIndex,
6832
+ title
6775
6833
  } = column;
6776
- column.customCell = (_record, rowIndex) => ({
6834
+ column.customCell = (record, rowIndex) => ({
6777
6835
  style: {
6778
6836
  textAlign: cellAlign,
6779
6837
  color: cellColor,
@@ -6782,7 +6840,17 @@ const _sfc_main$1 = defineComponent({
6782
6840
  },
6783
6841
  class: {
6784
6842
  highlight: unref(useRowIndex) === rowIndex && props2.clickHighlight
6785
- }
6843
+ },
6844
+ onClick: emitEvent("click", () => {
6845
+ const id = props2.id;
6846
+ const modal = getGlobalModel(id);
6847
+ record = {
6848
+ dataIndex,
6849
+ title,
6850
+ ...record
6851
+ };
6852
+ setGlobalModel(id, { ...modal, RECORD: record });
6853
+ })
6786
6854
  });
6787
6855
  if (Array.isArray(column.children)) {
6788
6856
  handleChildrenColumns(column.children);
@@ -6869,8 +6937,8 @@ const _sfc_main$1 = defineComponent({
6869
6937
  tableColumns.value = columns;
6870
6938
  tableDataSource.value = dataSource;
6871
6939
  } else {
6872
- tableColumns.value = unref(myColumns);
6873
- tableDataSource.value = unref(myDataSource);
6940
+ tableColumns.value = cloneDeep(unref(myColumns));
6941
+ tableDataSource.value = cloneDeep(unref(myDataSource));
6874
6942
  }
6875
6943
  }, {
6876
6944
  deep: true,
@@ -6885,7 +6953,7 @@ const _sfc_main$1 = defineComponent({
6885
6953
  if (isUseLoading)
6886
6954
  loading.value = true;
6887
6955
  let params = {};
6888
- if (unref(orderCondition) != null) {
6956
+ if (unref(orderCondition)) {
6889
6957
  params.orderCondition = unref(orderCondition);
6890
6958
  }
6891
6959
  if (props2.paginationShow) {
@@ -6899,7 +6967,9 @@ const _sfc_main$1 = defineComponent({
6899
6967
  const res = await requestData(params);
6900
6968
  const { rows = [], total: tableTotal = 0 } = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) || {};
6901
6969
  total.value = tableTotal;
6902
- myDataSource.value = rows;
6970
+ if (Array.isArray(rows)) {
6971
+ myDataSource.value = rows;
6972
+ }
6903
6973
  } catch (e) {
6904
6974
  console.error(e);
6905
6975
  } finally {
@@ -6992,7 +7062,7 @@ const _sfc_main$1 = defineComponent({
6992
7062
  };
6993
7063
  const useRowIndex = ref(-1);
6994
7064
  const customRow = (record, index2) => ({
6995
- onClick: emitEvent("click", () => {
7065
+ onClick: emitEvent("rowClick", () => {
6996
7066
  const id = props2.id;
6997
7067
  const modal = getGlobalModel(id);
6998
7068
  setGlobalModel(id, { ...modal, RECORD: record });
@@ -7015,8 +7085,12 @@ const _sfc_main$1 = defineComponent({
7015
7085
  refreshData
7016
7086
  });
7017
7087
  const summaryList = computed(() => {
7018
- const columns = props2.columns;
7019
- const summaryList2 = props2.isUseSeq ? [{ total: "\u5C0F\u8BA1" }] : [];
7088
+ const columns = unref(tableColumns);
7089
+ let summaryList2 = [];
7090
+ if (props2.isUseSeq) {
7091
+ columns.shift();
7092
+ summaryList2 = [{ total: "\u5C0F\u8BA1" }];
7093
+ }
7020
7094
  let calcTotalCount = 0;
7021
7095
  for (let i = 0; i < columns.length; i++) {
7022
7096
  const column = columns[i];
@@ -7038,24 +7112,32 @@ const _sfc_main$1 = defineComponent({
7038
7112
  return [];
7039
7113
  const start = (unref(pageNum) - 1) * unref(pageSize);
7040
7114
  const end = start + unref(pageSize);
7041
- const records = unref(myDataSource).slice(start, end);
7042
- for (let i = 0; i < records.length; i++) {
7043
- const record = records[i];
7044
- for (let j = 0; j < summaryList2.length; j++) {
7045
- const summary = summaryList2[j];
7046
- const { dataIndex, total: total2 } = summary;
7047
- const num = +record[dataIndex];
7048
- if (!Number.isNaN(num) && total2 != null) {
7049
- summary.total = num + total2;
7115
+ const records = unref(tableDataSource).slice(start, end);
7116
+ for (let i = 0; i < summaryList2.length; i++) {
7117
+ const summary = summaryList2[i];
7118
+ let total2 = 0;
7119
+ const { isCalcTotal, dataIndex } = summary;
7120
+ if (isCalcTotal === true) {
7121
+ for (let j = 0; j < records.length; j++) {
7122
+ const record = records[j];
7123
+ const num = record[dataIndex];
7124
+ if (!isNaN(num)) {
7125
+ total2 = num + total2;
7126
+ }
7050
7127
  }
7128
+ summary.total = total2;
7051
7129
  }
7052
7130
  }
7053
7131
  return summaryList2;
7054
7132
  });
7055
7133
  const { setRequest } = inject(REQUEST_MODEL, {
7056
- setRequest: (requestFn, sortNum) => void 0
7134
+ setRequest: ({ id, sortNum, requestFn }) => void 0
7135
+ });
7136
+ setRequest({
7137
+ id: props2.id,
7138
+ requestFn: refreshData,
7139
+ sortNum: props2.requestSort
7057
7140
  });
7058
- setRequest(refreshData, props2.requestSort);
7059
7141
  expose({
7060
7142
  refreshData
7061
7143
  });
@@ -7101,7 +7183,7 @@ const _sfc_main$1 = defineComponent({
7101
7183
  };
7102
7184
  }
7103
7185
  });
7104
- const Table_vue_vue_type_style_index_0_scoped_7b4da072_lang = "";
7186
+ const Table_vue_vue_type_style_index_0_scoped_3e5c9238_lang = "";
7105
7187
  const Table_vue_vue_type_style_index_1_lang = "";
7106
7188
  const _hoisted_1$1 = {
7107
7189
  key: 1,
@@ -7188,8 +7270,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7188
7270
  default: withCtx(() => [
7189
7271
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.summaryList, (summary, index2) => {
7190
7272
  return openBlock(), createBlock(_component_a_table_summary_cell, {
7191
- key: summary.dataIndex + index2,
7192
- index: summary.index,
7273
+ key: index2,
7274
+ index: index2,
7193
7275
  style: normalizeStyle({
7194
7276
  backgroundColor: _ctx.cellBackgroundColor,
7195
7277
  textAlign: summary.cellAlign || "center",
@@ -7199,8 +7281,12 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7199
7281
  }, {
7200
7282
  default: withCtx(() => [
7201
7283
  createElementVNode("div", {
7202
- class: normalizeClass([_ctx.contrastClass(summary.total, summary.format)])
7203
- }, toDisplayString((summary.format != null || summary.format !== "") && _ctx.formatFn(summary.total, summary.format)), 3)
7284
+ class: normalizeClass([_ctx.contrastClass(summary.total, summary.format)]),
7285
+ style: normalizeStyle({
7286
+ fontSize: _ctx.fontSize,
7287
+ fontWeight: _ctx.fontWeight
7288
+ })
7289
+ }, toDisplayString((summary.format != null || summary.format !== "") && _ctx.formatFn(summary.total, summary.format)), 7)
7204
7290
  ]),
7205
7291
  _: 2
7206
7292
  }, 1032, ["index", "style"]);
@@ -7219,7 +7305,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7219
7305
  }, 8, ["loading"])
7220
7306
  ], 4);
7221
7307
  }
7222
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-7b4da072"]]);
7308
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-3e5c9238"]]);
7223
7309
  const EcanTable = withInstall(Table);
7224
7310
  const mapProps = {
7225
7311
  ...props,