@ecan-bi/datav 1.1.1 → 1.1.3

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.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.1.1 */
1
+ /*! @ecan-bi/datav@1.1.3 */
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) {
@@ -1565,7 +1565,6 @@
1565
1565
  const ERD_URL = ((_d = window == null ? void 0 : window.config) == null ? void 0 : _d.erdURL) || "";
1566
1566
  const useOnEvent = (props2, events) => {
1567
1567
  vue.watch(() => props2.id, (id, oldId) => {
1568
- console.log(id, oldId);
1569
1568
  const eventBus = vue.inject(EVENT_BUS, {
1570
1569
  onEvent: (i, e) => void 0,
1571
1570
  offEvent: (i) => void 0
@@ -1682,8 +1681,6 @@
1682
1681
  const usedVariable = data[textVariable];
1683
1682
  if (usedVariable != null) {
1684
1683
  statement = statement.replace(textVariable, usedVariable);
1685
- } else {
1686
- statement = statement.replace(textVariable, "");
1687
1684
  }
1688
1685
  }
1689
1686
  try {
@@ -2830,7 +2827,9 @@
2830
2827
  const v = (_a2 = variable == null ? void 0 : variable.slice(1, variable.length - 1)) == null ? void 0 : _a2.trim();
2831
2828
  let usedVariable = data[v];
2832
2829
  if (usedVariable != null) {
2833
- if (props2.format === "percentage") {
2830
+ const format = props2.format;
2831
+ console.log("format", format);
2832
+ if (format === "percentage") {
2834
2833
  usedVariable = +usedVariable;
2835
2834
  if (!isNaN(usedVariable)) {
2836
2835
  usedVariable = (usedVariable * 100).toFixed(2);
@@ -2842,6 +2841,13 @@
2842
2841
  } else {
2843
2842
  text = text.replace(variable, `<span style="color:${props2.variableColor};font-size:${props2.variableFontSize}">${0}%</span>`);
2844
2843
  }
2844
+ } else if (format === "percent") {
2845
+ console.log("format", format);
2846
+ usedVariable = +usedVariable;
2847
+ if (!isNaN(usedVariable)) {
2848
+ usedVariable = (usedVariable * 100).toFixed(2);
2849
+ text = text.replace(variable, `<span style="color:${props2.variableColor};font-size:${props2.variableFontSize}">${usedVariable}%</span>`);
2850
+ }
2845
2851
  } else if (props2.format === "money") {
2846
2852
  usedVariable = +usedVariable;
2847
2853
  if (!isNaN(usedVariable)) {
@@ -2924,7 +2930,7 @@
2924
2930
  };
2925
2931
  }
2926
2932
  });
2927
- const Text_vue_vue_type_style_index_0_scoped_860fa6ea_lang = "";
2933
+ const Text_vue_vue_type_style_index_0_scoped_0a5690c3_lang = "";
2928
2934
  const _hoisted_1$8 = ["innerHTML"];
2929
2935
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2930
2936
  const _component_skeleton = vue.resolveComponent("skeleton");
@@ -2942,7 +2948,7 @@
2942
2948
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2943
2949
  }, null, 12, _hoisted_1$8));
2944
2950
  }
2945
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-860fa6ea"]]);
2951
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-0a5690c3"]]);
2946
2952
  const EcanText = withInstall(Text);
2947
2953
  const _sfc_main$m = vue.defineComponent({
2948
2954
  name: "EcanScrollText",
@@ -3155,7 +3161,7 @@
3155
3161
  key: 0,
3156
3162
  class: "ranking"
3157
3163
  };
3158
- const _hoisted_3$1 = {
3164
+ const _hoisted_3$2 = {
3159
3165
  key: 1,
3160
3166
  class: "ecan-list-content"
3161
3167
  };
@@ -3203,7 +3209,7 @@
3203
3209
  ], 4);
3204
3210
  }), 128))
