11wqe1 hace 9 meses
padre
commit
294d88e38d

+ 8 - 2
src/components/pages/components/lookWork.vue

@@ -10,6 +10,7 @@
         />
         <span>{{ userName }}</span>
         <span>{{ courseName }}</span>
+        <el-button size="small" type="primary" style="margin-left: 10px;height: 25px;line-height: 8px;" @click="expPdf">导出</el-button>
       </div>
 
       <div v-if="isStu == 0">
@@ -708,7 +709,8 @@ export default {
       workList: [],
       CState: 0,
       tableData: [],
-      loading: false
+      loading: false,
+      resData:{}
     };
   },
 
@@ -786,6 +788,9 @@ export default {
     }
   },
   methods: {
+    expPdf(){
+      this.$emit('childExportPdfSetBtn',{uid:this.uid,con:this.resData});
+    },
     // 下一个
     nxtPer() {
       this.positP++;
@@ -848,7 +853,7 @@ export default {
       this.$hevueImgPreview(url);
     },
     // 获取作业信息
-    async exportPdfSet(uid, con) {
+    async exportPdfSet() {
       this.loading = true;
       this.tableData.forEach((e, i) => {
         if (e.userid == this.uid) {
@@ -879,6 +884,7 @@ export default {
             this.workEvaList = res.data[13];
 
             console.log('res.data[0][0]',res.data[0][0]);
+            this.resData = JSON.parse(JSON.stringify(res.data[0][0]))
             
             this.courseName = res.data[0][0].course;
             this.CState = res.data[0][0].state;

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

@@ -927,9 +927,10 @@ export default {
   overflow: hidden;
 }
 .worksDiaCon {
-  width: 894pt;
+  width: 810pt;
   margin: auto;
-  padding: 60px 100px;
+  min-height: 1200px;
+  padding: 60px 8% 0;
   box-sizing: border-box;
   background-color: rgb(255, 251, 220);
 }

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

@@ -302,7 +302,7 @@
           <div slot="title" class="header-title">
             <div style="color: #fff">查看&批改</div>
           </div>
-          <LookWork  :id="id" :studentId="studentId" :key="studentId"></LookWork>
+          <LookWork @childExportPdfSetBtn="childExportPdfSetBtn" :id="id" :studentId="studentId" :key="dialogVisible3"></LookWork>
 
           <!-- <div v-else class="zyBoxC" ref="reportPdf">
             <div class="courseTitle" v-if="allWorks.course">
@@ -1585,7 +1585,7 @@
 
 <!-- 自定义导出作业筛选弹框 -->
     <el-dialog
-      title="自定义导出作业"
+      :title="dataJson.state == 5 ? '按任务导出作业' : '自定义导出作业'"
       :visible.sync="dialogVisibleBao"
       :append-to-body="true"
       width="550px"
@@ -1594,7 +1594,7 @@
     >
       <div>
         <div>
-          <Report :cid="dataJson.courseId" :dataJson="dataJson"></Report>
+          <Report :cid="dataJson.courseId" :dataJson="dataJson" ref="reportRef"></Report>
         </div>
       </div>
       <span slot="footer" class="dialog-footer"> </span>
@@ -1998,6 +1998,15 @@ export default {
 
       this.exportW++
     },
+    // 子元素调用父元素 按任务查看导出作业集
+    childExportPdfSetBtn(val) {
+      this.worksDialog = true;
+      this.worksDialogCon = val.con;
+      this.exportPdfSetUid = val.uid;
+      this.digNum = 0
+
+      this.exportW++
+    },
     // 导出所有作业
     exportPdfSetAllWork(){
       this.worksDialog = true;
@@ -2224,14 +2233,15 @@ export default {
     },
     lookWork(id, uid, type, index,con) {
       // console.log('con',con);
+      this.studentId = '';
 
       this.scopeId1 = id;
       this.studentId = uid;
 
       // if (this.DState == 5) {
-      this.$nextTick(()=>{
-        this.dialogVisible3 = true
-      })
+      // this.$nextTick(()=>{
+      this.dialogVisible3 = true
+      // })
       // }
       return