@ecan-bi/datav 1.1.6 → 1.1.8

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.6 */
1
+ /*! @ecan-bi/datav@1.1.8 */
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";
@@ -1493,7 +1493,7 @@ const props = {
1493
1493
  isOpenRequestTimer: false,
1494
1494
  requestInterval: 1,
1495
1495
  requestSort: 0,
1496
- requestParams: [{ key: "", value: { id: "", prop: "" } }],
1496
+ requestParams: [{ key: null, value: {} }],
1497
1497
  events: [],
1498
1498
  dataType: "static"
1499
1499
  };
@@ -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"];
@@ -5862,13 +5875,16 @@ const _sfc_main$7 = defineComponent({
5862
5875
  if (tooltipFormatter === "") {
5863
5876
  tooltipFormatter = "{marker} {a} {c}";
5864
5877
  }
5878
+ const seriesTypes = props2.seriesTypes;
5865
5879
  for (let i = 0; i < len; i++) {
5880
+ const seriesType = seriesTypes[i];
5881
+ const { tooltipFormatter: _tooltipFormatter } = seriesType || {};
5866
5882
  const { marker, seriesName, name, value, data } = params[i] || {};
5867
5883
  if (i === 0) {
5868
5884
  formatter += `${name}<br/>`;
5869
5885
  }
5870
5886
  formatter += useVariablesInText(
5871
- tooltipFormatter,
5887
+ _tooltipFormatter || tooltipFormatter,
5872
5888
  {
5873
5889
  marker,
5874
5890
  name,
@@ -6839,7 +6855,9 @@ const _sfc_main$1 = defineComponent({
6839
6855
  cellColor,
6840
6856
  dataIndex,
6841
6857
  title,
6842
- tableFilter
6858
+ tableFilter,
6859
+ headerCellAlign,
6860
+ headerCellColor
6843
6861
  } = column;
6844
6862
  if (tableFilter) {
6845
6863
  filterDataIndexList.push(dataIndex);
@@ -6848,6 +6866,17 @@ const _sfc_main$1 = defineComponent({
6848
6866
  column.customFilterDropdown = true;
6849
6867
  column.onFilter = (value, record) => record[dataIndex].toString().toLowerCase().includes(value.toLowerCase());
6850
6868
  }
6869
+ column.customHeaderCell = () => ({
6870
+ style: {
6871
+ display: "table-cell",
6872
+ verticalAlign: "middle",
6873
+ fontSize: props2.headerFontSize,
6874
+ fontWeight: props2.headerFontWeight,
6875
+ textAlign: headerCellAlign || "center",
6876
+ color: headerCellColor,
6877
+ borderBottomColor: props2.borderColor
6878
+ }
6879
+ });
6851
6880
  column.customCell = (record, rowIndex) => ({
6852
6881
  style: {
6853
6882
  textAlign: cellAlign,
@@ -7231,7 +7260,7 @@ const _sfc_main$1 = defineComponent({
7231
7260
  const _inputValue = unref(column.filterOptionsInputValue).trim();
7232
7261
  if (Array.isArray(filterOptions)) {
7233
7262
  filterOptions = filterOptions.filter((filterOption) => {
7234
- if (filterOption.label) {
7263
+ if (typeof filterOption.label === "string") {
7235
7264
  return filterOption.label.toLowerCase().includes(_inputValue.toLowerCase());
7236
7265
  }
7237
7266
  return true;
@@ -7266,7 +7295,7 @@ const _sfc_main$1 = defineComponent({
7266
7295
  };
7267
7296
  }
7268
7297
  });
7269
- const Table_vue_vue_type_style_index_0_scoped_915e7876_lang = "";
7298
+ const Table_vue_vue_type_style_index_0_scoped_2403ec91_lang = "";
7270
7299
  const Table_vue_vue_type_style_index_1_lang = "";
7271
7300
  const _hoisted_1$1 = /* @__PURE__ */ createTextVNode(" \u641C\u7D22 ");
7272
7301
  const _hoisted_2 = /* @__PURE__ */ createTextVNode(" \u91CD\u7F6E ");
@@ -7305,19 +7334,6 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7305
7334
  pagination: _ctx.pagination,
7306
7335
  onChange: _ctx.tableChange
7307
7336
  }, {
7308
- headerCell: withCtx(({ column }) => [
7309
- createElementVNode("div", {
7310
- style: normalizeStyle({
7311
- fontSize: _ctx.headerFontSize,
7312
- fontWeight: _ctx.headerFontWeight,
7313
- width: "100%",
7314
- height: "100%",
7315
- textAlign: column.headerCellAlign || "center",
7316
- color: column.headerCellColor,
7317
- borderBottomColor: _ctx.borderColor
7318
- })
7319
- }, toDisplayString(column.title), 5)
7320
- ]),
7321
7337
  customFilterDropdown: withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7322
7338
  createElementVNode("div", {
7323
7339
  class: "ecan-table-filter",
@@ -7354,7 +7370,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7354
7370
  createVNode(_component_a_button, {
7355
7371
  size: "small",
7356
7372
  style: { "width": "90px" },
7357
- onClick: ($event) => _ctx.onResetFilter(clearFilters)
7373
+ onClick: ($event) => _ctx.onResetFilter(clearFilters, column)
7358
7374
  }, {
7359
7375
  default: withCtx(() => [
7360
7376
  _hoisted_2
@@ -7435,7 +7451,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7435
7451
  }, 8, ["loading"])
7436
7452
  ], 4);
7437
7453
  }
7438
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-915e7876"]]);
7454
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-2403ec91"]]);
7439
7455
  const EcanTable = withInstall(Table);
7440
7456
  const mapProps = {
7441
7457
  ...props,