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

chore: 实验成绩增加重置按钮

上级 3c3ff73d
...@@ -101,3 +101,8 @@ export function exportExperimentRecord(params: { experiment_id: string }) { ...@@ -101,3 +101,8 @@ export function exportExperimentRecord(params: { experiment_id: string }) {
export function syncExperimentExam(params: { experiment_id: string }) { export function syncExperimentExam(params: { experiment_id: string }) {
return httpRequest.get('/api/lab/v1/teacher/record/sync-theory-score', { params }) return httpRequest.get('/api/lab/v1/teacher/record/sync-theory-score', { params })
} }
// 重置
export function recordReject(params: { experiment_id: string; student_id: string }) {
return httpRequest.get('/api/lab/v1/teacher/record/reject', { params })
}
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
import type { RecordItem } from '../types' import type { RecordItem } from '../types'
import { Upload, Promotion, Download, Refresh } 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, recordReject } from '../api'
import { useFilterList } from '../composables/useFilterList' import { useFilterList } from '../composables/useFilterList'
import { useCookies } from '@vueuse/integrations/useCookies' import { useCookies } from '@vueuse/integrations/useCookies'
import { ElMessage } from 'element-plus'
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'))
...@@ -123,6 +124,12 @@ function onUpdateSuccess() { ...@@ -123,6 +124,12 @@ function onUpdateSuccess() {
const exportVisible = ref(false) const exportVisible = ref(false)
const syncVisible = ref(false) const syncVisible = ref(false)
async function handleReset(row: RecordItem) {
await recordReject({ experiment_id: row.experiment_id, student_id: row.student_id })
ElMessage.success('重置成功')
appList?.refetch()
}
</script> </script>
<template> <template>
...@@ -152,6 +159,7 @@ const syncVisible = ref(false) ...@@ -152,6 +159,7 @@ const syncVisible = ref(false)
<el-button text type="primary" v-if="row.status === 1 || row.status === 2" @click="handleScore(row)" v-permission="'v1-teacher-record-check'" <el-button 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 text type="primary" v-if="row.status === 1 || row.status === 2" @click="handleReset(row)">重置</el-button>
<el-button text type="primary" v-if="row.has_score_log" @click="handleScoreLog(row)" v-permission="'v1-teacher-record-check'">查看历史成绩</el-button> <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>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论