提交 4136914a authored 作者: 王鹏飞's avatar 王鹏飞

chore: 大赛评分列表新增模块状态

上级 ae8af73e
...@@ -71,8 +71,50 @@ const listOptions = $computed(() => { ...@@ -71,8 +71,50 @@ const listOptions = $computed(() => {
{ label: '评分规则', prop: 'competition_is_more_status' }, { label: '评分规则', prop: 'competition_is_more_status' },
{ label: '已评分人数', prop: 'checked_count', slots: 'table-count' }, { label: '已评分人数', prop: 'checked_count', slots: 'table-count' },
{ label: '已评分', prop: 'checked_flag_name' }, { label: '已评分', prop: 'checked_flag_name' },
{ label: '得分', prop: 'score_name' }, { label: '得分', prop: 'score_name', slots: 'table-score' },
{ label: '更新时间', prop: 'updated_time' }, { label: '更新时间', prop: 'updated_time' },
{
label: '模块一',
prop: 'module_1',
computed({ row }: { row: any }) {
return getModuleStatus(row, 0)
}
},
{
label: '模块二',
prop: 'module_2',
computed({ row }: { row: any }) {
return getModuleStatus(row, 1)
}
},
{
label: '模块三',
prop: 'module_3',
computed({ row }: { row: any }) {
return getModuleStatus(row, 2)
}
},
{
label: '模块四',
prop: 'module_4',
computed({ row }: { row: any }) {
return getModuleStatus(row, 3)
}
},
{
label: '模块五',
prop: 'module_5',
computed({ row }: { row: any }) {
return getModuleStatus(row, 4)
}
},
{
label: '模块六',
prop: 'module_6',
computed({ row }: { row: any }) {
return getModuleStatus(row, 5)
}
},
{ label: '操作', slots: 'table-x', width: 100 } { label: '操作', slots: 'table-x', width: 100 }
] ]
} }
...@@ -85,40 +127,33 @@ const importScoreVisible = $ref(false) ...@@ -85,40 +127,33 @@ const importScoreVisible = $ref(false)
function onUpdateSuccess() { function onUpdateSuccess() {
appList?.refetch() appList?.refetch()
} }
function getModuleStatus(row: any, index: number) {
const [first] = row.student_module_status_list
try {
const data: any = JSON.parse(first.data)
const status: number = data[index].status
if (status == 0) return '未开始'
if (status == 1) return '<span class="is-inProgress">进行中</span>'
if (status == 2) return '<span class="is-completed">已完成</span>'
} catch (error) {
// console.log(error)
}
return '未开始'
}
</script> </script>
<template> <template>
<AppCard title="大赛评分"> <AppCard title="大赛评分">
<AppList v-bind="listOptions" ref="appList"> <AppList v-bind="listOptions" ref="appList">
<template #header-buttons> <template #header-buttons>
<el-button <el-button type="primary" round :icon="Refresh" @click="syncDialogVisible = true" v-permission="'v1-expert-check-sync-exam'">系统同步考试成绩</el-button>
type="primary" <el-button type="primary" round :icon="Upload" @click="importExamVisible = true" v-permission="'v1-expert-check-import-exam'">批量导入考试成绩</el-button>
round <el-button type="primary" round :icon="Upload" @click="importScoreVisible = true" v-permission="'v1-expert-check-import-score'">批量导入完整评分</el-button>
:icon="Refresh"
@click="syncDialogVisible = true"
v-permission="'v1-expert-check-sync-exam'"
>系统同步考试成绩</el-button
>
<el-button
type="primary"
round
:icon="Upload"
@click="importExamVisible = true"
v-permission="'v1-expert-check-import-exam'"
>批量导入考试成绩</el-button
>
<el-button
type="primary"
round
:icon="Upload"
@click="importScoreVisible = true"
v-permission="'v1-expert-check-import-score'"
>批量导入完整评分</el-button
>
</template> </template>
<template #table-count="{ row }"> {{ row.checked_count }}/{{ row.need_check_count }} </template> <template #table-count="{ row }"> {{ row.checked_count }}/{{ row.need_check_count }} </template>
<template #table-score="{ row }"> <template #table-score="{ row }">
<span :class="{ 'is-info': row.score !== '--' }">{{ row.score }}</span> <span :class="{ 'is-info': row.score_name !== '--' }">{{ row.score_name }}</span>
</template> </template>
<template #table-x="{ row }"> <template #table-x="{ row }">
<el-button text type="primary" v-if="row.publish_status === '0'" v-permission="'v1-expert-check-set-score'"> <el-button text type="primary" v-if="row.publish_status === '0'" v-permission="'v1-expert-check-set-score'">
...@@ -132,17 +167,17 @@ function onUpdateSuccess() { ...@@ -132,17 +167,17 @@ function onUpdateSuccess() {
<!-- 批量导入考试成绩 --> <!-- 批量导入考试成绩 -->
<ImportExamDialog v-model="importExamVisible" @update="onUpdateSuccess" v-if="importExamVisible"></ImportExamDialog> <ImportExamDialog v-model="importExamVisible" @update="onUpdateSuccess" v-if="importExamVisible"></ImportExamDialog>
<!-- 批量导入完整评分 --> <!-- 批量导入完整评分 -->
<ImportScoreDialog <ImportScoreDialog v-model="importScoreVisible" @update="onUpdateSuccess" v-if="importScoreVisible"></ImportScoreDialog>
v-model="importScoreVisible"
@update="onUpdateSuccess"
v-if="importScoreVisible"></ImportScoreDialog>
</template> </template>
<style lang="scss" scoped> <style lang="scss">
.is-success {
color: #63a103;
}
.is-info { .is-info {
color: #b18862; color: #b18862;
} }
.is-completed {
color: #b8b8b8;
}
.is-inProgress {
color: var(--main-color);
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论