@nokecy/qc-ui 1.0.27 → 1.0.28

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.
@@ -33,7 +33,17 @@ var getFilter = function getFilter(objectKey, value, colDef) {
33
33
  return "".concat(objectKey, " = ").concat(value);
34
34
  }
35
35
  if (value instanceof Array) {
36
- return "".concat(objectKey, " >= ").concat((0, _dayjs.default)(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat((0, _dayjs.default)(value[1]).add(1, 'days').format("YYYY-MM-DD"));
36
+ // 处理时间数组
37
+ if (value.length === 2 && value.every(function (v) {
38
+ return (0, _dayjs.default)(v).isValid();
39
+ })) {
40
+ return "".concat(objectKey, " >= ").concat((0, _dayjs.default)(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat((0, _dayjs.default)(value[1]).add(1, 'days').format("YYYY-MM-DD"));
41
+ }
42
+
43
+ // 处理非时间数组(如数字数组),转为 "asnStatus=10|asnStatus=20"
44
+ return "".concat(value.map(function (v) {
45
+ return "".concat(objectKey, "=").concat(v);
46
+ }).join('|'));
37
47
  }
38
48
  var items = [];
39
49
  getObjectFilter(value, objectKey, items, colDef);
@@ -26,7 +26,17 @@ var getFilter = function getFilter(objectKey, value, colDef) {
26
26
  return "".concat(objectKey, " = ").concat(value);
27
27
  }
28
28
  if (value instanceof Array) {
29
- return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD"));
29
+ // 处理时间数组
30
+ if (value.length === 2 && value.every(function (v) {
31
+ return dayjs(v).isValid();
32
+ })) {
33
+ return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD"));
34
+ }
35
+
36
+ // 处理非时间数组(如数字数组),转为 "asnStatus=10|asnStatus=20"
37
+ return "".concat(value.map(function (v) {
38
+ return "".concat(objectKey, "=").concat(v);
39
+ }).join('|'));
30
40
  }
31
41
  var items = [];
32
42
  getObjectFilter(value, objectKey, items, colDef);