@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.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.0.88 */
1
+ /*! @ecan-bi/datav@1.0.89 */
2
2
  (function(global, factory) {
3
3
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("echarts/core"), require("resize-detector"), require("ant-design-vue"), require("ant-design-vue/es/spin/style"), require("ant-design-vue/es/skeleton/style"), require("lodash-es"), require("axios"), require("mitt"), require("dayjs"), require("ant-design-vue/es/progress/style"), require("ant-design-vue/es/input/style"), require("ant-design-vue/es/date-picker/style"), require("ant-design-vue/es/date-picker/locale/zh_CN"), require("ant-design-vue/es/select/style"), require("ant-design-vue/es/button/style"), require("ant-design-vue/es/checkbox/style"), require("echarts/renderers"), require("echarts/charts"), require("echarts/components"), require("echarts"), require("ant-design-vue/es/modal/style"), require("ant-design-vue/es/table/style")) : typeof define === "function" && define.amd ? define(["exports", "vue", "echarts/core", "resize-detector", "ant-design-vue", "ant-design-vue/es/spin/style", "ant-design-vue/es/skeleton/style", "lodash-es", "axios", "mitt", "dayjs", "ant-design-vue/es/progress/style", "ant-design-vue/es/input/style", "ant-design-vue/es/date-picker/style", "ant-design-vue/es/date-picker/locale/zh_CN", "ant-design-vue/es/select/style", "ant-design-vue/es/button/style", "ant-design-vue/es/checkbox/style", "echarts/renderers", "echarts/charts", "echarts/components", "echarts", "ant-design-vue/es/modal/style", "ant-design-vue/es/table/style"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@ecan/bi-datav"] = {}, global.vue, global["echarts/core"], global["resize-detector"], global["ant-design-vue"], null, null, global["lodash-es"], global.axios, global.mitt, global.dayjs, null, null, null, global["ant-design-vue/es/date-picker/locale/zh_CN"], null, null, null, global["echarts/renderers"], global["echarts/charts"], global["echarts/components"], global.echarts));
4
4
  })(this, function(exports2, vue, core, resizeDetector, antDesignVue, style$1, style$2, lodashEs, axios, mitt, dayjs, style$3, style$4, style$5, locale, style$6, style$7, style$8, renderers, charts, components$1, echarts) {
@@ -1756,7 +1756,7 @@
1756
1756
  _params[key] = useVariablesInText(value);
1757
1757
  }
1758
1758
  });
1759
- _params = { ...window.requestParams, ..._params, ...params };
1759
+ _params = { ...window.config.requestParams, ..._params, ...params };
1760
1760
  let urlParams = "";
1761
1761
  const keys = Object.keys(_params);
1762
1762
  const last = keys.length - 1;
@@ -2622,7 +2622,6 @@
2622
2622
  setTheme();
2623
2623
  });
2624
2624
  const contextRequestUrl = vue.computed(() => {
2625
- console.log("props.contextRequestUrl", props2.contextRequestUrl);
2626
2625
  return useVariablesInText(props2.contextRequestUrl);
2627
2626
  });
2628
2627
  const pageMode = vue.computed(() => props2.pageMode);
@@ -2776,7 +2775,10 @@
2776
2775
  variableFontSize: "14px",
2777
2776
  data: {},
2778
2777
  variableDefaultValue: "0",
2779
- format: ""
2778
+ format: "",
2779
+ target: "self",
2780
+ href: "",
2781
+ linkPage: ""
2780
2782
  };
2781
2783
  const textComponentProps = transformToComponentProps(textProps);
2782
2784
  const textEvents = ["refreshData", "click"];
@@ -2876,6 +2878,24 @@
2876
2878
  });
2877
2879
  const emitEvent = useEmitEvent(props2);
2878
2880
  const click = emitEvent("click", () => {
2881
+ if (!props2.linkPage && !props2.href)
2882
+ return;
2883
+ const linkPage = props2.linkPage || "";
2884
+ const pageUrl = usePageUrl(vue.unref(pageMode), linkPage);
2885
+ const href = props2.href;
2886
+ let url = href || pageUrl;
2887
+ url = useVariablesInText(url);
2888
+ const target = props2.target;
2889
+ if (target == null || target === "")
2890
+ return;
2891
+ if (target !== "event") {
2892
+ window.open(url, "_" + target);
2893
+ } else {
2894
+ window.parent.postMessage({
2895
+ type: "openPage",
2896
+ url: href
2897
+ }, "*");
2898
+ }
2879
2899
  });
2880
2900
  return {
2881
2901
  style: style2,
@@ -2902,7 +2922,7 @@
2902
2922
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2903
2923
  }, null, 12, _hoisted_1$7));
2904
2924
  }
2905
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-1b461e28"]]);
2925
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-604c9a14"]]);
2906
2926
  const EcanText = withInstall(Text);
2907
2927
  const ScrollText_vue_vue_type_style_index_0_scoped_true_lang = "";
