ZhangXianQiang
2024-06-06 24bfecf770d1c85a1d9ee1e41f36d07c7d920a9d
feat:退出考试提示框
2个文件已修改
47 ■■■■■ 已修改文件
components.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/exam/index.vue 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components.d.ts
@@ -14,6 +14,7 @@
    ElCollapse: typeof import('element-plus/es')['ElCollapse']
    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
    ElCountdown: typeof import('element-plus/es')['ElCountdown']
    ElDialog: typeof import('element-plus/es')['ElDialog']
    ElIcon: typeof import('element-plus/es')['ElIcon']
    ElInput: typeof import('element-plus/es')['ElInput']
    ElPagination: typeof import('element-plus/es')['ElPagination']
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;
}