@ecan-bi/datav 1.1.5 → 1.1.7

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.5 */
1
+ /*! @ecan-bi/datav@1.1.7 */
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) {
@@ -1724,21 +1724,34 @@
1724
1724
  return;
1725
1725
  let _params = {};
1726
1726
  requestParams.forEach((param) => {
1727
- var _a2;
1728
1727
  const { key, value } = param;
1729
1728
  if (typeof value === "object" && value.id) {
1730
1729
  let record = {};
1731
- const { id, prop, propKey } = value;
1730
+ const { id, prop, propKey, operate } = value;
1732
1731
  if (id === "THIS") {
1733
1732
  record = getGlobalModel(vue.unref(touchEventId)) || {};
1734
1733
  } else {
1735
1734
  record = getGlobalModel(id) || {};
1736
1735
  }
1737
1736
  const p = vue.unref(record[prop]);
1738
- let v = "";
1737
+ let v = null;
1739
1738
  const isNeedFormat = ["date", "range"].some((item) => lowerCaseIncludes(record == null ? void 0 : record.type, item));
1740
1739
  if (isNeedFormat) {
1741
- v = ((_a2 = vue.unref(p)) == null ? void 0 : _a2.format((propKey == null ? void 0 : propKey.trim()) || record.format)) || "";
1740
+ const { value: value2, type, mode } = operate || {};
1741
+ if (value2 && type && mode) {
1742
+ switch (type) {
1743
+ case "add":
1744
+ v = vue.unref(p).add(value2, mode);
1745
+ break;
1746
+ case "minus":
1747
+ v = vue.unref(p).subtract(value2, mode);
1748
+ break;
1749
+ }
1750
+ }
1751
+ if (v == null) {
1752
+ v = vue.unref(p);
1753
+ }
1754
+ v = (v == null ? void 0 : v.format((propKey == null ? void 0 : propKey.trim()) || record.format)) || "";
1742
1755
  } else {
1743
1756
  if (Object.prototype.toString.call(p) === "[object Object]") {
1744
1757
  v = p[propKey || "value"];
@@ -2829,7 +2842,6 @@
2829
2842
  let usedVariable = data[v];
2830
2843
  if (usedVariable != null) {
2831
2844
  const format = props2.format;
2832
- console.log("format", format);
2833
2845
  if (format === "percentage") {
2834
2846
  usedVariable = +usedVariable;
2835
2847
  if (!isNaN(usedVariable)) {
@@ -2843,7 +2855,6 @@
2843
2855
  text = text.replace(variable, `<span style="color:${props2.variableColor};font-size:${props2.variableFontSize}">${0}%</span>`);
2844
2856
  }
2845
2857
  } else if (format === "percent") {
2846
- console.log("format", format);
2847
2858
  usedVariable = +usedVariable;
2848
2859
  if (!isNaN(usedVariable)) {
2849
2860
  usedVariable = (usedVariable * 100).toFixed(2);
@@ -2931,7 +2942,7 @@
2931
2942
  };
2932
2943
  }
2933
2944
  });
2934
- const Text_vue_vue_type_style_index_0_scoped_0a5690c3_lang = "";
2945
+ const Text_vue_vue_type_style_index_0_scoped_445a06d8_lang = "";
2935
2946
  const _hoisted_1$8 = ["innerHTML"];
2936
2947
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2937
2948
  const _component_skeleton = vue.resolveComponent("skeleton");
@@ -2949,7 +2960,7 @@
2949
2960
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2950
2961
  }, null, 12, _hoisted_1$8));
2951
2962
  }
2952
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-0a5690c3"]]);
2963
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-445a06d8"]]);
2953
2964
  const EcanText = withInstall(Text);
2954
2965
  const _sfc_main$m = vue.defineComponent({
2955
2966
  name: "EcanScrollText",
@@ -3171,7 +3182,7 @@
3171
3182
  class: "ranking"
3172
3183
  };
3173
3184
  const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "icon" }, null, -1));
3174
- const _hoisted_6$2 = { class: "sort" };
3185
+ const _hoisted_6$1 = { class: "sort" };
3175
3186
  const _hoisted_7$1 = {
3176
3187
  key: 2,
3177
3188
  class: "empty"
@@ -3233,7 +3244,7 @@
3233
3244
  }, [
3234
3245
  _ctx.useRanking ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
3235
3246
  _hoisted_5$2,
3236
- vue.createElementVNode("div", _hoisted_6$2, " Top " + vue.toDisplayString(i + 1), 1)
3247
+ vue.createElementVNode("div", _hoisted_6$1, " Top " + vue.toDisplayString(i + 1), 1)
3237
3248
  ])) : vue.createCommentVNode("", true),
