From 945cbd86a706804d3d8e9d4da14e159be7e6f3eb Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期一, 17 六月 2024 13:43:02 +0800 Subject: [PATCH] feat(考试):多选题 --- src/views/exam/components/answer-main/answer-multiple/index.vue | 56 ++++++---------------------- src/preload.js | 3 + src/store/modules/exam.js | 2 src/views/meet/index.vue | 16 +++++++ 4 files changed, 30 insertions(+), 47 deletions(-) diff --git a/src/preload.js b/src/preload.js index 6540bd3..c0eda45 100644 --- a/src/preload.js +++ b/src/preload.js @@ -1,5 +1,6 @@ const { contextBridge, ipcRenderer } = require('electron'); contextBridge.exposeInMainWorld('electron', { - openNewWindow: (arg) => ipcRenderer.send('open-new-window', arg) + openNewWindow: (arg) => ipcRenderer.send('open-new-window', arg), + closeNewWindow: (arg) => ipcRenderer.send('close-new-window', arg) }); \ No newline at end of file diff --git a/src/store/modules/exam.js b/src/store/modules/exam.js index f436304..fb33503 100644 --- a/src/store/modules/exam.js +++ b/src/store/modules/exam.js @@ -12,7 +12,7 @@ const examType = ref({ 1: '鍗曢�夐', - 2: '澶氶�夐' + 2: '澶氶�夐', }); const currentType = ref(1); diff --git a/src/views/exam/components/answer-main/answer-multiple/index.vue b/src/views/exam/components/answer-main/answer-multiple/index.vue index b8a570b..328da09 100644 --- a/src/views/exam/components/answer-main/answer-multiple/index.vue +++ b/src/views/exam/components/answer-main/answer-multiple/index.vue @@ -1,13 +1,13 @@ <template> <div class="answer-container w-full h-full"> <el-scrollbar> - <ExamInfo class="mb-5"></ExamInfo> + <ExamInfo class="mb-5" :questionIndex="currentIndex" :title="activeQuestion.title"></ExamInfo> <div class="answer-content"> - <div class="answer-item flex" v-for="item, index in examInfo.answerList" @click="answerClick(item)" + <div class="answer-item flex" v-for="item, index in activeQuestion.items" @click="answerClick(item)" :class="answerState(item)"> - <div class="answer-icon flex flex-col justify-center items-center flex-shrink-0">{{ item.type }}</div> - <div class="answer-text text-gray-700">{{ item.text }}</div> + <div class="answer-icon flex flex-col justify-center items-center flex-shrink-0">{{ item.prefix }}</div> + <div class="answer-text text-gray-700">{{ item.content }}</div> </div> </div> @@ -17,50 +17,17 @@ <script setup> import { ref } from 'vue'; +import {storeToRefs} from 'pinia'; import ExamInfo from '@/components/ExamInfo/index.vue'; +import {useExamStore} from '@/store/index.js'; -const examInfo = ref({ - qId: 1, - answerList: [ - { - type: 'A', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - { - type: 'B', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - { - type: 'C', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - { - type: 'D', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - { - type: 'E', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - { - type: 'F', - text: '娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯璇曟祴璇�', - isActive: false - }, - ] -}); +const examStore = useExamStore(); -const activeIndex = ref(null); - +const {currentIndex,activeQuestion} = storeToRefs(examStore); const answerClick = (item) => { if(item) { - resetAnswer(); - item.isActive = true + // resetAnswer(); + item.isActive = !item.isActive; } }; @@ -71,9 +38,10 @@ } const resetAnswer = () => { - examInfo.value.answerList.forEach(item => item.isActive = false); + activeQuestion.value.items.forEach(item => item.isActive = false); } + </script> <style lang="scss" scoped> diff --git a/src/views/meet/index.vue b/src/views/meet/index.vue index 1d9f847..cc2941d 100644 --- a/src/views/meet/index.vue +++ b/src/views/meet/index.vue @@ -7,6 +7,7 @@ <script setup> import { ref, onMounted } from 'vue'; const meet = ref(null); +let jitsiApi = null; onMounted(() => { const width = window.innerWidth; const height = window.innerHeight; @@ -20,12 +21,25 @@ configOverwrite: { prejoinConfig: { enabled: false + }, + whiteboard: { + enabled: true } }, toolbarButtons: ['whiteboard'] }; - const api = new JitsiMeetExternalAPI(domain, options); + jitsiApi = new JitsiMeetExternalAPI(domain, options); + jitsiInit(); }); + +const jitsiInit = () => { + jitsiApi.addListener('readyToClose', () => { + + }); +} + + + </script> <style lang="scss" scoped></style> \ No newline at end of file -- Gitblit v1.8.0