瀏覽代碼

Merge branch 'beta' of https://git.cocorobo.cn/CocoRoboLabs/pbl-teacher-table into beta

SanHQin 8 月之前
父節點
當前提交
ea414680c4

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.f398745547aa6b312d151b4eeacf6852.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.bba3ed5aca95350eeef8.js></script><script type=text/javascript src=./static/js/app.884f5b51457646503a9d.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.495892e4baa50d732f4946780f603a10.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.571c38d63f24b1ae9e16.js></script><script type=text/javascript src=./static/js/vendor.bba3ed5aca95350eeef8.js></script><script type=text/javascript src=./static/js/app.3e069b7251da762b2909.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.495892e4baa50d732f4946780f603a10.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.495892e4baa50d732f4946780f603a10.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.f398745547aa6b312d151b4eeacf6852.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.f398745547aa6b312d151b4eeacf6852.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3e069b7251da762b2909.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.3e069b7251da762b2909.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.571c38d63f24b1ae9e16.js.map


+ 4 - 0
src/App.vue

@@ -517,4 +517,8 @@ html::-webkit-scrollbar-thumb {
   display: flex;
   justify-content: flex-end;
 }
+
+.custom-confirm-box{
+  width: 450px;
+}
 </style>

+ 1 - 0
src/assets/icon/course/downArrow.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731554649616" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2281" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M508.025406 655.446718c-14.45307 0-28.183486-5.781228-39.023289-15.898376l-231.249118-231.249118c-10.117149-10.117149-10.117149-26.015526 0-36.132675s26.015526-10.117149 36.132675 0l231.249118 231.249118c2.16796 2.16796 4.335921 2.16796 5.781228 0l231.971771-231.971771c10.117149-10.117149 26.015526-10.117149 35.410021 0 10.117149 10.117149 10.117149 26.015526 0 36.132674l-231.971771 231.971772c-9.394495 10.117149-23.124912 15.898377-38.300635 15.898376z" fill="#478cff" p-id="2282"></path></svg>

+ 222 - 45
src/components/pages/aiAddCourse/addCourse.vue

@@ -195,13 +195,13 @@
                               style="justify-content: center; min-width: 175px"></el-switch> -->
                           <span>生成模式:</span>
                           <el-radio-group v-model="isuseT" style="display: flex; align-items: center" @change="changeIsuseT">
-                            <div class="all_choose info_radio" style="margin-left: 10px">
+                            <div class="all_choose info_radio">
                               <el-radio :label="false">从零开始生成</el-radio>
                             </div>
                             <div class="all_choose info_radio" style="margin-left: 10px">
                               <el-radio :label="true">从已有教案生成</el-radio>
                             </div>
-                            <div class="all_choose info_radio">
+                            <div class="all_choose info_radio" style="margin-left: 10px">
                               <el-radio :label="1">对话模式生成</el-radio>
                             </div>
                             <div class="all_choose info_radio" style="margin-left: 10px">
@@ -1525,7 +1525,7 @@
                   <el-tooltip effect="light" content="右键单击可配置提示词" placement="bottom">
                   <button class="c_pub_button_confirm" style="margin: 0px 0 0px auto;"
                     @contextmenu.prevent="openAiDialog(1, 'aitargetTextDetail3',1), addCourseBehavior('courseBehavior', '右键课程目标-生成目标按钮')"
-                    @click="openAiDialog(2, 'aitargetTextDetail3',1), addCourseBehavior('courseBehavior', '点击课程目标-生成目标按钮')">生成目标</button>
+                    @click="openAiDialog(2, 'aitargetTextDetail3',1), addCourseBehavior('courseBehavior', '点击课程目标-生成目标按钮')" ref="aitargetTextDetail3">生成目标</button>
                   </el-tooltip>
                   <div style="margin-top: 10px;width:100%" v-if="mubiaoInfoData.length">
                     <div class="add_chapters_box add_c_none" v-if="
@@ -2595,10 +2595,20 @@
                     v-if="steps > 1 && steps != 5 && istemplate != 1" @click="lastSteps" style="margin-left: auto;border: none;">
                     {{ steps == 4 ? "返回课程" : "上一步" }}
                   </button>
-                  <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="openAiDialog2(2, 'aiTask3','all', ''), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</button>
-                  <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="openAiDialog(2, 'aiTaskG2', 'all'), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有工具按钮`)" v-if="panTool() == 0">一键生成所有工具</button>
-                  <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="allEvaCan(), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有评价按钮`)" v-if="panTool() > 0 && panTaskElist() == 0 && panEvaCont() == 0">一键生成所有评价</button>
-                  <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="exportTaskEA(), addCourseBehavior('courseBehavior', `点击学历案-导出评价和学历案按钮`)">导出评价和学历案</button>
+                  <button class="c_pub_button_confirm3 buttonBoxB">
+                    <span>一键生成</span>
+                    <div class="buttonBox">
+                      <div @click="openAiDialog2(2, 'aiTask3','all', ''), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</div>
+                      <div @click="openAiDialog(2, 'aiTaskG2', 'all'), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有工具按钮`)" v-if="panTool() == 0">一键生成所有工具</div>
+                      <div @click="openAiDialog2(2, 'aiTaskG2', 'all'), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有工具按钮`)" v-if="panTool() > 0">重新生成所有工具</div>
+                      <div @click="allEvaCan(), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有评价按钮`)" v-if="panTool() > 0">{{panTaskElist() == 0 && panEvaCont() == 0 ? '一键生成所有评价' : '重新生成所有评价'}}</div>
+                      <div @click="exportTaskEA(), addCourseBehavior('courseBehavior', `点击学历案-导出评价和学历案按钮`)">导出评价和学历案</div>
+                    </div>
+                  </button>
+                  <!-- <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="openAiDialog2(2, 'aiTask3','all', ''), addCourseBehavior('courseBehavior', `点击学历案-重新生成所有任务按钮`)">重新生成所有任务</button> -->
+                  <!-- <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="openAiDialog(2, 'aiTaskG2', 'all'), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有工具按钮`)" v-if="panTool() == 0">一键生成所有工具</button> -->
+                  <!-- <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="allEvaCan(), addCourseBehavior('courseBehavior', `点击学历案-一键生成所有评价按钮`)" v-if="panTool() > 0 && panTaskElist() == 0 && panEvaCont() == 0">一键生成所有评价</button> -->
+                  <!-- <button class="c_pub_button_confirm3" style="margin: 0 0 0 10px;" @click="exportTaskEA(), addCourseBehavior('courseBehavior', `点击学历案-导出评价和学历案按钮`)">导出评价和学历案</button> -->
                   <button class="c_pub_button_confirm" style="margin: 0 0 0 10px;" v-if="steps < 4 && istemplate != 1" @click="nextSteps">
                     {{ steps == 3 ? "确认上传" : "下一步" }}
                   </button> 
@@ -2668,7 +2678,7 @@
 
                   <div style="margin: 0 0 10px 0; padding: 0" v-for="(item, index) in unitJson[unitIndex].chapterInfo"
                     :key="index">