3205
3211
  ])) : vue.createCommentVNode("", true),
3206
- _ctx.dataSource.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
3212
+ _ctx.dataSource.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
3207
3213
  _ctx.useTitle ? (vue.openBlock(), vue.createElementBlock("div", {
3208
3214
  key: 0,
3209
3215
  class: "title-placeholder",
@@ -6218,7 +6224,7 @@
6218
6224
  const _withScopeId = (n) => (vue.pushScopeId("data-v-f3fc1305"), n = n(), vue.popScopeId(), n);
6219
6225
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "top-left border-item" }, null, -1));
6220
6226
  const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "top-right border-item" }, null, -1));
6221
- const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
6227
+ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
6222
6228
  const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "bottom-right border-item" }, null, -1));
6223
6229
  const _hoisted_5 = { class: "title-item-wrapper" };
6224
6230
  const _hoisted_6 = { class: "title-item" };
@@ -6254,7 +6260,7 @@
6254
6260
  _ctx.useBorderModify ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
6255
6261
  _hoisted_1$5,
6256
6262
  _hoisted_2$1,
6257
- _hoisted_3,
6263
+ _hoisted_3$1,
6258
6264
  _hoisted_4
6259
6265
  ], 64)) : vue.createCommentVNode("", true)
6260
6266
  ], 4)) : vue.createCommentVNode("", true),
@@ -6813,13 +6819,13 @@
6813
6819
  const x = vue.computed(() => props2.scrollX);
6814
6820
  const y = vue.computed(() => parseFloat(props2.height) - vue.unref(splitY));
6815
6821
  const myColumns = vue.ref([]);
6816
- const myDataSource = vue.ref(props2.data);
6822
+ const myDataSource = vue.ref([]);
6817
6823
  const tableColumns = vue.ref([]);
6818
6824
  const tableDataSource = vue.ref([]);
6819
6825
  const total = vue.ref(0);
6820
6826
  const pageNum = vue.ref(1);
6821
6827
  const pageSize = vue.computed(() => props2.paginationPageSize);
