@ecan-bi/datav 1.0.63 → 1.0.66

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
@@ -2749,7 +2749,7 @@
2749
2749
  alignItems: "center",
2750
2750
  variableFontSize: "14px",
2751
2751
  data: {},
2752
- variableDefaultValue: "",
2752
+ variableDefaultValue: "0",
2753
2753
  format: ""
2754
2754
  };
2755
2755
  const textComponentProps = transformToComponentProps(textProps);
@@ -3201,7 +3201,7 @@
3201
3201
  strokeTextWidth: "100%",
3202
3202
  lineHeight: "26px",
3203
3203
  decimalFormat: false,
3204
- variableDefaultValue: ""
3204
+ variableDefaultValue: "0"
3205
3205
  };
3206
3206
  const proportionComponentProps = transformToComponentProps(proportionProps);
3207
3207
  const proportionEvents = ["refreshData", "click"];
@@ -3233,47 +3233,68 @@
3233
3233
  immediate: true,
3234
3234
  deep: true
3235
3235
  });
3236
- const defaultValue = 0;
3237
- const value = vue.computed(() => {
3236
+ const myValue = vue.computed(() => {
3238
3237
  const data = vue.unref(myData);
3239
- if (data == null)
3238
+ const defaultValue = +props2.variableDefaultValue;
3239
+ if (data == null && !isNaN(defaultValue))
3240
3240
  return defaultValue;
3241
- const values = Object.values(data);
3242
- const value2 = values[0] * 100;
3243
- if (!isNaN(value2)) {
3244
- return props2.decimalFormat ? value2.toFixed(2) : value2;
3241
+ const variables = props2.text.match(/\{.+\}/g) || [];
3242
+ let value;
3243
+ const valueSet = new Set(Object.values(data));
3244
+ for (let i = 0; i < variables.length; i++) {
3245
+ const variable = variables[i];
3246
+ if (valueSet.has(variables[i])) {
3247
+ value = variable;
3248
+ break;
3249
+ }
3245
3250
  }
3246
- return 0;
3251
+ if (typeof value === "string" && !isNaN(+value)) {
3252
+ value = +value;
3253
+ } else if (!isNaN(defaultValue)) {
3254
+ value = defaultValue;
3255
+ } else {
3256
+ value = 0;
3257
+ }
3258
+ value = value * 100;
3259
+ if (props2.decimalFormat) {
3260
+ value = +value.toFixed(2);
3261
+ }
3262
+ return value;
3247
3263
  });
3248
3264
  const text = vue.computed(() => {
3265
+ var _a2;
3249
3266
  let text2 = props2.text;
3267
+ if (text2 === "")
3268
+ return vue.unref(myValue);
3269
+ const defaultValue = props2.variableDefaultValue;
3250
3270
  const data = vue.unref(myData);
3251
3271
  const variables = text2.match(/\{.+\}/g) || [];
3252
- if (text2 === "")
3253
- return vue.unref(value) + "%";
3254
- for (let i = 0; i < (variables == null ? void 0 : variables.length); i++) {
3272
+ for (let i = 0; i < variables.length; i++) {
3255
3273
  const variable = variables[i];
3256
3274
  let statement = variable.slice(1, variable.length - 1);
3257
- const textVariables = statement.match(/[a-zA-Z]\w*/g);
3275
+ const textVariables = statement.match(/.*/g);
3258
3276
  for (let j = 0; j < (textVariables == null ? void 0 : textVariables.length); j++) {
3259
- const textVariable = textVariables[i];
3277
+ const textVariable = (_a2 = textVariables[i]) == null ? void 0 : _a2.trim();
3260
3278
  if (data[textVariable] != null) {
3261
3279
  statement = statement.replace(textVariable, data[textVariable]);
3262
3280
  } else {
3263
- statement = statement.replace(textVariable, props2.variableDefaultValue);
3281
+ statement = statement.replace(textVariable, defaultValue);
3264
3282
  }
3265
3283
  }
3266
3284
  let usedVariable = statement;
3267
3285
  try {
3268
- if (/[+\-*/%]+/g.test(statement)) {
3286
+ if (/\w+[+\-*/%]+\w+/g.test(statement)) {
3269
3287
  const eval2 = eval;
3270
3288
  usedVariable = eval2(statement);
3271
3289
  }
3272
3290
  } catch (e) {
3273
3291
  console.error(e);
3274
3292
  }
3275
- if (props2.decimalFormat) {
3276
- usedVariable = usedVariable == null ? void 0 : usedVariable.toFixed(2);
3293
+ if (typeof usedVariable === "number" || !isNaN(+usedVariable)) {
3294
+ usedVariable = +usedVariable * 100;
3295
+ if (props2.decimalFormat) {
3296
+ usedVariable = usedVariable.toFixed(2);
3297
+ }
3277
3298
  }
3278
3299
  text2 = text2.replace(variable, usedVariable + "");
3279
3300
  }
@@ -3312,7 +3333,7 @@
3312
3333
  style: style2,
3313
3334
  myWidth,
3314
3335
  text,
3315
- value,
3336
+ myValue,
3316
3337
  loading,
3317
3338
  click
3318
3339
  };
@@ -3327,7 +3348,7 @@
3327
3348
  }, [
3328
3349
  vue.createVNode(_component_a_progress, {
3329
3350
  class: "progress",
3330
- percent: _ctx.value,
3351
+ percent: _ctx.myValue,
3331
3352
  width: _ctx.myWidth,
3332
3353
  type: _ctx.strokeType,
3333
3354
  strokeColor: _ctx.strokeColor,
@@ -3357,7 +3378,7 @@
3357
3378
  }, 8, ["percent", "width", "type", "strokeColor", "strokeLinecap", "trailColor", "strokeWidth", "gapDegree", "onClick"])
3358
3379
  ], 4);
3359
3380
  }
3360
- const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-5758f39c"]]);
3381
+ const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-95ca32ca"]]);
3361
3382
  const EcanProportion = withInstall(Proportion);
3362
3383
  const inputProps = {
3363
3384
  ...props,
@@ -4926,7 +4947,8 @@
4926
4947
  },
4927
4948
  components: {
4928
4949
  Spin,
4929
- Echarts
4950
+ Echarts,
4951
+ AModal: antDesignVue.Modal
4930
4952
  },
4931
4953
  setup(props2) {
4932
4954
  const style2 = usePickComponentStyle(props2);
@@ -5943,6 +5965,7 @@
5943
5965
  const EcanModal = withInstall(Modal);
5944
5966
  const tabsProps = {
5945
5967
  ...props,
5968
+ tabHorizontalPadding: "0px",
5946
5969
  type: "ecanTabs",
5947
5970
  name: "\u6807\u7B7E\u9875",
5948
5971
  keyName: "\u6807\u7B7E\u9875",
@@ -6027,7 +6050,7 @@
6027
6050
  };
6028
6051
  }
6029
6052
  });
6030
- const _withScopeId = (n) => (vue.pushScopeId("data-v-20bbeaac"), n = n(), vue.popScopeId(), n);
6053
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-019ea41f"), n = n(), vue.popScopeId(), n);
6031
6054
  const _hoisted_1$3 = ["onClick"];
6032
6055
  const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "tabs-content" }, null, -1));
