mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 11:45:59 +00:00
fix
This commit is contained in:
@@ -5,7 +5,7 @@ import _difference from 'lodash/difference';
|
||||
import debug from 'debug';
|
||||
import stableStringify from 'json-stable-stringify';
|
||||
import { PerspectiveDataPattern } from './PerspectiveDataPattern';
|
||||
import { perspectiveValueMatcherSimple } from './perspectiveTools';
|
||||
import { perspectiveValueMatcher } from './perspectiveTools';
|
||||
|
||||
const dbg = debug('dbgate:PerspectiveCache');
|
||||
|
||||
@@ -19,7 +19,7 @@ export class PerspectiveBindingGroup {
|
||||
|
||||
matchRow(row) {
|
||||
return this.table.bindingColumns.every((column, index) =>
|
||||
perspectiveValueMatcherSimple(row[column], this.bindingValues[index])
|
||||
perspectiveValueMatcher(row[column], this.bindingValues[index])
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ export class PerspectiveCacheTable {
|
||||
|
||||
storeGroupSize(props: PerspectiveDataLoadProps, bindingValues: any[], count: number) {
|
||||
const originalBindingValue = props.bindingValues.find(v =>
|
||||
_zip(v, bindingValues).every(([x, y]) => perspectiveValueMatcherSimple(x, y))
|
||||
_zip(v, bindingValues).every(([x, y]) => perspectiveValueMatcher(x, y))
|
||||
);
|
||||
// console.log('storeGroupSize NEW', bindingValues);
|
||||
// console.log('storeGroupSize ORIGINAL', originalBindingValue);
|
||||
|
||||
@@ -835,10 +835,10 @@ export class PerspectivePatternColumnNode extends PerspectiveTreeNode {
|
||||
return null;
|
||||
}
|
||||
|
||||
get generatesHiearchicGridColumn() {
|
||||
get generatesHiearchicGridColumn(): boolean {
|
||||
// return true;
|
||||
// console.log('generatesHiearchicGridColumn', this.parentTableNode?.nodeConfig?.checkedColumns, this.codeName + '::');
|
||||
if (!!this.tableNodeOrParent?.nodeConfig?.checkedColumns?.find(x => x.startsWith(this.codeName + '::'))) {
|
||||
if (this.tableNodeOrParent?.nodeConfig?.checkedColumns?.find(x => x.startsWith(this.codeName + '::'))) {
|
||||
return true;
|
||||
}
|
||||
// return false;
|
||||
|
||||
@@ -9,14 +9,14 @@ export function getPerspectiveMostNestedChildColumnName(columnName: string) {
|
||||
return path[path.length - 1];
|
||||
}
|
||||
|
||||
// export function perspectiveValueMatcher(value1, value2): boolean {
|
||||
// if (value1?.$oid && value2?.$oid) return value1.$oid == value2.$oid;
|
||||
// if (Array.isArray(value1)) return !!value1.find(x => perspectiveValueMatcher(x, value2));
|
||||
// if (Array.isArray(value2)) return !!value2.find(x => perspectiveValueMatcher(value1, x));
|
||||
// return value1 == value2;
|
||||
// }
|
||||
|
||||
export function perspectiveValueMatcher(value1, value2): boolean {
|
||||
if (value1?.$oid && value2?.$oid) return value1.$oid == value2.$oid;
|
||||
if (Array.isArray(value1)) return !!value1.find(x => perspectiveValueMatcher(x, value2));
|
||||
if (Array.isArray(value2)) return !!value2.find(x => perspectiveValueMatcher(value1, x));
|
||||
return value1 == value2;
|
||||
}
|
||||
|
||||
export function perspectiveValueMatcherSimple(value1, value2): boolean {
|
||||
if (value1?.$oid && value2?.$oid) return value1.$oid == value2.$oid;
|
||||
return value1 == value2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user