From 4a91e1c8f8cc2b9363b938630d8148f9cbef3c4a Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期三, 19 六月 2024 15:40:01 +0800 Subject: [PATCH] feat(考试):添加提交试卷提示窗 --- src/views/exam/index.vue | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index 090e41e..733daf1 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -40,7 +40,7 @@ </div> <div class="submit-wrapper"> - <el-button type="primary" class="submit-button">鎻愪氦璇曞嵎</el-button> + <el-button type="primary" class="submit-button" @click="submitExam">鎻愪氦璇曞嵎</el-button> </div> </div> @@ -79,16 +79,32 @@ <!-- 閫�鍑鸿�冭瘯鎻愮ず寮圭獥 --> - <el-dialog v-model="dialogVisible" title="娉ㄦ剰" width="500"> + <el-dialog v-model="quitDialog" title="娉ㄦ剰" width="500"> <div class="dialog-container"> <p>璇风‘璁ゆ槸鍚﹂��鍑哄綋鍓嶈�冭瘯</p> - <p>褰撳墠鑰冭瘯璇曞嵎浼氳嚜鍔ㄦ彁浜�,鍚庣画灏嗘棤娉曠户缁綔绛�</p> + <p>褰撳墠璇曞嵎浼氳嚜鍔ㄦ彁浜�,鍚庣画灏嗘棤娉曠户缁綔绛�</p> </div> <template #footer> <div class="dialog-footer"> - <el-button @click="dialogVisible = false">鍙栨秷</el-button> - <el-button type="primary" @click="confirmCancel"> - 纭畾 + <el-button @click="quitDialog = false">缁х画浣滅瓟</el-button> + <el-button type="danger" @click="confirmQuit"> + 纭畾閫�鍑� + </el-button> + </div> + </template> + </el-dialog> + + <!-- 浜ゅ嵎鎻愮ず寮圭獥 --> + <el-dialog v-model="submitDialog" title="纭浜ゅ嵎?" width="500"> + <div class="dialog-container"> + <p>璇风‘璁ゆ槸鍚︽彁浜よ瘯鍗�</p> + <p>涓�鏃︿氦鍗峰皢鏃犳硶缁х画浣滅瓟鎴栦慨鏀圭瓟妗�</p> + </div> + <template #footer> + <div class="dialog-footer"> + <el-button @click="submitDialog = false">缁х画浣滅瓟</el-button> + <el-button type="primary" @click="confirmSubmit"> + 纭鎻愪氦 </el-button> </div> </template> @@ -123,7 +139,8 @@ 3: AnswerAudio, }; -const dialogVisible = ref(false); +const quitDialog = ref(false); +const submitDialog = ref(false); const prevQuestion = () => { currentIndex.value--; @@ -181,15 +198,28 @@ } }; +// 閫�鍑鸿�冭瘯 const closeClick = () => { - dialogVisible.value = true; + quitDialog.value = true; }; -const confirmCancel = () => { - dialogVisible.value = false; +const confirmQuit = () => { + quitDialog.value = false; router.back(); }; +// 浜ゅ嵎 +const submitExam = () => { + submitDialog.value = true; +} + +const confirmSubmit = () => { + submitDialog.value = false; + router.back(); +}; + + + watchEffect(() => { let progress = 0; examDetail.value.forEach(item => { -- Gitblit v1.8.0