@ecan-bi/datav 1.0.88 → 1.0.89

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 (102) hide show
  1. package/dist/index.es.js +115 -38
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +114 -37
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/style.css +12 -12
  6. package/es/container/modal/Modal.js +1 -4
  7. package/es/container/modal/Modal.js.map +1 -1
  8. package/es/container/modal/index.js.map +1 -1
  9. package/es/container/modal/props.js +1 -1
  10. package/es/container/modal/props.js.map +1 -1
  11. package/es/graph/bar/Bar.js +33 -2
  12. package/es/graph/bar/Bar.js.map +1 -1
  13. package/es/graph/bar/index.js.map +1 -1
  14. package/es/graph/bar/props.js +1 -2
  15. package/es/graph/bar/props.js.map +1 -1
  16. package/es/graph/combo-graph/ComboGraph.js +44 -12
  17. package/es/graph/combo-graph/ComboGraph.js.map +1 -1
  18. package/es/graph/combo-graph/props.js +1 -1
  19. package/es/graph/combo-graph/props.js.map +1 -1
  20. package/es/graph/line/Line.js +37 -3
  21. package/es/graph/line/Line.js.map +1 -1
  22. package/es/graph/line/props.js +7 -6
  23. package/es/graph/line/props.js.map +1 -1
  24. package/es/graph/pie/Pie.js +22 -1
  25. package/es/graph/pie/Pie.js.map +1 -1
  26. package/es/graph/pie/props.js +1 -1
  27. package/es/graph/pie/props.js.map +1 -1
  28. package/es/graph/scatter/Scatter.js +10 -1
  29. package/es/graph/scatter/Scatter.js.map +1 -1
  30. package/es/graph/scatter/props.js +1 -1
  31. package/es/graph/scatter/props.js.map +1 -1
  32. package/es/hooks/useRequestData.js +1 -1
  33. package/es/hooks/useRequestData.js.map +1 -1
  34. package/es/hooks/useValueFormatter.js +2 -1
  35. package/es/hooks/useValueFormatter.js.map +1 -1
  36. package/es/hooks/useVariablesInText.js +33 -11
  37. package/es/hooks/useVariablesInText.js.map +1 -1
  38. package/es/setting/provider-config/ProviderConfig.js +3 -1
  39. package/es/setting/provider-config/ProviderConfig.js.map +1 -1
  40. package/es/table/table/Table.js +87 -28
  41. package/es/table/table/Table.js.map +1 -1
  42. package/es/table/table/index.js.map +1 -1
  43. package/es/table/table/props.js +1 -0
  44. package/es/table/table/props.js.map +1 -1
  45. package/es/text/text/Text.js +21 -1
  46. package/es/text/text/Text.js.map +1 -1
  47. package/es/text/text/props.js +4 -1
  48. package/es/text/text/props.js.map +1 -1
  49. package/lib/container/modal/Modal.js +1 -4
  50. package/lib/container/modal/Modal.js.map +1 -1
  51. package/lib/container/modal/index.js.map +1 -1
  52. package/lib/container/modal/props.js +1 -1
  53. package/lib/container/modal/props.js.map +1 -1
  54. package/lib/graph/bar/Bar.js +33 -2
  55. package/lib/graph/bar/Bar.js.map +1 -1
  56. package/lib/graph/bar/index.js.map +1 -1
  57. package/lib/graph/bar/props.js +1 -2
  58. package/lib/graph/bar/props.js.map +1 -1
  59. package/lib/graph/combo-graph/ComboGraph.js +44 -12
  60. package/lib/graph/combo-graph/ComboGraph.js.map +1 -1
  61. package/lib/graph/combo-graph/props.js +1 -1
  62. package/lib/graph/combo-graph/props.js.map +1 -1
  63. package/lib/graph/line/Line.js +37 -3
  64. package/lib/graph/line/Line.js.map +1 -1
  65. package/lib/graph/line/props.js +7 -6
  66. package/lib/graph/line/props.js.map +1 -1
  67. package/lib/graph/pie/Pie.js +22 -1
  68. package/lib/graph/pie/Pie.js.map +1 -1
  69. package/lib/graph/pie/props.js +1 -1
  70. package/lib/graph/pie/props.js.map +1 -1
  71. package/lib/graph/scatter/Scatter.js +10 -1
  72. package/lib/graph/scatter/Scatter.js.map +1 -1
  73. package/lib/graph/scatter/props.js +1 -1
  74. package/lib/graph/scatter/props.js.map +1 -1
  75. package/lib/hooks/useRequestData.js +1 -1
  76. package/lib/hooks/useRequestData.js.map +1 -1
  77. package/lib/hooks/useValueFormatter.js +2 -1
  78. package/lib/hooks/useValueFormatter.js.map +1 -1
  79. package/lib/hooks/useVariablesInText.js +33 -11
  80. package/lib/hooks/useVariablesInText.js.map +1 -1
  81. package/lib/setting/provider-config/ProviderConfig.js +3 -1
  82. package/lib/setting/provider-config/ProviderConfig.js.map +1 -1
  83. package/lib/style.css +6503 -6503
  84. package/lib/table/table/Table.js +87 -28
  85. package/lib/table/table/Table.js.map +1 -1
  86. package/lib/table/table/index.js.map +1 -1
  87. package/lib/table/table/props.js +1 -0
  88. package/lib/table/table/props.js.map +1 -1
  89. package/lib/text/text/Text.js +21 -1
  90. package/lib/text/text/Text.js.map +1 -1
  91. package/lib/text/text/props.js +4 -1
  92. package/lib/text/text/props.js.map +1 -1
  93. package/package.json +1 -1
  94. package/types/container/modal/index.d.ts +1 -1
  95. package/types/table/table/Table.vue.d.ts +44 -5
  96. package/types/table/table/index.d.ts +45 -6
  97. package/types/table/table/props.d.ts +21 -0
  98. package/types/text/text/Text.vue.d.ts +66 -0
  99. package/types/text/text/index.d.ts +66 -0
  100. package/types/text/text/props.d.ts +36 -0
  101. package/types/hooks/usePickEchartsData.d.ts +0 -2
  102. package/types/hooks/useTooltipFormatter.d.ts +0 -4
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.0.88 */
1
+ /*! @ecan-bi/datav@1.0.89 */
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";
@@ -6,7 +6,7 @@ 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";
7
7
  import "ant-design-vue/es/spin/style";
