Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
04de15b2
提交
04de15b2
authored
8月 12, 2026
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 添加重置考试状态功能,优化评分操作逻辑
上级
2d105ddf
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
41 行增加
和
8 行删除
+41
-8
api.ts
src/modules/score/api.ts
+5
-0
useScore.ts
src/modules/score/composables/useScore.ts
+25
-4
Index.vue
src/modules/score/views/Index.vue
+11
-4
没有找到文件。
src/modules/score/api.ts
浏览文件 @
04de15b2
...
...
@@ -20,6 +20,11 @@ export function updateScore(data: { id: string; check_status: number; total_scor
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-student-record/score'
,
data
)
}
// 重置考试状态(学生误触提交时,将已提交重置为未提交,允许重新作答)
export
function
resetStatus
(
data
:
{
id
:
string
})
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-student-record/reset-status'
,
data
)
}
// 一键发布成绩
export
function
publishAll
()
{
return
httpRequest
.
post
(
'/api/lab/v1/experiment/live-student-record/publish-all'
)
...
...
src/modules/score/composables/useScore.ts
浏览文件 @
04de15b2
import
{
getScoreList
,
getScoreDetail
,
updateScore
}
from
'../api'
import
{
getScoreList
,
getScoreDetail
,
updateScore
,
resetStatus
}
from
'../api'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useChat
}
from
'@ezijing/ai-vue'
import
{
ElMessage
}
from
'element-plus'
...
...
@@ -216,10 +216,31 @@ ${JSON.stringify(outputExample, null, 2)}`
}
}
const
handleResetScoreStatus
=
async
(
id
:
string
)
=>
{
// 解锁评分:卡在「评分中」时恢复为已评分,数据保留
const
handleUnlockScoreStatus
=
async
(
id
:
string
)
=>
{
await
updateScore
({
id
,
check_status
:
2
})
ElMessage
.
success
(
'重置成绩状态成功'
)
ElMessage
.
success
(
'解锁成功'
)
}
// 重置评分:回到暂未评分(可重新进入评分流程),数据保留
const
handleResetScoreStatus
=
async
(
id
:
string
)
=>
{
await
updateScore
({
id
,
check_status
:
0
})
ElMessage
.
success
(
'重置评分成功'
)
}
return
{
isLoading
,
fetchScoreList
,
fetchScoreDetail
,
handleAIScoreList
,
handleAIScore
,
handleResetScoreStatus
}
const
handleResetExamStatus
=
async
(
id
:
string
)
=>
{
await
resetStatus
({
id
})
ElMessage
.
success
(
'重置考试状态成功'
)
}
return
{
isLoading
,
fetchScoreList
,
fetchScoreDetail
,
handleAIScoreList
,
handleAIScore
,
handleUnlockScoreStatus
,
handleResetScoreStatus
,
handleResetExamStatus
,
}
}
src/modules/score/views/Index.vue
浏览文件 @
04de15b2
...
...
@@ -7,7 +7,8 @@ import { useScore } from '../composables/useScore'
import
{
useUserStore
}
from
'@/stores/user'
const
userStore
=
useUserStore
()
const
{
isLoading
,
handleAIScoreList
,
handleResetScoreStatus
}
=
useScore
()
const
{
isLoading
,
handleAIScoreList
,
handleUnlockScoreStatus
,
handleResetScoreStatus
,
handleResetExamStatus
}
=
useScore
()
const
route
=
useRoute
()
const
appList
=
ref
(
null
)
...
...
@@ -62,7 +63,7 @@ const listOptions = computed(() => {
},
{
label
:
'提交时间'
,
prop
:
'commit_time'
},
{
label
:
'批改时间'
,
prop
:
'check_time'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
12
0
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
28
0
},
],
}
})
...
...
@@ -109,8 +110,14 @@ useIntervalFn(() => {
<el-button
text
type=
"primary"
v-if=
"row.check_status != '1'"
>
<router-link
:to=
"
{ path: 'score/view', query: { ...$route.query, id: row.id } }">评分
</router-link>
</el-button>
<el-button
text
type=
"primary"
@
click=
"() => handleResetScoreStatus(row.id)"
v-if=
"userStore.isAdmin"
>
重置
</el-button
<el-button
text
type=
"primary"
@
click=
"() => handleUnlockScoreStatus(row.id)"
v-if=
"userStore.isAdmin && row.check_status == '1'"
>
解锁
</el-button
>
<el-button
text
type=
"primary"
@
click=
"() => handleResetScoreStatus(row.id)"
v-if=
"userStore.isAdmin && row.check_status != '0'"
>
重置评分
</el-button
>
<el-button
text
type=
"primary"
@
click=
"() => handleResetExamStatus(row.id)"
v-if=
"userStore.isAdmin"
>
重置考试
</el-button
>
</
template
>
</AppList>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论