【新增】监控管理试卷任务监控、细节优化
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="方案ID" align="center" prop="taskId" />
|
||||
<!-- <el-table-column label="方案ID" align="center" prop="taskId" /> -->
|
||||
<el-table-column label="题型" align="center" prop="spName" />
|
||||
<el-table-column label="难度" align="center" prop="quLevel">
|
||||
<template #default="scope">
|
||||
@@ -47,14 +47,26 @@
|
||||
<span v-else>未知</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="试题别名" align="center" prop="quTitle"/>
|
||||
|
||||
<!-- <el-table-column label="关键字" align="center" prop="keywords" /> -->
|
||||
<el-table-column label="试题数量" align="center" prop="quNumbers"/>
|
||||
|
||||
<el-table-column label="每题分数" align="center" prop="quScores"/>
|
||||
<el-table-column label="小计分数" align="center" prop="subtotalScore"/>
|
||||
|
||||
<el-table-column label="试题别名" align="center" prop="quTitle"/>
|
||||
<el-table-column label="别名排序" align="center">
|
||||
<template #default="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.sort"
|
||||
placeholder="请输入排序"
|
||||
size="small"
|
||||
:min="0"
|
||||
style="width: 100px"
|
||||
@change="(val) => handleSortChange(scope.row, val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -76,6 +88,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- ✅ 总分展示区域 -->
|
||||
<div style="display: flex; justify-content: flex-end; padding: 5px; margin: 10px 0; font-weight: bold;">
|
||||
总分:{{ totalScore }}
|
||||
</div>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
@@ -153,7 +170,40 @@ const queryParams = reactive({
|
||||
taskId: props.taskId,
|
||||
spName:undefined
|
||||
})
|
||||
const totalScore = computed(() => {
|
||||
return list.value.reduce((sum, item) => {
|
||||
// 确保字段存在且为数字
|
||||
const score = parseFloat(item.subtotalScore) || 0;
|
||||
return sum + score;
|
||||
}, 0);
|
||||
});
|
||||
// 排序值修改后自动调用接口
|
||||
// 排序值修改后自动调用接口
|
||||
const handleSortChange = async (row, newValue) => {
|
||||
if (newValue < 0) {
|
||||
message.error('排序不能小于 0')
|
||||
row.sort = 0
|
||||
return
|
||||
}
|
||||
|
||||
// 1. 获取所有 quTitle 相同的项
|
||||
const sameTitleItems = list.value.filter(item => item.quTitle === row.quTitle)
|
||||
|
||||
// 2. 批量更新 sort 值
|
||||
const updateList = sameTitleItems.map(item => ({
|
||||
...item,
|
||||
sort: newValue
|
||||
}))
|
||||
|
||||
try {
|
||||
// 假设后端支持批量更新接口
|
||||
await Promise.all(updateList.map(item => SmsChannelApi.updateScheme(item)))
|
||||
message.success('同别名方案的排序已同步更新')
|
||||
getList()
|
||||
} catch (error) {
|
||||
message.error('排序更新失败')
|
||||
}
|
||||
}
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
// 1. 并行拉下拉所需的选项
|
||||
|
Reference in New Issue
Block a user