Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
ec85999c
提交
ec85999c
authored
11月 25, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bug fixes
上级
70b2a0cb
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
80 行增加
和
28 行删除
+80
-28
ScoreDialog.vue
src/modules/admin/lab/score/components/ScoreDialog.vue
+62
-26
ScoreViewPrepareDialog.vue
...les/admin/lab/score/components/ScoreViewPrepareDialog.vue
+9
-1
ScoreViewResultDialog.vue
...ules/admin/lab/score/components/ScoreViewResultDialog.vue
+9
-1
没有找到文件。
src/modules/admin/lab/score/components/ScoreDialog.vue
浏览文件 @
ec85999c
...
...
@@ -2,7 +2,7 @@
import
type
{
RecordItem
,
FileItem
}
from
'../types'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
{
getExperimentScore
,
getExperimentScoreTemplate
,
updateExperimentScore
}
from
'../api'
import
{
getExperimentScore
,
getExperimentScoreTemplate
,
updateExperimentScore
,
getExperimentReport
}
from
'../api'
const
ScoreViewPicturesDialog
=
defineAsyncComponent
(()
=>
import
(
'./ScoreViewPicturesDialog.vue'
))
const
ScoreViewPrepareDialog
=
defineAsyncComponent
(()
=>
import
(
'./ScoreViewPrepareDialog.vue'
))
...
...
@@ -20,35 +20,40 @@ const emit = defineEmits<{
let
experiment
=
$ref
<
any
>
()
let
detail
=
$ref
<
any
>
()
function
fetchInfo
()
{
getExperimentScore
({
experiment_id
:
props
.
data
.
experiment_id
,
student_id
:
props
.
data
.
student_id
}).
then
(
res
=>
{
experiment
=
res
.
data
.
experiment
detail
=
res
.
data
.
achievement
if
(
detail
.
score_details
)
{
try
{
form
.
score_details
=
JSON
.
parse
(
detail
.
score_details
).
map
((
item
:
any
)
=>
{
return
{
...
item
,
percent
:
parseFloat
(
item
.
percent
),
score
:
parseFloat
(
item
.
score
),
commit_score
:
parseFloat
(
item
.
commit_score
)
}
})
}
catch
(
error
)
{
fetchTemplate
()
console
.
log
(
error
)
async
function
fetchInfo
()
{
await
getExperimentScore
({
experiment_id
:
props
.
data
.
experiment_id
,
student_id
:
props
.
data
.
student_id
}).
then
(
async
res
=>
{
experiment
=
res
.
data
.
experiment
detail
=
res
.
data
.
achievement
if
(
detail
.
score_details
)
{
try
{
form
.
score_details
=
JSON
.
parse
(
detail
.
score_details
).
map
((
item
:
any
)
=>
{
return
{
...
item
,
percent
:
parseFloat
(
item
.
percent
),
score
:
parseFloat
(
item
.
score
),
commit_score
:
parseFloat
(
item
.
commit_score
)
}
})
}
catch
(
error
)
{
await
fetchTemplate
()
console
.
log
(
error
)
}
}
else
{
await
fetchTemplate
()
}
if
(
experiment
.
report_upload_way
===
2
)
{
await
fetchReport
()
}
}
else
{
fetchTemplate
()
}
}
)
)
}
watchEffect
(()
=>
{
fetchInfo
()
})
function
fetchTemplate
()
{
getExperimentScoreTemplate
({
experiment_id
:
props
.
data
.
experiment_id
}).
then
(
res
=>
{
async
function
fetchTemplate
()
{
await
getExperimentScoreTemplate
({
experiment_id
:
props
.
data
.
experiment_id
}).
then
(
res
=>
{
form
.
score_details
=
res
.
data
.
detail
.
rule_list
.
map
((
item
:
any
)
=>
{
return
{
...
item
,
...
...
@@ -59,6 +64,24 @@ function fetchTemplate() {
})
})
}
// 获取实验报告分数
let
report
=
$ref
<
any
>
()
async
function
fetchReport
()
{
await
getExperimentReport
({
experiment_id
:
props
.
data
.
experiment_id
,
student_id
:
props
.
data
.
student_id
}).
then
(
res
=>
{
report
=
res
.
data
.
detail
const
reportScore
=
parseFloat
(
report
.
score
||
0
)
form
.
score_details
=
form
.
score_details
.
map
((
item
:
any
)
=>
{
if
(
item
.
type
===
1
)
{
item
.
commit_score
=
reportScore
}
return
item
})
}
)
}
// 实验报告文件
const
file
=
$computed
<
FileItem
>
(()
=>
{
try
{
...
...
@@ -95,6 +118,15 @@ function handleSubmit() {
}
)
}
function
scoreValue
(
value
:
any
)
{
if
(
typeof
value
!==
'number'
&&
!
value
)
{
return
'--'
}
else
{
return
value
}
}
const
pictureVisible
=
$ref
(
false
)
const
prepareVisible
=
$ref
(
false
)
const
resultVisible
=
$ref
(
false
)
...
...
@@ -140,7 +172,7 @@ const resultVisible = $ref(false)
</el-row>
</el-form-item>
<div
class=
"score-result"
>
<p
class=
"score-result__total"
>
{{
score
||
'--'
}}
</p>
<p
class=
"score-result__total"
>
{{
score
Value
(
score
)
}}
</p>
<el-table
:data=
"form.score_details"
stripe
...
...
@@ -154,7 +186,11 @@ const resultVisible = $ref(false)
<el-table-column
label=
"操作"
prop=
"commit_score"
align=
"center"
>
<
template
#
default=
"{ row }"
>
<template
v-if=
"row.type === 1"
>
<el-button
text
type=
"primary"
v-if=
"experiment.report_upload_way === 2"
>
<el-button
text
type=
"primary"
@
click=
"$emit('update:modelValue')"
v-if=
"experiment.report_upload_way === 2"
>
<router-link
:to=
"`/admin/lab/score/report?experiment_id=$
{data.experiment_id}
&
student_id=${data.student_id}`"
target="_blank"
...
...
@@ -171,7 +207,7 @@ const resultVisible = $ref(false)
step-strictly
placeholder=
"请输入成绩"
style=
"width: 100px"
></el-input-number>
<el-button
text
type=
"primary"
>
<el-button
text
type=
"primary"
v-if=
"file?.url"
>
<router-link
:to=
"file.url"
target=
"_blank"
>
查阅报告
</router-link>
</el-button>
</
template
>
...
...
src/modules/admin/lab/score/components/ScoreViewPrepareDialog.vue
浏览文件 @
ec85999c
...
...
@@ -20,7 +20,7 @@ onMounted(() => {
<
template
>
<el-dialog
title=
"查看实验准备"
width=
"800px"
>
<div
v-html=
"detail.detail"
v-if=
"detail"
></div>
<div
class=
"dialog-html"
v-html=
"detail.detail"
v-if=
"detail"
></div>
<template
#
footer
>
<el-row
justify=
"center"
>
<el-button
round
auto-insert-space
@
click=
"$emit('update:modelValue', false)"
>
关闭
</el-button>
...
...
@@ -28,3 +28,11 @@ onMounted(() => {
</
template
>
</el-dialog>
</template>
<
style
lang=
"scss"
scoped
>
.dialog-html
{
:deep
(*)
{
max-width
:
100%
;
}
}
</
style
>
src/modules/admin/lab/score/components/ScoreViewResultDialog.vue
浏览文件 @
ec85999c
...
...
@@ -20,7 +20,7 @@ onMounted(() => {
<
template
>
<el-dialog
title=
"查看实验结果"
width=
"800px"
>
<div
v-html=
"detail.detail"
v-if=
"detail"
></div>
<div
class=
"dialog-html"
v-html=
"detail.detail"
v-if=
"detail"
></div>
<template
#
footer
>
<el-row
justify=
"center"
>
<el-button
round
auto-insert-space
@
click=
"$emit('update:modelValue', false)"
>
关闭
</el-button>
...
...
@@ -28,3 +28,11 @@ onMounted(() => {
</
template
>
</el-dialog>
</template>
<
style
lang=
"scss"
scoped
>
.dialog-html
{
:deep
(*)
{
max-width
:
100%
;
}
}
</
style
>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论