فهرست منبع

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_mock

qinzhipeng_v 5 سال پیش
والد
کامیت
f13bbe1f90

+ 11 - 12
src/views/Platform/presentation/Templates/ClientReport.vue

@@ -47,7 +47,7 @@
       <div style="margin: 0 12%; font-size:18px; font-family:PingFangSC-Medium,PingFang SC; font-weight:500; color:rgba(51,59,74,1); line-height:29px;">
         报告预览
       </div>
-      <div class="descr" style=" margin-bottom: 2%; height: 350px; overflow:scroll; overflow-x: hidden">
+      <div class="descr" style="height: 350px; overflow:scroll; overflow-x: hidden">
         <ResultPageyL id="resumeId1" :message="report" />
       </div>
       <div align="center">
@@ -98,8 +98,8 @@ export default {
     init(index, newData) {
       console.log(newData, '准出dialog')
       this.dialogDaliy = true
-      var url = location.href // 获取url中"?"符后的字串
-      var arr = url.split('=')
+      const url = location.href // 获取url中"?"符后的字串
+      const arr = url.split('=')
       switch (index) {
         case 1: // 新建
           this.client_task = [Number(arr[1])]
@@ -221,16 +221,15 @@ export default {
       }
     },
     sendReport(e) {
-      var ele = this.report
+      const ele = this.report
+      const targetDom = document.getElementById('resumeId1')
+      const copyDom = targetDom.cloneNode(true)
+      document.querySelector('body').appendChild(copyDom)
       setTimeout(() => {
-        var targetDom = document.getElementById('resumeId1')
-        var copyDom = targetDom.cloneNode(true)
-        document.querySelector('body').appendChild(copyDom)
-        const height = document.querySelector('.reportContent').clientHeight
-        html2canvas(copyDom, { useCORS: true, height: height }).then(canvas => {
-          var imgData = canvas.toDataURL('image/png')
-          var sendImgData = imgData.substring(imgData.indexOf(',') + 1)
-          var postData = { 'reportId': ele.id, 'imgStr': sendImgData, 'url': window.location.href, 'emailUser': e.name, 'copyTo': e.names }
+        html2canvas(document.getElementsByClassName('reportContent')[1], { useCORS: true }).then(canvas => {
+          const imgData = canvas.toDataURL('image/png')
+          const sendImgData = imgData.substring(imgData.indexOf(',') + 1)
+          const postData = { 'reportId': ele.id, 'imgStr': sendImgData, 'url': window.location.href, 'emailUser': e.name, 'copyTo': e.names }
           projectTestReportSendmail(postData).then(res => {
             res.code === 200 ? this.$message.success('发送测试报告成功') : this.$message.error('发送测试报告失败,请联系管理员!')
             this.handleClose()

+ 4 - 6
src/views/Platform/presentation/Templates/TestReport.vue

@@ -216,12 +216,11 @@ export default {
     sendReport(e) {
       this.send = true
       const ele = this.preview
+      const targetDom = document.getElementById('resumeId')
+      const copyDom = targetDom.cloneNode(true)
+      document.querySelector('body').appendChild(copyDom)
       setTimeout(() => {
-        const targetDom = document.getElementById('resumeId')
-        let copyDom = targetDom.cloneNode(true)
-        document.querySelector('body').appendChild(copyDom)
-        const height = document.querySelector('.reportContent').clientHeight
-        html2canvas(copyDom, { useCORS: true, height: height }).then(canvas => {
+        html2canvas(document.getElementsByClassName('reportContent')[1], { useCORS: true }).then(canvas => {
           const imgData = canvas.toDataURL('image/png')
           const sendImgData = imgData.substring(imgData.indexOf(',') + 1)
           const postData = { 'reportId': ele.id, 'imgStr': sendImgData, 'url': window.location.href, 'emailUser': e.name, 'copyTo': e.names }
@@ -230,7 +229,6 @@ export default {
             this.handleClose1()
             this.send = false
             document.querySelector('body').removeChild(copyDom)
-            copyDom = null
           })
         })
       }, 500)

+ 5 - 1
src/views/Platform/presentation/testPresentation.vue

@@ -290,7 +290,11 @@ export default {
       this.$set(this.queryData, 'ClientReport', '')
       this.$set(this.queryData, 'code', '')
       this.restaurants = []
-      taskListCreate({ statusList: [3], bizId: localStorage.getItem('bizId') }).then(res => {
+      let statusList = [3]
+      if (e === 3) {
+        statusList = [1]
+      }
+      taskListCreate({ statusList: statusList, bizId: localStorage.getItem('bizId') }).then(res => {
         this.restaurants = res.data.taskInfoList
       })
     },