fix: 客户端管理 错误的status disabled

This commit is contained in:
dap 2025-02-05 13:20:30 +08:00
parent 049ccca3e0
commit 1df9236a53
2 changed files with 18 additions and 8 deletions

View File

@ -1,3 +1,9 @@
# 1.2.1
# BUG FIXES
- 客户端管理 错误的status disabled
# 1.2.0
**REFACTOR**

View File

@ -55,6 +55,14 @@ function setupForm(update: boolean) {
]);
}
// Schema
const getStatusSchema = (disabled: boolean) => [
{
componentProps: { disabled },
fieldName: 'status',
},
];
const [BasicDrawer, drawerApi] = useVbenDrawer({
onCancel: handleCancel,
onConfirm: handleConfirm,
@ -70,15 +78,11 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
if (isUpdate.value && id) {
const record = await clientInfo(id);
// id1
formApi.updateSchema([
{
componentProps: {
disabled: record.id === 1,
},
fieldName: 'status',
},
]);
formApi.updateSchema(getStatusSchema(record.id === 1));
await formApi.setValues(record);
} else {
// :
formApi.updateSchema(getStatusSchema(false));
}
drawerApi.drawerLoading(false);
},