From 24bfecf770d1c85a1d9ee1e41f36d07c7d920a9d Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期四, 06 六月 2024 15:42:14 +0800
Subject: [PATCH] feat:退出考试提示框

---
 src/views/exam/index.vue |   46 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue
index fa8f549..8703f59 100644
--- a/src/views/exam/index.vue
+++ b/src/views/exam/index.vue
@@ -7,8 +7,17 @@
           <div class="title-container text-3xl font-semibold text-white mr-8">
             娴嬭瘯娴嬭瘯娴嬭瘯
           </div>
-
           <AnswerTime></AnswerTime>
+
+          <div class="return-container grow flex justify-end">
+            <el-button type="danger" size="large" circle @click="closeClick">
+              <template #icon>
+                <el-icon :size="20">
+                  <Close />
+                </el-icon>
+              </template>
+            </el-button>
+          </div>
         </div>
 
         <div class="exam-main grow flex justify-between">
@@ -67,11 +76,29 @@
         </div>
       </div>
     </div>
+
+
+    <!-- 鎻愮ず寮圭獥 -->
+    <el-dialog v-model="dialogVisible" title="娉ㄦ剰" width="500">
+      <div class="dialog-container">
+        <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>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import {ref} from 'vue';
+import { ref } from 'vue';
+import { Close } from '@element-plus/icons-vue';
 import AnswerTag from './components/answer-tag/index.vue';
 import AnswerProgress from './components/answer-progress/index.vue';
 import AnswerSheet from './components/answer-sheet/index.vue';
@@ -82,17 +109,27 @@
 const typeComponent = {
   1: AnswerSingle,
   2: AnswerMultiple,
-}
+};
 
 const currentType = ref(1);
 const questionIndex = ref(0);
 
+const dialogVisible = ref(false);
+
 const prevQuestion = () => {
   questionIndex.value--;
-}
+};
 
 const nextQuestion = () => {
   questionIndex.value++;
+};
+
+const closeClick = () => {
+  dialogVisible.value = true;
+};
+
+const confirmCancel = () => {
+  dialogVisible.value = false;
 }
 </script>
 
@@ -141,6 +178,7 @@
   width: 160px;
   height: 40px;
 }
+
 .tool-button {
   margin: 0 20px;
 }

--
Gitblit v1.8.0