@ecan-bi/datav 1.0.76 → 1.0.77

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,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.0.76 */
1
+ /*! @ecan-bi/datav@1.0.77 */
2
2
  var _a, _b, _c;
3
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";
4
4
  import { throttle, init, use, registerMap } from "echarts/core";
@@ -6362,15 +6362,18 @@ const _sfc_main$1 = defineComponent({
6362
6362
  return;
6363
6363
  dataSource.value = data;
6364
6364
  });
6365
+ const orderCondition = ref(void 0);
6365
6366
  const requestData = useRequestData(props2);
6366
6367
  const loading = ref(false);
6367
- const handleRequestData = async () => {
6368
+ const handleRequestData = async (isUseLoading = true) => {
6368
6369
  var _a2;
6369
6370
  try {
6370
- loading.value = true;
6371
+ if (isUseLoading)
6372
+ loading.value = true;
6371
6373
  const res = await requestData({
6372
6374
  pageNum: unref(pageNum),
6373
- pageSize: unref(pageSize)
6375
+ pageSize: unref(pageSize),
6376
+ orderCondition: unref(orderCondition)
6374
6377
  });
6375
6378
  const { rows = [], total: tableTotal = 0 } = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) || {};
6376
6379
  total.value = tableTotal;
@@ -6381,8 +6384,21 @@ const _sfc_main$1 = defineComponent({
6381
6384
  loading.value = false;
6382
6385
  }
6383
6386
  };
6384
- const tableChange = ({ current }, _filters, _sorter) => {
6387
+ const tableChange = ({ current }, _filters, sorter) => {
6385
6388
  pageNum.value = current;
6389
+ if (sorter && Object.keys(sorter).length > 0) {
6390
+ const { field, order } = sorter;
6391
+ const map = {
6392
+ ascend: "asc",
6393
+ descend: "desc"
6394
+ };
6395
+ const fieldOrder = map[order];
6396
+ if (field != null && fieldOrder != null) {
6397
+ orderCondition.value = field + " " + fieldOrder;
6398
+ pageNum.value = 1;
6399
+ }
6400
+ }
6401
+ refreshData(false);
6386
6402
  };
6387
6403
  const pagination = computed(() => {
6388
6404
  const simple = props2.simple;
@@ -6461,12 +6477,12 @@ const _sfc_main$1 = defineComponent({
6461
6477
  setGlobalModel(id, { ...modal, RECORD: record });
6462
6478
  })
6463
6479
  });
6464
- const refreshData = () => {
6480
+ const refreshData = (isUseLoading = true) => {
6465
6481
  if (unref(pageMode) === "design")
6466
6482
  return;
6467
6483
  switch (props2.dataType) {
6468
6484
  case "request":
6469
- handleRequestData();
6485
+ handleRequestData(isUseLoading);
6470
6486
  break;
6471
6487
  case "indicator":
6472
6488
  handleIndicatorData();
@@ -6666,7 +6682,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
6666
6682
  }, 8, ["loading"])
6667
6683
  ], 4);
6668
6684
  }
6669
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-56012732"]]);
6685
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-34b40a0f"]]);
6670
6686
  const EcanTable = withInstall(Table);
6671
6687
  const mapProps = {
6672
6688
  ...props,