fix(data-vi): bug when filtering chart with assocations (#3867)
* fix(data-vi): bug when filtering chart with assocations * fix: remote select
This commit is contained in:
parent
11536cb0e0
commit
868a487b2d
@ -52,7 +52,8 @@ const InternalRemoteSelect = connect(
|
||||
const { getField } = useCollection_deprecated();
|
||||
const searchData = useRef(null);
|
||||
const { getCollectionJoinField, getInterface } = useCollectionManager_deprecated();
|
||||
const collectionField = getField(fieldSchema.name) || getCollectionJoinField(fieldSchema.name as string);
|
||||
const colletionFieldName = fieldSchema['x-collection-field'] || fieldSchema.name;
|
||||
const collectionField = getField(colletionFieldName) || getCollectionJoinField(colletionFieldName);
|
||||
const targetField =
|
||||
_targetField ||
|
||||
(collectionField?.target &&
|
||||
|
@ -305,12 +305,15 @@ export const useChartFilter = () => {
|
||||
.filter(([_, props]) => props)
|
||||
.forEach(([name, props]) => {
|
||||
const { operator } = props || {};
|
||||
const { dataSource, fieldName } = parseFilterFieldName(name);
|
||||
const { dataSource, fieldName: _fieldName } = parseFilterFieldName(name);
|
||||
let fieldName = _fieldName;
|
||||
const ds = dm.getDataSource(dataSource);
|
||||
const cm = ds.collectionManager;
|
||||
const field = cm.getCollectionField(fieldName);
|
||||
if (field?.target) {
|
||||
name = `${fieldName}.${field.targetKey || 'id'}`;
|
||||
const tk = field.targetKey || 'id';
|
||||
fieldName = `${fieldName}.${tk}`;
|
||||
name = `${name}.${tk}`;
|
||||
}
|
||||
const [collection, ...fields] = fieldName.split('.');
|
||||
const value = getValuesByPath(values, name);
|
||||
|
Loading…
Reference in New Issue
Block a user