3238
3249
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.columns, (column) => {
3239
3250
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -6228,7 +6239,7 @@
6228
6239
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
6229
6240
  const _hoisted_4$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "bottom-right border-item" }, null, -1));
6230
6241
  const _hoisted_5$1 = { class: "title-item-wrapper" };
6231
- const _hoisted_6$1 = { class: "title-item" };
6242
+ const _hoisted_6 = { class: "title-item" };
6232
6243
  const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("img", {
6233
6244
  class: "title-decoration-left",
6234
6245
  src: _imports_0
@@ -6271,7 +6282,7 @@
6271
6282
  style: vue.normalizeStyle(_ctx.borderStyle)
6272
6283
  }, [
6273
6284
  vue.createElementVNode("div", _hoisted_5$1, [
6274
- vue.createElementVNode("div", _hoisted_6$1, [
6285
+ vue.createElementVNode("div", _hoisted_6, [
6275
6286
  _hoisted_7,
6276
6287
  vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(_ctx.title), 1),
6277
6288
  _hoisted_9
@@ -6741,6 +6752,7 @@
6741
6752
  paginationPageSize: 10,
6742
6753
  isUseAction: false,
6743
6754
  clickHighlight: false,
6755
+ filterDropdownHeight: "200px",
6744
6756
  actionList: [{
6745
6757
  title: "",
6746
6758
  href: "",
@@ -6845,7 +6857,9 @@
6845
6857
  cellColor,
6846
6858
  dataIndex,
6847
6859
  title,
6848
- tableFilter
6860
+ tableFilter,
6861
+ headerCellAlign,
6862
+ headerCellColor
6849
6863
  } = column;
6850
6864
  if (tableFilter) {
6851
6865
  filterDataIndexList.push(dataIndex);
@@ -6854,6 +6868,17 @@
6854
6868
  column.customFilterDropdown = true;
6855
6869
  column.onFilter = (value, record) => record[dataIndex].toString().toLowerCase().includes(value.toLowerCase());
6856
6870
  }
6871
+ column.customHeaderCell = () => ({
6872
+ style: {
6873
+ display: "table-cell",
6874
+ verticalAlign: "middle",
6875
+ fontSize: props2.headerFontSize,
6876
+ fontWeight: props2.headerFontWeight,
6877
+ textAlign: headerCellAlign || "center",
6878
+ color: headerCellColor,
6879
+ borderBottomColor: props2.borderColor
6880
+ }
6881
+ });
6857
6882
  column.customCell = (record, rowIndex) => ({
6858
6883
  style: {
6859
6884
  textAlign: cellAlign,
@@ -7237,7 +7262,7 @@
7237
7262
  const _inputValue = vue.unref(column.filterOptionsInputValue).trim();
7238
7263
  if (Array.isArray(filterOptions)) {
7239
7264
  filterOptions = filterOptions.filter((filterOption) => {
7240
- if (filterOption.label) {
7265
+ if (typeof filterOption.label === "string") {
7241
7266
  return filterOption.label.toLowerCase().includes(_inputValue.toLowerCase());
7242
7267
  }
7243
7268
  return true;
@@ -7272,20 +7297,16 @@
7272
7297
  };
7273
7298
  }
7274
7299
  });
7275
- const Table_vue_vue_type_style_index_0_scoped_43db63c3_lang = "";
7300
+ const Table_vue_vue_type_style_index_0_scoped_2403ec91_lang = "";
7276
7301
  const Table_vue_vue_type_style_index_1_lang = "";
7277
- const _hoisted_1$1 = {
7278
- class: "ecan-table-filter",
7279
- style: { "padding": "8px" }
7280
- };
7281
- const _hoisted_2 = /* @__PURE__ */ vue.createTextVNode(" \u641C\u7D22 ");
7282
- const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode(" \u91CD\u7F6E ");
7283
- const _hoisted_4 = { key: 0 };
7284
- const _hoisted_5 = {
7302
+ const _hoisted_1$1 = /* @__PURE__ */ vue.createTextVNode(" \u641C\u7D22 ");
7303
+ const _hoisted_2 = /* @__PURE__ */ vue.createTextVNode(" \u91CD\u7F6E ");
7304
+ const _hoisted_3 = { key: 0 };
7305
+ const _hoisted_4 = {
7285
7306
  key: 1,
7286
7307
  class: "action-list"
7287
7308
  };
7288
- const _hoisted_6 = ["href", "target", "onClick"];
7309
+ const _hoisted_5 = ["href", "target", "onClick"];
7289
7310
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7290
7311
  const _component_a_input = vue.resolveComponent("a-input");
7291
7312
  const _component_a_checkbox_group = vue.resolveComponent("a-checkbox-group");
@@ -7315,21 +7336,13 @@
7315
7336
  pagination: _ctx.pagination,
7316
7337
  onChange: _ctx.tableChange
7317
7338
  }, {
7318
- headerCell: vue.withCtx(({ column }) => [
7339
+ customFilterDropdown: vue.withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7319
7340
  vue.createElementVNode("div", {
7341
+ class: "ecan-table-filter",
7320
7342
  style: vue.normalizeStyle({
7321
- fontSize: _ctx.headerFontSize,
7322
- fontWeight: _ctx.headerFontWeight,
7323
- width: "100%",
7324
- height: "100%",
7325
- textAlign: column.headerCellAlign || "center",
7326
- color: column.headerCellColor,
7327
- borderBottomColor: _ctx.borderColor
7343
+ height: _ctx.filterDropdownHeight
7328
7344
  })
7329
- }, vue.toDisplayString(column.title), 5)
7330
- ]),
7331
- customFilterDropdown: vue.withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7332
- vue.createElementVNode("div", _hoisted_1$1, [
7345
+ }, [
7333
7346
  vue.createVNode(_component_a_input, {
7334
7347
  value: column.filterOptionsInputValue,
7335
7348
  "onUpdate:value": ($event) => column.filterOptionsInputValue = $event,
@@ -7344,32 +7357,34 @@
7344
7357
  options: _ctx.useFilterOptions(column),
7345
7358
  onChange: ($event) => _ctx.useSetSelectedKeys(setSelectedKeys, column)
7346
7359
  }, null, 8, ["value", "onUpdate:value", "options", "onChange"]),
7347
- vue.createVNode(_component_a_button, {
7348
- type: "primary",
7349
- size: "small",
7350
- style: { "width": "90px", "margin-right": "8px" },
7351
- onClick: () => confirm()
7352
- }, {
7353
- default: vue.withCtx(() => [
7354
- _hoisted_2
7355
- ]),
7356
- _: 2
7357
- }, 1032, ["onClick"]),
7358
- vue.createVNode(_component_a_button, {
7359
- size: "small",
7360
- style: { "width": "90px" },
7361
- onClick: ($event) => _ctx.onResetFilter(clearFilters)
7362
- }, {
7363
- default: vue.withCtx(() => [
7364
- _hoisted_3
7365
- ]),
7366
- _: 2
7367
- }, 1032, ["onClick"])
7368
- ])
7360
+ vue.createElementVNode("div", null, [
7361
+ vue.createVNode(_component_a_button, {
7362
+ type: "primary",
7363
+ size: "small",
7364
+ style: { "width": "90px", "margin-right": "8px" },
7365
+ onClick: () => confirm()
7366
+ }, {
7367
+ default: vue.withCtx(() => [
7368
+ _hoisted_1$1
7369
+ ]),
7370
+ _: 2
7371
+ }, 1032, ["onClick"]),
7372
+ vue.createVNode(_component_a_button, {
7373
+ size: "small",
7374
+ style: { "width": "90px" },
7375
+ onClick: ($event) => _ctx.onResetFilter(clearFilters, column)
7376
+ }, {
7377
+ default: vue.withCtx(() => [
7378
+ _hoisted_2
7379
+ ]),
7380
+ _: 2
7381
+ }, 1032, ["onClick"])
7382
+ ])
7383
+ ], 4)
7369
7384
  ]),
7370
7385
  bodyCell: vue.withCtx(({ column, index: index2, text, record }) => [
7371
- column.dataIndex === "SEQ" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(index2 + 1), 1)) : vue.createCommentVNode("", true),
7372
- column.dataIndex === "ACTION" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
7386
+ column.dataIndex === "SEQ" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3, vue.toDisplayString(index2 + 1), 1)) : vue.createCommentVNode("", true),
7387
+ column.dataIndex === "ACTION" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [
7373
7388
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.actionList, (action, index22) => {
7374
7389
  return vue.openBlock(), vue.createElementBlock("div", {
7375
7390
  class: "action",
@@ -7384,7 +7399,7 @@
7384
7399
  fontWeight: _ctx.fontWeight
7385
7400
  }),
7386
7401
  onClick: ($event) => _ctx.onTouchHrefEvent(action.target, _ctx.handleHref(action.href, record))
7387
- }, vue.toDisplayString(action.title), 13, _hoisted_6)
7402
+ }, vue.toDisplayString(action.title), 13, _hoisted_5)
7388
7403
  ]);
7389
7404
  }), 128))
7390
7405
  ])) : (vue.openBlock(), vue.createElementBlock("div", {
@@ -7438,7 +7453,7 @@
7438
7453
  }, 8, ["loading"])
7439
7454
  ], 4);
7440
7455
  }
7441
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-43db63c3"]]);
7456
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-2403ec91"]]);
7442
7457
  const EcanTable = withInstall(Table);
7443
7458
  const mapProps = {
7444
7459
  ...props,