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);