点击关闭

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

View File

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

View File

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