8
8
  import "ant-design-vue/es/skeleton/style";
9
- import { mapValues, without, pick, debounce } from "lodash-es";
9
+ import { mapValues, without, pick, debounce, cloneDeep } from "lodash-es";
10
10
  import axios from "axios";
11
11
  import mitt from "mitt";
12
12
  import dayjs from "dayjs";
@@ -1751,7 +1751,7 @@ const useRequestData = (props2, callBack = () => {
1751
1751
  _params[key] = useVariablesInText(value);
1752
1752
  }
1753
1753
  });
1754
- _params = { ...window.requestParams, ..._params, ...params };
1754
+ _params = { ...window.config.requestParams, ..._params, ...params };
1755
1755
  let urlParams = "";
1756
1756
  const keys = Object.keys(_params);
1757
1757
  const last = keys.length - 1;
@@ -2617,7 +2617,6 @@ const _sfc_main$n = defineComponent({
2617
2617
  setTheme();
2618
2618
  });
2619
2619
  const contextRequestUrl = computed(() => {
2620
- console.log("props.contextRequestUrl", props2.contextRequestUrl);
2621
2620
  return useVariablesInText(props2.contextRequestUrl);
2622
2621
  });
2623
2622
  const pageMode = computed(() => props2.pageMode);
@@ -2771,7 +2770,10 @@ const textProps = {
2771
2770
  variableFontSize: "14px",
2772
2771
  data: {},
2773
2772
  variableDefaultValue: "0",
2774
- format: ""
2773
+ format: "",
2774
+ target: "self",
2775
+ href: "",
2776
+ linkPage: ""
2775
2777
  };
