@ecan-bi/datav 1.0.85 → 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 +30 -34
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +30 -34
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
- package/types/control/date-picker/DatePicker.vue.d.ts +59 -1
- package/types/control/date-picker/index.d.ts +59 -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";
|
|
@@ -1720,15 +1720,10 @@ const useRequestData = (props2, callBack = () => {
|
|
|
1720
1720
|
} else {
|
|
1721
1721
|
if (Object.prototype.toString.call(p) === "[object Object]") {
|
|
1722
1722
|
v = p[propKey || "value"];
|
|
1723
|
-
} else if (Array.isArray(p)) {
|
|
1724
|
-
v = p.join(",");
|
|
1725
1723
|
} else {
|
|
1726
1724
|
v = p;
|
|
1727
1725
|
}
|
|
1728
|
-
console.log(p);
|
|
1729
|
-
console.log("v", v);
|
|
1730
1726
|
}
|
|
1731
|
-
console.log("v", v);
|
|
1732
1727
|
_params[key] = v;
|
|
1733
1728
|
} else if (typeof value === "string") {
|
|
1734
1729
|
_params[key] = useVariablesInText(value);
|
|
@@ -2218,23 +2213,29 @@ const useValueFormatter = (formatter, value) => {
|
|
|
2218
2213
|
if (formatter == null)
|
|
2219
2214
|
return value;
|
|
2220
2215
|
const variables = formatter.match(/\{.*\}/g);
|
|
2221
|
-
if (variables == null || variables.length === 0)
|
|
2216
|
+
if (variables == null || variables.length === 0) {
|
|
2222
2217
|
return value;
|
|
2218
|
+
}
|
|
2223
2219
|
for (let i = 0; i < variables.length; i++) {
|
|
2224
2220
|
const variable = variables[i];
|
|
2225
2221
|
if (variable == null || variable === "")
|
|
2226
2222
|
break;
|
|
2227
2223
|
let statement = variable.slice(1, -1);
|
|
2228
2224
|
statement = statement == null ? void 0 : statement.replace(/value/g, value);
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
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;
|
|
2234
2238
|
}
|
|
2235
|
-
formatter = formatter.replace(variable, result);
|
|
2236
|
-
} catch (e) {
|
|
2237
|
-
console.error(e);
|
|
2238
2239
|
}
|
|
2239
2240
|
}
|
|
2240
2241
|
return formatter;
|
|
@@ -3477,8 +3478,7 @@ const datePickerProps = {
|
|
|
3477
3478
|
};
|
|
3478
3479
|
const datePickerComponentProps = transformToComponentProps(datePickerProps);
|
|
3479
3480
|
const datePickerEvents = ["dateChange"];
|
|
3480
|
-
const
|
|
3481
|
-
const DatePicker_vue_vue_type_style_index_1_lang = "";
|
|
3481
|
+
const DatePicker_vue_vue_type_style_index_0_lang = "";
|
|
3482
3482
|
const _sfc_main$g = defineComponent({
|
|
3483
3483
|
name: "EcanDatePicker",
|
|
3484
3484
|
props: {
|
|
@@ -3490,7 +3490,12 @@ const _sfc_main$g = defineComponent({
|
|
|
3490
3490
|
setup(props2) {
|
|
3491
3491
|
const style2 = usePickComponentStyle(props2);
|
|
3492
3492
|
const getPopupContainer = () => document.getElementById("ProviderConfig") || document.body;
|
|
3493
|
-
const myValue =
|
|
3493
|
+
const myValue = ref(null);
|
|
3494
|
+
watch(() => props2.value, () => {
|
|
3495
|
+
myValue.value = props2.value ? dayjs(props2.value) : null;
|
|
3496
|
+
}, {
|
|
3497
|
+
immediate: true
|
|
3498
|
+
});
|
|
3494
3499
|
const { setGlobalModel } = inject(GLOBAL_MODEL, {
|
|
3495
3500
|
setGlobalModel: (key, value) => void 0
|
|
3496
3501
|
});
|
|
@@ -3534,7 +3539,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3534
3539
|
}, null, 8, ["value", "format", "picker", "showTime", "locale", "onChange", "getPopupContainer"])
|
|
3535
3540
|
], 4);
|
|
3536
3541
|
}
|
|
3537
|
-
const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g]
|
|
3542
|
+
const DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g]]);
|
|
3538
3543
|
const EcanDatePicker = withInstall(DatePicker);
|
|
3539
3544
|
const selectProps = {
|
|
3540
3545
|
...props,
|
|
@@ -3853,7 +3858,8 @@ const _sfc_main$c = defineComponent({
|
|
|
3853
3858
|
const style2 = usePickComponentStyle(props2);
|
|
3854
3859
|
const myOption = ref([]);
|
|
3855
3860
|
const myValue = ref([]);
|
|
3856
|
-
|
|
3861
|
+
const handleDataAndOption = (data) => {
|
|
3862
|
+
const value = props2.value;
|
|
3857
3863
|
let _value = [];
|
|
3858
3864
|
data.forEach((item) => {
|
|
3859
3865
|
if (item.checked) {
|
|
@@ -3867,6 +3873,9 @@ const _sfc_main$c = defineComponent({
|
|
|
3867
3873
|
}
|
|
3868
3874
|
myOption.value = data;
|
|
3869
3875
|
myValue.value = _value;
|
|
3876
|
+
};
|
|
3877
|
+
watch(() => [props2.data, props2.value], ([data]) => {
|
|
3878
|
+
handleDataAndOption(data);
|
|
3870
3879
|
}, {
|
|
3871
3880
|
immediate: true,
|
|
3872
3881
|
deep: true
|
|
@@ -3881,20 +3890,7 @@ const _sfc_main$c = defineComponent({
|
|
|
3881
3890
|
return;
|
|
3882
3891
|
const res = await requestData();
|
|
3883
3892
|
const data = ((_b2 = (_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.rows) || [];
|
|
3884
|
-
|
|
3885
|
-
let _value = [];
|
|
3886
|
-
data.forEach((item) => {
|
|
3887
|
-
if (item.checked) {
|
|
3888
|
-
_value.push(item.value);
|
|
3889
|
-
}
|
|
3890
|
-
});
|
|
3891
|
-
if (typeof value === "string" && value !== "") {
|
|
3892
|
-
_value = _value.concat(value.split(","));
|
|
3893
|
-
} else if (Array.isArray(value)) {
|
|
3894
|
-
_value = _value.concat(value);
|
|
3895
|
-
}
|
|
3896
|
-
myOption.value = data;
|
|
3897
|
-
myValue.value = _value;
|
|
3893
|
+
handleDataAndOption(data);
|
|
3898
3894
|
};
|
|
3899
3895
|
const id = props2.id;
|
|
3900
3896
|
const { getGlobalModel, setGlobalModel } = inject(GLOBAL_MODEL, {
|