修改bug

This commit is contained in:
lq
2025-09-25 10:36:56 +08:00
parent 603bf7c207
commit 0afab0aa19
4 changed files with 25 additions and 16 deletions

View File

@ -17,7 +17,7 @@
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@vueuse/core": "^9.12.0", "@vueuse/core": "^9.12.0",
"ali-oss": "^6.17.1", "ali-oss": "^6.17.1",
"ant-design-vue": "~4.2.6", "ant-design-vue": "^4.2.6",
"ant-design-x-vue": "^1.3.2", "ant-design-x-vue": "^1.3.2",
"axios": "^1.3.0", "axios": "^1.3.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",

2
pnpm-lock.yaml generated
View File

@ -27,7 +27,7 @@ importers:
specifier: ^6.17.1 specifier: ^6.17.1
version: 6.20.0 version: 6.20.0
ant-design-vue: ant-design-vue:
specifier: ~4.2.6 specifier: ^4.2.6
version: 4.2.6(vue@3.5.18(typescript@4.9.5)) version: 4.2.6(vue@3.5.18(typescript@4.9.5))
ant-design-x-vue: ant-design-x-vue:
specifier: ^1.3.2 specifier: ^1.3.2

View File

@ -240,7 +240,6 @@ watch(
dayModel.value = newVal.dayModel || new Date(); dayModel.value = newVal.dayModel || new Date();
weekModel.value = newVal.weekModel || new Date(); weekModel.value = newVal.weekModel || new Date();
monthModel.value = newVal.monthModel || new Date(); monthModel.value = newVal.monthModel || new Date();
emitChange();
} }
}, },
{ deep: true }, { deep: true },

View File

@ -6,6 +6,7 @@
placement="right" placement="right"
:visible="visible" :visible="visible"
@after-visible-change="onAfterVisibleChange" @after-visible-change="onAfterVisibleChange"
@close="handleClose"
@cancel="handleCancel" @cancel="handleCancel"
width="904px" width="904px"
class="task-drawer" class="task-drawer"
@ -246,25 +247,18 @@ const getStatus = (status: number) => {
} }
}; };
// 抽屉显示状态变化处理 // 抽屉关闭事件处理(右上角关闭按钮)
const onAfterVisibleChange = (visible: boolean) => { const handleClose = () => {
emit('after-visible-change', visible); console.log('关闭');
if (visible) { emit('cancel');
// 当抽屉显示时,使用最新参数请求数据 emit('update:visible', false);
fetchProductData();
} else {
// 关闭时清空数据
materialData.value = [];
selectedRowKeys.value = [];
choseText.value = '';
choseImgArray.value = [];
}
}; };
// 取消按钮处理 // 取消按钮处理
const handleCancel = () => { const handleCancel = () => {
console.log('取消'); console.log('取消');
emit('cancel'); emit('cancel');
emit('update:visible', false);
}; };
// 确定按钮处理 // 确定按钮处理
@ -282,6 +276,22 @@ const handleOk = () => {
}); });
emit('update:visible', false); emit('update:visible', false);
}; };
// 抽屉显示状态变化处理
const onAfterVisibleChange = (visible: boolean) => {
emit('after-visible-change', visible);
if (visible) {
// 当抽屉显示时,使用最新参数请求数据
fetchProductData();
} else {
// 关闭时清空数据
materialData.value = [];
selectedRowKeys.value = [];
choseText.value = '';
choseImgArray.value = [];
}
};
</script> </script>
<style scoped> <style scoped>