فهرست منبع

增加导入导出任务的查询列表页面

刘洋 2 سال پیش
والد
کامیت
1ce2731e57

+ 13 - 0
src/api/api-types/system.d.ts

@@ -56,6 +56,16 @@ export namespace System {
 
   type ImportRfPaper = BaseDefine<RfPaperImport>
 
+  interface importOrExportItem {
+    filePath: string
+    id: number
+    spentTime: string
+    status: string
+    statusMsg: string
+    statusName: string
+    taskTypeName: string
+  }
+
   interface ScoreListItem {
     /** 作文评卷员代码 */
     compositionMarker: string
@@ -124,6 +134,7 @@ export namespace System {
   >
   /** 考生数据导入状态 */
   type GetStudentImportStatus = BaseDefine<null, { importing: boolean; progress: number }>
+  type imortAndExportList = BaseDefine<MultipleQuery<{ taskType?: string }>, MultipleResult<importOrExportItem>>
   export interface ApiMap {
     importMarkingData: ImportMarkingData
     /** 创建评卷分配表 */
@@ -143,5 +154,7 @@ export namespace System {
     getUnMarkTasks: GetUnMarkTasks
     /** 考生数据导入状态 */
     getStudentImportStatus: GetStudentImportStatus
+    /** 数据导入导出记录 */
+    imortAndExportList: imortAndExportList
   }
 }

+ 2 - 0
src/api/system.ts

@@ -42,6 +42,8 @@ const SystemApi: DefineApiModule<System.ApiMap> = {
     download: true,
     timeout: 0,
   },
+  /** 导入导出记录 */
+  imortAndExportList: '/api/operate/task/page',
   /** 任务设置 - 按评卷员设置 */
   markerSetCount: {
     url: '/api/user/marker/add/count',

+ 7 - 0
src/constants/dicts.ts

@@ -30,3 +30,10 @@ export const PaperMap: Record<PaperType, string> = {
   SAMPLE_B: '培训B卷',
   STANDARD: '标准卷',
 }
+
+/** 是/否  */
+export const TaskTypeOption = [
+  { label: '全部', value: '' },
+  { label: 'CET成绩导出', value: 'CET_SCORE_EXPORT' },
+  { label: '考生导入', value: 'STUDENT_IMPORT' },
+]

+ 80 - 0
src/modules/admin-data/imformation-report/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="flex direction-column full">
+    <div class="p-l-base p-t-medium-base fill-blank">
+      <base-form ref="formRef" size="small" :items="items" :model="model">
+        <template #form-item-operation>
+          <el-button type="primary" @click="onSearch">查询</el-button>
+          <!-- <el-button type="primary" custom-1 @click="onExport">导出</el-button> -->
+        </template>
+      </base-form>
+    </div>
+    <div class="flex-1 p-base">
+      <div class="p-base radius-base fill-blank">
+        <base-table ref="tableRef" :columns="columns" :data="data">
+          <template #column-operation="{ row }">
+            <el-link target="_blank" type="primary" :href="row.filePath">下载</el-link>
+          </template>
+        </base-table>
+        <el-pagination
+          v-bind="pagination"
+          v-model:current-page="currentPage"
+          background
+          right
+          :hide-on-single-page="true"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+<script setup lang="ts" name="ImformationReport">
+import { reactive, computed, onMounted } from 'vue'
+import type { ExtractMultipleApiParams } from '@/api/api'
+import type { EpFormItem, EpTableColumn, EpFormRules } from 'global-type'
+import useVW from '@/hooks/useVW'
+import useTable from '@/hooks/useTable'
+import useForm from '@/hooks/useForm'
+import { ElButton, ElPagination, ElLink } from 'element-plus'
+import BaseForm from '@/components/element/BaseForm.vue'
+import BaseTable from '@/components/element/BaseTable.vue'
+import { TaskTypeOption } from '@/constants/dicts'
+const { formRef, elFormRef, defineColumn, _ } = useForm()
+
+const OneRowSpan5 = defineColumn(_, 'row-1', { span: 5 })
+const changeModelValue = (val: any) => {
+  //   alert(val)
+}
+onMounted(() => {
+  onSearch()
+})
+const items = computed<EpFormItem[]>(() => {
+  return [
+    OneRowSpan5({
+      label: '任务类型',
+      prop: 'taskType',
+      slotType: 'select',
+      slot: {
+        options: TaskTypeOption,
+        onChange: changeModelValue,
+      },
+    }),
+    OneRowSpan5({ slotName: 'operation', labelWidth: useVW(20) }),
+  ]
+})
+
+const model = reactive<ExtractMultipleApiParams<'imortAndExportList'>>({
+  taskType: '',
+})
+const { pagination, currentPage, loading, data, fetchTable } = useTable('imortAndExportList', model)
+const onSearch = async () => {
+  fetchTable()
+}
+const columns: EpTableColumn[] = [
+  { label: 'ID', prop: 'id' },
+  { label: '文件路径', prop: 'filePath' },
+  { label: '用时', prop: 'spentTime' },
+  { label: '状态', prop: 'statusName' },
+  { label: '状态描述', prop: 'statusMsg' },
+  { label: '任务类型', prop: 'taskTypeName' },
+  { label: '操作', slotName: 'operation', showOverflowTooltip: false, minWidth: 80 },
+]
+</script>

+ 1 - 1
src/plugins/request/index.ts

@@ -12,7 +12,7 @@ const toastError = (message?: string) => {
 const request = axios.create({
   baseURL: import.meta.env.VITE_APP_API_HOST || '/',
   withCredentials: true,
-  timeout: 20000,
+  timeout: 60000,
   method: 'post',
   headers: {
     'Content-Type': 'application/x-www-form-urlencoded',

+ 11 - 0
src/router/admin.ts

@@ -157,6 +157,17 @@ const routes: RouteRecordRaw[] = [
           sort: 4,
         },
       },
+      {
+        name: 'ImformationReport',
+        path: 'imformation-report',
+        component: () => import('@/modules/admin-data/imformation-report/index.vue'),
+        meta: {
+          label: '任务信息报告',
+          menu: true,
+          menuId: 'data-imformation_report',
+          sort: 5,
+        },
+      },
     ],
   },
   {