chore: 调整触发时机
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user