2908
2928
  const _sfc_main$l = vue.defineComponent({
@@ -6199,7 +6219,7 @@
6199
6219
  keyName: "\u5F39\u7A97",
6200
6220
  componentList: [],
6201
6221
  fullModal: false,
6202
- destroyOnClose: false,
6222
+ destroyOnClose: true,
6203
6223
  position: "default"
6204
6224
  };
6205
6225
  const modalComponentProps = transformToComponentProps(modalProps);
@@ -6311,9 +6331,6 @@
6311
6331
  width: _ctx.isFullModal || _ctx.isFullWidth ? "100%" : _ctx.modalWith,
6312
6332
  destroyOnClose: _ctx.destroyOnClose,
6313
6333
  style: vue.normalizeStyle(_ctx.modalStyle),
6314
- bodyStyle: {
6315
- background: "red"
6316
- },
6317
6334
  onOk: _ctx.onOk,
6318
6335
  onCancel: _ctx.onCancel
6319
6336
  }, vue.createSlots({
@@ -6352,7 +6369,7 @@
6352
6369
  } : void 0
6353
6370
  ]), 1032, ["getContainer", "wrapClassName", "visible", "width", "destroyOnClose", "style", "onOk", "onCancel"]);
6354
6371
  }
6355
- const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-24c6a724"]]);
6372
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-780a06e1"]]);
6356
6373
  const EcanModal = withInstall(Modal);
6357
6374
  const tabsProps = {
6358
6375
  ...props,
@@ -6564,6 +6581,7 @@
6564
6581
  columnsFixedNum: 0,
6565
6582
  scrollX: 0,
6566
6583
  paginationShow: true,
6584
+ isReverse: false,
6567
6585
  simple: false,
6568
6586
  headerCellBackgroundColor: "",
6569
6587
  cellBackgroundColor: "",
@@ -6651,27 +6669,34 @@
6651
6669
  });
6652
6670
  const x = vue.computed(() => props2.scrollX);
6653
6671
  const y = vue.computed(() => parseFloat(props2.height) - vue.unref(splitY));
6654
- const myColumns = vue.computed(() => {
6655
- let columns = [];
6672
+ const myColumns = vue.ref([]);
6673
+ const myDataSource = vue.ref(props2.data);
6674
+ const tableColumns = vue.ref([]);
6675
+ const tableDataSource = vue.ref([]);
6676
+ const total = vue.ref(0);
6677
+ const pageNum = vue.ref(1);
6678
+ const pageSize = vue.computed(() => props2.paginationPageSize);
6679
+ const handleColumns = (columns = []) => {
6680
+ let _columns = [];
6656
6681
  const isUseSeq = props2.isUseSeq;
6657
6682
  if (isUseSeq) {
6658
- columns.push({
6683
+ _columns.push({
6659
6684
  title: "\u5E8F\u53F7",
6660
6685
  dataIndex: "SEQ"
6661
6686
  });
6662
6687
  }
6663
- columns = columns.concat(props2.columns);
6688
+ _columns = _columns.concat(lodashEs.cloneDeep(columns));
6664
6689
  if (props2.isUseAction) {
6665
- columns.push({
6690
+ _columns.push({
6666
6691
  title: "\u64CD\u4F5C",
6667
6692
  dataIndex: "ACTION",
6668
6693
  width: props2.actionColumnWidth
6669
6694
  });
6670
6695
  }
6671
- const len = columns.length;
6696
+ const len = _columns.length;
6672
6697
  const columnsFixedNum = props2.columnsFixedNum;
6673
6698
  for (let i = 0; i < len; i++) {
6674
- const column = columns[i];
6699
+ const column = _columns[i];
6675
6700
  if (i < columnsFixedNum) {
6676
6701
  column.fixed = "left";
6677
6702
  } else {
@@ -6700,16 +6725,71 @@
6700
6725
  }
6701
6726
  });
6702
6727
  }
6703
- return columns;
6728
+ myColumns.value = _columns;
6729
+ };
6730
+ vue.watch(() => [
6731
+ props2.columns,
6732
+ props2.isUseSeq,
6733
+ props2.isUseAction,
6734
+ props2.columnsFixedNum,
6735
+ props2.actionColumnWidth,
6736
+ props2.headerCellBackgroundColor,
6737
+ props2.cellBackgroundColor,
6738
+ props2.borderColor
6739
+ ], () => {
6740
+ handleColumns(props2.columns);
6741
+ }, {
6742
+ immediate: true,
6743
+ deep: true
6704
6744
  });
6705
- const total = vue.ref(0);
6706
- const pageNum = vue.ref(1);
6707
- const pageSize = vue.computed(() => props2.paginationPageSize);
6708
- const dataSource = vue.ref(props2.data);
6709
6745
  vue.watch(() => [props2.data, props2.dataType], ([data, dataType]) => {
6710
6746
  if (dataType !== "static")
6711
6747
  return;
6712
- dataSource.value = data;
6748
+ myDataSource.value = data;
6749
+ });
6750
+ const handleReverseTable = (columns, dataSource) => {
6751
+ const firstColumns = columns[0];
6752
+ const _columns = [{
6753
+ title: firstColumns.title,
6754
+ dataIndex: "col0",
6755
+ key: "col0"
6756
+ }];
6757
+ for (let i = 0; i < dataSource.length; i++) {
6758
+ const data = dataSource[i];
6759
+ const dataIndex = "col" + (i + 1);
6760
+ _columns.push({
6761
+ title: data[firstColumns.dataIndex],
6762
+ dataIndex,
6763
+ key: dataIndex
6764
+ });
6765
+ }
6766
+ const _dataSource = [];
6767
+ for (let i = 1; i < columns.length; i++) {
6768
+ const column = columns[i];
6769
+ const _data = { col0: column.title };
6770
+ for (let j = 0; j < dataSource.length; j++) {
6771
+ const data = dataSource[j];
6772
+ _data[`col${j + 1}`] = data[column.dataIndex];
6773
+ }
6774
+ _dataSource.push(_data);
6775
+ }
6776
+ return {
6777
+ columns: _columns,
6778
+ dataSource: _dataSource
6779
+ };
6780
+ };
6781
+ vue.watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
6782
+ if (props2.isReverse) {
6783
+ const { columns, dataSource } = handleReverseTable(vue.unref(myColumns), vue.unref(myDataSource));
6784
+ tableColumns.value = columns;
6785
+ tableDataSource.value = dataSource;
6786
+ } else {
6787
+ tableColumns.value = vue.unref(myColumns);
6788
+ tableDataSource.value = vue.unref(myDataSource);
6789
+ }
6790
+ }, {
6791
+ deep: true,
6792
+ immediate: true
6713
6793
  });
6714
6794
  const orderCondition = vue.ref(void 0);
6715
6795
  const requestData = useRequestData(props2);
@@ -6733,7 +6813,7 @@
6733
6813
  const res = await requestData(params);
6734
6814
  const { rows = [], total: tableTotal = 0 } = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) || {};
6735
6815
  total.value = tableTotal;
6736
- dataSource.value = rows;
6816
+ myDataSource.value = rows;
6737
6817
  } catch (e) {
6738
6818
  console.error(e);
6739
6819
  } finally {
@@ -6806,12 +6886,10 @@
6806
6886
  getGlobalModel: (key) => void 0,
6807
6887
  setGlobalModel: (key, value) => void 0
6808
6888
  });
