@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.es.js +53 -27
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +53 -27
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +13 -14
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2743,7 +2743,7 @@ const textProps = {
|
|
|
2743
2743
|
alignItems: "center",
|
|
2744
2744
|
variableFontSize: "14px",
|
|
2745
2745
|
data: {},
|
|
2746
|
-
variableDefaultValue: "",
|
|
2746
|
+
variableDefaultValue: "0",
|
|
2747
2747
|
format: ""
|
|
2748
2748
|
};
|
|
2749
2749
|
const textComponentProps = transformToComponentProps(textProps);
|
|
@@ -3195,7 +3195,7 @@ const proportionProps = {
|
|
|
3195
3195
|
strokeTextWidth: "100%",
|
|
3196
3196
|
lineHeight: "26px",
|
|
3197
3197
|
decimalFormat: false,
|
|
3198
|
-
variableDefaultValue: ""
|
|
3198
|
+
variableDefaultValue: "0"
|
|
3199
3199
|
};
|
|
3200
3200
|
const proportionComponentProps = transformToComponentProps(proportionProps);
|
|
3201
3201
|
const proportionEvents = ["refreshData", "click"];
|
|
@@ -3227,47 +3227,68 @@ const _sfc_main$h = defineComponent({
|
|
|
3227
3227
|
immediate: true,
|
|
3228
3228
|
deep: true
|
|
3229
3229
|
});
|
|
3230
|
-
const
|
|
3231
|
-
const value = computed(() => {
|
|
3230
|
+
const myValue = computed(() => {
|
|
3232
3231
|
const data = unref(myData);
|
|
3233
|
-
|
|
3232
|
+
const defaultValue = +props2.variableDefaultValue;
|
|
3233
|
+
if (data == null && !isNaN(defaultValue))
|
|
3234
3234
|
return defaultValue;
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3235
|
+
const variables = props2.text.match(/\{.+\}/g) || [];
|
|
3236
|
+
let value;
|
|
3237
|
+
const valueSet = new Set(Object.values(data));
|
|
3238
|
+
for (let i = 0; i < variables.length; i++) {
|
|
3239
|
+
const variable = variables[i];
|
|
3240
|
+
if (valueSet.has(variables[i])) {
|
|
3241
|
+
value = variable;
|
|
3242
|
+
break;
|
|
3243
|
+
}
|
|
3239
3244
|
}
|
|
3240
|
-
|
|
3245
|
+
if (typeof value === "string" && !isNaN(+value)) {
|
|
3246
|
+
value = +value;
|
|
3247
|
+
} else if (!isNaN(defaultValue)) {
|
|
3248
|
+
value = defaultValue;
|
|
3249
|
+
} else {
|
|
3250
|
+
value = 0;
|
|
3251
|
+
}
|
|
3252
|
+
value = value * 100;
|
|
3253
|
+
if (props2.decimalFormat) {
|
|
3254
|
+
value = +value.toFixed(2);
|
|
3255
|
+
}
|
|
3256
|
+
return value;
|
|
3241
3257
|
});
|
|
3242
3258
|
const text = computed(() => {
|
|
3259
|
+
var _a2;
|
|
3243
3260
|
let text2 = props2.text;
|
|
3261
|
+
if (text2 === "")
|
|
3262
|
+
return unref(myValue);
|
|
3263
|
+
const defaultValue = props2.variableDefaultValue;
|
|
3244
3264
|
const data = unref(myData);
|
|
3245
3265
|
const variables = text2.match(/\{.+\}/g) || [];
|
|
3246
|
-
|
|
3247
|
-
return unref(value) + "%";
|
|
3248
|
-
for (let i = 0; i < (variables == null ? void 0 : variables.length); i++) {
|
|
3266
|
+
for (let i = 0; i < variables.length; i++) {
|
|
3249
3267
|
const variable = variables[i];
|
|
3250
3268
|
let statement = variable.slice(1, variable.length - 1);
|
|
3251
|
-
const textVariables = statement.match(
|
|
3269
|
+
const textVariables = statement.match(/.*/g);
|
|
3252
3270
|
for (let j = 0; j < (textVariables == null ? void 0 : textVariables.length); j++) {
|
|
3253
|
-
const textVariable = textVariables[i];
|
|
3271
|
+
const textVariable = (_a2 = textVariables[i]) == null ? void 0 : _a2.trim();
|
|
3254
3272
|
if (data[textVariable] != null) {
|
|
3255
3273
|
statement = statement.replace(textVariable, data[textVariable]);
|
|
3256
3274
|
} else {
|
|
3257
|
-
statement = statement.replace(textVariable,
|
|
3275
|
+
statement = statement.replace(textVariable, defaultValue);
|
|
3258
3276
|
}
|
|
3259
3277
|
}
|
|
3260
3278
|
let usedVariable = statement;
|
|
3261
3279
|
try {
|
|
3262
|
-
if (
|
|
3280
|
+
if (/\w+[+\-*/%]+\w+/g.test(statement)) {
|
|
3263
3281
|
const eval2 = eval;
|
|
3264
3282
|
usedVariable = eval2(statement);
|
|
3265
3283
|
}
|
|
3266
3284
|
} catch (e) {
|
|
3267
3285
|
console.error(e);
|
|
3268
3286
|
}
|
|
3269
|
-
if (
|
|
3270
|
-
usedVariable = usedVariable
|
|
3287
|
+
if (typeof usedVariable === "number" || !isNaN(+usedVariable)) {
|
|
3288
|
+
usedVariable = +usedVariable * 100;
|
|
3289
|
+
if (props2.decimalFormat) {
|
|
3290
|
+
usedVariable = usedVariable.toFixed(2);
|
|
3291
|
+
}
|
|
3271
3292
|
}
|
|
3272
3293
|
text2 = text2.replace(variable, usedVariable + "");
|
|
3273
3294
|
}
|
|
@@ -3306,7 +3327,7 @@ const _sfc_main$h = defineComponent({
|
|
|
3306
3327
|
style: style2,
|
|
3307
3328
|
myWidth,
|
|
3308
3329
|
text,
|
|
3309
|
-
|
|
3330
|
+
myValue,
|
|
3310
3331
|
loading,
|
|
3311
3332
|
click
|
|
3312
3333
|
};
|
|
@@ -3321,7 +3342,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3321
3342
|
}, [
|
|
3322
3343
|
createVNode(_component_a_progress, {
|
|
3323
3344
|
class: "progress",
|
|
3324
|
-
percent: _ctx.
|
|
3345
|
+
percent: _ctx.myValue,
|
|
3325
3346
|
width: _ctx.myWidth,
|
|
3326
3347
|
type: _ctx.strokeType,
|
|
3327
3348
|
strokeColor: _ctx.strokeColor,
|
|
@@ -3351,7 +3372,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3351
3372
|
}, 8, ["percent", "width", "type", "strokeColor", "strokeLinecap", "trailColor", "strokeWidth", "gapDegree", "onClick"])
|
|
3352
3373
|
], 4);
|
|
3353
3374
|
}
|
|
3354
|
-
const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-
|
|
3375
|
+
const Proportion = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-95ca32ca"]]);
|
|
3355
3376
|
const EcanProportion = withInstall(Proportion);
|
|
3356
3377
|
const inputProps = {
|
|
3357
3378
|
...props,
|
|
@@ -4920,7 +4941,8 @@ const _sfc_main$8 = defineComponent({
|
|
|
4920
4941
|
},
|
|
4921
4942
|
components: {
|
|
4922
4943
|
Spin,
|
|
4923
|
-
Echarts
|
|
4944
|
+
Echarts,
|
|
4945
|
+
AModal: Modal$1
|
|
4924
4946
|
},
|
|
4925
4947
|
setup(props2) {
|
|
4926
4948
|
const style2 = usePickComponentStyle(props2);
|
|
@@ -5937,6 +5959,7 @@ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4
|
|
|
5937
5959
|
const EcanModal = withInstall(Modal);
|
|
5938
5960
|
const tabsProps = {
|
|
5939
5961
|
...props,
|
|
5962
|
+
tabHorizontalPadding: "0px",
|
|
5940
5963
|
type: "ecanTabs",
|
|
5941
5964
|
name: "\u6807\u7B7E\u9875",
|
|
5942
5965
|
keyName: "\u6807\u7B7E\u9875",
|
|
@@ -6021,7 +6044,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
6021
6044
|
};
|
|
6022
6045
|
}
|
|
6023
6046
|
});
|
|
6024
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
6047
|
+
const _withScopeId = (n) => (pushScopeId("data-v-019ea41f"), n = n(), popScopeId(), n);
|
|
6025
6048
|
const _hoisted_1$3 = ["onClick"];
|
|
6026
6049
|
const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "tabs-content" }, null, -1));
|
|
6027
6050
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -6039,6 +6062,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6039
6062
|
return openBlock(), createElementBlock("div", {
|
|
6040
6063
|
class: "tab",
|
|
6041
6064
|
style: normalizeStyle({
|
|
6065
|
+
padding: `5px ${_ctx.tabHorizontalPadding}`,
|
|
6042
6066
|
color: _ctx.isActive(index2) ? _ctx.activeTabColor : _ctx.tabColor,
|
|
6043
6067
|
backgroundImage: _ctx.isActive(index2) ? _ctx.useImagePath(_ctx.activeTabBackgroundImage, true) : _ctx.useImagePath(_ctx.tabBackgroundImage, true),
|
|
6044
6068
|
marginRight: _ctx.tabBarGutter
|
|
@@ -6049,7 +6073,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6049
6073
|
createElementVNode("div", {
|
|
6050
6074
|
class: "tab-inner",
|
|
6051
6075
|
style: normalizeStyle({
|
|
6052
|
-
borderBottom: `1px solid ${_ctx.isActive(index2) ? _ctx.activeTabColor : "transparent"}`
|
|
6076
|
+
borderBottom: !_ctx.activeTabBackgroundImage && !_ctx.tabBackgroundImage ? `1px solid ${_ctx.isActive(index2) ? _ctx.activeTabColor : "transparent"}` : ""
|
|
6053
6077
|
})
|
|
6054
6078
|
}, toDisplayString(tab.title), 5)
|
|
6055
6079
|
], 12, _hoisted_1$3);
|
|
@@ -6058,7 +6082,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6058
6082
|
_hoisted_2$1
|
|
6059
6083
|
], 4);
|
|
6060
6084
|
}
|
|
6061
|
-
const Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-
|
|
6085
|
+
const Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-019ea41f"]]);
|
|
6062
6086
|
const EcanTabs = withInstall(Tabs);
|
|
6063
6087
|
const imageProps = {
|
|
6064
6088
|
...props,
|
|
@@ -6086,6 +6110,8 @@ const _sfc_main$2 = defineComponent({
|
|
|
6086
6110
|
pageMode: "normal"
|
|
6087
6111
|
});
|
|
6088
6112
|
const onClick = () => {
|
|
6113
|
+
if (!props2.linkPage && !props2.href)
|
|
6114
|
+
return;
|
|
6089
6115
|
const linkPage = props2.linkPage || "";
|
|
6090
6116
|
const pageUrl = usePageUrl(unref(pageMode), linkPage);
|
|
6091
6117
|
const href = props2.href;
|
|
@@ -6123,7 +6149,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6123
6149
|
style: normalizeStyle(_ctx.style)
|
|
6124
6150
|
}, " \u8BF7\u4E0A\u4F20\u56FE\u7247 ", 4));
|
|
6125
6151
|
}
|
|
6126
|
-
const Image = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-
|
|
6152
|
+
const Image = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-ab94aeb2"]]);
|
|
6127
6153
|
const EcanImage = withInstall(Image);
|
|
6128
6154
|
const tableProps = {
|
|
6129
6155
|
...props,
|