fix: 修复供应商管理弹窗交互问题
- 导入 TDesign react-19-adapter 修复 MessagePlugin 在 React 19 下的渲染错误 - Dialog 禁用蒙版点击和 ESC 键关闭,防止误操作丢失表单数据 - 重构弹窗关闭逻辑,使用 mutateAsync 替代 useEffect 监听 isSuccess - 成功后自动关闭弹窗,失败后保持弹窗打开并显示错误提示
This commit is contained in:
@@ -15,7 +15,7 @@ interface ProviderFormValues {
|
||||
interface ProviderFormProps {
|
||||
open: boolean;
|
||||
provider?: Provider;
|
||||
onSave: (values: ProviderFormValues) => void;
|
||||
onSave: (values: ProviderFormValues) => Promise<void> | void;
|
||||
onCancel: () => void;
|
||||
loading: boolean;
|
||||
}
|
||||
@@ -59,6 +59,8 @@ export function ProviderForm({
|
||||
<Dialog
|
||||
header={isEdit ? '编辑供应商' : '添加供应商'}
|
||||
visible={open}
|
||||
closeOnOverlayClick={false}
|
||||
closeOnEscKeydown={false}
|
||||
onConfirm={() => { form?.submit(); return false; }}
|
||||
onClose={onCancel}
|
||||
confirmLoading={loading}
|
||||
|
||||
Reference in New Issue
Block a user