6809
- const dataColumns = vue.ref([]);
6810
- const handleIndicatorDataset = (colmuns = [], rows = []) => {
6811
- dataColumns.value = colmuns.map((it) => {
6812
- return { title: it, dataIndex: it, key: it };
6813
- });
6814
- dataSource.value = rows;
6889
+ const handleIndicatorDataset = (dataColumns = [], dataRows = []) => {
6890
+ const _columns = dataColumns.map((column) => ({ title: column, dataIndex: column, key: column }));
6891
+ handleColumns(_columns);
6892
+ myDataSource.value = dataRows;
6815
6893
  };
6816
6894
  const indicatorData = useIndicatorData(props2);
6817
6895
  const handleIndicatorData = async () => {
@@ -6872,7 +6950,7 @@
6872
6950
  return [];
6873
6951
  const start = (vue.unref(pageNum) - 1) * vue.unref(pageSize);
6874
6952
  const end = start + vue.unref(pageSize);
6875
- const records = vue.unref(dataSource).slice(start, end);
6953
+ const records = vue.unref(myDataSource).slice(start, end);
6876
6954
  for (let i = 0; i < records.length; i++) {
6877
6955
  const record = records[i];
6878
6956
  for (let j = 0; j < summaryList2.length; j++) {
@@ -6918,15 +6996,14 @@
6918
6996
  return {
6919
6997
  x,
6920
6998
  y,
6921
- myColumns,
6922
6999
  style: style2,
6923
7000
  customRow,
6924
7001
  pagination,
6925
7002
  formatFn,
6926
7003
  contrastClass,
6927
7004
  tableChange,
6928
- dataColumns,
6929
- dataSource,
7005
+ tableDataSource,
7006
+ tableColumns,
6930
7007
  summaryList,
6931
7008
  loading,
6932
7009
  onTouchHrefEvent,
@@ -6957,8 +7034,8 @@
6957
7034
  style: {
6958
7035
  height: "100%"
6959
7036
  },
6960
- columns: _ctx.dataColumns.length > 0 ? _ctx.dataColumns : _ctx.myColumns,
6961
- "data-source": _ctx.dataSource,
7037
+ columns: _ctx.tableColumns,
7038
+ "data-source": _ctx.tableDataSource,
6962
7039
  bordered: _ctx.bordered,
6963
7040
  size: _ctx.size,
6964
7041
  customRow: _ctx.customRow,
@@ -7038,7 +7115,7 @@
7038
7115
  }, 8, ["loading"])
7039
7116
  ], 4);
7040
7117
  }
7041
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-0963bd5a"]]);
7118
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-48569fe8"]]);
7042
7119
  const EcanTable = withInstall(Table);
7043
7120
  const mapProps = {
7044
7121
  ...props,