fix: Field form values is not displayed
This commit is contained in:
parent
a3c4a8dd9c
commit
819f1a3472
@ -652,7 +652,7 @@ function CreateFieldButton() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function EditFieldButton() {
|
function EditFieldButton() {
|
||||||
const { refresh } = useCollectionsContext();
|
const { refresh, findCollection } = useCollectionsContext();
|
||||||
const { service } = useTable();
|
const { service } = useTable();
|
||||||
const ctx = useContext(TableRowContext);
|
const ctx = useContext(TableRowContext);
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
@ -688,7 +688,11 @@ function EditFieldButton() {
|
|||||||
type={'link'}
|
type={'link'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
form.setValues(clone(ctx.record));
|
const collection = findCollection(ctx.record.collection_name);
|
||||||
|
const values = collection?.generalFields?.find(
|
||||||
|
(field) => field.key === ctx.record.key,
|
||||||
|
);
|
||||||
|
form.setValues(clone(values || {}));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
|
Loading…
Reference in New Issue
Block a user