fix: 修复mobile选择类型不能用的情况 fix #723
Reviewed-on: daoyoucloud/tachycode#725 Co-authored-by: wjh <wwwjh0710@163.com> Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
parent
520b0024d4
commit
a08b45b498
5
.changeset/fluffy-jobs-wait.md
Normal file
5
.changeset/fluffy-jobs-wait.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@hera/plugin-mobile": patch
|
||||
---
|
||||
|
||||
修复选择不能用的情况
|
@ -21,7 +21,7 @@ export const useTabSearchFieldItemProps = () => {
|
||||
result.labelKey = fieldSchema['x-component-props']?.fieldNames?.label || result.valueKey;
|
||||
const fieldInterface = fieldSchema['x-component-props'].interface;
|
||||
if (canBeOptionalField(fieldInterface)) {
|
||||
const field = optionalFieldList.find((field) => field.fieldName === fieldSchema['fieldName']);
|
||||
const field = optionalFieldList.find((field) => field.name === fieldSchema['fieldName']);
|
||||
const operatorMap = {
|
||||
select: '$in',
|
||||
multipleSelect: '$anyOf',
|
||||
@ -33,9 +33,8 @@ export const useTabSearchFieldItemProps = () => {
|
||||
result.valueKey = 'value';
|
||||
result.labelKey = 'label';
|
||||
result.list = _list;
|
||||
result.filterKey = `${field.fieldName}.${operatorMap[field.interface]}`;
|
||||
result.filterKey = `${field.name}.${operatorMap[field.interface]}`;
|
||||
}
|
||||
|
||||
return {
|
||||
list: result.list,
|
||||
valueKey: result.valueKey,
|
||||
|
@ -20,7 +20,10 @@ export const useTabSearchFieldItemRelatedProps = () => {
|
||||
const blockProps = { dataSource: 'main' };
|
||||
const headers = useDataSourceHeaders(blockProps?.dataSource);
|
||||
const cm = useCollectionManager();
|
||||
const collectionField = useMemo(() => collection?.getField(fieldSchema.name as any), [collection, fieldSchema.name]);
|
||||
const collectionField = useMemo(
|
||||
() => collection?.getField(fieldSchema['fieldName'] as any),
|
||||
[collection, fieldSchema['fieldName']],
|
||||
);
|
||||
const collectionFieldName = collectionField?.name;
|
||||
const fieldInterface = fieldSchema['x-component-props'].interface;
|
||||
const result = { list: null, valueKey: '', labelKey: '', filterKey: '' };
|
||||
|
@ -75,7 +75,7 @@ export const TabSearchItemFieldSettings = new SchemaSettings({
|
||||
const fieldCollection = fieldSchema['x-component-props']?.['collectionName'];
|
||||
const correlation = fieldSchema['x-component-props']?.['correlation'];
|
||||
const collectionField =
|
||||
c.getField(fieldSchema['name']) ||
|
||||
c.getField(fieldSchema['fieldName']) ||
|
||||
cm.getCollectionField(fieldSchema['x-collection-field']) ||
|
||||
cm.getCollection(fieldCollection + '.' + correlation);
|
||||
const compile = useCompile();
|
||||
|
Loading…
Reference in New Issue
Block a user