contains和overlaps增加了对单个对象的判定
This commit is contained in:
parent
7d6456ac8e
commit
6005e9aacd
|
|
@ -455,18 +455,18 @@ var TreeStore = /** @class */ (function (_super) {
|
|||
}
|
||||
case '$contains': {
|
||||
// json中的多值查询
|
||||
(0, assert_1.assert)(value instanceof Array);
|
||||
var array_1 = value instanceof Array ? value : [value];
|
||||
return function (row) {
|
||||
var data = (0, lodash_1.get)(row, path);
|
||||
return (0, lodash_1.difference)(value, data).length === 0 || obscurePass(data, option);
|
||||
return (0, lodash_1.difference)(array_1, data).length === 0 || obscurePass(data, option);
|
||||
};
|
||||
}
|
||||
case '$overlaps': {
|
||||
// json中的多值查询
|
||||
(0, assert_1.assert)(value instanceof Array);
|
||||
var array_2 = value instanceof Array ? value : [value];
|
||||
return function (row) {
|
||||
var data = (0, lodash_1.get)(row, path);
|
||||
return (0, lodash_1.intersection)(value, data).length > 0 || obscurePass(data, option);
|
||||
return (0, lodash_1.intersection)(array_2, data).length > 0 || obscurePass(data, option);
|
||||
};
|
||||
}
|
||||
default: {
|
||||
|
|
|
|||
|
|
@ -509,18 +509,18 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
|
|||
}
|
||||
case '$contains': {
|
||||
// json中的多值查询
|
||||
assert(value instanceof Array);
|
||||
const array = value instanceof Array ? value : [value];
|
||||
return (row) => {
|
||||
const data = get(row, path);
|
||||
return difference(value, data).length === 0 || obscurePass(data, option);
|
||||
return difference(array, data).length === 0 || obscurePass(data, option);
|
||||
};
|
||||
}
|
||||
case '$overlaps': {
|
||||
// json中的多值查询
|
||||
assert(value instanceof Array);
|
||||
const array = value instanceof Array ? value : [value];
|
||||
return (row) => {
|
||||
const data = get(row, path);
|
||||
return intersection(value, data).length > 0 || obscurePass(data, option);
|
||||
return intersection(array, data).length > 0 || obscurePass(data, option);
|
||||
};
|
||||
}
|
||||
default: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue