Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
030b547a
提交
030b547a
authored
7月 06, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 添加大赛模式选择功能,优化提交逻辑
上级
290131a3
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
55 行增加
和
21 行删除
+55
-21
CompetitionRuleDialog.vue
...admin/lab/experiment/components/CompetitionRuleDialog.vue
+11
-7
Competition.vue
src/modules/student/lab/views/Competition.vue
+44
-14
没有找到文件。
src/modules/admin/lab/experiment/components/CompetitionRuleDialog.vue
浏览文件 @
030b547a
...
@@ -22,6 +22,7 @@ const gradeRuleList = [
...
@@ -22,6 +22,7 @@ const gradeRuleList = [
{
label
:
'直播总结汇报'
,
value
:
6
},
{
label
:
'直播总结汇报'
,
value
:
6
},
]
]
const
defaultConfig
=
{
const
defaultConfig
=
{
mode
:
'formal'
,
min_submit_time
:
''
,
min_submit_time
:
''
,
practical_question
:
''
,
practical_question
:
''
,
rules
:
[]
as
any
[],
rules
:
[]
as
any
[],
...
@@ -77,7 +78,7 @@ watch(
...
@@ -77,7 +78,7 @@ watch(
(
value
)
=>
{
(
value
)
=>
{
if
(
value
)
fetchInfo
()
if
(
value
)
fetchInfo
()
},
},
{
immediate
:
true
}
{
immediate
:
true
}
,
)
)
// 提交
// 提交
...
@@ -195,6 +196,12 @@ function disabledMinSubmitDate(time: Date) {
...
@@ -195,6 +196,12 @@ function disabledMinSubmitDate(time: Date) {
:value=
"item.value"
></el-option>
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"大赛模式"
>
<el-radio-group
v-model=
"form.config.mode"
>
<el-radio
label=
"test"
>
训练
</el-radio>
<el-radio
label=
"formal"
>
正赛
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"开始时间"
prop=
"start_time"
>
<el-form-item
label=
"开始时间"
prop=
"start_time"
>
<el-date-picker
<el-date-picker
v-model=
"form.start_time"
v-model=
"form.start_time"
...
@@ -211,7 +218,7 @@ function disabledMinSubmitDate(time: Date) {
...
@@ -211,7 +218,7 @@ function disabledMinSubmitDate(time: Date) {
value-format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
style=
"width: 100%"
/>
style=
"width: 100%"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"最短交卷时间"
prop=
"config.min_submit_time"
>
<el-form-item
label=
"最短交卷时间"
prop=
"config.min_submit_time"
v-if=
"false"
>
<el-date-picker
<el-date-picker
v-model=
"form.config.min_submit_time"
v-model=
"form.config.min_submit_time"
type=
"datetime"
type=
"datetime"
...
@@ -220,16 +227,13 @@ function disabledMinSubmitDate(time: Date) {
...
@@ -220,16 +227,13 @@ function disabledMinSubmitDate(time: Date) {
:disabled-date=
"disabledMinSubmitDate"
:disabled-date=
"disabledMinSubmitDate"
style=
"width: 100%"
/>
style=
"width: 100%"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"试题"
prop=
"questions"
>
<el-form-item
label=
"试题"
prop=
"questions"
v-if=
"false"
>
<el-select
v-model=
"form.questions"
style=
"width: 100%"
placeholder=
"请选择"
filterable
>
<el-select
v-model=
"form.questions"
style=
"width: 100%"
placeholder=
"请选择"
filterable
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"实操试题"
prop=
"config.practical_question"
>
<el-form-item
label=
"实操试题"
prop=
"config.practical_question"
>
<AppEditor
<AppEditor
v-model=
"form.config.practical_question"
:height=
"320"
placeholder=
"请输入实操试题内容"
/>
v-model=
"form.config.practical_question"
:height=
"320"
placeholder=
"请输入实操试题内容"
/>
</el-form-item>
</el-form-item>
<el-divider
/>
<el-divider
/>
<el-form-item
label-width=
"0"
>
<el-form-item
label-width=
"0"
>
...
...
src/modules/student/lab/views/Competition.vue
浏览文件 @
030b547a
...
@@ -60,24 +60,31 @@ const handleSubmit = async () => {
...
@@ -60,24 +60,31 @@ const handleSubmit = async () => {
await
submit
()
await
submit
()
ElMessage
.
success
(
'提交成功'
)
ElMessage
.
success
(
'提交成功'
)
isEntry
.
value
=
false
isEntry
.
value
=
false
}
}
,
)
)
}
}
const
tabActive
=
ref
(
'bi'
)
const
tabActive
=
ref
(
'bi'
)
const
practicalQuestionHtml
=
computed
(()
=>
{
const
competitionConfig
=
computed
(()
=>
{
const
rawConfig
=
competition
.
value
?.
config
const
rawConfig
=
competition
.
value
?.
config
if
(
!
rawConfig
)
return
''
if
(
!
rawConfig
)
return
{}
try
{
try
{
const
config
=
typeof
rawConfig
===
'string'
?
JSON
.
parse
(
rawConfig
)
:
rawConfig
return
typeof
rawConfig
===
'string'
?
JSON
.
parse
(
rawConfig
)
:
rawConfig
return
config
?.
practical_question
||
''
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
error
)
console
.
error
(
error
)
return
''
return
{}
}
}
})
})
const
isFormalMode
=
computed
(()
=>
{
return
competitionConfig
.
value
?.
mode
===
'formal'
})
const
practicalQuestionHtml
=
computed
(()
=>
{
return
competitionConfig
.
value
?.
practical_question
||
''
})
useEventListener
(
window
,
'message'
,
async
(
event
)
=>
{
useEventListener
(
window
,
'message'
,
async
(
event
)
=>
{
console
.
log
(
event
)
console
.
log
(
event
)
const
{
data
}
=
event
const
{
data
}
=
event
...
@@ -102,17 +109,31 @@ useEventListener(window, 'message', async (event) => {
...
@@ -102,17 +109,31 @@ useEventListener(window, 'message', async (event) => {
<template
v-if=
"competition?.competition == '4'"
>
<template
v-if=
"competition?.competition == '4'"
>
<AppCard>
<AppCard>
<el-button
:type=
"tabActive === 'bi' ? 'primary' : 'default'"
@
click=
"tabActive = 'bi'"
>
实操环境
</el-button>
<el-button
:type=
"tabActive === 'bi' ? 'primary' : 'default'"
@
click=
"tabActive = 'bi'"
>
实操环境
</el-button>
<el-button
:type=
"tabActive === 'exam' ? 'primary' : 'default'"
@
click=
"tabActive = 'exam'"
>
理论试题
</el-button>
<el-button
:type=
"tabActive === 'exam' ? 'primary' : 'default'"
@
click=
"tabActive = 'exam'"
>
理论试题
</el-button
>
</AppCard>
</AppCard>
<div
class=
"iframe-box"
>
<div
class=
"iframe-box"
>
<iframe
allow=
"camera; microphone"
allowfullscreen
:src=
"biURL"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
<iframe
allow=
"camera; microphone"
allowfullscreen
:src=
"biURL"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
v-show=
"tabActive === 'bi'"
></iframe>
v-show=
"tabActive === 'bi'"
></iframe>
<iframe
allow=
"camera; microphone"
allowfullscreen
:src=
"examURL"
frameborder=
"0"
class=
"iframe"
<iframe
ref=
"iframeRef"
v-show=
"tabActive === 'exam'"
></iframe>
allow=
"camera; microphone"
allowfullscreen
:src=
"examURL"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
v-show=
"tabActive === 'exam'"
></iframe>
</div>
</div>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<AppCard>
<AppCard
v-if=
"isFormalMode"
>
<div
class=
"competition-header"
>
<div
class=
"competition-header"
>
<div
class=
"time"
>
<div
class=
"time"
>
<div
class=
"label"
>
倒计时:
</div>
<div
class=
"label"
>
倒计时:
</div>
...
@@ -122,7 +143,12 @@ useEventListener(window, 'message', async (event) => {
...
@@ -122,7 +143,12 @@ useEventListener(window, 'message', async (event) => {
</div>
</div>
</AppCard>
</AppCard>
<div
class=
"iframe-box"
>
<div
class=
"iframe-box"
>
<iframe
allow=
"camera; microphone"
allowfullscreen
:src=
"LAB_URL"
frameborder=
"0"
class=
"iframe"
<iframe
allow=
"camera; microphone"
allowfullscreen
:src=
"LAB_URL"
frameborder=
"0"
class=
"iframe"
ref=
"iframeRef"
></iframe>
ref=
"iframeRef"
></iframe>
</div>
</div>
</
template
>
</
template
>
...
@@ -138,7 +164,9 @@ useEventListener(window, 'message', async (event) => {
...
@@ -138,7 +164,9 @@ useEventListener(window, 'message', async (event) => {
<p>
{{
competition
?.
start_time
}}
~
{{
competition
?.
end_time
}}
</p>
<p>
{{
competition
?.
start_time
}}
~
{{
competition
?.
end_time
}}
</p>
</div>
</div>
</div>
</div>
<el-button
v-if=
"canEnter"
type=
"primary"
size=
"large"
@
click=
"handleEntry"
class=
"entry-btn"
>
进入实操考试
</el-button>
<el-button
v-if=
"canEnter"
type=
"primary"
size=
"large"
@
click=
"handleEntry"
class=
"entry-btn"
>
进入实操考试
</el-button
>
<el-button
plain
v-if=
"isSubmitted"
type=
"primary"
size=
"large"
class=
"entry-btn"
>
考试已提交
</el-button>
<el-button
plain
v-if=
"isSubmitted"
type=
"primary"
size=
"large"
class=
"entry-btn"
>
考试已提交
</el-button>
</div>
</div>
<el-empty
description=
"暂无比赛"
v-else
/>
<el-empty
description=
"暂无比赛"
v-else
/>
...
@@ -308,7 +336,9 @@ useEventListener(window, 'message', async (event) => {
...
@@ -308,7 +336,9 @@ useEventListener(window, 'message', async (event) => {
p
{
p
{
font-size
:
18px
;
font-size
:
18px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
font-weight
:
400
;
color
:
#fff
;
color
:
#fff
;
line-height
:
25px
;
line-height
:
25px
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论