提交 0864fe5d authored 作者: 王鹏飞's avatar 王鹏飞

feat: 新增网络主播赛项选项,更新比赛页面的选项卡逻辑

上级 98b49f36
......@@ -54,6 +54,7 @@ const competitionOptions = ref([
{ label: '全媒体运营赛项', value: '2' },
{ label: '互联网营销师(直播销售)', value: '3' },
{ label: '全媒体运营师(网络编辑)', value: '4' },
{ label: '网络主播赛项(理论考试)', value: '5' },
])
async function fetchInfo() {
......
......@@ -29,7 +29,6 @@ export function useCompetition() {
return `${urls.lab}&token=${cookies.get('TGC')}`
})
watchEffect(() => {
if (courses.value.length) {
courseId.value = courses.value[0].id
......@@ -43,16 +42,15 @@ export function useCompetition() {
})
const experimentInfo = ref<ExperimentType>()
const fetchExperiment = async () => {
return false
const res = await getExperiment({ experiment_id: experimentId.value })
experimentInfo.value = res.data.detail
if (res.data.detail.exam_status == 1) {
fetchExamList()
}
}
const fetchExperimentCompetition = async () => {
const res = await getExperimentCompetition({ experiment_id: experimentId.value })
competition.value = res.data.detail
if (res.data.detail.competition == '4') {
fetchExamList()
}
}
watchEffect(() => {
if (experimentId.value) {
......@@ -80,6 +78,5 @@ export function useCompetition() {
examList.value = res.data.items
}
return { competition, courseId, experimentId, experimentInfo, submit, fetchExamList, examURL, biURL }
}
......@@ -64,7 +64,7 @@ const handleSubmit = async () => {
},
)
}
const tabActive = ref('bi')
const tabActive = ref('exam')
const competitionConfig = computed(() => {
const rawConfig = competition.value?.config
......@@ -96,7 +96,7 @@ useEventListener(window, 'message', async (event) => {
})
</script>
<template>
<DragPanel v-if="isEntry">
<DragPanel :isLeftShow="!practicalQuestionHtml" v-if="isEntry">
<template #left>
<div class="left-box">
<h2 class="left-box-title">实操试题</h2>
......@@ -133,6 +133,16 @@ useEventListener(window, 'message', async (event) => {
v-show="tabActive === 'exam'"></iframe>
</div>
</template>
<template v-else-if="competition?.competition == '5'">
<iframe
allow="camera; microphone"
allowfullscreen
:src="examURL"
frameborder="0"
class="iframe"
ref="iframeRef"
v-show="tabActive === 'exam'"></iframe>
</template>
<template v-else>
<AppCard v-if="isFormalMode">
<div class="competition-header">
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论