Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
8e5c7263
提交
8e5c7263
authored
12月 06, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: #3269
上级
e79295c1
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
27 行增加
和
13 行删除
+27
-13
Result.vue
src/modules/student/lab/components/Result.vue
+20
-11
types.ts
src/modules/student/lab/types.ts
+1
-0
Index.vue
src/modules/student/lab/views/Index.vue
+6
-2
没有找到文件。
src/modules/student/lab/components/Result.vue
浏览文件 @
8e5c7263
<
script
setup
lang=
"ts"
>
import
type
{
ExperimentRecord
,
ExperimentRecordFile
}
from
'../types'
import
type
{
Experiment
Info
,
Experiment
Record
,
ExperimentRecordFile
}
from
'../types'
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
import
ImageViewer
from
'@/components/ImageViewer.vue'
import
{
uploadExperimentPicture
,
getExperimentReport
,
getExperimentReportCache
}
from
'../api'
const
ResultScoreDialog
=
defineAsyncComponent
(()
=>
import
(
'./ResultScoreDialog.vue'
))
interface
Props
{
experiment_id
?:
string
data
?:
ExperimentInfo
}
const
props
=
defineProps
<
Props
>
()
...
...
@@ -21,6 +21,15 @@ const dialogVisible = $ref(false)
const
canRemove
=
$computed
(()
=>
{
return
!
(
detail
?.
status
!==
0
)
})
const
hasScore
=
$computed
(()
=>
{
if
(
props
.
data
?.
report_upload_way
===
2
)
{
// 在线报告
return
props
.
data
.
is_commit_report
?
detail
?.
is_check_report
&&
detail
?.
status
===
2
:
detail
?.
status
===
2
}
else
{
return
detail
?.
status
===
2
}
})
let
imageViewerVisible
=
$ref
<
boolean
>
(
false
)
let
imageViewerIndex
=
$ref
<
number
>
(
0
)
// 查看
...
...
@@ -30,9 +39,9 @@ function handlePreview(index: number) {
}
// 删除
async
function
handleRemove
(
index
:
number
,
file
:
ExperimentRecordFile
)
{
if
(
!
props
.
experiment_id
)
return
if
(
!
props
.
data
)
return
let
reportDetail
:
any
=
[]
await
getExperimentReportCache
({
experiment_id
:
props
.
experiment_
id
}).
then
(
res
=>
{
await
getExperimentReportCache
({
experiment_id
:
props
.
data
.
id
}).
then
(
res
=>
{
const
report
=
res
.
data
.
report
if
(
report
.
detail
)
{
try
{
...
...
@@ -42,7 +51,7 @@ async function handleRemove(index: number, file: ExperimentRecordFile) {
}
}
})
await
getExperimentReport
({
experiment_id
:
props
.
experiment_
id
}).
then
(
res
=>
{
await
getExperimentReport
({
experiment_id
:
props
.
data
.
id
}).
then
(
res
=>
{
const
report
=
res
.
data
.
report
if
(
report
.
detail
)
{
try
{
...
...
@@ -64,9 +73,9 @@ async function handleRemove(index: number, file: ExperimentRecordFile) {
return
}
ElMessageBox
.
confirm
(
'删除之后无法恢复,确认删除该截图吗?'
,
'提示'
).
then
(()
=>
{
if
(
!
props
.
experiment_id
)
return
if
(
!
props
.
data
)
return
const
pictures
=
detail
?.
pictures
.
filter
((
item
,
i
)
=>
i
!==
index
)
uploadExperimentPicture
({
experiment_id
:
props
.
experiment_
id
,
pictures
:
JSON
.
stringify
(
pictures
)
}).
then
(()
=>
{
uploadExperimentPicture
({
experiment_id
:
props
.
data
.
id
,
pictures
:
JSON
.
stringify
(
pictures
)
}).
then
(()
=>
{
emit
(
'update'
)
})
})
...
...
@@ -74,10 +83,10 @@ async function handleRemove(index: number, file: ExperimentRecordFile) {
</
script
>
<
template
>
<template
v-if=
"detail &&
experiment_id
"
>
<template
v-if=
"detail &&
data
"
>
<div
class=
"result-score"
>
<h2>
我的成绩
</h2>
<template
v-if=
"
detail.status === 2
"
>
<template
v-if=
"
hasScore
"
>
<p
class=
"t1"
@
click=
"dialogVisible = !dialogVisible"
>
{{
parseFloat
(
detail
.
score
)
}}
</p>
<p
class=
"t2"
>
批改讲师:
{{
detail
.
checker_user
.
real_name
}}
</p>
</
template
>
...
...
@@ -101,8 +110,8 @@ async function handleRemove(index: number, file: ExperimentRecordFile) {
<ImageViewer
v-model=
"imageViewerVisible"
:index=
"imageViewerIndex"
:items=
"detail.pictures"
></ImageViewer>
<ResultScoreDialog
v-model=
"dialogVisible"
:experiment_id=
"
experiment_
id"
v-if=
"dialogVisible &&
experiment_id
"
></ResultScoreDialog>
:experiment_id=
"
data.
id"
v-if=
"dialogVisible &&
data
"
></ResultScoreDialog>
</template>
<el-empty
description=
"暂无数据"
v-else
/>
</template>
...
...
src/modules/student/lab/types.ts
浏览文件 @
8e5c7263
...
...
@@ -104,6 +104,7 @@ export interface ExperimentRecord {
}
course
:
CourseType
student
:
ExperimentStudent
is_check_report
:
boolean
}
export
interface
ExperimentRecordFile
{
url
:
string
...
...
src/modules/student/lab/views/Index.vue
浏览文件 @
8e5c7263
...
...
@@ -75,7 +75,11 @@ function fetchInfo() {
function
fetchExperimentRecord
()
{
if
(
!
form
.
experiment_id
)
return
getExperimentRecord
({
experiment_id
:
form
.
experiment_id
}).
then
(
res
=>
{
detail
=
Array
.
isArray
(
res
.
data
.
data
)
?
undefined
:
res
.
data
.
data
if
(
Array
.
isArray
(
res
.
data
.
data
))
{
detail
=
undefined
}
else
{
detail
=
{
...
res
.
data
.
data
,
is_check_report
:
res
.
data
.
is_check_report
}
}
})
}
...
...
@@ -237,7 +241,7 @@ function handleReportPreviewReady() {
<Discuss
:experiment_id=
"form.experiment_id"
></Discuss>
</el-tab-pane>
<el-tab-pane
label=
"过程与结果"
lazy
>
<Result
:
experiment_id=
"form.experiment_id
"
@
update=
"fetchExperimentRecord"
></Result>
<Result
:
data=
"experimentInfo
"
@
update=
"fetchExperimentRecord"
></Result>
</el-tab-pane>
</el-tabs>
</div>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论