|
@@ -62,12 +62,7 @@
|
|
<el-table-column prop="name" label="姓名" width="100" />
|
|
<el-table-column prop="name" label="姓名" width="100" />
|
|
<el-table-column prop="subjectCode" label="科目" width="120" />
|
|
<el-table-column prop="subjectCode" label="科目" width="120" />
|
|
<el-table-column prop="groupNumber" label="分组" width="100" sortable />
|
|
<el-table-column prop="groupNumber" label="分组" width="100" sortable />
|
|
- <el-table-column label="状态" width="100">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-tag :type="getStatusType(scope.row.status)" size="small">
|
|
|
|
- {{ getStatusText(scope.row.status) }}
|
|
|
|
- </el-tag>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <el-table-column prop="statusText" label="状态" width="100">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="markedCount" label="已评数量" width="120" sortable>
|
|
<el-table-column prop="markedCount" label="已评数量" width="120" sortable>
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
@@ -170,12 +165,20 @@
|
|
<!-- 导入 -->
|
|
<!-- 导入 -->
|
|
<ImportDialog
|
|
<ImportDialog
|
|
ref="importDialogRef"
|
|
ref="importDialogRef"
|
|
- title="导入数据"
|
|
|
|
- upload-url="/api/admin/site/import"
|
|
|
|
|
|
+ title="导入评卷员"
|
|
|
|
+ upload-url="/api/admin/exam/marker/import"
|
|
|
|
+ :upload-data="uploadData"
|
|
:format="['xls', 'xlsx']"
|
|
:format="['xls', 'xlsx']"
|
|
- :download-handle="downloadTemplate"
|
|
|
|
|
|
+ :download-handle="() => downloadExport('markerImportTemplate')"
|
|
download-filename="评卷员导入模板.xlsx"
|
|
download-filename="评卷员导入模板.xlsx"
|
|
/>
|
|
/>
|
|
|
|
+
|
|
|
|
+ <!-- 授权码 -->
|
|
|
|
+ <CodeConfirmDialog
|
|
|
|
+ ref="codeConfirmDialogRef"
|
|
|
|
+ :progress="curMarkerGroupProgress"
|
|
|
|
+ @modified="onResetFinishConfirm"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -192,8 +195,10 @@
|
|
import { MarkMarkerItem, MarkMarkerListFilter } from '@/api/types/mark';
|
|
import { MarkMarkerItem, MarkMarkerListFilter } from '@/api/types/mark';
|
|
import useTable from '@/hooks/table';
|
|
import useTable from '@/hooks/table';
|
|
import { modalConfirm } from '@/utils/ui';
|
|
import { modalConfirm } from '@/utils/ui';
|
|
|
|
+ import { downloadExport } from '@/utils/download-export';
|
|
|
|
|
|
import SetMarkCountDialog from './components/SetMarkCountDialog.vue';
|
|
import SetMarkCountDialog from './components/SetMarkCountDialog.vue';
|
|
|
|
+ import CodeConfirmDialog from './components/CodeConfirmDialog.vue';
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'MarkerManage',
|
|
name: 'MarkerManage',
|
|
@@ -209,6 +214,9 @@
|
|
|
|
|
|
const setMarkCountDialogRef = ref<InstanceType<typeof SetMarkCountDialog>>();
|
|
const setMarkCountDialogRef = ref<InstanceType<typeof SetMarkCountDialog>>();
|
|
const curMarkerIds = ref<number[]>([]);
|
|
const curMarkerIds = ref<number[]>([]);
|
|
|
|
+ const curMarkerGroupProgress = ref<number>(0);
|
|
|
|
+ const curRow = ref<MarkMarkerItem>();
|
|
|
|
+ const codeConfirmDialogRef = ref<InstanceType<typeof CodeConfirmDialog>>();
|
|
|
|
|
|
const {
|
|
const {
|
|
dataList,
|
|
dataList,
|
|
@@ -227,26 +235,6 @@
|
|
return selectedRows.value.map((row) => row.id);
|
|
return selectedRows.value.map((row) => row.id);
|
|
});
|
|
});
|
|
|
|
|
|
- // 获取状态类型
|
|
|
|
- function getStatusType(status: string) {
|
|
|
|
- const statusMap: Record<string, string> = {
|
|
|
|
- enabled: 'success',
|
|
|
|
- disabled: 'danger',
|
|
|
|
- binding: 'warning',
|
|
|
|
- };
|
|
|
|
- return statusMap[status] || 'info';
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 获取状态文本
|
|
|
|
- function getStatusText(status: string) {
|
|
|
|
- const statusMap: Record<string, string> = {
|
|
|
|
- enabled: '已启用',
|
|
|
|
- disabled: '已禁用',
|
|
|
|
- binding: '绑定中',
|
|
|
|
- };
|
|
|
|
- return statusMap[status] || status;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// 启用/禁用评卷员
|
|
// 启用/禁用评卷员
|
|
async function onEnable(row: MarkMarkerItem, enable: boolean) {
|
|
async function onEnable(row: MarkMarkerItem, enable: boolean) {
|
|
const action = enable ? '启用' : '禁用';
|
|
const action = enable ? '启用' : '禁用';
|
|
@@ -393,14 +381,15 @@
|
|
|
|
|
|
// 重置已评数量
|
|
// 重置已评数量
|
|
async function onResetFinishCount(row: MarkMarkerItem) {
|
|
async function onResetFinishCount(row: MarkMarkerItem) {
|
|
- const confirm = await modalConfirm(
|
|
|
|
- `确认重置评卷员 ${row.name}(${row.loginName}) 的已评数量吗?`,
|
|
|
|
- '提示 '
|
|
|
|
- ).catch(() => false);
|
|
|
|
- if (!confirm) return;
|
|
|
|
|
|
+ // TODO:获取进度
|
|
|
|
+ // curMarkerGroupProgress.value = row.progress;
|
|
|
|
+ curRow.value = row;
|
|
|
|
+ codeConfirmDialogRef.value?.open();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ async function onResetFinishConfirm(deleteCode: string) {
|
|
try {
|
|
try {
|
|
- await markMarkerResetFinishCount(row.id);
|
|
|
|
|
|
+ await markMarkerResetFinishCount(curRow.value.id, deleteCode);
|
|
ElMessage.success('重置已评数量成功');
|
|
ElMessage.success('重置已评数量成功');
|
|
getList();
|
|
getList();
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -410,14 +399,10 @@
|
|
|
|
|
|
// 导入
|
|
// 导入
|
|
const importDialogRef = ref();
|
|
const importDialogRef = ref();
|
|
|
|
+ const uploadData = computed(() => {
|
|
|
|
+ return { subjectCode: searchModel.subjectCode };
|
|
|
|
+ });
|
|
const onImport = () => {
|
|
const onImport = () => {
|
|
importDialogRef.value?.open();
|
|
importDialogRef.value?.open();
|
|
};
|
|
};
|
|
- async function downloadTemplate() {
|
|
|
|
- // const res = await downloadByApi(() => agentTemplate()).catch((e) => {
|
|
|
|
- // Message.error(e || '下载失败,请重新尝试!');
|
|
|
|
- // });
|
|
|
|
- // if (!res) return;
|
|
|
|
- // Message.success('下载成功!');
|
|
|
|
- }
|
|
|
|
</script>
|
|
</script>
|