瀏覽代碼

下载导出优化

1
mo 4 年之前
父節點
當前提交
a12284b9e9
共有 1 個文件被更改,包括 56 次插入14 次删除
  1. 56 14
      src/views/reportForm/downList.vue

+ 56 - 14
src/views/reportForm/downList.vue

@@ -34,10 +34,49 @@
           :data="tableList"
         >
           <el-table-column
+            width="120"
             align="center"
-            prop="studentId"
-            label="分部"
+            prop="id"
+            label="下载编号"
           ></el-table-column>
+          <el-table-column
+
+            align="center"
+            prop="name"
+            label="文件名"
+          ></el-table-column>
+
+          <el-table-column
+
+            align="center"
+            prop="status"
+            label="文件状态"
+          >
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.status == 0 ? "生成中" : "已生成" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+
+            align="center"
+            prop=" createTime"
+            label="生成时间"
+          >
+            <template slot-scope="scope">
+              <div>
+                {{scope.row.createTime | dateForMinFormat}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column prop="fileUrl" label="下载地址" align="center">
+            <template  slot-scope="scope">
+              <div>
+                <a :href="scope.row.fileUrl" target="view_window" style="color:#14928A">点击下载</a>
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
         <pagination
           sync
@@ -57,14 +96,14 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
-import { managerDownloadList } from "./api"
+import { managerDownloadList } from "./api";
 export default {
   components: { pagination },
   data() {
     return {
       searchForm: {
         order: null,
-        userId:null
+        userId: null,
       },
 
       tableList: [],
@@ -88,23 +127,26 @@ export default {
   },
   methods: {
     init() {
-      this.getList()
+      this.getList();
     },
     async getList() {
       try {
-        const res = await managerDownloadList({...this.searchForm,page:this.rules.page,rows:this.rules.limit})
-        this.tableList = res.data.rows
-        this.rules.total = res.data.total
-        console.log(res)
-      }catch(e){
-        console.log(e)
+        const res = await managerDownloadList({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
       }
     },
-    search(){
+    search() {
       this.rules.page = 1;
-      this.getList()
+      this.getList();
     },
-    onReSet(){},
+    onReSet() {},
   },
 };
 </script>