刘洋 7 mesi fa
parent
commit
130e058c81
3 ha cambiato i file con 27 aggiunte e 3 eliminazioni
  1. 2 1
      .env.development
  2. 11 0
      src/api/order.ts
  3. 14 2
      src/views/order/student-manage/index.vue

+ 2 - 1
.env.development

@@ -1,2 +1,3 @@
+VUE_APP_DEV_PROXY='http://192.168.11.199:8080'
 # VUE_APP_DEV_PROXY='http://192.168.10.41:8080'
-VUE_APP_DEV_PROXY='http://apply-test.qmth.com.cn'
+# VUE_APP_DEV_PROXY='http://apply-test.qmth.com.cn'

+ 11 - 0
src/api/order.ts

@@ -213,3 +213,14 @@ export function getMyTasks(data: any): any {
 export function getTaskTypes(): any {
   return axios.post('/api/admin/async/task/type/list');
 }
+
+export function studentExport(params: any): Promise<AxiosResponse<Blob>> {
+  return axios.post(
+    '/api/admin/student/export',
+    {},
+    {
+      responseType: 'blob',
+      params,
+    }
+  );
+}

+ 14 - 2
src/views/order/student-manage/index.vue

@@ -57,9 +57,13 @@
         accept=".png,.jpg,.jpeg"
         @upload-success="toPage(1)"
       ></upload-button>
+
+      <a-button type="primary" status="success" @click="exportFile"
+        >导出</a-button
+      >
     </a-space>
     <a-table
-      v-model:selectedKeys="selectedKeys"
+      v-model:selected-keys="selectedKeys"
       class="page-table"
       :columns="columns"
       :data="dataList"
@@ -103,12 +107,14 @@
     orderRecordCancel,
     orderRecordListPage2,
     orderRecordDelete,
+    studentExport,
   } from '@/api/order';
   import { OrderRecordItem } from '@/api/types/order';
   import useTable from '@/hooks/table';
   // import useLoading from '@/hooks/loading';
   import { modalConfirm } from '@/utils/arco';
   import { useAppStore, useUserStore } from '@/store';
+  import { downloadByApi } from '@/utils/download';
   import type { TableRowSelection } from '@arco-design/web-vue';
 
   defineOptions({
@@ -137,7 +143,7 @@
   const searchModel = reactive({
     taskId: '',
     teachingId: '',
-    agentId: '',
+    // agentId: '',
     name: '',
     identityNumber: '',
     studentCode: '',
@@ -218,6 +224,12 @@
     getList();
   }
 
+  const exportFile = () => {
+    downloadByApi(() => studentExport(searchModel)).catch((e) => {
+      Message.error(e || '下载失败,请重新尝试!');
+    });
+  };
+
   watch(dataList, () => {
     selectedKeys.value = [];
   });