点击关闭

This commit is contained in:
lq
2025-09-24 17:27:57 +08:00
parent 6aa532bebe
commit cc35c1020f
3 changed files with 5 additions and 18 deletions

View File

@ -168,7 +168,6 @@
<!-- 原料库子组件使用:visible和@update:visible替代v-model -->
<RawMaterialDrawer
:visible="showDrawer2"
@update:visible="(val) => (showDrawer2 = val)"
:query="materialQuery"
@after-visible-change="handleMaterialDrawerVisibleChange"
@confirm="handleMaterialConfirm"
@ -374,6 +373,7 @@ const handleMaterialConfirm = (result) => {
// 处理原料库取消
const handleMaterialCancel = () => {
// 取消逻辑
showDrawer2.value = false;
};
// 处理成品库选择确认
@ -402,6 +402,7 @@ const handleProductConfirm = (result) => {
// 处理成品库取消
const handleProductCancel = () => {
// 取消逻辑
showDrawer3.value = false;
};
// 处理发布类型变化

View File

@ -6,7 +6,7 @@
placement="right"
:visible="visible"
@after-visible-change="onAfterVisibleChange"
@close="handleClose"
@cancel="handleCancel"
width="904px"
class="task-drawer"
style="right: 481px"
@ -241,15 +241,8 @@ const onAfterVisibleChange = (visible: boolean) => {
}
};
// 抽屉关闭事件处理
const handleClose = () => {
emit('update:visible', false);
emit('cancel');
};
// 取消按钮处理
const handleCancel = () => {
emit('update:visible', false);
emit('cancel');
};

View File

@ -6,7 +6,7 @@
placement="right"
:visible="visible"
@after-visible-change="onAfterVisibleChange"
@close="handleClose"
@cancel="handleCancel"
width="904px"
class="task-drawer"
style="right: 481px"
@ -150,7 +150,6 @@ const getOrigin = (origin: number): string => {
// 定义Emits类型
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'after-visible-change', visible: boolean): void;
(
e: 'confirm',
data: {
@ -262,15 +261,9 @@ const onAfterVisibleChange = (visible: boolean) => {
}
};
// 抽屉关闭事件处理
const handleClose = () => {
emit('update:visible', false);
emit('cancel');
};
// 取消按钮处理
const handleCancel = () => {
emit('update:visible', false);
console.log('取消');
emit('cancel');
};