@ecan-bi/datav 1.0.76 → 1.0.78

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.78 */
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,19 @@ 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),
6377
+ layer: "1"
6374
6378
  });
6375
6379
  const { rows = [], total: tableTotal = 0 } = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) || {};
6376
6380
  total.value = tableTotal;
@@ -6381,8 +6385,21 @@ const _sfc_main$1 = defineComponent({
6381
6385
  loading.value = false;
6382
6386
  }
6383
6387
  };
6384
- const tableChange = ({ current }, _filters, _sorter) => {
6388
+ const tableChange = ({ current }, _filters, sorter) => {
6385
6389
  pageNum.value = current;
6390
+ if (sorter && Object.keys(sorter).length > 0) {
6391
+ const { field, order } = sorter;
6392
+ const map = {
6393
+ ascend: "asc",
6394
+ descend: "desc"
6395
+ };
6396
+ const fieldOrder = map[order];
6397
+ if (field != null && fieldOrder != null) {
6398
+ orderCondition.value = field + " " + fieldOrder;
6399
+ pageNum.value = 1;
6400
+ }
6401
+ }
6402
+ refreshData(false);
6386
6403
  };
6387
6404
  const pagination = computed(() => {
6388
6405
  const simple = props2.simple;
@@ -6461,12 +6478,12 @@ const _sfc_main$1 = defineComponent({
6461
6478
  setGlobalModel(id, { ...modal, RECORD: record });
6462
6479
  })
6463
6480
  });
6464
- const refreshData = () => {
6481
+ const refreshData = (isUseLoading = true) => {
6465
6482
  if (unref(pageMode) === "design")
6466
6483
  return;
6467
6484
  switch (props2.dataType) {
6468
6485
  case "request":
6469
- handleRequestData();
6486
+ handleRequestData(isUseLoading);
6470
6487
  break;
6471
6488
  case "indicator":
6472
6489
  handleIndicatorData();
@@ -6666,7 +6683,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
6666
6683
  }, 8, ["loading"])
6667
6684
  ], 4);
6668
6685
  }
6669
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-56012732"]]);
6686
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-4ed03b13"]]);
6670
6687
  const EcanTable = withInstall(Table);
6671
6688
  const mapProps = {
6672
6689
  ...props,