mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix: external data source filterTargetKey undefined in filter action (#4815)
* fix: external data source filterTargetKey undefined in filter action * fix: bug
This commit is contained in:
parent
cfcf9291dc
commit
a754bcedd8
@ -8,15 +8,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ExclamationCircleTwoTone } from '@ant-design/icons';
|
import { ExclamationCircleTwoTone } from '@ant-design/icons';
|
||||||
import { useCollectionRecordData, useCompile } from '@nocobase/client';
|
import { useCollectionRecordData, useCompile, Input } from '@nocobase/client';
|
||||||
|
import { useField } from '@formily/react';
|
||||||
import { Popover } from 'antd';
|
import { Popover } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SetFilterTargetKey } from './SetFilterTargetKey';
|
import { SetFilterTargetKey } from './SetFilterTargetKey';
|
||||||
|
|
||||||
export const CollectionTitle = () => {
|
export const CollectionTitle = (props) => {
|
||||||
const record = useCollectionRecordData();
|
const record = useCollectionRecordData() || {};
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
if (record.filterTargetKey) {
|
const field = useField();
|
||||||
|
if (field.editable) {
|
||||||
|
return <Input {...props} />;
|
||||||
|
}
|
||||||
|
if (record?.filterTargetKey) {
|
||||||
return compile(record.title);
|
return compile(record.title);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user