chore: 调整触发时机

This commit is contained in:
dap 2024-09-23 20:34:40 +08:00
parent 4a8ca67500
commit 07e9483c91

View File

@ -120,6 +120,13 @@ const [BasicDrawer, drawerApi] = useVbenDrawer({
onConfirm: handleConfirm, onConfirm: handleConfirm,
async onOpenChange(isOpen) { async onOpenChange(isOpen) {
if (!isOpen) { if (!isOpen) {
//
formApi.updateSchema([
{
componentProps: { options: [], placeholder: '请先选择部门' },
fieldName: 'postIds',
},
]);
return null; return null;
} }
drawerApi.drawerLoading(true); drawerApi.drawerLoading(true);
@ -187,13 +194,6 @@ async function handleConfirm() {
async function handleCancel() { async function handleCancel() {
drawerApi.close(); drawerApi.close();
await formApi.resetForm(); await formApi.resetForm();
//
formApi.updateSchema([
{
componentProps: { options: [], placeholder: '请先选择部门' },
fieldName: 'postIds',
},
]);
} }
</script> </script>