6822
- const handleChildrenColumns = (_columns) => {
6828
+ const handleChildrenColumns = (_columns = []) => {
6823
6829
  if (Array.isArray(_columns) && _columns.length > 0) {
6824
6830
  const len = _columns.length;
6825
6831
  const columnsFixedNum = props2.columnsFixedNum;
@@ -6864,25 +6870,22 @@
6864
6870
  }
6865
6871
  };
6866
6872
  const handleColumns = (columns = []) => {
6867
- let _columns = [];
6868
- const isUseSeq = props2.isUseSeq;
6869
- if (isUseSeq) {
6870
- _columns.push({
6873
+ if (props2.isUseSeq) {
6874
+ columns.unshift({
6871
6875
  title: "\u5E8F\u53F7",
6872
6876
  dataIndex: "SEQ",
6873
6877
  align: "center"
6874
6878
  });
6875
6879
  }
6876
- _columns = _columns.concat(lodashEs.cloneDeep(columns));
6877
6880
  if (props2.isUseAction) {
6878
- _columns.push({
6881
+ columns.push({
6879
6882
  title: "\u64CD\u4F5C",
6880
6883
  dataIndex: "ACTION",
6881
6884
  width: props2.actionColumnWidth
6882
6885
  });
6883
6886
  }
6884
- handleChildrenColumns(_columns);
6885
- myColumns.value = _columns;
6887
+ handleChildrenColumns(columns);
6888
+ return columns;
6886
6889
  };
6887
6890
  vue.watch(() => [
6888
6891
  props2.columns,
@@ -6893,7 +6896,7 @@
6893
6896
  props2.cellBackgroundColor,
6894
6897
  props2.borderColor
6895
6898
  ], () => {
6896
- handleColumns(props2.columns);
6899
+ myColumns.value = handleColumns(lodashEs.cloneDeep(props2.columns));
6897
6900
  }, {
6898
6901
  immediate: true,
6899
6902
  deep: true
@@ -6902,6 +6905,21 @@
6902
6905
  if (dataType !== "static")
6903
6906
  return;
6904
6907
  myDataSource.value = data;
6908
+ }, {
6909
+ immediate: true
6910
+ });
6911
+ vue.watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
6912
+ if (props2.isReverse) {
6913
+ const { columns, dataSource } = handleReverseTable(lodashEs.cloneDeep(vue.unref(myColumns)), lodashEs.cloneDeep(vue.unref(myDataSource)));
6914
+ tableColumns.value = columns;
6915
+ tableDataSource.value = dataSource;
6916
+ } else {
6917
+ tableColumns.value = vue.unref(myColumns);
6918
+ tableDataSource.value = vue.unref(myDataSource);
6919
+ }
6920
+ }, {
6921
+ immediate: true,
6922
+ flush: "post"
6905
6923
  });
6906
6924
  const handleReverseTable = (columns, dataSource) => {
6907
6925
  const firstColumns = columns[0];
@@ -6936,19 +6954,6 @@
6936
6954
  dataSource: _dataSource
6937
6955
  };
6938
6956
  };
6939
- vue.watch(() => [props2.isReverse, myColumns.value, myDataSource.value], () => {
6940
- if (props2.isReverse) {
6941
- const { columns, dataSource } = handleReverseTable(vue.unref(myColumns), vue.unref(myDataSource));
6942
- tableColumns.value = columns;
6943
- tableDataSource.value = dataSource;
6944
- } else {
6945
- tableColumns.value = lodashEs.cloneDeep(vue.unref(myColumns));
6946
- tableDataSource.value = lodashEs.cloneDeep(vue.unref(myDataSource));
6947
- }
6948
- }, {
6949
- deep: true,
6950
- immediate: true
6951
- });
6952
6957
  const orderCondition = vue.ref("");
6953
6958
  const requestData = useRequestData(props2);
6954
6959
  const loading = vue.ref(false);
@@ -7049,7 +7054,8 @@
7049
7054
  });
7050
7055
  const handleIndicatorDataset = (dataColumns = [], dataRows = []) => {
7051
7056
  const _columns = dataColumns.map((column) => ({ title: column, dataIndex: column, key: column }));
7052
- handleColumns(_columns);
7057
+ const columns = handleColumns(_columns);
7058
+ myColumns.value = columns;
7053
7059
  myDataSource.value = dataRows;
7054
7060
  };
7055
7061
  const indicatorData = useIndicatorData(props2);
@@ -7091,16 +7097,17 @@
7091
7097
  });
