Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
74124d5d
提交
74124d5d
authored
10月 08, 2023
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 大赛新增实操试卷
上级
83dd5a68
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
87 行增加
和
39 行删除
+87
-39
api.ts
src/modules/admin/contest/items/api.ts
+3
-3
ViewExam.vue
src/modules/admin/contest/items/components/ViewExam.vue
+15
-1
ViewExamFormDialog.vue
...les/admin/contest/items/components/ViewExamFormDialog.vue
+10
-3
View.vue
src/modules/admin/contest/items/views/View.vue
+1
-1
api.ts
src/modules/student/contest/api.ts
+7
-14
Exam.vue
src/modules/student/contest/components/Exam.vue
+41
-0
Lab.vue
src/modules/student/contest/views/Lab.vue
+10
-17
没有找到文件。
src/modules/admin/contest/items/api.ts
浏览文件 @
74124d5d
...
...
@@ -152,15 +152,15 @@ export function deleteQuestion(data: { id: string }) {
export
function
getAllExamList
(
params
:
{
competition_id
:
string
})
{
return
httpRequest
.
get
(
'/api/resource/v1/backend/competition-exam/list'
,
{
params
})
}
// 添加大赛
模块
试卷
// 添加大赛试卷
export
function
createExam
(
data
:
{
competition_id
:
string
;
exam_id
:
string
;
sort
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/competition-exam/create'
,
data
)
}
// 更新大赛
模块
试卷
// 更新大赛试卷
export
function
updateExam
(
data
:
{
id
:
string
;
exam_id
:
string
;
sort
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/competition-exam/update'
,
data
)
}
// 删除大赛
模块
试卷
// 删除大赛试卷
export
function
deleteExam
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/resource/v1/backend/competition-exam/delete'
,
data
)
}
src/modules/admin/contest/items/components/ViewExam.vue
浏览文件 @
74124d5d
...
...
@@ -25,7 +25,21 @@ const listOptions = {
columns
:
[
{
label
:
'序号'
,
type
:
'index'
,
width
:
60
},
{
label
:
'试卷名称'
,
prop
:
'exam_info.name'
},
{
label
:
'模块'
,
prop
:
'sort'
},
{
label
:
'试卷类型'
,
prop
:
'type'
,
computed
({
row
}:
{
row
:
any
})
{
const
map
:
Record
<
string
,
string
>
=
{
'1'
:
'正式比赛试卷'
,
'2'
:
'训练试卷'
}
return
map
[
row
.
type
]
||
row
.
type
}
},
{
label
:
'模块'
,
prop
:
'sort'
,
computed
({
row
}:
{
row
:
any
})
{
return
row
.
type
===
'1'
?
row
.
sort
:
''
}
},
{
label
:
'创建人'
,
prop
:
'created_operator_name'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
},
{
label
:
'更新时间'
,
prop
:
'updated_time'
},
...
...
src/modules/admin/contest/items/components/ViewExamFormDialog.vue
浏览文件 @
74124d5d
...
...
@@ -21,6 +21,7 @@ const formRef = $ref<FormInstance>()
const
form
=
reactive
<
any
>
({
competition_id
:
detail
.
id
,
exam_id
:
''
,
type
:
'1'
,
sort
:
1
,
platform_key
:
'career_data_analysis'
})
...
...
@@ -36,7 +37,7 @@ const isUpdate = $computed(() => {
return
!!
props
.
data
?.
id
})
const
title
=
$computed
(()
=>
{
return
isUpdate
?
'编辑大赛
模块试卷'
:
'新增大赛模块
试卷'
return
isUpdate
?
'编辑大赛
试卷'
:
'新增大赛
试卷'
})
let
examList
=
$ref
<
Record
<
string
,
any
>
[]
>
([])
...
...
@@ -52,7 +53,7 @@ onMounted(() => {
// 提交
function
handleSubmit
()
{
formRef
?.
validate
().
then
(()
=>
{
const
params
=
Object
.
assign
({},
pick
(
form
,
[
'competition_id'
,
'exam_id'
,
'sort'
]))
const
params
=
Object
.
assign
({},
pick
(
form
,
[
'competition_id'
,
'exam_id'
,
'sort'
,
'type'
]))
isUpdate
?
handleUpdate
(
params
)
:
handleCreate
(
params
)
})
}
...
...
@@ -78,12 +79,18 @@ function handleUpdate(params: any) {
<
template
>
<el-dialog
:title=
"title"
:close-on-click-modal=
"false"
width=
"600px"
@
update:modelValue=
"$emit('update:modelValue')"
>
<el-form
ref=
"formRef"
:model=
"form"
:rules=
"rules"
label-width=
"90px"
>
<el-form-item
label=
"试卷类型"
prop=
"type"
>
<el-radio-group
v-model=
"form.type"
>
<el-radio
label=
"1"
>
正式比赛试卷
</el-radio>
<el-radio
label=
"2"
>
训练试卷
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"试卷名称"
prop=
"exam_id"
>
<el-select
v-model=
"form.exam_id"
filterable
style=
"width: 100%"
>
<el-option
v-for=
"item in examList"
:key=
"item.exam_id"
:label=
"item.name"
:value=
"item.exam_id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"模块"
prop=
"sort"
>
<el-form-item
label=
"模块"
prop=
"sort"
v-if=
"form.type === '1'"
>
<el-select
v-model=
"form.sort"
>
<el-option
v-for=
"item in 6"
:value=
"item"
:key=
"item"
></el-option>
</el-select>
...
...
src/modules/admin/contest/items/views/View.vue
浏览文件 @
74124d5d
...
...
@@ -155,7 +155,7 @@ function handleExperts() {
<AppCard
title=
"大赛试题"
>
<ViewQuestion
:id=
"id"
></ViewQuestion>
</AppCard>
<AppCard
title=
"大赛
模块
试卷"
>
<AppCard
title=
"大赛试卷"
>
<ViewExam
:id=
"id"
></ViewExam>
</AppCard>
<!-- 评分规则 -->
...
...
src/modules/student/contest/api.ts
浏览文件 @
74124d5d
...
...
@@ -51,12 +51,7 @@ export function getExperimentVideoPlayInfo(params: { source_id: string }) {
}
// 获取实验讨论交流
export
function
getExperimentDiscussList
(
params
:
{
competition_id
:
string
tag
:
number
page
?:
number
'per-page'
?:
number
})
{
export
function
getExperimentDiscussList
(
params
:
{
competition_id
:
string
;
tag
:
number
;
page
?:
number
;
'per-page'
?:
number
})
{
return
httpRequest
.
get
(
'/api/lab/v1/student/competition/discussion-list'
,
{
params
})
}
// 发表新话题
...
...
@@ -93,14 +88,7 @@ export function getExperimentReport(params: { competition_id: string; platform_k
}
// 上传实验报告
export
function
uploadExperimentReport
(
data
:
{
competition_id
:
string
platform_key
:
string
name
:
string
url
:
string
size
:
number
desc
:
string
})
{
export
function
uploadExperimentReport
(
data
:
{
competition_id
:
string
;
platform_key
:
string
;
name
:
string
;
url
:
string
;
size
:
number
;
desc
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/student/competition/save-train-report'
,
data
)
}
...
...
@@ -108,3 +96,8 @@ export function uploadExperimentReport(data: {
export
function
deleteExperimentReport
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/student/competition/delete-train-report'
,
data
)
}
// 获取实操试卷
export
function
getExperimentExam
(
params
:
{
competition_id
:
string
;
platform_key
:
string
;
project
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/student/competition/train-exams'
,
{
params
})
}
src/modules/student/contest/components/Exam.vue
0 → 100644
浏览文件 @
74124d5d
<
script
setup
lang=
"ts"
>
import
{
useCookies
}
from
'@vueuse/integrations/useCookies'
import
{
getExperimentExam
}
from
'../api'
interface
Props
{
competition_id
:
string
experiment_id
?:
any
}
const
props
=
defineProps
<
Props
>
()
const
route
=
useRoute
()
const
cookies
=
useCookies
()
const
list
=
ref
<
any
[]
>
([])
// 当前选中的考试
const
currentExam
=
computed
(()
=>
{
return
list
.
value
[
0
]
})
// 考试平台 URL
const
examURL
=
computed
(()
=>
{
return
`https://exam-show.ezijing.com/exam/
${
currentExam
.
value
?.
exam_id
}?
has_time
=
0
&
has_submit
=
0
&
has_save
=
1
`
// return `
https
:
//dev.ezijing.com:5173/exam/7003551966412406784?has_time=0&has_submit=0&has_save=1`
})
async
function
fetchInfo
()
{
const
res
=
await
getExperimentExam
({
competition_id
:
props
.
competition_id
,
platform_key
:
route
.
query
?.
type
as
string
,
project
:
'x1'
})
const
resCookies
=
res
.
data
.
cookies
cookies
.
set
(
resCookies
.
key
,
resCookies
.
auth_key
,
{
domain
:
'.ezijing.com'
,
path
:
'/'
})
list
.
value
=
res
.
data
.
items
||
[]
}
onMounted
(()
=>
{
fetchInfo
()
})
</
script
>
<
template
>
<iframe
class=
"iframe"
:src=
"examURL"
frameborder=
"0"
v-if=
"currentExam"
></iframe>
<el-empty
description=
"暂无数据"
v-else
/>
</
template
>
src/modules/student/contest/views/Lab.vue
浏览文件 @
74124d5d
...
...
@@ -12,6 +12,7 @@ const Book = defineAsyncComponent(() => import('../components/Book.vue'))
const
Video
=
defineAsyncComponent
(()
=>
import
(
'../components/Video.vue'
))
const
Discuss
=
defineAsyncComponent
(()
=>
import
(
'../components/Discuss.vue'
))
const
Result
=
defineAsyncComponent
(()
=>
import
(
'../components/Result.vue'
))
const
Exam
=
defineAsyncComponent
(()
=>
import
(
'../components/Exam.vue'
))
const
ReportDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ReportDialog.vue'
))
const
route
=
useRoute
()
...
...
@@ -57,11 +58,9 @@ const cookies = useCookies(['TGC'])
let
iframeKey
=
$ref
(
Date
.
now
())
// 返回首页
function
handleBackHome
()
{
ElMessageBox
.
confirm
(
'此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?'
,
'提示'
).
then
(
()
=>
{
iframeKey
=
Date
.
now
()
}
)
ElMessageBox
.
confirm
(
'此操作将会强制返回到实验室首页,您当前的操作内容有可能丢失,确定返回首页吗?'
,
'提示'
).
then
(()
=>
{
iframeKey
=
Date
.
now
()
})
}
const
iframeRef
=
$ref
<
HTMLIFrameElement
>
()
...
...
@@ -127,10 +126,7 @@ const getExperimentId = computed(() => {
const
item
=
competition
?.
train_platform_configs
.
find
((
item
:
any
)
=>
item
.
platform_key
===
route
.
query
.
type
)
let
value
=
'0'
if
(
item
?.
url
)
{
value
=
item
?.
url
.
indexOf
(
'experiment_id'
)
!==
-
1
?
item
?.
url
.
substring
(
item
?.
url
.
indexOf
(
'experiment_id='
)
+
14
,
item
?.
url
.
length
+
1
)
:
'0'
value
=
item
?.
url
.
indexOf
(
'experiment_id'
)
!==
-
1
?
item
?.
url
.
substring
(
item
?.
url
.
indexOf
(
'experiment_id='
)
+
14
,
item
?.
url
.
length
+
1
)
:
'0'
}
return
value
})
...
...
@@ -157,6 +153,9 @@ const reportDialogVisible = $ref(false)
<el-tab-pane
label=
"过程与结果"
lazy
>
<Result
:competition_id=
"id"
@
update=
"fetchInfo"
></Result>
</el-tab-pane>
<el-tab-pane
label=
"实操试卷"
lazy
>
<Exam
:competition_id=
"id"
></Exam>
</el-tab-pane>
</el-tabs>
</div>
</
template
>
...
...
@@ -174,10 +173,7 @@ const reportDialogVisible = $ref(false)
<div
class=
"close-btn"
@
click=
"handleShowHead"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 16 86"
aria-hidden=
"true"
width=
"16"
height=
"66"
>
<g
fill=
"none"
fill-rule=
"evenodd"
>
<path
class=
"path-wapper"
d=
"M0 0l14.12 8.825A4 4 0 0116 12.217v61.566a4 4 0 01-1.88 3.392L0 86V0z"
fill=
"#f8f9fa"
></path>
<path
class=
"path-wapper"
d=
"M0 0l14.12 8.825A4 4 0 0116 12.217v61.566a4 4 0 01-1.88 3.392L0 86V0z"
fill=
"#f8f9fa"
></path>
<path
class=
"path-arrow"
style=
"transform: rotate(180deg); transform-origin: center"
...
...
@@ -191,10 +187,7 @@ const reportDialogVisible = $ref(false)
</div>
</
template
>
</DragPanel>
<ReportDialog
v-model=
"reportDialogVisible"
:data=
"competition"
v-if=
"reportDialogVisible && competition"
></ReportDialog>
<ReportDialog
v-model=
"reportDialogVisible"
:data=
"competition"
v-if=
"reportDialogVisible && competition"
></ReportDialog>
</template>
<!-- 上传报告 -->
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论