-                    <div v-if="courseState == 4" style="position: relative;
+                    <div v-loading="anLoading[0]" v-if="courseState == 4" style="position: relative;
                             background: #fff;
                             box-sizing: border-box;
                             padding: 1px 20px 10px;
@@ -2693,7 +2703,7 @@
                           </el-tooltip>
                         </div>
                       </div>
-                      <div>
+                      <div >
                         <div class="add_chapters_box add_c_none" v-if="
                           item.taskJson[0].chapterData &&
                           item.taskJson[0].chapterData.length == 0
@@ -3107,6 +3117,7 @@
                           </div>
                         </div>
                         <div
+                          v-loading="anLoading[itemTaskIndex]"
                           style="position: relative"
                           v-if="courseState == 5"
                         >
@@ -7319,7 +7330,7 @@ import JSZip from "jszip";
 import evaList from "./evaList.vue";
 import MindTask from "./jsmind2";
 import ConvertApi from 'convertapi-js'
-let convertApi = ConvertApi.auth('secret_8jZzewWvAJluEjTR')
+let convertApi = ConvertApi.auth('secret_U1EO5rhgMCnoBnBT')
 
 var OpenCC = require("opencc-js");
 let converter = OpenCC.Converter({
@@ -7867,6 +7878,7 @@ export default {
       r_agentid: "",
       course_info: "",
       stepShow: true,
+      anLoading: [],
     };
   },
   directives: {
@@ -9624,9 +9636,9 @@ export default {
     },
     async createTeacherAn(index){
       // this.lineCount = index;
-      this.loading = true
       let md = new MarkdownIt();
       if(this.courseState == 4){
+        this.anLoading[0] = true
         // if(index == 0 || index){
         //   let _task = this.unitJson[0].chapterInfo[0].taskJson[index]
         //   let name = _task.task+'-教案'
@@ -9641,6 +9653,7 @@ export default {
         }
         // }
       }else if(this.courseState == 5){
+        this.anLoading[index] = true
         if(index == 0 || index){
           let _task = this.unitJson[0].chapterInfo[0].taskJson[index]
           let name = _task.task+'-教案'
@@ -9754,13 +9767,21 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       // });
       // const file = new File([blob], dname, { type: 'application/msword' });
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
-      let params = convertApi.createParams()
-      params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
+      // let params = convertApi.createParams()
+      // params.add('file', file)
+      // try {
+      //   let result = await convertApi.convert('docx', 'docx', params)
+      //   file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+      //     return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+      //   });
+      //   await this.beforeUploadHtml(file, index, callback)
+      // } catch (error) {
+      //   console.log('=================','报错')
+      //   await this.beforeUploadHtml(file, index, callback)
+      //   return
+      // }
       await this.beforeUploadHtml(file, index, callback)
+
     },
     async generateExport(a, html, index) {
       // <html lang="en">
@@ -9797,15 +9818,22 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       // 创建文件流
 
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
-      let params = convertApi.createParams()
-      params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
+      // let params = convertApi.createParams()
+      // params.add('file', file)
+      // try {
+      //   let result = await convertApi.convert('docx', 'docx', params)
+      //   file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+      //     return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+      //   });
 
-      // 执行下载
+      //   // 执行下载
+      //   saveAs(file, dname);
+      // } catch (error) {
+      //   saveAs(file, dname);
+      //   // this.$message.error('导出失败')
+      // }
       saveAs(file, dname);
+    
       // return file
     },
     async generateExport2(a, html, index) {
@@ -9846,12 +9874,19 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
         let params = convertApi.createParams()
         params.add('file', file)
-        let result = await convertApi.convert('docx', 'docx', params)
-        file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-          return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-        });
-
         resolve(file);  // 通过 Promise 返回 File 对象
+
+        // try {
+        //   let result = await convertApi.convert('docx', 'docx', params)
+        //   file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+        //     return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+        //   });
+
+        //   resolve(file);  // 通过 Promise 返回 File 对象
+        // } catch (error) {
+        //   resolve('');  // 通过 Promise 返回 File 对象
+        // }
+
       });
     },
     beforeUploadHtml(event, index, callback) {
@@ -9891,13 +9926,15 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
                 })
                 .send(function (err, data) {
                   if(index == (_this.unitJson[0].chapterInfo[0].taskJson.length - 1) && _this.courseState == 4){
-                    _this.loading = false
+                    _this.anLoading[0] = false
                   }
 
                   if(_this.courseState == 5){
-                    _this.loading = false
+                    _this.anLoading[index] = false
                   }
                   callback ? callback() : ''
+                  _this.$forceUpdate();
+
                   if (err) {
                       _this.$message.error("上传失败");
                   } else {
@@ -9954,12 +9991,18 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
       // });
       // const file = new File([blob], dname, { type: 'application/msword' });
       let file = new File([blob], dname, { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
-      let params = convertApi.createParams()
-      params.add('file', file)
-      let result = await convertApi.convert('docx', 'docx', params)
-      file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-        return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-      });
+      // let params = convertApi.createParams()
+      // params.add('file', file)
+      // try {
+      //   let result = await convertApi.convert('docx', 'docx', params)
+      //   file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+      //     return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+      //   });
+      //   await this.beforeUploadHtml2(file, index, callback)
+      // } catch (error) {
+      //   await this.beforeUploadHtml2(file, index, callback)
+      //   return;
+      // }
       await this.beforeUploadHtml2(file, index, callback)
     },
     beforeUploadHtml2(event, index, callback) {
@@ -10691,6 +10734,17 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
           // loading.close();
           return;
         }
+        if (
+          ['DOC'].indexOf(
+              file.name
+                .split(".")
+              [file.name.split(".").length - 1].toLocaleUpperCase()
+            ) !== -1
+          ) {
+          this.$message.error("抱歉,小可暂时不支持.doc的文件呢");
+          this.inputShow = true;
+          return;
+        }
 
         if (type == 3) {
           var b = [
@@ -10797,13 +10851,62 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
           // this.inputShow = true;
           let params = convertApi.createParams()
           params.add('file', file)
-          let result = await convertApi.convert('doc', 'docx', params)
-          // Get result file URL
-          file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
-            return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
-          });
-          console.log(result)
-          console.log(file)
+          try {
+            let result = await convertApi.convert('doc', 'docx', params);
+            // Get result file URL
+            file = await fetch(result.files[0].Url).then(res => res.blob()).then(blob => {
+              return new File([blob], result.files[0].FileName, { type: 'application/octet-stream' });
+            });
+            console.log(result)
+            console.log(file)
+          } catch (error) {
+            cfindex2++;
+            if(type == 14){
+              _this.teacherinfoisFinishSize = cfindex2;
+            }else if(type == 16){
+              _this.mubiaoinfoisFinishSize = cfindex2;
+            }else if(type == 17){
+              _this.xuanzeinfoisFinishSize = cfindex2;
+            }else if(type == 18){
+              _this.pingjiainfoisFinishSize[tindex] = cfindex2;
+            }else if(type == 19){
+              _this.knowinfoisFinishSize = cfindex2;
+            }else if(type == 20){
+              _this.knowinfoisFinishSize2 = cfindex2;
+            }else {
+              _this.infoisFinishSize = cfindex2;
+            }
+            setTimeout(() => {
+              if (
+                cfindex2 == event.target.files.length ||
+                cfindex2 > event.target.files.length
+              ) {
+                if(type == 14){
+                  _this.teacherinfoproVisible = false;
+                }else if(type == 16){
+                  _this.mubiaoinfoproVisible = false;
+                }else if(type == 17){
+                  _this.xuanzeinfoproVisible = false;
+                }else if(type == 18){
+                  _this.pingjiainfoproVisible[tindex] = false;
+                }else if(type == 19){
+                  _this.knowinfoproVisible = false;
+                }else if(type == 20){
+                  _this.knowinfoproVisible2 = false;
+                }else{
+                  _this.infoproVisible = false;
+                }
+              }
+            
+              _this.$forceUpdate();
+            }, 1000);
+            _this.inputShow = true;
+            _this.$message.error("抱歉,小可暂时不支持.doc的文件呢");
+            // 捕捉到这个convertApi.convert报错就不要往下走了
+            return; // 直接返回,不继续执行后续代码
+          }
+
+
           // return;
         }
 
@@ -17705,6 +17808,7 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
+        customClass: 'custom-confirm-box'
       })
         .then(() => {
           // if ((this.templateid == "4480d65a-1e48-11ef-bee5-005056b86db5" || this.templateid == "cf5722a4-401b-11ef-b873-005056b86dc3") && type == "aiTeacher2") {
@@ -17716,6 +17820,9 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
         .catch(() => {
         
         });
+      setTimeout(() => {
+        this.setTipsIndex()
+      }, 500)
     },
     async openAiDialog(clickType, type, callback, index, tindex) {
       let fileid = this.isFileSearch ? [...this.fileIds] : []
@@ -17866,6 +17973,13 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
           });
           return;
         }
