@ecan-bi/datav 1.0.81 → 1.0.83

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 CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/datav@1.0.81 */
1
+ /*! @ecan-bi/datav@1.0.83 */
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";
@@ -1713,13 +1713,22 @@ const useRequestData = (props2, callBack = () => {
1713
1713
  record = getGlobalModel(id) || {};
1714
1714
  }
1715
1715
  const p = unref(record[prop]);
1716
- const isNeedFormat = ["date", "range"].some((item) => lowerCaseIncludes(record == null ? void 0 : record.type, item));
1717
1716
  let v = "";
1717
+ const isNeedFormat = ["date", "range"].some((item) => lowerCaseIncludes(record == null ? void 0 : record.type, item));
1718
1718
  if (isNeedFormat) {
1719
1719
  v = ((_a2 = unref(p)) == null ? void 0 : _a2.format((propKey == null ? void 0 : propKey.trim()) || record.format)) || "";
1720
1720
  } else {
1721
- v = p != null && typeof p === "object" ? p[propKey || "value"] : p;
1721
+ if (Object.prototype.toString.call(p) === "[object Object]") {
1722
+ v = p[propKey || "value"];
1723
+ } else if (Array.isArray(p)) {
1724
+ v = p.join(",");
1725
+ } else {
1726
+ v = p;
1727
+ }
1728
+ console.log(p);
1729
+ console.log("v", v);
1722
1730
  }
1731
+ console.log("v", v);
1723
1732
  _params[key] = v;
1724
1733
  } else if (typeof value === "string") {
1725
1734
  _params[key] = useVariablesInText(value);
@@ -3565,9 +3574,17 @@ const _sfc_main$f = defineComponent({
3565
3574
  const myValue = ref(props2.value || props2.data[0]);
3566
3575
  const dataFieldNames = props2.dataFieldNames;
3567
3576
  const filterOption = (input, option) => {
3568
- var _a2;
3569
3577
  const labelKey = dataFieldNames.label;
3570
- return ((_a2 = option[labelKey]) == null ? void 0 : _a2.toLowerCase().indexOf(input == null ? void 0 : input.toLowerCase())) >= 0;
3578
+ const valueKey = dataFieldNames.value;
3579
+ let value;
3580
+ const labelValue = option[labelKey];
3581
+ const valueValue = option[valueKey];
3582
+ if (labelValue != null) {
3583
+ value = labelValue;
3584
+ } else if (valueValue != null) {
3585
+ value = valueValue;
3586
+ }
3587
+ return !!((value == null ? void 0 : value.toLowerCase().indexOf(input == null ? void 0 : input.toLowerCase())) >= 0);
3571
3588
  };
3572
3589
  const handleRequestData = async () => {
3573
3590
  var _a2, _b2;
@@ -3630,7 +3647,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
3630
3647
  }, null, 8, ["value", "options", "getPopupContainer", "field-names", "filter-option", "onChange"])
3631
3648
  ], 4);
3632
3649
  }
3633
- const Select = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-0a8df5d2"]]);
3650
+ const Select = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-5e92066a"]]);
3634
3651
  const EcanSelect = withInstall(Select);
3635
3652
  const rangePickerProps = {
3636
3653
  ...props,
@@ -3814,7 +3831,7 @@ const checkboxProps = {
3814
3831
  keyName: "\u590D\u9009\u6846",
3815
3832
  rotate: "",
3816
3833
  type: "ecanCheckbox",
3817
- value: "",
3834
+ value: [],
3818
3835
  data: [
3819
3836
  { label: "\u9009\u9879\u4E00", value: "1", checked: true },
3820
3837
  { label: "\u9009\u9879\u4E8C", value: "2", checked: true },
@@ -3836,15 +3853,20 @@ const _sfc_main$c = defineComponent({
3836
3853
  const style2 = usePickComponentStyle(props2);
3837
3854
  const myOption = ref([]);
3838
3855
  const myValue = ref([]);
3839
- watch(() => props2.data, (data) => {
3840
- const value = [];
3856
+ watch(() => [props2.data, props2.value], ([data, value]) => {
3857
+ let _value = [];
3841
3858
  data.forEach((item) => {
3842
3859
  if (item.checked) {
3843
- value.push(item.value);
3860
+ _value.push(item.value);
3844
3861
  }
3845
3862
  });
3863
+ if (typeof value === "string" && value !== "") {
3864
+ _value = _value.concat(value.split(","));
3865
+ } else if (Array.isArray(value)) {
3866
+ _value = _value.concat(value);
3867
+ }
3846
3868
  myOption.value = data;
3847
- myValue.value = value;
3869
+ myValue.value = _value;
3848
3870
  }, {
3849
3871
  immediate: true,
3850
3872
  deep: true