objectPredicate中对路径是根结点的情况容错

This commit is contained in:
Xu Chang 2023-11-30 18:58:32 +08:00
parent fdff94cfcc
commit f00599b840
3 changed files with 6 additions and 6 deletions

View File

@ -493,7 +493,7 @@ export default class TreeStore extends CascadeStore {
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = get(row, path);
const data = path ? get(row, path) : row;
return differenceBy(array, data, (value) => {
if (typeof value === 'object') {
return JSON.stringify(value);
@ -506,7 +506,7 @@ export default class TreeStore extends CascadeStore {
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = get(row, path);
const data = path ? get(row, path) : row;
return intersectionBy(array, data, (value) => {
if (typeof value === 'object') {
return JSON.stringify(value);

View File

@ -495,7 +495,7 @@ class TreeStore extends CascadeStore_1.CascadeStore {
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = (0, lodash_1.get)(row, path);
const data = path ? (0, lodash_1.get)(row, path) : row;
return (0, lodash_1.differenceBy)(array, data, (value) => {
if (typeof value === 'object') {
return JSON.stringify(value);
@ -508,7 +508,7 @@ class TreeStore extends CascadeStore_1.CascadeStore {
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = (0, lodash_1.get)(row, path);
const data = path ? (0, lodash_1.get)(row, path) : row;
return (0, lodash_1.intersectionBy)(array, data, (value) => {
if (typeof value === 'object') {
return JSON.stringify(value);

View File

@ -630,7 +630,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = get(row, path);
const data = path ? get(row, path) : row;
return differenceBy(array, data, (value: any) => {
if (typeof value === 'object') {
return JSON.stringify(value);
@ -643,7 +643,7 @@ export default class TreeStore<ED extends EntityDict & BaseEntityDict> extends C
// json中的多值查询
const array = value instanceof Array ? value : [value];
return (row) => {
const data = get(row, path);
const data = path ? get(row, path) : row;
return intersectionBy(array, data, (value: any) => {
if (typeof value === 'object') {
return JSON.stringify(value);