2776
2778
  const textComponentProps = transformToComponentProps(textProps);
2777
2779
  const textEvents = ["refreshData", "click"];
@@ -2871,6 +2873,24 @@ const _sfc_main$m = defineComponent({
2871
2873
  });
2872
2874
  const emitEvent = useEmitEvent(props2);
2873
2875
  const click = emitEvent("click", () => {
2876
+ if (!props2.linkPage && !props2.href)
2877
+ return;
2878
+ const linkPage = props2.linkPage || "";
2879
+ const pageUrl = usePageUrl(unref(pageMode), linkPage);
2880
+ const href = props2.href;
2881
+ let url = href || pageUrl;
2882
+ url = useVariablesInText(url);
2883
+ const target = props2.target;
2884
+ if (target == null || target === "")
2885
+ return;
2886
+ if (target !== "event") {
2887
+ window.open(url, "_" + target);
2888
+ } else {
2889
+ window.parent.postMessage({
2890
+ type: "openPage",
2891
+ url: href
2892
+ }, "*");
2893
+ }
2874
2894
  });
2875
2895
  return {
2876
2896
  style: style2,
@@ -2897,7 +2917,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
2897
2917
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2898
2918
  }, null, 12, _hoisted_1$7));
2899
2919
  }
2900
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-1b461e28"]]);
2920
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-604c9a14"]]);
2901
2921
  const EcanText = withInstall(Text);
2902
2922
  const ScrollText_vue_vue_type_style_index_0_scoped_true_lang = "";
2903
2923
  const _sfc_main$l = defineComponent({
@@ -6194,7 +6214,7 @@ const modalProps = {
6194
6214
  keyName: "\u5F39\u7A97",
6195
6215
  componentList: [],
6196
6216
  fullModal: false,
6197
- destroyOnClose: false,
6217
+ destroyOnClose: true,
6198
6218
  position: "default"
6199
6219
  };
6200
6220
  const modalComponentProps = transformToComponentProps(modalProps);
@@ -6306,9 +6326,6 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
6306
6326
  width: _ctx.isFullModal || _ctx.isFullWidth ? "100%" : _ctx.modalWith,
6307
6327
  destroyOnClose: _ctx.destroyOnClose,
6308
6328
  style: normalizeStyle(_ctx.modalStyle),
6309
- bodyStyle: {
6310
- background: "red"
6311
- },
6312
6329
  onOk: _ctx.onOk,
6313
6330
  onCancel: _ctx.onCancel
6314
6331
  }, createSlots({
@@ -6347,7 +6364,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
6347
6364
  } : void 0
6348
6365
  ]), 1032, ["getContainer", "wrapClassName", "visible", "width", "destroyOnClose", "style", "onOk", "onCancel"]);
6349
6366
  }
6350
- const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-24c6a724"]]);
6367
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-780a06e1"]]);
6351
6368
  const EcanModal = withInstall(Modal);