+        if(callback != 'all' && !this.unitJson[0].chapterInfo[0].taskJson[callback].taskDetail3){
+          this.$message({
+            message: `请先生成任务${callback}的教案在执行此操作`,
+            type: "warning"
+          });
+          return;
+        }
         this.aitype = type
         this.aiText = this.aiJson.aiTaskG2
         this.aiCallBack = callback
@@ -18100,6 +18214,12 @@ ${_this.unitJson[0].chapterInfo[0].taskJson[index].taskDetail3.replaceAll('#',''
           this.$message.error("请生成简要描述后再生成目标");
           return;
         }
+        this.$nextTick(() => {
+          const targetDiv = this.$refs.aitargetTextDetail3;
+          if (targetDiv) {
+            targetDiv.scrollIntoView();
+          }
+        });
         this.aitype = type
         this.aiText = this.aiJson.aiTargetGet
         this.aiText2 = this.aiJson.aiTarget2
@@ -18632,7 +18752,8 @@ ${msg3}
           let _this = this
           function processNext() {
             if (ij < _this.unitJson[0].chapterInfo[0].taskJson.length) {
-              if(!_this.taskGLoading[ij][1]){
+              if(!_this.taskGLoading[ij][1] || !_this.unitJson[0].chapterInfo[0].taskJson[ij].taskDetail3){
+                _this.taskGLoading[ij][1] = false
                 ij++;
                 processNext();
                 return;
@@ -19484,6 +19605,12 @@ ${this.courseText && this.aiCallBack[0] == 2 ? '注意,优化原有的<参考
           this.isTargetCancelSource2.close()
           this.isTargetCancelSource2 = null
         }
+        this.$nextTick(() => {
+          const targetDiv = this.$refs.aitargetTextDetail3;
+          if (targetDiv) {
+            targetDiv.scrollIntoView();
+          }
+        });
       }
       if(this.isTargetCancelToken1 && type == 'target1'){
         this.$message.success("已经成功停止生成目标")
@@ -29932,4 +30059,54 @@ ol {
   height: 12px;
   margin-left: 5px;
 }
+
+.buttonBoxB{
+  position: relative;
+  margin: 0 0 0 10px;
+}
+
+.buttonBoxB::after{
+  content: '';
+  display: block;
+  background-image: url(../../../assets/icon/course/downArrow.svg);
+  background-size: 100% 100%;
+  width: 15px;
+  height: 15px;
+  cursor: pointer;
+  margin-left: 5px;
+}
+
+.buttonBoxB:hover .buttonBox{
+  display: block;
+}
+
+.buttonBox {
+  position: absolute;
+  bottom: -0;
+  left: 0;
+  transform: translateY(100%);
+  background: #fff;
+  border-radius: 5px;
+  box-shadow: 0 0 3px 1px #e3e3e3;
+  width: 155px;
+  display: none;
+  z-index: 99999;
+}
+
+.buttonBox>div {
+  height: 40px;
+  line-height: 40px;
+  width: 100%;
+  text-align: center;
+  color: #000;
+  box-sizing: border-box;
+}
+
+.buttonBox>div+div {
+  border-top: 1px solid #e0e0e0;
+}
+
+.buttonBox>div:hover {
+  background: #f6f8ff;
+}
 </style>

+ 9 - 6
src/components/pages/components/exjsmind.vue

@@ -85,13 +85,16 @@ export default {
 
 <style scoped>
 .exjsmind >>> jmnode {
-  font-size: 12px !important;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  min-width: 20px;
-  max-width: 300px;
+
+  /* display: flex; */
+  /* align-items: center; */
+  /* justify-content: center; */
+  /* min-width: 20px; */
+  max-width: 250px;
   overflow: hidden;
+  letter-spacing: 3px;
+  font-size: 12px !important;
+  /* flex-wrap: wrap; */
   /* white-space: wrap; */
 }
 </style>

File diff suppressed because it is too large
+ 308 - 337
src/components/pages/components/exportDataDialog.vue


+ 4 - 68
src/components/pages/components/exportWorksDialog.vue

@@ -826,82 +826,18 @@ export default {
         );
       });
 
-      // let domHeight = this.$refs.reportPdf.offsetHeight;
-      // // console.log('this.$refs.reportPdf',this.$refs.reportPdf.offsetHeight);
-      // let maxHeight = 64257;
-      //   html2canvas(this.$refs.reportPdf, {
-      //     useCORS: true, // 如果截图的内容里有图片,可能会有跨域的情况,加上这个参数,解决文件跨域问题
-      //     scale: maxHeight / domHeight > 1 ? 1 : maxHeight / domHeight
-      //   })
-      //     .then(canvas => {
-      //       const contentWidth = canvas.width;
-      //       const contentHeight = canvas.height;
-
-      //       var pageData = canvas.toDataURL("image/jpeg", 1.0);
-
-      //       var pdf = new jspdf("", "pt", [contentWidth, contentHeight]);
-
-      //       //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
-      //       //当内容未超过pdf一页显示的范围,无需分页
-      //       // if (leftHeight < pageHeight) {
-      //       pdf.addImage(pageData, "JPEG", 0, 0, contentWidth, contentHeight);
-
-      //       pdf.save(
-      //         this.worksDialogCon2.course +
-      //           "-作业集-" +
-      //           this.worksDialogCon2.sName +
-      //           ".pdf"
-      //       );
-      //       return resolve();
-      //     })
-      //     .catch(err => {
-      //       console.log(err);
-      //     });
+  
     },
 
     // 压缩pdf
     async getPdf2() {
-      // html2canvas(content)
-      //   .then(canvas => {
-      //     const imgData = canvas.toDataURL("image/png");
-      //     const pdf = new jspdf("p", "pt", [
-      //       content.offsetWidth,
-      //       content.offsetHeight
-      //     ]);
-
-      //     pdf.addImage(
-      //       imgData,
-      //       "PNG",
-      //       0,
-      //       0,
-      //       content.offsetWidth,
-      //       content.offsetHeight
-      //     );
-      //     pdf.save(
-      //       this.worksDialogCon2.course +
-      //           "-作业集-" +
-      //           this.worksDialogCon2.sName +
-      //           ".pdf"
-      //     );
-      //   })
-      // let domHeight = this.$refs.reportPdf.offsetHeight;
-      // let maxHeight = 64257;
+  
       const content = this.$refs.reportPdf;
 
       return new Promise((resolve, reject) => {
         html2canvas(content)
           .then(canvas => {
-            // const contentWidth = canvas.width;
-            // const contentHeight = canvas.height;
-
-            // var pageData = canvas.toDataURL("image/jpeg", 1.0);
-
-            // var pdf = new jspdf("", "pt", [contentWidth, contentHeight]);
-
-            // //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
-            // //当内容未超过pdf一页显示的范围,无需分页
-            // // if (leftHeight < pageHeight) {
-            // pdf.addImage(pageData, "JPEG", 0, 0, contentWidth, contentHeight);
+          
             const imgData = canvas.toDataURL("image/png");
             const pdf = new jspdf("p", "pt", [
               content.offsetWidth,
@@ -1415,7 +1351,7 @@ export default {
   display: flex;
   flex-direction: column;
   padding: 0 110px;
-  padding-bottom: 30px;
+  padding-bottom: 100px;
   box-sizing: border-box;
   font-family: PingFang SC;
 }

+ 93 - 71
src/components/pages/components/lookReport.vue

@@ -34,6 +34,15 @@
           size="small"
           >一键导出</el-button
         >
+        <el-button
+          v-if="checkCourse.state == 5"
+          @click="batchExportPdf"
+          :type="multipleSelection.length < 3 ? 'info' : 'primary'"
+          :disabled="multipleSelection.length < 3"
+          size="small"
+          >批量导出</el-button
+        >
+
         <el-button
           style="margin-left: 20px;"
           @click="pageBack"
@@ -100,7 +109,15 @@
         :fit="true"
         style="width: 100%"
         :header-cell-style="{ background: 'rgb(238,238,238)' }"
+        @selection-change="handleSelectionChange"
       >
+        <el-table-column
+          v-if="checkCourse.state == 5"
+          key="1"
+          type="selection"
+          width="55"
+        >
+        </el-table-column>
         <el-table-column
           prop="sName"
           label="姓名"
@@ -160,7 +177,6 @@
       </div>
     </div>
 
-
     <!-- ai查看报告 -->
     <el-dialog
       :visible.sync="worksDialog"
@@ -171,39 +187,33 @@
       :fullscreen="true"
     >
       <div slot="title" class="header-title">
-        <div style="color: #fff">{{ this.digNum == 2 ?'查看':'导出' }}报告</div>
+        <div style="color: #fff">
+          {{ this.digNum == 2 ? "查看" : "导出" }}报告
+        </div>
       </div>
-      <exportDataDialog  
+      <exportDataDialog
         v-if="checkCourse.state == 5"
-        :key="exportW" 
+        :key="exportW"
         :digNum="digNum"
-        :oid="oid" 
-        :multipleSelection="multipleSelection" 
-        :worksDialogCon="worksDialogCon" 
-        :worksDialog.sync="worksDialog" 
-        :cid="checkCourse.courseId">
+        :oid="oid"
+        :classAarray="classAarray"
+        :multipleSelection="multipleSelection"
+        :worksCon="worksDialogCon"
+        :worksDialog.sync="worksDialog"
+        :cid="checkCourse.courseId"
+      >
       </exportDataDialog>
-
+      <!-- 非ai查看报告 -->
       <div v-else class="report_box">
         <studentReport
-            :checkCourse="checkCourse.courseId"
-            :checkStudent="checkStudent"
-            @cancelR="cancelR"
-            :oid="oid"
+          :checkCourse="checkCourse.courseId"
+          :checkStudent="checkStudent"
+          @cancelR="cancelR"
+          :oid="oid"
         ></studentReport>
       </div>
     </el-dialog>
 
-
-    <!-- 非ai查看报告
-    <div class="report_box" v-if="reportVisible">
-        <studentReport
-            :checkCourse="checkCourse.courseId"
-            :checkStudent="checkStudent"
-            @cancelR="cancelR"
-            :oid="oid"
-        ></studentReport> 
-    </div> -->
   </div>
 </template>
 
@@ -212,7 +222,7 @@ import exportDataDialog from "./exportDataDialog.vue";
 import studentReport from "./studentReport.vue";
 
 export default {
-  props: ["signDialog", "checkCourse","oid"],
+  props: ["signDialog", "checkCourse", "oid"],
   components: {
     exportDataDialog,
     studentReport
@@ -221,12 +231,12 @@ export default {
     return {
       // 查看报告table数据
       lookReportTab: [],
-      exportW:0,
-      multipleSelection:[],
-      worksDialog:false,
-      digNum:0,
+      exportW: 0,
+      multipleSelection: [],
+      worksDialog: false,
+      digNum: 0,
       reportVisible: false,
-      checkStudent:'',
+      checkStudent: "",
       userAarray: [],
       classAarray: [],
       uname: "",
@@ -235,7 +245,7 @@ export default {
       page2: 1,
       total2: 0,
       isLoading2: false,
-      worksDialogCon:{}
+      worksDialogCon: {}
     };
   },
   mounted() {
@@ -250,56 +260,71 @@ export default {
     }
   },
   methods: {
+    // 批量选择作业
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
     // ai查看报告
-    lookPdf(val){
-      this.worksDialogCon=val
+    lookPdf(val) {
+      this.worksDialogCon = val;
       this.worksDialog = true;
-      this.digNum = 2
-      this.exportW++
+      this.digNum = 2;
+      this.exportW++;
     },
     // 一键导出
     exportWorkPdf() {
-      this
-        .$confirm("一键导出所有报告需要占用您大量时间,是否导出?", "提示", {
-          confirmButtonText: "确认",
-          cancelButtonText: "取消",
-          type: "warning",
+      this.$confirm("一键导出所有报告需要占用您大量时间,是否导出?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
+        .then(() => {
+          this.worksDialog = true;
+          this.digNum = 1;
+          this.exportW++;
         })
+        .catch(err => {
+          console.log(err);
+        });
+    },
+    batchExportPdf() {
+      this.$confirm("批量导出报告需要占用您一些时间,是否导出?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
         .then(() => {
+
           this.worksDialog = true;
-          this.digNum = 1
-          this.exportW++
+
+          this.digNum = 0;
+          this.exportW++;
         })
-        .catch((err) => {
-            console.log(err);
+        .catch(err => {
+          console.log(err);
         });
-     
     },
     // 导出报告
     getPdf(val) {
-
-        this
-        .$confirm("直接导出报告需要占用您一些时间,是否导出?", "提示", {
-          confirmButtonText: "确认",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
+      this.$confirm("直接导出报告需要占用您一些时间,是否导出?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning"
+      })
         .then(() => {
-            console.log('val',val);
+          console.log("val", val);
 
-            this.worksDialogCon=val
-            this.worksDialog = true;
+          this.worksDialogCon = val;
+          this.worksDialog = true;
 
-            this.multipleSelection = []
-            this.multipleSelection.push(val)
-            this.digNum = 0
-            this.exportW++
+          this.multipleSelection = [];
+          this.multipleSelection.push(val);
+          this.digNum = 0;
+          this.exportW++;
         })
-        .catch((err) => {
-            console.log(err);
+        .catch(err => {
+          console.log(err);
         });
-        
-
     },
     // 关闭弹框返回查看课程
     pageBack() {
@@ -358,8 +383,7 @@ export default {
     },
     handleClose(done) {
       done();
-    },
-   
+    }
   }
 };
 </script>
@@ -369,9 +393,9 @@ export default {
   width: 94%;
   margin: auto;
 }
-.TableCss >>> .el-table__header-wrapper .el-table__header .el-checkbox {
+/* .TableCss >>> .el-table__header-wrapper .el-table__header .el-checkbox {
   display: none;
-}
+} */
 .JsonTit {
   width: 100%;
   padding: 20px 0;
@@ -394,14 +418,12 @@ export default {
   margin-left: 10px;
 }
 
-
-
-.worksDialogCSSExp>>> .el-dialog__header {
+.worksDialogCSSExp >>> .el-dialog__header {
   /* padding: 9px 20px 10px; */
   background: #32455b !important;
 }
 
-.worksDialogCSSExp >>> .el-dialog__wrapper{
+.worksDialogCSSExp >>> .el-dialog__wrapper {
   overflow: hidden !important;
 }
 .worksDialogCSSExp >>> .el-dialog__body {

+ 567 - 32
src/components/pages/components/report.vue

@@ -1,5 +1,26 @@
 <template>
   <div class="r_box" v-loading="isLoading">
+    <div class="r_cbox">
+      <span>班级筛选</span>
+      <el-select
+        multiple
+        collapse-tags
+        class="r_select"
+        v-model="chooseClass"
+        placeholder="全部"
+        filterable
+        @change="changeClass"
+      >
+        <el-option
+          v-for="item in classArray"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        >
+        </el-option>
+      </el-select>
+    </div>
+
     <div class="r_cbox">
       <span>学生姓名</span>
       <el-select
@@ -67,7 +88,9 @@
       <el-button class="btn" type="primary" @click="confirmPdf">确定</el-button>
     </div>
 
-    <!-- 自定义导出作业pdf弹框 -->
+
+
+
     <el-dialog
       :visible.sync="worksDialog"
       :before-close="handleClose"
@@ -76,7 +99,488 @@
       :fullscreen="true"
     >
       <div slot="title" class="header-title">
-        <div style="color: #fff">自定义导出:{{ dataJson.title }}</div>
+        <div style="color: #fff">{{dataJson.state == 5 ?"按任务导出" :'自定义导出' + ':' +dataJson.title }}</div>
+      </div>
+
+      <div class="worksDiaCon" ref="reportPdf">
+        <div style="margin-bottom: 30px;font-size: 42px;">
+          {{ dataJson.title }}
+        </div>
+        <!-- <div
+          v-for="(userP, upi) in pdfUser"
+          style="background-color: #fff;border-radius: 8px;margin-top: 10px;"
+          :key="upi + 'upi'" 
+        >-->
+          <!-- <div style="padding: 10px;box-sizing: border-box;">
+            <h1>{{ userP.username }}</h1>
+          </div> -->
+
+          <div
+            v-for="(i, wip) in workList"
+           
+            :key="i.id"
+            class="stageCon"
+          >
+          <!-- v-if="
+              isStage(i.taskList, userP.userid) &&
+                (chap.length ? chap.indexOf(wip) != -1 : true)
+            " -->
+            <div v-if="dataJson.state != 5" class="stageTit">
+              第{{ i.id * 1 + 1 }}阶段<span v-if="i.name">:{{ i.name }}</span>
+            </div>
+            <div
+              v-for="k in i.taskList"
+              :key="k.task + 'a'"
+              
+              style="margin-bottom: 15px"
+            >
+            <!-- v-if="isTask(k.toolEList, userP.userid, k)" -->
+              <div
+                style="
+                    width: 100%;
+                    display: flex;
+                    justify-content: space-between;
+                    margin-bottom: 10px;
+                  "
+              >
+                <div class="taskTitInd">
+                  <span>任务{{ k.task + 1 }}</span>
+                  <span>{{ k.taskTit }}</span>
+                </div>
+                <div></div>
+              </div>
+              <div v-if="k.taskDetail" class="taskBri">
+                <div v-html="k.taskDetail"></div>
+              </div>
+              <div
+                class="WorksCon"
+                v-for="(l, lind) in k.toolEList"
+                :key="lind + 'l'"
+              >
+                <div
+                  v-if="l.content && l.content.length"
+                  v-for="(imgp, imgIdx) in l.content"
+                  :key="imgIdx + 'img'"
+                >
+                  <!-- <div
+                    v-if="
+                      (imgp && imgp[0] && imgp[0].userid == userP.userid) ||
+                        imgp.userid == userP.userid
+                    "
+                  > -->
+                  <div
+                    v-for="(userP, upi) in pdfUser"
+                    style="background-color: #fff;border-radius: 8px;margin-top: 10px;"
+                    :key="upi + 'upi'"
+                  >
+                    <div  v-if="
+                      (imgp && imgp[0] && imgp[0].userid == userP.userid) ||
+                        imgp.userid == userP.userid
+                    ">
+                      <div style="padding: 10px;box-sizing: border-box;">
+                        <h1>{{ userP.username }}</h1>
+                      </div>
+                      <div v-if="l.tool[0] == 15">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/thirdToolList/answer.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:问答工具</div>
+                            <div>提问:{{ l.content[0][0].answerTitle }}</div>
+                          </div>
+                        </div>
+                        <div class="answerTxt">
+                          回答:{{ l.content[0][0].answer }}
+                        </div>
+                      </div>
+                      <div v-if="l.tool[0] == 52">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/fourthToolList/text.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:文档工具</div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <div class="answerTxt" v-html="l.content[0].text"></div>
+                      </div>
+                      <div v-if="l.tool[0] == 16 || l.tool[0] == 50">
+                        <div class="toolBlk">
+                          <img
+                            v-if="l.tool[0] == 16"
+                            src="../../../assets/icon/thirdToolList/work.png"
+                            alt=""
+                          />
+                          <img
+                            v-if="l.tool[0] == 50"
+                            src="../../../assets/icon/thirdToolList/plwork.png"
+                            alt=""
+                          />
+
+                          <div class="toolTit">
+                            <div>
+                              工具{{ lind + 1 }}:{{
+                                l.tool[0] == 16 ? "作业提交" : "批量上传"
+                              }}
+                            </div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <div v-for="(i, codex) in l.content" :key="codex + 'co'">
+                          <div class="answerTxt" v-html="i.con"></div>
+                        </div>
+                      </div>
+                      <div
+                        v-if="l.tool[0] == 7 || l.tool[0] == 1 || l.tool[0] == 3"
+                      >
+                        <div class="toolBlk">
+                          <img
+                            v-if="l.tool[0] == 1"
+                            src="../../../assets/icon/secondToolList/whiteBoard.png"
+                            alt=""
+                          />
+                          <img
+                            v-if="l.tool[0] == 3"
+                            src="../../../assets/icon/secondToolList/mindMapping.png"
+                            alt=""
+                          />
+                          <img
+                            v-if="l.tool[0] == 7"
+                            src="../../../assets/icon/secondToolList/mindNetwork.png"
+                            alt=""
+                          />
+
+                          <div class="toolTit">
+                            <div>
+                              工具{{ lind + 1 }}:{{
+                                l.tool[0] == 1
+                                  ? "电子白板"
+                                  : l.tool[0] == 7
+                                  ? "思维网格"
+                                  : "思维导图"
+                              }}
+                            </div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <img
+                          style="max-width: 200px"
+                          :src="l.content[0].con"
+                          alt=""
+                        />
+                        <div>{{ l.content[0].con }}</div>
+                      </div>
+                      <div v-if="l.tool[0] == 48">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/fourthToolList/table.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:表格</div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <el-form>
+                          <div class="cont" v-html="l.content[0].text"></div>
+                        </el-form>
+                      </div>
+                      <div v-if="l.tool[0] == 4">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/thirdToolList/ask.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:问卷调查</div>
+                            <div>标题:{{ l.content[0][0].askJson.askTitle }}</div>
+                          </div>
+                        </div>
+
+                        <div
+                          style="margin-bottom: 5px"
+                          v-for="(i, index) in l.content[0][0].askJson.askJson"
+                          :key="index"
+                        >
+                          <div>题目:{{ i.askstitle }}</div>
+                          <el-radio-group
+                            v-if="!i.type"
+                            v-model="l.content[0][0].anwer[index]"
+                          >
+                            <el-radio
+                              v-for="(item2, checkIndex) in i.checkList"
+                              :key="checkIndex + 'b'"
+                              :label="checkIndex"
+                              disabled
+                            >
+                              {{ item2 }}
+                            </el-radio>
+                          </el-radio-group>
+                          <el-checkbox-group
+                            v-model="l.content[0][0].anwer[index]"
+                            v-else
+                          >
+                            <div class="radioBox">
+                              <el-checkbox
+                                v-for="(item2, checkIndex) in i.checkList"
+                                :key="checkIndex + 'c'"
+                                :label="checkIndex"
+                                disabled
+                              >
+                                {{ item2 }}
+                              </el-checkbox>
+                            </div>
+                          </el-checkbox-group>
+                        </div>
+                      </div>
+                      <div v-if="l.tool[0] == 45">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/thirdToolList/choose.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:选择题</div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <div
+                          v-for="(i, index) in l.content[0].testJson"
+                          :key="index + 'm'"
+                        >
+                          <div>题目:{{ i.teststitle }}</div>
+                          <div
+                            v-if="i.type == 1"
+                            style="display: flex; flex-direction: column"
+                          >
+                            <el-radio-group v-model="l.content[0].radio[index]">
+                              <div class="radioBox">
+                                <el-radio
+                                  v-for="(item2, checkIndex) in i.checkList"
+                                  :key="checkIndex + 'b'"
+                                  :label="checkIndex"
+                                  disabled
+                                  :class="[
+                                    i.answer == checkIndex
+                                      ? 'redioStyle5'
+                                      : 'redioStyle2'
+                                  ]"
+                                >
+                                  <div
+                                    v-if="
+                                      item2 && item2.imgType && item2.imgType == 1
+                                    "
+                                  >
+                                    <div
+                                      class="inImg"
+                                      @click.stop="previewImg(item2.src)"
+                                    >
+                                      <img
+                                        style="display: block"
+                                        :src="item2.src"
+                                        alt=""
+                                      />
+                                    </div>
+                                    <span>{{ item2.src }}</span>
+                                  </div>
+                                  <span v-else v-html="item2"></span>
+                                </el-radio>
+                              </div>
+                            </el-radio-group>
+                          </div>
+                          <div class="radioBox">
+                            <el-checkbox-group
+                              v-model="l.content[0].radio[index]"
+                              v-if="i.type == '2'"
+                            >
+                              <div class="radioBox">
+                                <el-checkbox
+                                  v-for="(item2, checkIndex) in i.checkList"
+                                  :key="checkIndex + 'c'"
+                                  :label="checkIndex"
+                                  disabled
+                                  :class="[
+                                    i.answer.includes(checkIndex)
+                                      ? 'redioStyle3'
+                                      : 'redioStyle4'
+                                  ]"
+                                >
+                                  <div style="display: flex">
+                                    <div
+                                      v-if="
+                                        item2 &&
+                                          item2.imgType &&
+                                          item2.imgType == 1
+                                      "
+                                    >
+                                      <div
+                                        class="inImg"
+                                        @click.stop="previewImg(item2.src)"
+                                      >
+                                        <img
+                                          style="display: block"
+                                          :src="item2.src"
+                                          alt=""
+                                        />
+                                      </div>
+                                    </div>
+                                    <span v-else v-html="item2"></span>
+                                  </div>
+                                </el-checkbox>
+                              </div>
+                            </el-checkbox-group>
+                          </div>
+                        </div>
+                      </div>
+                      <div v-if="l.tool[0] == 41">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/thirdToolList/select.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:选择匹配</div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <img
+                          style="max-width: 200px"
+                          :src="l.selectJson.url"
+                          alt=""
+                        />
+                        <div>
+                          {{ l.selectJson.url }}
+                        </div>
+                        <div>
+                          <span style="margin-right: 10px">选项:</span
+                          ><span
+                            style="margin-right: 10px"
+                            v-for="(item, itInd) in l.selectJson.select"
+                            :key="itInd"
+                            >{{ item }}</span
+                          >
+                        </div>
+                        <div>
+                          <span style="margin-right: 10px">答案:</span>
+
+                          <span
+                            style="margin-right: 10px"
+                            v-for="(item, itInd) in l.content[0].con"
+                            :key="itInd"
+                            >{{ itInd + 1 }}、{{
+                              l.selectJson.select[item]
+                            }}</span
+                          >
+                        </div>
+                      </div>
+                      <div v-if="l.tool[0] == 47">
+                        <div class="toolBlk">
+                          <img
+                            src="../../../assets/icon/fourthToolList/conSentences.png"
+                            alt=""
+                          />
+                          <div class="toolTit">
+                            <div>工具{{ lind + 1 }}:排序</div>
+                            <div>
+                              根据前期的了解与实地调研对于项目的了解,进行思考与讨论提出问题。
+                            </div>
+                          </div>
+                        </div>
+                        <div
+                          v-for="(i, index) in l.content[0]"
+                          :key="index"
+                          style="margin-bottom: 10px"
+                        >
+                          <div
+                            style="
+                              height: 20px;
+                              display: flex;
+                              align-items: center;
+                              flex-wrap: wrap;
+                            "
+                          >
+                            题目:
+                            <div
+                              class="sortTool"
+                              v-for="(i, index) in i.addSentence"
+                              :key="index"
+                            >
+                              {{ i }}
+                            </div>
+                            <span
+                              v-if="
+                                JSON.stringify(i.chooseSenList) ==
+                                  JSON.stringify(i.addSentence)
+                              "
+                              style="color: #868ce4"
+                              >回答正确</span
+                            >
+                            <span v-else style="color: red">回答错误</span>
+                          </div>
+                          <div
+                            style="
+                              margin: 10px 0;
+                              display: flex;
+                              align-items: center;
+                              flex-wrap: wrap;
+                            "
+                          >
+                            学生回答:
+                            <div
+                              class="sortTool"
+                              v-for="(i, index) in i.chooseSenList"
+                              :key="index"
+                            >
+                              {{ i }}
+                            </div>
+                          </div>
+                          <div>
+                            正确答案:
+                            <span style="margin: 0 5px">{{
+                              i.addSentence.join(",")
+                            }}</span>
+                          </div>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                  <!-- </div> -->
+                </div>
+              </div>
+            </div>
+          </div>
+        <!-- </div> -->
+      </div>
+    </el-dialog>
+
+
+
+    <!-- 自定义导出作业pdf弹框 -->
+    <!-- <el-dialog
+      :visible.sync="worksDialog"
+      :before-close="handleClose"
+      class="worksDialogCSSExp"
+      :append-to-body="true"
+      :fullscreen="true"
+    >
+      <div slot="title" class="header-title">
+        <div style="color: #fff">{{dataJson.state == 5 ?"按任务导出" :'自定义导出' + ':' +dataJson.title }}</div>
       </div>
 
       <div class="worksDiaCon" ref="reportPdf">
@@ -528,7 +1032,7 @@
           </div>
         </div>
       </div>
-    </el-dialog>
+    </el-dialog> -->
   </div>
 </template>
 
@@ -536,17 +1040,19 @@
 import html2canvas from "html2canvas";
 import jspdf from "jspdf";
 export default {
-  props: ["cid", "dataJson"],
+  props: ["cid", "dataJson", "classArray"],
   data() {
     return {
       worksDialog: false,
       pdfUser: [],
       uname: [],
+      chooseClass: [],
       chap: [],
       task: [],
       dyAarray: [],
       dyList: [],
-      userAarray: [],
+      userAarray: [], //作业提交学生
+      userAarrayCopy: [], //班级筛选的时候使用作业提交学生
       isLoading: false,
       workList: [],
       workEvaList: []
@@ -645,20 +1151,38 @@ export default {
           content.offsetHeight
         );
 
-        let username = "";
+        let className = "";
+
+        if (this.chooseClass.length) {
+          this.classArray.forEach((e,i)=>{
+            if (this.chooseClass.indexOf(e.id) != -1) {
+              className += `${e.name}、`
+            }
+          })
+        }else{
+          this.classArray.forEach(e=>{
+              className += `${e.name}、`
+          })
+        }
+
+        className = className.slice(0 , -1 ) + '-'
+
+        
+
+
+
         let taskName = "";
         let taskList = JSON.parse(JSON.stringify(this.task));
 
-        this.pdfUser.forEach((e, i) => {
-          if (this.pdfUser.length - 1 == i) {
-            username += `${e.username}-`;
-          } else {
-            username += `${e.username},`;
-          }
-        });
+        // this.pdfUser.forEach((e, i) => {
+        //   if (this.pdfUser.length - 1 == i) {
+        //     username += `${e.username}-`;
+        //   } else {
+        //     username += `${e.username},`;
+        //   }
+        // });
 
         if (this.dataJson.state == 5) {
-
           if (!taskList.length) {
             this.dyAarray[0].taskList.forEach(e => {
               let ar = 0 + "-" + e.id;
@@ -667,19 +1191,19 @@ export default {
             });
           }
 
-         
-
           this.dyAarray[0].taskList.forEach(e => {
             let ar = 0 + "-" + e.id;
             console.log("ar", ar);
 
             if (taskList.indexOf(ar) != -1) {
-              taskName += `${e.name}-`;
+              taskName += `${e.name}`;
             }
           });
-          pdf.save(username + this.dataJson.title + "-" + taskName + ".pdf");
+          taskName = taskName.slice(0 , -1 )
+
+          pdf.save(className + this.dataJson.title + "-" + taskName + ".pdf");
         } else {
-          pdf.save(username + this.dataJson.title + ".pdf");
+          pdf.save(className + this.dataJson.title + ".pdf");
         }
 
         // this.worksDialog = false;
@@ -693,18 +1217,19 @@ export default {
       this.ajax
         .get(this.$store.state.api + "getCourseWorksReport1", params)
         .then(res => {
-          res.data[1];
-          res.data[3]; //问卷
-          res.data[4]; //问答题
-          res.data[5];
-          res.data[6]; //选择题
-          res.data[7]; //个人评价作业
-          res.data[8]; //选择匹配作业
-          res.data[9]; //排序作业
-          res.data[10]; //表格作业
-          res.data[11]; //cocopi或源码编辑作业
-          res.data[12]; //文档作业
+          // res.data[1];
+          // res.data[3]; //问卷
+          // res.data[4]; //问答题
+          // res.data[5];
+          // res.data[6]; //选择题
+          // res.data[7]; //个人评价作业
+          // res.data[8]; //选择匹配作业
+          // res.data[9]; //排序作业
+          // res.data[10]; //表格作业
+          // res.data[11]; //cocopi或源码编辑作业
+          // res.data[12]; //文档作业
           this.workEvaList = res.data[13];
+          this.userAarrayCopy = JSON.parse(JSON.stringify(res.data[14]));
           this.userAarray = res.data[14];
 
           var dyJSON = JSON.parse(res.data[0][0].chapters);
@@ -859,7 +1384,7 @@ export default {
       }
       console.log("this.pdfUser", this.pdfUser);
 
-      this.worksDialog = true;
+        this.worksDialog = true;        
       setTimeout(() => {
         this.getPdf();
       }, 500);
@@ -874,6 +1399,16 @@ export default {
         }
       }
     },
+    changeClass() {
+      if (this.chooseClass.length) {
+        this.userAarray = this.userAarrayCopy.filter(e => {
+          let kk = this.chooseClass.filter(item => e.classid.includes(item));
+          return kk.length ? e :''
+        });
+      } else {
+        this.userAarray = JSON.parse(JSON.stringify(this.userAarrayCopy));
+      }
+    },
     handleClose(done) {
       done();
     }
@@ -930,7 +1465,7 @@ export default {
   width: 810pt;
   margin: auto;
   min-height: 1200px;
-  padding: 60px 8% 0;
+  padding: 60px 8%;
   box-sizing: border-box;
   background-color: rgb(255, 251, 220);
 }

+ 34 - 18
src/components/pages/components/studentWorksDetail.vue

@@ -200,7 +200,7 @@
             <div style="color: #fff">查看&批改</div>
           </div>
 
-          <LookWorks :id="checkCourse" :isStu="1" :studentId="studentId" :key="countM"></LookWorks>
+          <LookWorks @childExportPdfSetBtn="childExportPdfSetBtn" :id="checkCourse" :isStu="1" :studentId="studentId" :key="countM"></LookWorks>
 
           <!-- <div v-else class="zyBoxC" ref="reportPdf">
             <div class="courseTitle" v-if="allWorks.course">
@@ -1470,18 +1470,6 @@
     </el-dialog>
 
     <div class="report_box" v-if="reportVisible">
-      <!-- <el-dialog
-        v-if="exportData.state == 5"
-        :visible.sync="reportVisible"
-        width="100%"
-        :before-close="handleClose"
-        class="full_diy"
-        :append-to-body="true"
-      >
-      <div slot="title" class="header-title">
-        <div style="color: #fff">查看作业</div>
-      </div>
-    </el-dialog>  -->
 
     <el-dialog
       v-if="exportData.state == 5"
@@ -1495,7 +1483,7 @@
       <div slot="title" class="header-title">
         <div style="color: #fff">查看报告</div>
       </div>
-      <exportDataDialog  :key="checkStudent" :digNum="'2'" :oid="oid" :worksDialogCon="exportData" :cid="checkCourse"></exportDataDialog>
+      <exportDataDialog  :key="checkStudent" :digNum="'2'" :oid="oid" :worksCon="exportData" :cid="checkCourse"></exportDataDialog>
 
     </el-dialog>
 
@@ -1508,7 +1496,20 @@
         :typeNum = "1"
       ></studentReport>
     </div>
-   
+
+
+    <el-dialog
+      :visible.sync="worksDialog"
+      :before-close="handleClose"
+      class="worksDialogCSSExp"
+      :append-to-body="true"
+      :fullscreen="true"
+    >
+      <div slot="title" class="header-title">
+        <div style="color: #fff">导出作业集</div>
+      </div>
+      <exportWorksDialog  :key="exportW" :digNum="digNum" :oid="oid" :worksDialog.sync="worksDialog" :worksDialogCon="worksDialogCon" :uid="exportPdfSetUid" :cid="checkCourse"></exportWorksDialog>
+    </el-dialog>
   </div>
 </template>
 
@@ -1520,6 +1521,8 @@ import saveAs from "file-saver";
 import html2canvas from "html2canvas";
 import LookWorks from "./lookWork.vue";
 import exportDataDialog from "./exportDataDialog.vue";
+import exportWorksDialog from "./exportWorksDialog.vue";
+
 
 import jspdf from "jspdf";
 export default {
@@ -1527,8 +1530,8 @@ export default {
     StudentData,
     studentReport,
     LookWorks,
-    exportDataDialog
-
+    exportDataDialog,
+    exportWorksDialog
   },
   props: ["uid", "ooid", "oorg","username","dialogVisibleS"],
   data() {
@@ -1759,7 +1762,12 @@ export default {
       exportData:'',
       DState:'',
       cid:'',
-      countM: 0
+      countM: 0,
+      worksDialog:false,
+      worksDialogCon:'',
+      exportPdfSetUid:'',
+      digNum:2,
+      exportW:0
     };
   },
   mounted() {
@@ -1816,6 +1824,14 @@ export default {
     goTo(path) {
       this.$router.push(path);
     },
+    // 子元素调用父元素 按任务查看导出作业集
+    childExportPdfSetBtn(val) {
+      this.worksDialog = true;
+      this.worksDialogCon = val.con;
+      this.exportPdfSetUid = val.uid;
+      this.digNum = 0;
+      this.exportW++
+    },
     backPage(){
       this.$emit("StuCancel");
     },

+ 7 - 6
src/components/pages/components/worksDetail2.vue

@@ -18,18 +18,19 @@
           >一键导出</el-button
         >
         <el-button @click="exportData" 
-          v-if="DState == 5 && cutTabNum == 0 && multipleSelection.length > 1"
-          type="primary" 
+          v-if="DState == 5 && cutTabNum == 0"
+          :type="multipleSelection.length < 3 ? 'info' : 'primary'" 
+          :disabled="multipleSelection.length < 3"
           size="small"
           >批量导出</el-button
         >
-        <el-button @click="exportData" 
+        <!-- <el-button
           v-if="DState == 5 && cutTabNum == 0 && multipleSelection.length < 2"
           type="info" 
           disabled
           size="small"
           >批量导出</el-button
-        >
+        > -->
         <el-button @click="customizeExport" 
           type="primary" 
           size="small"
@@ -1594,7 +1595,7 @@
     >
       <div>
         <div>
-          <Report :cid="dataJson.courseId" :dataJson="dataJson" ref="reportRef"></Report>
+          <Report :cid="dataJson.courseId" :dataJson="dataJson" ref="reportRef" :classArray="classArray"></Report>
         </div>
       </div>
       <span slot="footer" class="dialog-footer"> </span>
@@ -1965,7 +1966,7 @@ export default {
     // 批量导出
     exportData(){
       // this.$emit("update:dialogVisibleBao", true);
-      this.$confirm("批量导出报告需要占用您较多时间,是否导出?", "提示", {
+      this.$confirm("批量导出作业需要占用您较多时间,是否导出?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",

+ 2 - 2
src/components/pages/works.vue

@@ -492,7 +492,7 @@
       ></studentReport>
     </div>
 
-    <el-dialog
+    <!-- <el-dialog
       :visible.sync="worksDialog"
       :before-close="handleClose"
       class="worksDialogCSSExp"
@@ -512,7 +512,7 @@
         :worksDialog.sync="worksDialog" 
         :cid="checkCourse.courseId">
       </exportDataDialog>
-    </el-dialog>
+    </el-dialog> -->
    
   </div>
 </template>

Some files were not shown because too many files changed in this diff