@nokecy/qc-ui 0.1.22 → 0.1.24
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.
|
@@ -29,7 +29,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
29
|
|
|
30
30
|
var getFilter = function getFilter(objectKey, value) {
|
|
31
31
|
if (typeof value === 'string') {
|
|
32
|
-
return "".concat(objectKey, " =* ").concat(value);
|
|
32
|
+
return value != "" ? "".concat(objectKey, " =* ").concat(value) : "";
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (typeof value === 'number') {
|
|
@@ -44,31 +44,34 @@ var getFilter = function getFilter(objectKey, value) {
|
|
|
44
44
|
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"));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
var items = [];
|
|
48
|
+
getObjectFilter(value, objectKey, items);
|
|
49
|
+
return items.join(",");
|
|
48
50
|
};
|
|
49
51
|
|
|
50
|
-
var getObjectFilter = function getObjectFilter(obj, objKey) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
var getObjectFilter = function getObjectFilter(obj, objKey, items) {
|
|
53
|
+
Object.keys(obj).map(function (key) {
|
|
54
|
+
var value = obj[key];
|
|
55
|
+
var objectKey = "".concat(objKey, ".").concat(key);
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
if (typeof value === 'number') {
|
|
58
|
+
items.push("".concat(objectKey, " = ").concat(value));
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
if (typeof value === 'string') {
|
|
62
|
+
value && value != "" && items.push("".concat(objectKey, " =* ").concat(value));
|
|
63
|
+
}
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
if (typeof value === 'boolean') {
|
|
66
|
+
items.push("".concat(objectKey, " = ").concat(value));
|
|
67
|
+
}
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
if (value instanceof Array) {
|
|
70
|
+
items.push("".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")));
|
|
71
|
+
}
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
if (value instanceof Object) items.push(getObjectFilter(value, "".concat(objKey, ".").concat(key), items));
|
|
74
|
+
});
|
|
72
75
|
};
|
|
73
76
|
|
|
74
77
|
var convertFilterModel = function convertFilterModel(filterModel) {
|
|
@@ -20,7 +20,7 @@ import dayjs from 'dayjs';
|
|
|
20
20
|
|
|
21
21
|
var getFilter = function getFilter(objectKey, value) {
|
|
22
22
|
if (typeof value === 'string') {
|
|
23
|
-
return "".concat(objectKey, " =* ").concat(value);
|
|
23
|
+
return value != "" ? "".concat(objectKey, " =* ").concat(value) : "";
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if (typeof value === 'number') {
|
|
@@ -35,31 +35,34 @@ var getFilter = function getFilter(objectKey, value) {
|
|
|
35
35
|
return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD"));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
var items = [];
|
|
39
|
+
getObjectFilter(value, objectKey, items);
|
|
40
|
+
return items.join(",");
|
|
39
41
|
};
|
|
40
42
|
|
|
41
|
-
var getObjectFilter = function getObjectFilter(obj, objKey) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
var getObjectFilter = function getObjectFilter(obj, objKey, items) {
|
|
44
|
+
Object.keys(obj).map(function (key) {
|
|
45
|
+
var value = obj[key];
|
|
46
|
+
var objectKey = "".concat(objKey, ".").concat(key);
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
if (typeof value === 'number') {
|
|
49
|
+
items.push("".concat(objectKey, " = ").concat(value));
|
|
50
|
+
}
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (typeof value === 'string') {
|
|
53
|
+
value && value != "" && items.push("".concat(objectKey, " =* ").concat(value));
|
|
54
|
+
}
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
if (typeof value === 'boolean') {
|
|
57
|
+
items.push("".concat(objectKey, " = ").concat(value));
|
|
58
|
+
}
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
if (value instanceof Array) {
|
|
61
|
+
items.push("".concat(objectKey, " >= ").concat(dayjs(value[0]).format("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD")));
|
|
62
|
+
}
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
if (value instanceof Object) items.push(getObjectFilter(value, "".concat(objKey, ".").concat(key), items));
|
|
65
|
+
});
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
var convertFilterModel = function convertFilterModel(filterModel) {
|