@ecan-bi/datav 1.1.6 → 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.6 */
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"];
@@ -6839,7 +6852,9 @@ const _sfc_main$1 = defineComponent({
6839
6852
  cellColor,
6840
6853
  dataIndex,
6841
6854
  title,
6842
- tableFilter
6855
+ tableFilter,
6856
+ headerCellAlign,
6857
+ headerCellColor
6843
6858
  } = column;
6844
6859
  if (tableFilter) {
6845
6860
  filterDataIndexList.push(dataIndex);
@@ -6848,6 +6863,17 @@ const _sfc_main$1 = defineComponent({
6848
6863
  column.customFilterDropdown = true;
6849
6864
  column.onFilter = (value, record) => record[dataIndex].toString().toLowerCase().includes(value.toLowerCase());
6850
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
+ });
6851
6877
  column.customCell = (record, rowIndex) => ({
6852
6878
  style: {
6853
6879
  textAlign: cellAlign,
@@ -7231,7 +7257,7 @@ const _sfc_main$1 = defineComponent({
7231
7257
  const _inputValue = unref(column.filterOptionsInputValue).trim();
7232
7258
  if (Array.isArray(filterOptions)) {
7233
7259
  filterOptions = filterOptions.filter((filterOption) => {
7234
- if (filterOption.label) {
7260
+ if (typeof filterOption.label === "string") {
7235
7261
  return filterOption.label.toLowerCase().includes(_inputValue.toLowerCase());
7236
7262
  }
7237
7263
  return true;
@@ -7266,7 +7292,7 @@ const _sfc_main$1 = defineComponent({
7266
7292
  };
7267
7293
  }
7268
7294
  });
7269
- const Table_vue_vue_type_style_index_0_scoped_915e7876_lang = "";
7295
+ const Table_vue_vue_type_style_index_0_scoped_2403ec91_lang = "";
7270
7296
  const Table_vue_vue_type_style_index_1_lang = "";
7271
7297
  const _hoisted_1$1 = /* @__PURE__ */ createTextVNode(" \u641C\u7D22 ");
7272
7298
  const _hoisted_2 = /* @__PURE__ */ createTextVNode(" \u91CD\u7F6E ");
@@ -7305,19 +7331,6 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7305
7331
  pagination: _ctx.pagination,
7306
7332
  onChange: _ctx.tableChange
7307
7333
  }, {
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
7334
  customFilterDropdown: withCtx(({ column, selectedKeys, setSelectedKeys, confirm, clearFilters }) => [
7322
7335
  createElementVNode("div", {
7323
7336
  class: "ecan-table-filter",
@@ -7354,7 +7367,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7354
7367
  createVNode(_component_a_button, {
7355
7368
  size: "small",
7356
7369
  style: { "width": "90px" },
7357
- onClick: ($event) => _ctx.onResetFilter(clearFilters)
7370
+ onClick: ($event) => _ctx.onResetFilter(clearFilters, column)
7358
7371
  }, {
7359
7372
  default: withCtx(() => [
7360
7373
  _hoisted_2
@@ -7435,7 +7448,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
7435
7448
  }, 8, ["loading"])
7436
7449
  ], 4);
7437
7450
  }
7438
- const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-915e7876"]]);
7451
+ const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-2403ec91"]]);
7439
7452
  const EcanTable = withInstall(Table);
7440
7453
  const mapProps = {
7441
7454
  ...props,