@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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.1.5 */
1
+ /*! @ecan-bi/datav@1.1.7 */
2
2
  var _a, _b, _c, _d;
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, onBeforeUnmount, toDisplayString, Fragment, renderList, createElementVNode, normalizeClass, pushScopeId, popScopeId, createSlots, resolveDynamicComponent, mergeProps, withModifiers, reactive, createTextVNode, withDirectives, vShow } from "vue";
4
4
  import { throttle, init, use, registerMap } from "echarts/core";
@@ -1719,21 +1719,34 @@ const useRequestData = (props2, callBack = () => {
1719
1719
  return;
1720
1720
  let _params = {};
1721
1721
  requestParams.forEach((param) => {
1722
- var _a2;
1723
1722
  const { key, value } = param;
1724
1723
  if (typeof value === "object" && value.id) {
1725
1724
  let record = {};
1726
- const { id, prop, propKey } = value;
1725
+ const { id, prop, propKey, operate } = value;
1727
1726
  if (id === "THIS") {
1728
1727
  record = getGlobalModel(unref(touchEventId)) || {};
1729
1728
  } else {
1730
1729
  record = getGlobalModel(id) || {};
1731
1730
  }
1732
1731
  const p = unref(record[prop]);
1733
- let v = "";
1732
+ let v = null;
1734
1733
  const isNeedFormat = ["date", "range"].some((item) => lowerCaseIncludes(record == null ? void 0 : record.type, item));
1735
1734
  if (isNeedFormat) {
1736
- v = ((_a2 = unref(p)) == null ? void 0 : _a2.format((propKey == null ? void 0 : propKey.trim()) || record.format)) || "";
1735
+ const { value: value2, type, mode } = operate || {};
1736
+ if (value2 && type && mode) {
1737
+ switch (type) {
1738
+ case "add":
1739
+ v = unref(p).add(value2, mode);
1740
+ break;
1741
+ case "minus":
1742
+ v = unref(p).subtract(value2, mode);
1743
+ break;
1744
+ }
1745
+ }
1746
+ if (v == null) {
1747
+ v = unref(p);
1748
+ }
1749
+ v = (v == null ? void 0 : v.format((propKey == null ? void 0 : propKey.trim()) || record.format)) || "";
1737
1750
  } else {
1738
1751
  if (Object.prototype.toString.call(p) === "[object Object]") {
1739
1752
  v = p[propKey || "value"];
@@ -2824,7 +2837,6 @@ const _sfc_main$n = defineComponent({
2824
2837
  let usedVariable = data[v];
2825
2838
  if (usedVariable != null) {
2826
2839
  const format = props2.format;
2827
- console.log("format", format);
2828
2840
  if (format === "percentage") {
2829
2841
  usedVariable = +usedVariable;
2830
2842
  if (!isNaN(usedVariable)) {
@@ -2838,7 +2850,6 @@ const _sfc_main$n = defineComponent({
2838
2850
  text = text.replace(variable, `<span style="color:${props2.variableColor};font-size:${props2.variableFontSize}">${0}%</span>`);
2839
2851
  }
2840
2852
  } else if (format === "percent") {
2841
- console.log("format", format);
2842
2853
  usedVariable = +usedVariable;
2843
2854
  if (!isNaN(usedVariable)) {
2844
2855
  usedVariable = (usedVariable * 100).toFixed(2);
@@ -2926,7 +2937,7 @@ const _sfc_main$n = defineComponent({
2926
2937
  };
2927
2938
  }
2928
2939
  });
2929
- const Text_vue_vue_type_style_index_0_scoped_0a5690c3_lang = "";
2940
+ const Text_vue_vue_type_style_index_0_scoped_445a06d8_lang = "";
2930
2941
  const _hoisted_1$8 = ["innerHTML"];
2931
2942
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2932
2943
  const _component_skeleton = resolveComponent("skeleton");
@@ -2944,7 +2955,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
2944
2955
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.click && _ctx.click(...args))
2945
2956
  }, null, 12, _hoisted_1$8));
2946
2957
  }
2947
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-0a5690c3"]]);
2958
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-445a06d8"]]);
2948
2959
  const EcanText = withInstall(Text);
2949
2960
  const _sfc_main$m = defineComponent({
2950
2961
  name: "EcanScrollText",
@@ -3166,7 +3177,7 @@ const _hoisted_4$2 = {
3166
3177
  class: "ranking"
3167
3178
  };
3168
3179
  const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "icon" }, null, -1));
3169
- const _hoisted_6$2 = { class: "sort" };
3180
+ const _hoisted_6$1 = { class: "sort" };
3170
3181
  const _hoisted_7$1 = {
3171
3182
  key: 2,
3172
3183
  class: "empty"
@@ -3228,7 +3239,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
3228
3239
  }, [
3229
3240
  _ctx.useRanking ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
3230
3241
  _hoisted_5$2,
3231
- createElementVNode("div", _hoisted_6$2, " Top " + toDisplayString(i + 1), 1)
3242
+ createElementVNode("div", _hoisted_6$1, " Top " + toDisplayString(i + 1), 1)
3232
3243
  ])) : createCommentVNode("", true),
3233
3244
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (column) => {
3234
3245
  return openBlock(), createElementBlock("div", {
@@ -6223,7 +6234,7 @@ const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createEl
6223
6234
  const _hoisted_3$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-left border-item" }, null, -1));
6224
6235
  const _hoisted_4$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "bottom-right border-item" }, null, -1));
6225
6236
  const _hoisted_5$1 = { class: "title-item-wrapper" };
6226
- const _hoisted_6$1 = { class: "title-item" };
6237
+ const _hoisted_6 = { class: "title-item" };
6227
6238
  const _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("img", {
6228
6239
  class: "title-decoration-left",
6229
6240
  src: _imports_0
@@ -6266,7 +6277,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
6266
6277
  style: normalizeStyle(_ctx.borderStyle)
6267
6278
  }, [
6268
6279
  createElementVNode("div", _hoisted_5$1, [
6269
- createElementVNode("div", _hoisted_6$1, [
6280
+ createElementVNode("div", _hoisted_6, [
6270
6281
  _hoisted_7,
6271
6282
  createElementVNode("div", _hoisted_8, toDisplayString(_ctx.title), 1),
6272
6283
  _hoisted_9
@@ -6736,6 +6747,7 @@ const tableProps = {
6736
6747
  paginationPageSize: 10,
6737
6748
  isUseAction: false,
6738
6749
  clickHighlight: false,
6750
+ filterDropdownHeight: "200px",
6739
6751
  actionList: [{
6740
6752
  title: "",
6741
6753
  href: "",
@@ -6840,7 +6852,9 @@ const _sfc_main$1 = defineComponent({
6840
6852
  cellColor,
6841
6853
  dataIndex,
6842
6854
  title,
6843
- tableFilter
6855
+ tableFilter,
6856
+ headerCellAlign,
6857
+ headerCellColor
6844
6858
  } = column;
6845
6859
  if (tableFilter) {
6846
6860
  filterDataIndexList.push(dataIndex);
@@ -6849,6 +6863,17 @@ const _sfc_main$1 = defineComponent({
6849
6863
  column.customFilterDropdown = true;
6850
6864
  column.onFilter = (value, record) => record[dataIndex].toString().toLowerCase().includes(value.toLowerCase());
6851
6865
  }
6866
+ column.customHeaderCell = () => ({
6867
+ style: {
6868
+ display: "table-cell",
6869
+ verticalAlign: "middle",
6870
+ fontSize: props2.headerFontSize,
6871
+ fontWeight: props2.headerFontWeight,
6872
+ textAlign: headerCellAlign || "center",
6873
+ color: headerCellColor,
6874
+ borderBottomColor: props2.borderColor
6875
+ }
6876
+ });
6852
6877
  column.customCell = (record, rowIndex) => ({
6853
6878
  style: {
6854
6879
  textAlign: cellAlign,
@@ -7232,7 +7257,7 @@ const _sfc_main$1 = defineComponent({
7232
7257
  const _inputValue = unref(column.filterOptionsInputValue).trim();
7233
7258
  if (Array.isArray(filterOptions)) {
7234
7259
  filterOptions = filterOptions.filter((filterOption) => {
7235
- if (filterOption.label) {
7260
+ if (typeof filterOption.label === "string") {
7236
7261
  return filterOption.label.toLowerCase().includes(_inputValue.toLowerCase());
7237
7262
  }
7238
7263
  return true;
@@ -7267,20 +7292,16 @@ const _sfc_main$1 = defineComponent({
7267
7292
  };
7268
7293
  }
7269
7294
  });
7270
- const Table_vue_vue_type_style_index_0_scoped_43db63c3_lang = "";
7295
+ const Table_vue_vue_type_style_index_0_scoped_2403ec91_lang = "";
7271
7296
  const Table_vue_vue_type_style_index_1_lang = "";
7272
- const _hoisted_1$1 = {
7273
- class: "ecan-table-filter",
7274
- style: { "padding": "8px" }
7275
- };
7276
- const _hoisted_2 = /* @__PURE__ */ createTextVNode(" \u641C\u7D22 ");
7277
- const _hoisted_3 = /* @__PURE__ */ createTextVNode(" \u91CD\u7F6E ");
7278
- const _hoisted_4 = { key: 0 };
7279
- const _hoisted_5 = {
7297
+ const _hoisted_1$1 = /* @__PURE__ */ createTextVNode(" \u641C\u7D22 ");
7298
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode(" \u91CD\u7F6E ");
7299
+ const _hoisted_3 = { key: 0 };
7300
+ const _hoisted_4 = {
7280
7301
  key: 1,
7281
7302
  class: "action-list"
7282
7303
  };
7283
- const _hoisted_6 = ["href", "target", "onClick"];
7304
+ const _hoisted_5 = ["href", "target", "onClick"];
7284
7305
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7285
7306
  const _component_a_input = resolveComponent("a-input");
7286
7307
  const _component_a_checkbox_group = resolveComponent("a-checkbox-group");
@@ -7310,21 +7331,13 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7310
7331
  pagination: _ctx.pagination,
7311
7332
  onChange: _ctx.tableChange
7312
7333
  }, {
7313
- headerCell: withCtx(({ column }) => [
7334
+ customFilterDropdown: withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7314
7335
  createElementVNode("div", {
7336
+ class: "ecan-table-filter",
7315
7337
  style: normalizeStyle({
7316
- fontSize: _ctx.headerFontSize,
7317
- fontWeight: _ctx.headerFontWeight,
7318
- width: "100%",
7319
- height: "100%",
7320
- textAlign: column.headerCellAlign || "center",
7321
- color: column.headerCellColor,
7322
- borderBottomColor: _ctx.borderColor
7338
+ height: _ctx.filterDropdownHeight
7323
7339
  })
7324
- }, toDisplayString(column.title), 5)
7325
- ]),
7326
- customFilterDropdown: withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7327
- createElementVNode("div", _hoisted_1$1, [
7340
+ }, [
7328
7341
  createVNode(_component_a_input, {
7329
7342
  value: column.filterOptionsInputValue,
7330
7343
  "onUpdate:value": ($event) => column.filterOptionsInputValue = $event,
@@ -7339,32 +7352,34 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7339
7352
  options: _ctx.useFilterOptions(column),
7340
7353
  onChange: ($event) => _ctx.useSetSelectedKeys(setSelectedKeys, column)
7341
7354
  }, null, 8, ["value", "onUpdate:value", "options", "onChange"]),
7342
- createVNode(_component_a_button, {
7343
- type: "primary",
7344
- size: "small",
7345
- style: { "width": "90px", "margin-right": "8px" },
7346
- onClick: () => confirm()
7347
- }, {
7348
- default: withCtx(() => [
7349
- _hoisted_2
7350
- ]),
7351
- _: 2
7352
- }, 1032, ["onClick"]),
7353
- createVNode(_component_a_button, {
7354
- size: "small",
7355
- style: { "width": "90px" },
7356
- onClick: ($event) => _ctx.onResetFilter(clearFilters)
7357
- }, {
7358
- default: withCtx(() => [
7359
- _hoisted_3
7360
- ]),
7361
- _: 2
7362
- }, 1032, ["onClick"])
7363
- ])
7355
+ createElementVNode("div", null, [
7356
+ createVNode(_component_a_button, {
7357
+ type: "primary",
7358
+ size: "small",
7359
+ style: { "width": "90px", "margin-right": "8px" },
7360
+ onClick: () => confirm()
7361
+ }, {
7362
+ default: withCtx(() => [
7363
+ _hoisted_1$1
7364
+ ]),
7365
+ _: 2
7366
+ }, 1032, ["onClick"]),
7367
+ createVNode(_component_a_button, {
7368
+ size: "small",
7369
+ style: { "width": "90px" },
7370
+ onClick: ($event) => _ctx.onResetFilter(clearFilters, column)
7371
+ }, {
7372
+ default: withCtx(() => [
7373
+ _hoisted_2
7374
+ ]),
7375
+ _: 2
7376
+ }, 1032, ["onClick"])
7377
+ ])
7378
+ ], 4)
7364
7379
  ]),
7365
7380
  bodyCell: withCtx(({ column, index: index2, text, record }) => [
7366
- column.dataIndex === "SEQ" ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
7367
- column.dataIndex === "ACTION" ? (openBlock(), createElementBlock("div", _hoisted_5, [
7381
+ column.dataIndex === "SEQ" ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(index2 + 1), 1)) : createCommentVNode("", true),
7382
+ column.dataIndex === "ACTION" ? (openBlock(), createElementBlock("div", _hoisted_4, [
7368
7383
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.actionList, (action, index22) => {
7369
7384
  return openBlock(), createElementBlock("div", {
7370
7385
  class: "action",
@@ -7379,7 +7394,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7379
7394
  fontWeight: _ctx.fontWeight
7380
7395
  }),
7381
7396
  onClick: ($event) => _ctx.onTouchHrefEvent(action.target, _ctx.handleHref(action.href, record))
7382
- }, toDisplayString(action.title), 13, _hoisted_6)
7397
+ }, toDisplayString(action.title), 13, _hoisted_5)
7383
7398
  ]);
7384
7399
  }), 128))
7385
7400
  ])) : (openBlock(), createElementBlock("div", {
@@ -7433,7 +7448,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7433
7448
  }, 8, ["loading"])
7434
7449
  ], 4);
7435
7450
  }
7436
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-43db63c3"]]);
7451
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-2403ec91"]]);
7437
7452
  const EcanTable = withInstall(Table);
7438
7453
  const mapProps = {
7439
7454
  ...props,