lsc 2 년 전
부모
커밋
9c300ff3eb
2개의 변경된 파일19개의 추가작업 그리고 3개의 파일을 삭제
  1. 16 2
      src/components/pages/components/report.vue
  2. 3 1
      src/components/pages/components/worksDetail2.vue

+ 16 - 2
src/components/pages/components/report.vue

@@ -8,6 +8,7 @@
         class="r_select"
         v-model="uname"
         placeholder="全部"
+        filterable
       >
         <el-option
           v-for="item in userAarray"
@@ -121,7 +122,6 @@ export default {
       var _userA = this.userAarray;
       var _chap = JSON.parse(JSON.stringify(this.chap));
       var _task = this.task;
-
       if (this.uname.length) {
         for (var i = 0; i < _userA.length; i++) {
           if (this.uname.join(",").indexOf(_userA[i].userid) != -1) {
@@ -421,7 +421,21 @@ export default {
       // debugger
       //生成报告
       const link = document.createElement("a");
-      link.download = "报告.html"; // 文件名
+      // link.download = "报告.html"; // 文件名
+      let dname = this.course.title+'-'
+      var _uname = [];
+      var _userA = this.userAarray;
+      if (this.uname.length) {
+        for (var i = 0; i < _userA.length; i++) {
+          if (this.uname.join(",").indexOf(_userA[i].userid) != -1) {
+            _uname.push(_userA[i].username);
+          }
+        }
+        dname+=_uname.join('、')+'.html'
+      } else {
+        dname+='全部学生.html'
+      }
+      link.download = dname; // 文件名
       link.style.display = "none";
       // 创建文件流
       // 创建bolb实例时,内容一定要放在[]中

+ 3 - 1
src/components/pages/components/worksDetail2.vue

@@ -1724,7 +1724,9 @@ export default {
       // debugger
       // 生成报告
       const link = document.createElement("a");
-      link.download = "报告.html"; // 文件名
+      let dname = this.sInfo.course + "-" + this.sInfo.sName + ".html";
+      // link.download = "报告.html"; // 文件名
+      link.download = dname; // 文件名
       link.style.display = "none";
       // 创建文件流
       // 创建bolb实例时,内容一定要放在[]中