From 0e5f14cf081b8cffda12e7c1773fe1b6b69ce2eb Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期三, 20 十一月 2024 16:43:13 +0800 Subject: [PATCH] 问题和整改的新增以及修改页面点击取消按钮添加取消事件 --- src/views/fysp/check/ProCheck.vue | 34 +++++++++++++++++++--------------- src/views/fysp/check/components/CompProblemAddOrUpd.vue | 7 +++++-- src/views/fysp/check/components/ComChangeEdit.vue | 7 +++++-- src/views/fysp/check/components/CompProblemCard.vue | 10 +++++++++- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/views/fysp/check/ProCheck.vue b/src/views/fysp/check/ProCheck.vue index cd3678f..30bfb48 100644 --- a/src/views/fysp/check/ProCheck.vue +++ b/src/views/fysp/check/ProCheck.vue @@ -22,20 +22,20 @@ :loading="mainLoading" ></ToolBar> <el-scrollbar - v-if="curProList.length > 0" - class="el-scrollbar" - v-loading="mainLoading" - > - <CompProblemCard - :key="i" - v-for="(p, i) in curProList" - :index="i + 1" - :problem="p" - :subtask="curSubtask.data" - :topTask="topTask" - @submit="updateSubtask" - ></CompProblemCard> - </el-scrollbar> + v-if="curProList.length > 0" + class="el-scrollbar" + v-loading="mainLoading" + > + <CompProblemCard + :key="i" + v-for="(p, i) in curProList" + :index="i + 1" + :problem="p" + :subtask="curSubtask.data" + :topTask="topTask" + @submit="updateSubtask" + ></CompProblemCard> + </el-scrollbar> <el-empty v-else description="鏆傛棤璁板綍" v-loading="mainLoading" /> </template> </BaseContentLayout> @@ -46,6 +46,7 @@ :subtask="curSubtask.data" :topTask="topTask" ref="compProblemAddOrUpdRef" + @cancel="onAddProCanceled" @submit="updateSubtask" /> <ArbitraryPhoto @@ -279,12 +280,15 @@ this.mainLoading = false; }); }, + onAddProCanceled() { + this.proAddOrUpdDialogVisible = false; + }, // 闂鍗$墖缁勪欢涓诲姩鍙戣捣鍒锋柊鐖剁粍浠舵暟鎹� updateSubtask(refresh = false) { this.curSubtask.data.proCheckedNum++; this.curSubtask.type = this.getSubtaskType(this.curSubtask.data); if (this.proAddOrUpdDialogVisible) { - this.proAddOrUpdDialogVisible = false + this.proAddOrUpdDialogVisible = false; } this.refreshCurrSubtask(refresh); }, diff --git a/src/views/fysp/check/components/ComChangeEdit.vue b/src/views/fysp/check/components/ComChangeEdit.vue index 1ae4e56..293da55 100644 --- a/src/views/fysp/check/components/ComChangeEdit.vue +++ b/src/views/fysp/check/components/ComChangeEdit.vue @@ -47,7 +47,7 @@ </el-row> <div class="flex-div"> <el-button type="primary" @click="onSubmit">淇濆瓨</el-button> - <el-button @click="$emit('submit', false)">鍙栨秷</el-button> + <el-button @click="onCancel">鍙栨秷</el-button> </div> <el-image-viewer v-if="previewDialogVisible" @@ -68,7 +68,7 @@ import { useCloned } from '@vueuse/core'; import { ElMessage } from 'element-plus'; export default { - emits: ['submit'], + emits: ['submit', 'cancel'], components: { CompGenericWrapper }, @@ -162,6 +162,9 @@ this.fileList = useCloned(beforeEditImgList).cloned.value; this.oldFileList = useCloned(beforeEditImgList).cloned.value; }, + onCancel() { + this.$emit("cancel") + }, onSubmit() { if (!this.pictureValidate()) { return; diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue index 6fe60eb..067a428 100644 --- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue +++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue @@ -173,7 +173,7 @@ <el-button type="primary" @click="onSubmit" v-show="!readonly" >淇濆瓨</el-button > - <el-button @click="$emit('submit', false)" v-show="!readonly" + <el-button @click="onCancel" v-show="!readonly" >鍙栨秷</el-button > </el-form-item> @@ -233,7 +233,7 @@ import deviceApi from '@/api/fysp/deviceApi'; import { useFormConfirm } from '@/composables/formConfirm'; export default { - emits: ['submit'], + emits: ['submit', 'cancel'], components: { ArbitraryPhoto, CompDevicePhoto, @@ -561,6 +561,9 @@ } return true; }, + onCancel() { + this.$emit("cancel") + }, onSubmit() { this.$refs.formRef.validate((valid) => { if (valid && this.pictureValidate()) { diff --git a/src/views/fysp/check/components/CompProblemCard.vue b/src/views/fysp/check/components/CompProblemCard.vue index 8b0d513..d97b17b 100644 --- a/src/views/fysp/check/components/CompProblemCard.vue +++ b/src/views/fysp/check/components/CompProblemCard.vue @@ -139,6 +139,7 @@ :subtask="subtask" :topTask="topTask" ref="compProblemAddOrUpdRef" + @cancel="onProCanceled" @submit="onProSubmited" /> <!-- 鏁存敼 --> @@ -151,6 +152,7 @@ :subtask="subtask" :month="month" :oldChangeFileList="problem.mediafileList" + @cancel="onChangeCanceled" @submit="onChangeSubmited" /> <!-- 闂澶嶇幇 --> @@ -173,7 +175,7 @@ import CompProRecent from './CompProRecent.vue'; import { useCloned } from '@vueuse/core'; export default { - emits: ['submmit'], + emits: ['submmit', 'cancel'], components: { CompProblemAddOrUpd, ComChangeEdit, @@ -281,10 +283,16 @@ } }, methods: { + onProCanceled() { + this.proAddOrUpdDialogVisible = false; + }, onProSubmited(isOk) { this.$emit('submit', isOk); this.proAddOrUpdDialogVisible = false; }, + onChangeCanceled() { + this.changeDialogVisible = false; + }, onChangeSubmited(isOk) { this.$emit('submit', isOk); this.changeDialogVisible = false; -- Gitblit v1.9.3