Browse Source

feat: api-仲裁管理

zhangjie 1 tuần trước cách đây
mục cha
commit
211e7f53c7

+ 13 - 1
src/api/mark.ts

@@ -4,6 +4,7 @@ import {
   MarkQualityMonitorListPageParam,
   MarkQualityMonitorListPageRes,
   QMScoreItem,
+  MarkArbitrationListFilter,
   MarkArbitrationListPageRes,
   MarkArbitrationListPageParam,
   MarkTaskListPageRes,
@@ -80,7 +81,18 @@ export function qualityMonitorScoreList(
 export function getArbitrationList(
   params: MarkArbitrationListPageParam
 ): Promise<MarkArbitrationListPageRes> {
-  return axios.post('/api/mark/arbitration/list', {}, { params });
+  return axios.post('/api/admin/exam/arbitrate/list', {}, { params });
+}
+
+// 仲裁导出
+export function exportArbitrationList(
+  params: MarkArbitrationListFilter
+): Promise<AxiosResponse<Blob>> {
+  return axios.post(
+    '/api/admin/exam/arbitrate/export',
+    {},
+    { params, responseType: 'blob' }
+  );
 }
 
 // 任务管理

+ 2 - 3
src/components/select-data/search.ts

@@ -43,18 +43,17 @@ export default function useSearch(type: SelectType) {
     try {
       setLoading(true);
       let url = '';
+      let transform = defaultTransform;
       if (typeof config === 'string') {
         url = config;
       } else {
         url = config.url;
+        transform = config.transform || defaultTransform;
       }
       const res = (await axios.post(url, {}, { params })) as Array<
         Record<string, any>
       >;
 
-      const transform = config.transform
-        ? (config.transform as TransformType)
-        : defaultTransform;
       optionList.value = res.map(transform);
     } catch (error) {
       console.error(error);

+ 2 - 0
src/components/select-option/search.ts

@@ -16,6 +16,8 @@ const selectConfig = {
   examPoint: '/api/admin/student/examSite/list',
   // 专业类型
   subjectCategory: '/api/admin/student/category/list',
+  // 仲裁类型
+  arbitrationType: '/api/admin/exam/arbitrate/status',
 };
 
 export type SelectType = keyof typeof selectConfig;

+ 3 - 0
src/utils/download-export.ts

@@ -35,6 +35,7 @@ import {
 import {
   exportQualityMonitorList,
   exportGroupArbitrateStatList,
+  exportArbitrationList,
 } from '@/api/mark';
 
 import useLoading from '@/hooks/loading';
@@ -109,6 +110,8 @@ const downloadConfig = {
   exportGroupArbitrateStatList,
   // 导出质量监控列表
   exportQualityMonitorList,
+  // 导出仲裁列表
+  exportArbitrationList,
 };
 type DownloadType = keyof typeof downloadConfig;
 

+ 17 - 13
src/views/mark/ArbitrationManage.vue

@@ -14,15 +14,21 @@
         </el-input>
       </el-form-item>
       <el-form-item label="状态">
-        <el-select
+        <select-option
           v-model="searchModel.status"
-          placeholder="请选择状态"
+          type="'arbitrationType'"
+          style="width: 120px"
+        >
+        </select-option>
+      </el-form-item>
+      <el-form-item label="选做题">
+        <el-select
+          v-model="searchModel.unselective"
+          placeholder="请选择"
           clearable
           style="width: 120px"
         >
-          <el-option label="待处理" value="pending" />
-          <el-option label="已处理" value="processed" />
-          <el-option label="已关闭" value="closed" />
+          <el-option label="未选做" :value="true" />
         </el-select>
       </el-form-item>
       <el-form-item label="准考证号">
@@ -30,13 +36,10 @@
           v-model.trim="searchModel.examNumber"
           placeholder="请输入准考证号"
           clearable
-          style="width: 150px"
+          style="width: 200px"
         >
         </el-input>
       </el-form-item>
-      <el-form-item>
-        <el-checkbox v-model="searchModel.optional"> 选做题 </el-checkbox>
-      </el-form-item>
     </el-form>
     <el-divider class="form-divider" />
 
@@ -121,6 +124,7 @@
     MarkArbitrationListFilter,
   } from '@/api/types/mark';
   import useTable from '@/hooks/table';
+  import { downloadExport } from '@/utils/download-export';
 
   defineOptions({
     name: 'ArbitrationManage',
@@ -130,7 +134,7 @@
     subjectCode: null,
     groupNumber: '',
     status: '',
-    optional: undefined,
+    unselective: undefined,
     examNumber: '',
   });
 
@@ -183,8 +187,8 @@
     // TODO: 实现批量处理仲裁的逻辑
   }
 
-  function onExport() {
-    // TODO: 导出仲裁
-    ElMessage.info('导出仲裁');
+  // 导出功能
+  async function onExport() {
+    await downloadExport('exportArbitrationList', searchModel);
   }
 </script>