From f00599b8409e55b42cdbef2edc6b23e913843dcd Mon Sep 17 00:00:00 2001 From: "Xc@centOs" Date: Thu, 30 Nov 2023 18:58:32 +0800 Subject: [PATCH] =?UTF-8?q?objectPredicate=E4=B8=AD=E5=AF=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=98=AF=E6=A0=B9=E7=BB=93=E7=82=B9=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/store.js | 4 ++-- lib/store.js | 4 ++-- src/store.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/es/store.js b/es/store.js index ded3640..7557b34 100644 --- a/es/store.js +++ b/es/store.js @@ -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); diff --git a/lib/store.js b/lib/store.js index 9d6e6b5..bed313b 100644 --- a/lib/store.js +++ b/lib/store.js @@ -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); diff --git a/src/store.ts b/src/store.ts index b231e71..ae418b0 100644 --- a/src/store.ts +++ b/src/store.ts @@ -630,7 +630,7 @@ export default class TreeStore 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 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);