@ecan-bi/datav 1.0.86 → 1.0.87
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 +16 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +16 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/datav@1.0.
|
|
1
|
+
/*! @ecan-bi/datav@1.0.87 */
|
|
2
2
|
var _a, _b, _c;
|
|
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, toDisplayString, Fragment, renderList, createElementVNode, normalizeClass, pushScopeId, popScopeId, createSlots, resolveDynamicComponent, mergeProps, withModifiers, withDirectives, vShow } from "vue";
|
|
4
4
|
import { throttle, init, use, registerMap } from "echarts/core";
|
|
@@ -2213,23 +2213,29 @@ const useValueFormatter = (formatter, value) => {
|
|
|
2213
2213
|
if (formatter == null)
|
|
2214
2214
|
return value;
|
|
2215
2215
|
const variables = formatter.match(/\{.*\}/g);
|
|
2216
|
-
if (variables == null || variables.length === 0)
|
|
2216
|
+
if (variables == null || variables.length === 0) {
|
|
2217
2217
|
return value;
|
|
2218
|
+
}
|
|
2218
2219
|
for (let i = 0; i < variables.length; i++) {
|
|
2219
2220
|
const variable = variables[i];
|
|
2220
2221
|
if (variable == null || variable === "")
|
|
2221
2222
|
break;
|
|
2222
2223
|
let statement = variable.slice(1, -1);
|
|
2223
2224
|
statement = statement == null ? void 0 : statement.replace(/value/g, value);
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
result =
|
|
2225
|
+
if (/[+\-*/%]+/g.test(value)) {
|
|
2226
|
+
formatter = formatter.replace(variable, statement);
|
|
2227
|
+
} else {
|
|
2228
|
+
try {
|
|
2229
|
+
let result = statement;
|
|
2230
|
+
if (/[+\-*/%]+/g.test(statement)) {
|
|
2231
|
+
const eval2 = eval;
|
|
2232
|
+
result = eval2(statement);
|
|
2233
|
+
}
|
|
2234
|
+
formatter = formatter.replace(variable, result);
|
|
2235
|
+
} catch (e) {
|
|
2236
|
+
console.error(e);
|
|
2237
|
+
return value;
|
|
2229
2238
|
}
|
|
2230
|
-
formatter = formatter.replace(variable, result);
|
|
2231
|
-
} catch (e) {
|
|
2232
|
-
console.error(e);
|
|
2233
2239
|
}
|
|
2234
2240
|
}
|
|
2235
2241
|
return formatter;
|