7092
7098
  const summaryList = vue.computed(() => {
7093
7099
  const columns = vue.unref(tableColumns);
7094
- let summaryList2 = [];
7095
- if (props2.isUseSeq) {
7096
- columns.shift();
7097
- summaryList2 = [{ total: "\u5C0F\u8BA1" }];
7098
- }
7100
+ const summaryList2 = [];
7099
7101
  let calcTotalCount = 0;
7100
7102
  for (let i = 0; i < columns.length; i++) {
7101
7103
  const column = columns[i];
7102
7104
  const { isCalcTotal } = column;
7103
- if (isCalcTotal) {
7105
+ if (props2.isUseSeq && i === 0) {
7106
+ summaryList2.push({
7107
+ ...column,
7108
+ total: "\u5C0F\u8BA1"
7109
+ });
7110
+ } else if (isCalcTotal) {
7104
7111
  summaryList2.push({
7105
7112
  ...column,
7106
7113
  index: i,
@@ -7177,24 +7184,27 @@
7177
7184
  formatFn,
7178
7185
  contrastClass,
7179
7186
  tableChange,
7180
- tableDataSource,
7181
- tableColumns,
7187
+ myColumns,
7188
+ myDataSource,
7182
7189
  summaryList,
7183
7190
  loading,
7184
7191
  onTouchHrefEvent,
7185
7192
  handleHref,
7186
7193
  handleHrefTarget,
7187
- useRowIndex
7194
+ useRowIndex,
7195
+ tableColumns,
7196
+ tableDataSource
7188
7197
  };
7189
7198
  }
7190
7199
  });
7191
- const Table_vue_vue_type_style_index_0_scoped_3e5c9238_lang = "";
7200
+ const Table_vue_vue_type_style_index_0_scoped_292c12ab_lang = "";
7192
7201
  const Table_vue_vue_type_style_index_1_lang = "";
7193
- const _hoisted_1$1 = {
7202
+ const _hoisted_1$1 = { key: 0 };
7203
+ const _hoisted_2 = {
7194
7204
  key: 1,
7195
7205
  class: "action-list"
7196
7206
  };
7197
- const _hoisted_2 = ["href", "target", "onClick"];
7207
+ const _hoisted_3 = ["href", "target", "onClick"];
7198
7208
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7199
7209
  const _component_a_table_summary_cell = vue.resolveComponent("a-table-summary-cell");
7200
7210
  const _component_a_table_summary_row = vue.resolveComponent("a-table-summary-row");
@@ -7235,13 +7245,8 @@
7235
7245
  }, vue.toDisplayString(column.title), 5)
7236
7246
  ]),
7237
7247
  bodyCell: vue.withCtx(({ column, index: index2, text, record }) => [
7238
- column.dataIndex === "SEQ" ? (vue.openBlock(), vue.createElementBlock("span", {
7239
- key: 0,
7240
- style: vue.normalizeStyle({
7241
- fontSize: _ctx.fontSize,
7242
- fontWeight: _ctx.fontWeight
7243
- })
7244
- }, vue.toDisplayString(index2 + 1), 5)) : column.dataIndex === "ACTION" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
7248
+ column.dataIndex === "SEQ" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString(index2 + 1), 1)) : vue.createCommentVNode("", true),
7249
+ column.dataIndex === "ACTION" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
7245
7250
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.actionList, (action, index22) => {
7246
7251
  return vue.openBlock(), vue.createElementBlock("div", {
7247
7252
  class: "action",
@@ -7256,7 +7261,7 @@
7256
7261
  fontWeight: _ctx.fontWeight
7257
7262
  }),
7258
7263
  onClick: ($event) => _ctx.onTouchHrefEvent(action.target, _ctx.handleHref(action.href, record))
7259
- }, vue.toDisplayString(action.title), 13, _hoisted_2)
7264
+ }, vue.toDisplayString(action.title), 13, _hoisted_3)
7260
7265
  ]);
7261
7266
  }), 128))
7262
7267
  ])) : (vue.openBlock(), vue.createElementBlock("div", {
@@ -7266,7 +7271,7 @@
7266
7271
  fontSize: _ctx.fontSize,
7267
7272
  fontWeight: _ctx.fontWeight
7268
7273
  })
7269
- }, vue.toDisplayString((column.format != null || column.format !== "") && _ctx.formatFn(text, column.format)), 7))
7274
+ }, vue.toDisplayString(column.format != null ? _ctx.formatFn(text, column.format) : text), 7))
7270
7275
  ]),
7271
7276
  summary: vue.withCtx(() => [
7272
7277
  _ctx.summaryList.length > 0 ? (vue.openBlock(), vue.createBlock(_component_a_table_summary, { key: 0 }, {
@@ -7310,7 +7315,7 @@
7310
7315
  }, 8, ["loading"])
7311
7316
  ], 4);
7312
7317
  }
7313
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-3e5c9238"]]);
7318
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-292c12ab"]]);
7314
7319
  const EcanTable = withInstall(Table);
7315
7320
  const mapProps = {
7316
7321
  ...props,