Browse Source

Merge branch '05/08permission' into test

mo 4 năm trước cách đây
mục cha
commit
a23845f6af
1 tập tin đã thay đổi với 25 bổ sung23 xóa
  1. 25 23
      src/views/teamDetail/teamCourseList.vue

+ 25 - 23
src/views/teamDetail/teamCourseList.vue

@@ -1099,38 +1099,40 @@ export default {
         },
         params: this.getSearchForm(),
         url,
-        responseType: "blob",
+        // responseType: "blob",
       };
       this.$confirm("您确定导出报表", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
-        .then(() => {
+        .then((data) => {
           load.startLoading();
           axios(options)
             .then((res) => {
-              let blob = new Blob([res.data], {
-                // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
-                type: "application/vnd.ms-excel;charset=utf-8",
-                //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
-              });
-              let text = new Response(blob).text();
-              text.then((res) => {
-                // 判断是否报错
-                if (res.indexOf("code") != -1) {
-                  let json = JSON.parse(res);
-                  this.$message.error(json.msg);
-                } else {
-                  let objectUrl = URL.createObjectURL(blob);
-                  let link = document.createElement("a");
-                  let fname = "课表列表" + new Date().getTime() + ".xls"; //下载文件的名字
-                  link.href = objectUrl;
-                  link.setAttribute("download", fname);
-                  document.body.appendChild(link);
-                  link.click();
-                }
-              });
+              console.log(res)
+              this.$message.success(res.data.data)
+              // let blob = new Blob([res.data], {
+              //   // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+              //   type: "application/vnd.ms-excel;charset=utf-8",
+              //   //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
+              // });
+              // let text = new Response(blob).text();
+              // text.then((res) => {
+              //   // 判断是否报错
+              //   if (res.indexOf("code") != -1) {
+              //     let json = JSON.parse(res);
+              //     this.$message.error(json.msg);
+              //   } else {
+              //     let objectUrl = URL.createObjectURL(blob);
+              //     let link = document.createElement("a");
+              //     let fname = "课表列表" + new Date().getTime() + ".xls"; //下载文件的名字
+              //     link.href = objectUrl;
+              //     link.setAttribute("download", fname);
+              //     document.body.appendChild(link);
+              //     link.click();
+              //   }
+              // });
               load.endLoading();
             })
             .catch((error) => {