6352
6369
  const tabsProps = {
6353
6370
  ...props,
@@ -6559,6 +6576,7 @@ const tableProps = {
6559
6576
  columnsFixedNum: 0,
6560
6577
  scrollX: 0,
6561
6578
  paginationShow: true,
6579
+ isReverse: false,
6562
6580
  simple: false,
6563
6581
  headerCellBackgroundColor: "",
6564
6582
  cellBackgroundColor: "",
@@ -6646,27 +6664,34 @@ const _sfc_main$1 = defineComponent({
6646
6664
  });
6647
6665
  const x = computed(() => props2.scrollX);
6648
6666
  const y = computed(() => parseFloat(props2.height) - unref(splitY));
6649
- const myColumns = computed(() => {
6650
- let columns = [];
6667
+ const myColumns = ref([]);
6668
+ const myDataSource = ref(props2.data);
6669
+ const tableColumns = ref([]);
6670
+ const tableDataSource = ref([]);
6671
+ const total = ref(0);
6672
+ const pageNum = ref(1);
6673
+ const pageSize = computed(() => props2.paginationPageSize);
6674
+ const handleColumns = (columns = []) => {
6675
+ let _columns = [];
6651
6676
  const isUseSeq = props2.isUseSeq;
6652
6677
  if (isUseSeq) {
6653
- columns.push({
6678
+ _columns.push({
6654
6679
  title: "\u5E8F\u53F7",
6655
6680
  dataIndex: "SEQ"
6656
6681
  });
6657
6682
  }
6658
- columns = columns.concat(props2.columns);
6683
+ _columns = _columns.concat(cloneDeep(columns));
6659
6684
  if (props2.isUseAction) {
6660
- columns.push({
6685
+ _columns.push({
6661
6686
  title: "\u64CD\u4F5C",
6662
6687
  dataIndex: "ACTION",
6663
6688
  width: props2.actionColumnWidth
6664
6689
  });
6665
6690
  }
6666
- const len = columns.length;
6691
+ const len = _columns.length;
6667
6692
  const columnsFixedNum = props2.columnsFixedNum;
6668
6693
  for (let i = 0; i < len; i++) {
6669
- const column = columns[i];
6694
+ const column = _columns[i];
6670
6695
  if (i < columnsFixedNum) {
6671
6696
  column.fixed = "left";
6672
6697
  } else {
@@ -6695,16 +6720,71 @@ const _sfc_main$1 = defineComponent({
6695
6720
  }
6696
6721
  });
6697
6722
  }
6698
- return columns;
6723
+ myColumns.value = _columns;
6724
+ };
6725
+ watch(() => [
6726
+ props2.columns,
6727
+ props2.isUseSeq,
6728
+ props2.isUseAction,
6729
+ props2.columnsFixedNum,
6730
+ props2.actionColumnWidth,
6731
+ props2.headerCellBackgroundColor,
6732
+ props2.cellBackgroundColor,
6733
+ props2.borderColor
6734
+ ], () => {
6735
+ handleColumns(props2.columns);
6736
+ }, {
6737
+ immediate: true,
6738
+ deep: true
6699
6739
  });
6700
- const total = ref(0);
6701
- const pageNum = ref(1);
6702
- const pageSize = computed(() => props2.paginationPageSize);
6703
- const dataSource = ref(props2.data);
6704
6740
  watch(() => [props2.data, props2.dataType], ([data, dataType]) => {
6705
6741
  if (dataType !== "static")
6706
6742
  return;
6707
- dataSource.value = data;
6743
+ myDataSource.value = data;
6744
+ });
6745
+ const handleReverseTable = (columns, dataSource) => {
6746
+ const firstColumns = columns[0];
6747
+ const _columns = [{
6748
+ title: firstColumns.title,
6749
+ dataIndex: "col0",
6750
+ key: "col0"
6751
+ }];
6752
+ for (let i = 0; i < dataSource.length; i++) {
6753
+ const data = dataSource[i];
6754
+ const dataIndex = "col" + (i + 1);
6755
+ _columns.push({
6756
+ title: data[firstColumns.dataIndex],
6757
+ dataIndex,
6758
+ key: dataIndex
6759
+ });
6760
+ }
6761
+ const _dataSource = [];
6762
+ for (let i = 1; i < columns.length; i++) {
6763
+ const column = columns[i];
6764
+ const _data = { col0: column.title };
6765
+ for (let j = 0; j < dataSource.length; j++) {
6766
+ const data = dataSource[j];
6767
+ _data[`col${j + 1}`] = data[column.dataIndex];
6768
+ }
6769
+ _dataSource.push(_data);
6770
+ }
6771
+ return {
6772
+ columns: _columns,
6773
+ dataSource: _dataSource
6774
+ };
6775
+ };
6776
+ watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
6777
+ if (props2.isReverse) {
6778
+ const { columns, dataSource } = handleReverseTable(unref(myColumns), unref(myDataSource));
6779
+ tableColumns.value = columns;
6780
+ tableDataSource.value = dataSource;
6781
+ } else {
6782
+ tableColumns.value = unref(myColumns);
6783
+ tableDataSource.value = unref(myDataSource);
6784
+ }
6785
+ }, {
6786
+ deep: true,
6787
+ immediate: true
6708
6788
  });
6709
6789
  const orderCondition = ref(void 0);
6710
6790
  const requestData = useRequestData(props2);
@@ -6728,7 +6808,7 @@ const _sfc_main$1 = defineComponent({
6728
6808
  const res = await requestData(params);
6729
6809
  const { rows = [], total: tableTotal = 0 } = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) || {};
6730
6810
  total.value = tableTotal;
6731
- dataSource.value = rows;
6811
+ myDataSource.value = rows;
6732
6812
  } catch (e) {
6733
6813
  console.error(e);
6734
6814
  } finally {
@@ -6801,12 +6881,10 @@ const _sfc_main$1 = defineComponent({
6801
6881
  getGlobalModel: (key) => void 0,
6802
6882
  setGlobalModel: (key, value) => void 0
6803
6883
  });
6804
- const dataColumns = ref([]);
6805
- const handleIndicatorDataset = (colmuns = [], rows = []) => {
6806
- dataColumns.value = colmuns.map((it) => {
6807
- return { title: it, dataIndex: it, key: it };
6808
- });
6809
- dataSource.value = rows;
6884
+ const handleIndicatorDataset = (dataColumns = [], dataRows = []) => {
6885
+ const _columns = dataColumns.map((column) => ({ title: column, dataIndex: column, key: column }));
6886
+ handleColumns(_columns);
6887
+ myDataSource.value = dataRows;
6810
6888
  };
6811
6889
  const indicatorData = useIndicatorData(props2);
6812
6890
  const handleIndicatorData = async () => {
@@ -6867,7 +6945,7 @@ const _sfc_main$1 = defineComponent({
6867
6945
  return [];
6868
6946
  const start = (unref(pageNum) - 1) * unref(pageSize);
6869
6947
  const end = start + unref(pageSize);
6870
- const records = unref(dataSource).slice(start, end);
6948
+ const records = unref(myDataSource).slice(start, end);
6871
6949
  for (let i = 0; i < records.length; i++) {
6872
6950
  const record = records[i];
6873
6951
  for (let j = 0; j < summaryList2.length; j++) {
@@ -6913,15 +6991,14 @@ const _sfc_main$1 = defineComponent({
6913
6991
  return {
6914
6992
  x,
6915
6993
  y,
6916
- myColumns,
6917
6994
  style: style2,
6918
6995
  customRow,
6919
6996
  pagination,
6920
6997
  formatFn,
6921
6998
  contrastClass,
6922
6999
  tableChange,
6923
- dataColumns,
6924
- dataSource,
7000
+ tableDataSource,
7001
+ tableColumns,
6925
7002
  summaryList,
6926
7003
  loading,
6927
7004
  onTouchHrefEvent,
@@ -6952,8 +7029,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
6952
7029
  style: {
6953
7030
  height: "100%"
6954
7031
  },
6955
- columns: _ctx.dataColumns.length > 0 ? _ctx.dataColumns : _ctx.myColumns,
6956
- "data-source": _ctx.dataSource,
7032
+ columns: _ctx.tableColumns,
7033
+ "data-source": _ctx.tableDataSource,
6957
7034
  bordered: _ctx.bordered,
6958
7035
  size: _ctx.size,
6959
7036
  customRow: _ctx.customRow,
@@ -7033,7 +7110,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7033
7110
  }, 8, ["loading"])
7034
7111
  ], 4);
7035
7112
  }
7036
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-0963bd5a"]]);
7113
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-48569fe8"]]);
7037
7114
  const EcanTable = withInstall(Table);
7038
7115
  const mapProps = {
7039
7116
  ...props,