6033
6056
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
@@ -6045,6 +6068,7 @@
6045
6068
  return vue.openBlock(), vue.createElementBlock("div", {
6046
6069
  class: "tab",
6047
6070
  style: vue.normalizeStyle({
6071
+ padding: `5px ${_ctx.tabHorizontalPadding}`,
6048
6072
  color: _ctx.isActive(index2) ? _ctx.activeTabColor : _ctx.tabColor,
6049
6073
  backgroundImage: _ctx.isActive(index2) ? _ctx.useImagePath(_ctx.activeTabBackgroundImage, true) : _ctx.useImagePath(_ctx.tabBackgroundImage, true),
6050
6074
  marginRight: _ctx.tabBarGutter
@@ -6055,7 +6079,7 @@
6055
6079
  vue.createElementVNode("div", {
6056
6080
  class: "tab-inner",
6057
6081
  style: vue.normalizeStyle({
6058
- borderBottom: `1px solid ${_ctx.isActive(index2) ? _ctx.activeTabColor : "transparent"}`
6082
+ borderBottom: !_ctx.activeTabBackgroundImage && !_ctx.tabBackgroundImage ? `1px solid ${_ctx.isActive(index2) ? _ctx.activeTabColor : "transparent"}` : ""
6059
6083
  })
6060
6084
  }, vue.toDisplayString(tab.title), 5)
6061
6085
  ], 12, _hoisted_1$3);
@@ -6064,7 +6088,7 @@
6064
6088
  _hoisted_2$1
6065
6089
  ], 4);
6066
6090
  }
6067
- const Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-20bbeaac"]]);
6091
+ const Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-019ea41f"]]);
6068
6092
  const EcanTabs = withInstall(Tabs);
6069
6093
  const imageProps = {
6070
6094
  ...props,
@@ -6092,6 +6116,8 @@
6092
6116
  pageMode: "normal"
6093
6117
  });
6094
6118
  const onClick = () => {
6119
+ if (!props2.linkPage && !props2.href)
6120
+ return;
6095
6121
  const linkPage = props2.linkPage || "";
6096
6122
  const pageUrl = usePageUrl(vue.unref(pageMode), linkPage);
6097
6123
  const href = props2.href;
@@ -6129,7 +6155,7 @@
6129
6155
  style: vue.normalizeStyle(_ctx.style)
6130
6156
  }, " \u8BF7\u4E0A\u4F20\u56FE\u7247 ", 4));
6131
6157
  }
6132
- const Image = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-4511899d"]]);
6158
+ const Image = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-ab94aeb2"]]);
6133
6159
  const EcanImage = withInstall(Image);
6134
6160
  const tableProps = {
6135
6161
  ...props,