@ecan-bi/datav 1.0.53 → 1.0.54

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
@@ -3217,11 +3217,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3217
3217
  fontWeight: 400,
3218
3218
  strokeTextWidth: "100%",
3219
3219
  lineHeight: "26px",
3220
- decimalFormat: false
3220
+ decimalFormat: false,
3221
+ textDefaultValue: ""
3221
3222
  });
3222
3223
  const proportionComponentProps = transformToComponentProps(proportionProps);
3223
3224
  const proportionEvents = ["refreshData", "click"];
3224
- var Proportion_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".ecan-proportion[data-v-f55c66cc] {\n overflow: hidden;\n}\n.progress[data-v-f55c66cc] {\n width: 100%;\n height: 100%;\n}\n.format[data-v-f55c66cc] {\n margin: 0 auto;\n}\n")();
3225
+ var Proportion_vue_vue_type_style_index_0_scoped_true_lang = /* @__PURE__ */ (() => ".ecan-proportion[data-v-f029c988] {\n overflow: hidden;\n}\n.progress[data-v-f029c988] {\n width: 100%;\n height: 100%;\n}\n.format[data-v-f029c988] {\n margin: 0 auto;\n}\n")();
3225
3226
  const _sfc_main$h = vue.defineComponent({
3226
3227
  name: "EcanProportion",
3227
3228
  components: {
@@ -3230,6 +3231,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3230
3231
  },
3231
3232
  props: __spreadValues({}, proportionComponentProps),
3232
3233
  setup(props2) {
3234
+ const { pageMode } = vue.inject(GLOBAL_CONFIG, {
3235
+ pageMode: "normal"
3236
+ });
3233
3237
  const style2 = usePickComponentStyle(props2);
3234
3238
  const myWidth = vue.computed(() => {
3235
3239
  const width = props2.width;
@@ -3259,37 +3263,41 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3259
3263
  const text = vue.computed(() => {
3260
3264
  let text2 = props2.text;
3261
3265
  const data = vue.unref(myData);
3266
+ console.log(data);
3262
3267
  const variables = text2.match(/\{.*\}/g) || [];
3263
- console.log("variables", variables);
3264
3268
  if (text2 === "")
3265
3269
  return vue.unref(value) + "%";
3266
3270
  for (let i = 0; i < variables.length; i++) {
3267
3271
  const variable = variables[i];
3268
3272
  let statement = variable.slice(1, variable.length - 1);
3269
3273
  const textVariables = statement.match(/[a-zA-Z]\w*/g);
3270
- console.log("textVariables", textVariables);
3271
3274
  for (let j = 0; j < textVariables.length; j++) {
3272
3275
  const textVariable = textVariables[i];
3273
3276
  if (data[textVariable] != null) {
3274
3277
  statement = statement.replace(textVariable, data[textVariable]);
3278
+ } else {
3279
+ statement = statement.replace(textVariable, props2.textDefaultValue);
3275
3280
  }
3276
3281
  }
3277
3282
  console.log("statement", statement);
3278
- let usedVariable;
3279
- if (/[+\-*/%]+/g.test(statement)) {
3280
- const eval2 = eval;
3281
- usedVariable = eval2(statement);
3283
+ let usedVariable = statement;
3284
+ try {
3285
+ if (/[+\-*/%]+/g.test(statement)) {
3286
+ const eval2 = eval;
3287
+ usedVariable = eval2(statement);
3288
+ }
3289
+ } catch (e) {
3290
+ console.error(e);
3282
3291
  }
3283
3292
  if (props2.decimalFormat) {
3284
3293
  usedVariable = usedVariable == null ? void 0 : usedVariable.toFixed(2);
3285
3294
  }
3295
+ console.log("usedVariable", usedVariable);
3286
3296
  text2 = text2.replace(variable, usedVariable + "");
3287
3297
  }
3298
+ console.log("text", text2);
3288
3299
  return text2;
3289
3300
  });
3290
- const { pageMode } = vue.inject(GLOBAL_CONFIG, {
3291
- pageMode: "normal"
3292
- });
3293
3301
  const requestData = useRequestData(props2);
3294
3302
  const loading = vue.ref(false);
3295
3303
  const handleRequestData = async () => {
@@ -3368,7 +3376,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3368
3376
  }, 8, ["percent", "width", "type", "strokeColor", "strokeLinecap", "trailColor", "strokeWidth", "gapDegree", "onClick"])
3369
3377
  ], 4);
3370
3378
  }
3371
- var Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-f55c66cc"]]);
3379
+ var Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-f029c988"]]);
3372
3380
  const EcanProportion = withInstall(Proportion);
3373
3381
  const inputProps = __spreadProps(__spreadValues({}, props), {
3374
3382
  width: "200px",