Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-lab
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-lab
Commits
7b162517
提交
7b162517
authored
3月 20, 2024
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: 新增批量导出和同步理论成绩在实验成绩管理
上级
2fa8d884
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
92 行增加
和
41 行删除
+92
-41
api.ts
src/modules/admin/lab/score/api.ts
+13
-14
ExportDialog.vue
src/modules/admin/lab/score/components/ExportDialog.vue
+27
-0
SyncExamDialog.vue
src/modules/admin/lab/score/components/SyncExamDialog.vue
+33
-0
Index.vue
src/modules/admin/lab/score/views/Index.vue
+19
-27
没有找到文件。
src/modules/admin/lab/score/api.ts
浏览文件 @
7b162517
...
@@ -24,13 +24,7 @@ export function getExperimentRecord(params: { experiment_id: string; student_id:
...
@@ -24,13 +24,7 @@ export function getExperimentRecord(params: { experiment_id: string; student_id:
}
}
// 实验记录评分
// 实验记录评分
export
function
checkExperimentRecord
(
data
:
{
export
function
checkExperimentRecord
(
data
:
{
experiment_id
:
string
;
student_id
:
string
;
operate
:
number
;
result
:
number
;
file
:
number
})
{
experiment_id
:
string
student_id
:
string
operate
:
number
result
:
number
file
:
number
})
{
return
httpRequest
.
post
(
'/api/lab/v1/teacher/record/check'
,
data
)
return
httpRequest
.
post
(
'/api/lab/v1/teacher/record/check'
,
data
)
}
}
...
@@ -56,12 +50,7 @@ export function getExperimentReport(params: { experiment_id: string; student_id:
...
@@ -56,12 +50,7 @@ export function getExperimentReport(params: { experiment_id: string; student_id:
return
httpRequest
.
get
(
'/api/lab/v1/teacher/experiment/report-achievement'
,
{
params
})
return
httpRequest
.
get
(
'/api/lab/v1/teacher/experiment/report-achievement'
,
{
params
})
}
}
// 批改学员实验报告成绩
// 批改学员实验报告成绩
export
function
updateExperimentReport
(
data
:
{
export
function
updateExperimentReport
(
data
:
{
experiment_id
:
string
;
student_id
:
string
;
score_detail
:
string
;
comment
:
string
})
{
experiment_id
:
string
student_id
:
string
score_detail
:
string
comment
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/teacher/experiment/report-check'
,
data
)
return
httpRequest
.
post
(
'/api/lab/v1/teacher/experiment/report-check'
,
data
)
}
}
...
@@ -95,10 +84,20 @@ export function updateQuestionScore(data: { question_id: string; student_id: str
...
@@ -95,10 +84,20 @@ export function updateQuestionScore(data: { question_id: string; student_id: str
}
}
// 同步学生分数
// 同步学生分数
export
function
asyncStudentResult
(
data
:
{
experiment_id
:
string
;
student_id
:
string
;
})
{
export
function
asyncStudentResult
(
data
:
{
experiment_id
:
string
;
student_id
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/teacher/experiment-question/async-student-result'
,
data
)
return
httpRequest
.
post
(
'/api/lab/v1/teacher/experiment-question/async-student-result'
,
data
)
}
}
export
function
getStudentTicket
(
params
:
{
student_id
:
string
})
{
export
function
getStudentTicket
(
params
:
{
student_id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/teacher/system/get-student-ticket'
,
{
params
})
return
httpRequest
.
get
(
'/api/lab/v1/teacher/system/get-student-ticket'
,
{
params
})
}
}
// 批量导出实验记录评分
export
function
exportExperimentRecord
(
params
:
{
experiment_id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/teacher/record/download'
,
{
params
})
}
// 同步理论成绩
export
function
syncExperimentExam
(
params
:
{
experiment_id
:
string
})
{
return
httpRequest
.
get
(
'/api/lab/v1/teacher/record/sync-theory-score'
,
{
params
})
}
src/modules/admin/lab/score/components/ExportDialog.vue
0 → 100644
浏览文件 @
7b162517
<
script
setup
lang=
"ts"
>
import
{
useFilterList
}
from
'../composables/useFilterList'
const
{
experiments
}
=
useFilterList
()
const
form
=
reactive
<
any
>
({
experiment_id
:
''
})
const
exportUrl
=
computed
(()
=>
{
return
`/api/lab/v1/teacher/record/download?experiment_id=
${
form
.
experiment_id
}
`
})
</
script
>
<
template
>
<el-dialog
title=
"批量导出"
:close-on-click-modal=
"false"
width=
"400px"
>
<el-form
label-width=
"70px"
>
<el-form-item
label=
"实验名称"
>
<el-select
v-model=
"form.experiment_id"
>
<el-option
v-for=
"item in experiments"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
<a
:href=
"exportUrl"
target=
"_blank"
>
<el-button
type=
"primary"
:disabled=
"!form.experiment_id"
>
导出
</el-button>
</a>
</el-form-item>
</el-form>
</el-dialog>
</
template
>
src/modules/admin/lab/score/components/SyncExamDialog.vue
0 → 100644
浏览文件 @
7b162517
<
script
setup
lang=
"ts"
>
import
{
ElMessage
}
from
'element-plus'
import
{
useFilterList
}
from
'../composables/useFilterList'
import
{
syncExperimentExam
}
from
'../api'
const
emit
=
defineEmits
<
{
(
e
:
'update'
):
void
}
>
()
const
{
experiments
}
=
useFilterList
()
const
form
=
reactive
({
experiment_id
:
''
})
// 同步
function
handleSync
()
{
syncExperimentExam
({
experiment_id
:
form
.
experiment_id
}).
then
(()
=>
{
ElMessage
.
success
(
'同步成功'
)
emit
(
'update'
)
})
}
</
script
>
<
template
>
<el-dialog
title=
"同步1+X考试成绩"
:close-on-click-modal=
"false"
width=
"440px"
>
<el-form>
<el-form-item
label=
"实验名称"
>
<el-select
v-model=
"form.experiment_id"
value-key=
"id"
>
<el-option
v-for=
"item in experiments"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
<el-button
type=
"primary"
:disabled=
"!form.experiment_id"
@
click=
"handleSync"
>
一键同步成绩
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</
template
>
src/modules/admin/lab/score/views/Index.vue
浏览文件 @
7b162517
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
type
{
RecordItem
}
from
'../types'
import
type
{
RecordItem
}
from
'../types'
import
{
Upload
,
Promotion
}
from
'@element-plus/icons-vue'
import
{
Upload
,
Promotion
,
Download
,
Refresh
}
from
'@element-plus/icons-vue'
import
AppList
from
'@/components/base/AppList.vue'
import
AppList
from
'@/components/base/AppList.vue'
import
{
getExperimentRecordList
}
from
'../api'
import
{
getExperimentRecordList
}
from
'../api'
import
{
useFilterList
}
from
'../composables/useFilterList'
import
{
useFilterList
}
from
'../composables/useFilterList'
...
@@ -8,6 +8,8 @@ import { useCookies } from '@vueuse/integrations/useCookies'
...
@@ -8,6 +8,8 @@ import { useCookies } from '@vueuse/integrations/useCookies'
const
ScoreDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ScoreDialog.vue'
))
const
ScoreDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ScoreDialog.vue'
))
const
ImportDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ImportDialog.vue'
))
const
ImportDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ImportDialog.vue'
))
const
ExportDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ExportDialog.vue'
))
const
SyncExamDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/SyncExamDialog.vue'
))
const
ScoreLogDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ScoreLogDialog.vue'
))
const
ScoreLogDialog
=
defineAsyncComponent
(()
=>
import
(
'../components/ScoreLogDialog.vue'
))
const
{
courses
,
experiments
,
specialties
,
classes
}
=
useFilterList
()
const
{
courses
,
experiments
,
specialties
,
classes
}
=
useFilterList
()
...
@@ -118,6 +120,9 @@ function handleScoreLog(row: RecordItem) {
...
@@ -118,6 +120,9 @@ function handleScoreLog(row: RecordItem) {
function
onUpdateSuccess
()
{
function
onUpdateSuccess
()
{
appList
?.
refetch
()
appList
?.
refetch
()
}
}
const
exportVisible
=
ref
(
false
)
const
syncVisible
=
ref
(
false
)
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -125,14 +130,13 @@ function onUpdateSuccess() {
...
@@ -125,14 +130,13 @@ function onUpdateSuccess() {
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<AppList
v-bind=
"listOptions"
ref=
"appList"
>
<template
#
header-buttons
>
<template
#
header-buttons
>
<el-row
justify=
"space-between"
>
<el-row
justify=
"space-between"
>
<el-button
<div>
type=
"primary"
<el-button
type=
"primary"
round
:icon=
"Upload"
@
click=
"importVisible = true"
v-permission=
"'v1-teacher-record-upload'"
>
批量导入
</el-button>
round
<el-button
type=
"primary"
round
:icon=
"Download"
@
click=
"exportVisible = true"
v-permission=
"'v1-teacher-record-download'"
>
批量导出
</el-button>
:icon=
"Upload"
<el-button
type=
"primary"
round
:icon=
"Refresh"
@
click=
"syncVisible = true"
v-permission=
"'v1-teacher-record-sync-theory-score'"
@
click=
"importVisible = true"
>
同步理论成绩
</el-button
v-permission=
"'v1-teacher-record-upload'"
>
批量导入
</el-button
>
>
</div>
<a
:href=
"LAB_URL"
target=
"_blank"
>
<a
:href=
"LAB_URL"
target=
"_blank"
>
<el-button
type=
"primary"
round
:icon=
"Promotion"
>
进入实验室
</el-button>
<el-button
type=
"primary"
round
:icon=
"Promotion"
>
进入实验室
</el-button>
</a>
</a>
...
@@ -145,35 +149,23 @@ function onUpdateSuccess() {
...
@@ -145,35 +149,23 @@ function onUpdateSuccess() {
<span
:class=
"
{ 'is-info': row.score !== '--' }">
{{
row
.
score
}}
</span>
<span
:class=
"
{ 'is-info': row.score !== '--' }">
{{
row
.
score
}}
</span>
</
template
>
</
template
>
<
template
#
table-x=
"{ row }"
>
<
template
#
table-x=
"{ row }"
>
<el-button
<el-button
text
type=
"primary"
v-if=
"row.status === 1 || row.status === 2"
@
click=
"handleScore(row)"
v-permission=
"'v1-teacher-record-check'"
text
type=
"primary"
v-if=
"row.status === 1 || row.status === 2"
@
click=
"handleScore(row)"
v-permission=
"'v1-teacher-record-check'"
>
打分
</el-button
>
打分
</el-button
>
>
<el-button
<el-button
text
type=
"primary"
v-if=
"row.has_score_log"
@
click=
"handleScoreLog(row)"
v-permission=
"'v1-teacher-record-check'"
>
查看历史成绩
</el-button>
text
type=
"primary"
v-if=
"row.has_score_log"
@
click=
"handleScoreLog(row)"
v-permission=
"'v1-teacher-record-check'"
>
查看历史成绩
</el-button
>
</
template
>
</
template
>
</AppList>
</AppList>
</AppCard>
</AppCard>
<!-- 评分 -->
<!-- 评分 -->
<ScoreDialog
<ScoreDialog
v-model=
"dialogVisible"
:data=
"rowData"
@
update=
"onUpdateSuccess"
v-if=
"dialogVisible && rowData"
></ScoreDialog>
v-model=
"dialogVisible"
:data=
"rowData"
@
update=
"onUpdateSuccess"
v-if=
"dialogVisible && rowData"
></ScoreDialog>
<!-- 历史成绩 -->
<!-- 历史成绩 -->
<ScoreLogDialog
v-model=
"scoreLogVisible"
:data=
"rowData"
v-if=
"scoreLogVisible && rowData"
></ScoreLogDialog>
<ScoreLogDialog
v-model=
"scoreLogVisible"
:data=
"rowData"
v-if=
"scoreLogVisible && rowData"
></ScoreLogDialog>
<!-- 批量导入 -->
<!-- 批量导入 -->
<ImportDialog
v-model=
"importVisible"
@
update=
"onUpdateSuccess"
v-if=
"importVisible"
></ImportDialog>
<ImportDialog
v-model=
"importVisible"
@
update=
"onUpdateSuccess"
v-if=
"importVisible"
></ImportDialog>
<!-- 批量导出 -->
<ExportDialog
v-model=
"exportVisible"
v-if=
"exportVisible"
></ExportDialog>
<!-- 同步理论成绩 -->
<SyncExamDialog
v-model=
"syncVisible"
v-if=
"syncVisible"
></SyncExamDialog>
</template>
</template>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论