提交 27e703f5 authored 作者: 王鹏飞's avatar 王鹏飞

fix: 修复考试不回显的问题

上级 58f1ef51
...@@ -42,7 +42,7 @@ onMounted(() => { ...@@ -42,7 +42,7 @@ onMounted(() => {
<template> <template>
<section class="drag-panel"> <section class="drag-panel">
<div v-show="!isLeftShow" class="drag-panel-left" :class="{ 'is-hidden': !leftPanelVisible }"> <div v-if="!isLeftShow" class="drag-panel-left" :class="{ 'is-hidden': !leftPanelVisible }">
<div class="drag-cover" v-if="dragFlag"></div> <div class="drag-cover" v-if="dragFlag"></div>
<slot name="left"></slot> <slot name="left"></slot>
<div class="panel-resize" id="panel-resize"></div> <div class="panel-resize" id="panel-resize"></div>
......
...@@ -7,8 +7,13 @@ const appConfig = useAppConfig() ...@@ -7,8 +7,13 @@ const appConfig = useAppConfig()
interface Props { interface Props {
experiment_id: string experiment_id: string
examStatus?: number examStatus?: number
showInfo?: boolean
showIframe?: boolean
} }
const props = defineProps<Props>() const props = withDefaults(defineProps<Props>(), {
showInfo: true,
showIframe: false,
})
const model = defineModel() const model = defineModel()
const emits = defineEmits(['empty']) const emits = defineEmits(['empty'])
...@@ -50,15 +55,19 @@ watchEffect(() => { ...@@ -50,15 +55,19 @@ watchEffect(() => {
<template> <template>
<template v-if="currentExam"> <template v-if="currentExam">
<el-form label-suffix=":" label-position="top" v-if="appConfig.system !== 'x'"> <el-form label-suffix=":" label-position="top" v-if="showInfo">
<el-form-item label="考试名称">{{ currentExam.exam_info.name }}</el-form-item> <el-form-item label="考试名称">{{ currentExam.exam_info.name }}</el-form-item>
<el-form-item label="考试时间" <el-form-item label="考试时间"
>{{ currentExam.exam_info.start_time }}{{ currentExam.exam_info.end_time }}</el-form-item >{{ currentExam.exam_info.start_time }}{{ currentExam.exam_info.end_time }}</el-form-item
> >
</el-form> </el-form>
<div style="width: 100%; height: 100%"> <iframe
<iframe style="width: 100%; height: 100%" allowfullscreen class="iframe" :src="examURL" frameborder="0"></iframe> style="width: 100%; height: 100%"
</div> allowfullscreen
class="iframe"
:src="examURL"
frameborder="0"
v-if="showIframe"></iframe>
</template> </template>
<el-empty description="暂无数据" v-else /> <el-empty description="暂无数据" v-else />
</template> </template>
...@@ -353,6 +353,16 @@ function handleEmpty(name: string) { ...@@ -353,6 +353,16 @@ function handleEmpty(name: string) {
description="您已经提交该实验,不能再进行操作,切换其他实验再做操作吧。" description="您已经提交该实验,不能再进行操作,切换其他实验再做操作吧。"
style="flex: 1" style="flex: 1"
v-if="submitted" /> v-if="submitted" />
<template v-else>
<template v-if="experimentInfo?.exam_status === 1 && tabActive === 'exam'">
<Exam
v-model="examURL"
:showInfo="false"
:showIframe="true"
:experiment_id="form.experiment_id"
:examStatus="experimentInfo?.exam_status"
@empty="handleEmpty('exam')"></Exam>
</template>
<template v-else> <template v-else>
<iframe <iframe
allow="camera; microphone" allow="camera; microphone"
...@@ -363,11 +373,12 @@ function handleEmpty(name: string) { ...@@ -363,11 +373,12 @@ function handleEmpty(name: string) {
class="iframe" class="iframe"
ref="iframeRef"></iframe> ref="iframeRef"></iframe>
<div <div
style="padding: 10px; background-color: #fff; max-width: 300px; min-width: 300px" style="padding: 10px; background-color: #fff; width: 300px"
v-if="experimentInfo?.exam_status === 1 && tabActive === 'qa'"> v-if="experimentInfo?.exam_status === 1 && tabActive === 'qa'">
<Question :experiment_id="form.experiment_id" :exam_status="experimentInfo?.exam_status"></Question> <Question :experiment_id="form.experiment_id" :exam_status="experimentInfo?.exam_status"></Question>
</div> </div>
</template> </template>
</template>
</div> </div>
</template> </template>
</DragPanel> </DragPanel>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论