|
@@ -30,13 +30,40 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
|
+ <el-space wrap>
|
|
|
+ <el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="closeLoading"
|
|
|
+ @click="onCloseSubject"
|
|
|
+ >关闭</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-dropdown @command="onExportCommand">
|
|
|
+ <el-button type="primary">
|
|
|
+ 导出
|
|
|
+ <el-icon class="el-icon--right"><ArrowDown /> </el-icon>
|
|
|
+ </el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="fhy">整体评卷进度</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="fhy">评卷员工作量</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </el-space>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
|
|
|
<div class="part-box">
|
|
|
- <el-table class="page-table" :data="dataList" :loading="loading">
|
|
|
+ <el-table
|
|
|
+ class="page-table"
|
|
|
+ :data="dataList"
|
|
|
+ :loading="loading"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
<el-table-column property="courseName" label="科目" min-width="200" />
|
|
|
<el-table-column label="选做异常" min-width="100">
|
|
|
<template #default="scope">
|
|
@@ -83,13 +110,21 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { reactive, ref, computed, onMounted } from 'vue';
|
|
|
- import { getMarkStatInfo, getMarkStatList } from '@/api/mark';
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
+ import {
|
|
|
+ getMarkStatInfo,
|
|
|
+ getMarkStatList,
|
|
|
+ markSubjectClose,
|
|
|
+ } from '@/api/mark';
|
|
|
import {
|
|
|
MarkStatInfo,
|
|
|
MarkStatItem,
|
|
|
MarkStatListFilter,
|
|
|
} from '@/api/types/mark';
|
|
|
import useTable from '@/hooks/table';
|
|
|
+ import useLoading from '@/hooks/loading';
|
|
|
+ import { modalConfirm } from '@/utils/ui';
|
|
|
+
|
|
|
import Chart from '@/components/chart/index.vue';
|
|
|
|
|
|
defineOptions({
|
|
@@ -101,8 +136,15 @@
|
|
|
progress: null,
|
|
|
});
|
|
|
|
|
|
- const { dataList, pagination, loading, toPage, pageSizeChange } =
|
|
|
- useTable<MarkStatItem>(getMarkStatList, searchModel, false);
|
|
|
+ const {
|
|
|
+ dataList,
|
|
|
+ pagination,
|
|
|
+ loading,
|
|
|
+ selectedRows,
|
|
|
+ toPage,
|
|
|
+ pageSizeChange,
|
|
|
+ handleSelectionChange,
|
|
|
+ } = useTable<MarkStatItem>(getMarkStatList, searchModel, false);
|
|
|
|
|
|
// 统计信息
|
|
|
const statInfo = ref<MarkStatInfo>({
|
|
@@ -192,6 +234,36 @@
|
|
|
],
|
|
|
}));
|
|
|
|
|
|
+ // 关闭科目
|
|
|
+ const { loading: closeLoading, setLoading } = useLoading();
|
|
|
+ async function onCloseSubject() {
|
|
|
+ if (!selectedRows.value.length) {
|
|
|
+ ElMessage.warning('请选择科目');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const confirm = await modalConfirm('确认关闭所选科目吗?', '提示 ').catch(
|
|
|
+ () => false
|
|
|
+ );
|
|
|
+ if (!confirm) return;
|
|
|
+
|
|
|
+ try {
|
|
|
+ setLoading(true);
|
|
|
+ const ids = selectedRows.value.map((item) => item.courseId);
|
|
|
+ await markSubjectClose(ids);
|
|
|
+ ElMessage.success('关闭成功');
|
|
|
+ toPage(1);
|
|
|
+ } catch (error) {
|
|
|
+ console.error('关闭科目失败:', error);
|
|
|
+ } finally {
|
|
|
+ setLoading(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ const onExportCommand = (command: string) => {
|
|
|
+ console.log('导出命令:', command);
|
|
|
+ };
|
|
|
+
|
|
|
// 获取统计信息
|
|
|
async function getStatInfo() {
|
|
|
try {
|