sunjh 6 år sedan
förälder
incheckning
952b9d1688

+ 0 - 2
src/components/project/Project.vue

@@ -445,8 +445,6 @@ export default {
         datetime: this.project.datetime,
         usage: this.project.usage,
       }
-      console.log('aa')
-      console.log(newProject)
       Http.put(Apis.PROJECT.UPDATE_PROJECT.replace('{projectId}', this.projectId), newProject).then((res) => {
         console.log('bb')
         console.log(res)

+ 9 - 5
src/components/report/Report.vue

@@ -241,9 +241,12 @@ export default {
       //pro1564487183259_task1564487274060
       //pro1564487183259pro1564487183259_task1564487274060_rep1564488510500
       this.showLoading()
+      console.log('start')
+      console.log(this.projectId)
+      console.log(this.taskId)
+      console.log('end')
       if (this.taskId == null) {
         Http.get(Apis.REPORT.GET_PROJECT_REPORT.replace('{projectId}', this.projectId).replace('{reportId}', this.reportId)).then((res) => {
-
           this.report.name = res.crowdReportVO.name
           this.report.crowdTestTaskId = res.crowdReportVO.crowdTestTaskId
           this.report.scope = res.crowdReportVO.scope
@@ -254,9 +257,10 @@ export default {
           this.report.conclusion = res.crowdReportVO.conclusion
           this.report.target = res.crowdReportVO.target
           this.hideLoading()
-          notify('success', '修改成功')
+          //notify('success', '修改成功')
         }).catch((error) => {
-          notify('error', '修改失败:' + error.data)
+          this.hideLoading()
+          notify('error', '打开报告失败:' + error.data)
         })
       } else {
         Http.get(Apis.REPORT.GET_TASK_REPORT.replace('{projectId}', this.projectId).replace('{taskId}', this.taskId).replace('{reportId}', this.reportId)).then((res) => {
@@ -271,9 +275,9 @@ export default {
           this.report.conclusion = res.crowdReportVO.conclusion
           this.report.target = res.crowdReportVO.target
           this.hideLoading()
-          notify('success', '修改成功')
         }).catch((error) => {
-          notify('error', '修改失败:' + error.data)
+          this.hideLoading()
+          notify('error', '打开报告失败:' + error.data)
         })
       }
     },

+ 21 - 10
src/components/report/ReportList.vue

@@ -18,7 +18,7 @@
       <el-table-column prop="file" sortable label="报告文件">
         <template slot-scope="scope">
           <span v-if="scope.row.content==null || scope.row.content==''">暂无文件</span>
-          <a :href="scope.row.content" v-if="scope.row.content!=null" target="_blank"><i
+          <a :href="scope.row.file" v-if="scope.row.content!=null" target="_blank"><i
             class="fa fa-file-text-o"></i> {{scope.row.content}}</a>
         </template>
       </el-table-column>
@@ -43,21 +43,32 @@ export default {
   data () {
     return {
       editIndex: -1,
-      reportList: this.reports==null?[]:this.reports,
+      reportList: this.reports == null ? [] : this.reports,
       pid: this.projectId,
       tid: this.taskId,
     }
   },
   methods: {
     handleEdit (index, row) {
-      this.$router.push({
-        name: 'Report',
-        params: {
-          reportId: row.code,
-          projectId: this.pid,
-          taskId: this.tid
-        }
-      })
+      if (this.tid == null) {
+        this.$router.push({
+          name: 'ProjectReport',
+          params: {
+            reportId: row.code,
+            projectId: this.pid
+          }
+        })
+      } else {
+        this.$router.push({
+          name: 'Report',
+          params: {
+            reportId: row.code,
+            projectId: this.pid,
+            taskId: this.tid
+          }
+        })
+      }
+
       // this.editIndex = index;
     },
     handleDelete (index, row) {

+ 10 - 1
src/router/index.js

@@ -111,7 +111,7 @@ export default new Router({
       },
     },
     {
-      path: '/report/:reportId',
+      path: '/project/:projectId/task/:taskId/report/:reportId',
       name: 'Report',
       component: resolve => require(['@/components/report/Report.vue'], resolve),
       meta: {
@@ -120,6 +120,15 @@ export default new Router({
       },
     },
     {
+      path: '/project/:projectId/report/:reportId',
+      name: 'ProjectReport',
+      component: resolve => require(['@/components/report/Report.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      },
+    },
+    {
       path: '/greenChannel/addProject',
       name: 'ProjectAdd',
       component: resolve => require(['@/components/cheat/ProjectAdd.vue'], resolve),