Browse Source

优化报告

qinzhipeng_v 5 years ago
parent
commit
c88d73a4e5

+ 96 - 36
src/views/projectManage/taskList/components/reportList.vue

@@ -1,9 +1,12 @@
 <template>
   <div>
     <section class="main-section">
-      <div class="el-main-title">
-        <div class="title-left-icon" />
-        <div class="title-left-name">提测报告</div>
+      <div class="Layout_space_between">
+        <div class="el-main-title">
+          <div class="title-left-icon" />
+          <div class="title-left-name">提测报告</div>
+        </div>
+        <el-button class="task-report-btn" type="text" @click="getTest(10086)">{{ dataStatus?'查看历史':"回到最新" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table
@@ -15,7 +18,8 @@
         >
           <el-table-column label="标题名称" min-width="120">
             <template slot-scope="scope">
-              <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row, 2)">{{ scope.row.name }}</a>
+              <a v-if="dataStatus" href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row, 2)">{{ scope.row.reportName }}</a>
+              <a v-if="!dataStatus" href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row, 2)">{{ scope.row.name }}</a>
             </template>
           </el-table-column>
           <el-table-column label="状态" min-width="100" align="center">
@@ -24,12 +28,15 @@
             </template>
           </el-table-column>
           <el-table-column label="创建人" min-width="100" align="center">
-            <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
+            <template slot-scope="scope">
+              <span v-if="dataStatus">{{ scope.row.creatorObject === null ? '' : scope.row.creatorObject.name }}</span>
+              <span v-if="!dataStatus">{{ scope.row.createrObject.name }}</span>
+            </template>
           </el-table-column>
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
-          <el-table-column label="操作" width="200">
+          <el-table-column v-if="dataStatus" label="操作" width="200">
             <template slot-scope="scope">
               <div v-if="scope.row.status === 1 ? false : true">
                 <span v-if="scope.row.status === 3 ? true : false" class="btn" @click="back(1,scope.row.id, scope.row)">通过</span>
@@ -71,9 +78,12 @@
       </div>
     </section>
     <section class="main-section">
-      <div class="el-main-title">
-        <div class="title-left-icon" />
-        <div class="title-left-name">测试日报</div>
+      <div class="Layout_space_between">
+        <div class="el-main-title">
+          <div class="title-left-icon" />
+          <div class="title-left-name">测试日报</div>
+        </div>
+        <el-button class="task-report-btn" type="text" @click="getDaily(10011)">{{ dailyDataStatus?'查看历史':"回到最新" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table :data="dailyData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500' }" show-overflow-tooltip="true">
@@ -86,12 +96,15 @@
             <template slot-scope="scope">{{ scope.row.statusString }}</template>
           </el-table-column>
           <el-table-column label="创建人" min-width="100" align="center">
-            <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
+            <template slot-scope="scope">
+              <span v-if="dailyDataStatus">{{ !scope.row.createrObject? '':scope.row.createrObject.name }}</span>
+              <span v-if="!dailyDataStatus">{{ scope.row.createrObject.name }}</span>
+            </template>
           </el-table-column>
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
-          <el-table-column label="操作" width="200">
+          <el-table-column v-if="dailyDataStatus" label="操作" width="200">
             <template slot-scope="scope">
               <div>
                 <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="dailyButtom(5,scope.row.id, scope.row)">发送</span>
@@ -131,9 +144,12 @@
       </div>
     </section>
     <section class="main-section">
-      <div class="el-main-title">
-        <div class="title-left-icon" />
-        <div class="title-left-name">准出报告</div>
+      <div class="Layout_space_between">
+        <div class="el-main-title">
+          <div class="title-left-icon" />
+          <div class="title-left-name">准出报告</div>
+        </div>
+        <el-button class="task-report-btn" type="text" @click="getClient(10000)">{{ releaseDataStatus?'查看历史':"回到最新" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table :data="clientData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500' }" show-overflow-tooltip="true">
@@ -143,15 +159,21 @@
             </template>
           </el-table-column>
           <el-table-column label="状态" min-width="100" align="center">
-            <template slot-scope="scope">{{ scope.row.reportStatusString }}</template>
+            <template slot-scope="scope">
+              <span v-if="!releaseDataStatus">{{ scope.row.reportStatusString }}</span>
+              <span v-if="releaseDataStatus">{{ scope.row.statusString }}</span>
+            </template>
           </el-table-column>
           <el-table-column label="创建人" min-width="100" align="center">
-            <template slot-scope="scope">{{ scope.row.createrObject.name }}</template>
+            <template slot-scope="scope">
+              <span v-if="!releaseDataStatus">{{ scope.row.createrObject.name }}</span>
+              <span v-if="releaseDataStatus">{{ scope.row.creatorObject === null ? '' :scope.row.creatorObject.name }}</span>
+            </template>
           </el-table-column>
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
-          <el-table-column label="操作" width="200">
+          <el-table-column v-if="releaseDataStatus" label="操作" width="200">
             <template slot-scope="scope">
               <div v-if="scope.row.status === 1 ? false : true">
                 <span v-if="scope.row.status === 2 ? true : false" class="btn" @click="clientButtom(5,scope.row.id, scope.row)">发送</span>
@@ -202,11 +224,13 @@ import {
   launchTest,
   launchTestDelete
 } from '@/api/taskIndex' // ajax
+import '@/styles/PublicStyle/index.scss'
 import TestReport from '@/views/reportManagement/components/TestingReport' // 提测
 import DailyReport from '@/views/reportManagement/components/DailyReport' // 日报
 import ReleaseReport from '@/views/reportManagement/components/ReleaseReport' // 准出
 import { dailyReportDelete, projectTestReportDelete } from '@/api/testPresentetion' // 日报
 import { launchTestUpdate } from '@/api/InterfaceReport'
+import { reportdelivertestList, reportreleaseList, dailyReportListV2 } from '@/api/reportTemplate'
 export default {
   components: {
     TestReport,
@@ -219,6 +243,9 @@ export default {
       userNames: localStorage.getItem('realname'),
       taskId: Number(this.$route.query.id), // 任务id
       stColors: ['#409EFF', '#07BCA4', '#F56C6C', '#07BCA4'],
+      dataStatus: true, // 数据状态
+      releaseDataStatus: true, // 准出
+      dailyDataStatus: true, // 日报
       dialog_testData: false, // 打回弹窗
       dialog_daily: false, // 测试报告dialog
       dialog_client: false, // 准出报告dialog
@@ -257,28 +284,58 @@ export default {
     this.getClient()
   },
   methods: {
-    async getTest() { // 获取提测
-      const params = { taskId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
-      const res = await launchTest(params)
-      if (res.code === 200) {
-        this.testData = res.data.list
-        this.testPages.total = res.data.total
+    async getTest(val) { // 获取提测
+      val === 10086 ? this.dataStatus = !this.dataStatus : ''
+      if (this.dataStatus) {
+        const data = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
+        const res = await reportdelivertestList(data)
+        if (res.code === 200) {
+          this.testData = res.data.list
+          this.testPages.total = res.data.total
+        }
+      } else {
+        const params = { taskId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
+        const res = await launchTest(params)
+        if (res.code === 200) {
+          this.testData = res.data.list
+          this.testPages.total = res.data.total
+        }
       }
     },
-    async getDaily() { // 获取日报
-      const params = { taskId: this.taskId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
-      const res = await dailyReport(params)
-      if (res.code === 200) {
-        this.dailyData = res.data.list
-        this.dailyPages.total = res.data.total
+    async getDaily(val) { // 获取日报
+      val === 10011 ? this.dailyDataStatus = !this.dailyDataStatus : ''
+      if (this.dailyDataStatus) {
+        const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+        const res = await dailyReportListV2(indexPage)
+        if (res.code === 200) {
+          this.dailyData = res.data
+          this.dailyPages.total = res.total
+        }
+      } else {
+        const params = { taskId: this.taskId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
+        const res = await dailyReport(params)
+        if (res.code === 200) {
+          this.dailyData = res.data.list
+          this.dailyPages.total = res.data.total
+        }
       }
     },
-    async getClient() { // 获取准出
-      const params = { taskId: this.taskId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
-      const res = await projectTestReport(params)
-      if (res.code === 200) {
-        this.clientData = res.data.list
-        this.clientPages.total = res.data.total
+    async getClient(val) { // 获取准出
+      val === 10000 ? this.releaseDataStatus = !this.releaseDataStatus : ''
+      if (this.releaseDataStatus) {
+        const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+        const res = await reportreleaseList(indexPage)
+        if (res.code === 200) {
+          this.clientData = res.data.list
+          this.clientPages.total = res.data.total
+        }
+      } else {
+        const params = { taskId: this.taskId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+        const res = await projectTestReport(params)
+        if (res.code === 200) {
+          this.clientData = res.data.list
+          this.clientPages.total = res.data.total
+        }
       }
     },
     testSizeChange(e) { // 提测分页
@@ -364,7 +421,7 @@ export default {
       }
     },
     back(e, ele, data) { // 提测报告
-      this.requireName = data.name
+      this.dataStatus ? this.requireName = data.reportName : this.requireName = data.name
       this.CallBackStatus = e
       this.CallBackId = ele
       switch (e) {
@@ -473,4 +530,7 @@ export default {
 .btn{
   cursor: pointer;
 }
+.task-report-btn {
+  margin-right: 30px;
+}
 </style>

+ 1 - 1
src/views/reportManagement/ReleaseReport/newReleaeTemplate.vue

@@ -6,7 +6,7 @@
         <el-input v-model="from.moduleName" size="small" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
       </el-form-item>
       <el-form-item v-if="!releaseType" label="报告名称" prop="reportName" :rules="[{ required: true, message: '模版名称不能为空', trigger: 'change'}]"><br>
-        <el-input v-model="from.reportName" size="small" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
+        <el-input v-model="from.reportName" size="small" type="text" maxlength="50" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
       </el-form-item>
 
       <div class="backStyle">{{ !releaseType ? '报告模版' : '模版内容' }}</div>

+ 1 - 1
src/views/reportManagement/Testing/newTestingTemplate.vue

@@ -6,7 +6,7 @@
         <el-input v-model="fromCreateData.moduleName" size="small" style="width:100%;" placeholder="请输入模版名称(不可与现有模版重名)" />
       </el-form-item>
       <el-form-item v-if="!releaseType" label="报告名称" prop="reportName" :rules="[{ required: true, message: '报告名称不能为空', trigger: 'change'}]"><br>
-        <el-input v-model="from.reportName" size="small" style="width:100%;" placeholder="请输入报告名称名称" />
+        <el-input v-model="from.reportName" size="small" type="text" maxlength="50" style="width:100%;" placeholder="请输入报告名称名称" />
       </el-form-item>
       <div class="backStyle">{{ !releaseType? "报告内容" : '模版内容' }}</div>
 

+ 2 - 2
src/views/reportManagement/components/DailyReport.vue

@@ -10,7 +10,7 @@
     </el-steps>
 
     <div class="report-leftRight">
-      <div v-if="showOne" style="min-height: 50vh;">
+      <div v-if="showOne" style="min-height: 34vh;">
         <el-row type="flex" justify="center">
           <el-col :span="19" class="creator">模版名称</el-col>
           <el-col :span="5" class="creator">创建人</el-col>
@@ -185,7 +185,7 @@ export default {
     },
 
     reportReturn() { // 新建模版点击返回
-      this.fromData.radio = 1
+      this.fromData.radio = this.selectTemplate[0].id
       this.reportHome = true // 步骤条
       this.showOne = true // 模版选择
       this.reportTamplate = false // 编辑区域

+ 1 - 1
src/views/reportManagement/components/ReleaseReport.vue

@@ -10,7 +10,7 @@
     </el-steps>
 
     <div class="report-leftRight">
-      <div v-if="showOne" style="min-height: 50vh;">
+      <div v-if="showOne" style="min-height: 34vh;">
         <el-row type="flex" justify="center">
           <el-col :span="19" class="creator">模版名称</el-col>
           <el-col :span="5" class="creator">创建人</el-col>

+ 1 - 1
src/views/reportManagement/components/TestingReport.vue

@@ -10,7 +10,7 @@
     </el-steps>
 
     <div class="report-leftRight">
-      <div v-if="showOne" style="min-height: 50vh;">
+      <div v-if="showOne" style="min-height: 34vh;">
         <el-row type="flex" justify="center">
           <el-col :span="19" class="creator">模版名称</el-col>
           <el-col :span="5" class="creator">创建人</el-col>

+ 46 - 1
src/views/reportManagement/daily/components/iconDisplay.vue

@@ -10,6 +10,7 @@
       <el-table-column prop="Hold" label="Hold" align="center" min-width="100" />
     </el-table>
     <div class="backStyle">今日新增缺陷(-个)</div>
+    <div id="line-echarts" class="line-echarts" />
     <div class="Layout_space_between">
       <div id="lineShow" class="backTop" />
       <div id="barShow" class="backTop" />
@@ -35,7 +36,7 @@
 import moment from 'moment'
 import echarts from 'echarts'
 import '@/styles/PublicStyle/index.scss'
-import { bugGetReportSumData, bugGetReportHighPriData, bugGetReportDisDataByMember, bugGetReportDisDataByPri } from '@/api/reportTemplate' // 模版添删改查
+import { bugGetReportSumData, bugGetReportHighPriData, bugGetReportDisDataByMember, bugGetReportDisDataByPri, bugGetReportDisDataByDate } from '@/api/reportTemplate' // 模版添删改查
 export default {
   props: {
     details: { type: [Object, Array], default: null }
@@ -90,6 +91,24 @@ export default {
       this.tableList = [val.bugSum]
       this.report_bugList = val.bugHighPri
 
+      const data3 = val.bugDisByDate.yAxis.map(item => ({
+        ...item,
+        type: 'line',
+        smooth: true
+      }))
+      setTimeout(() => {
+        echarts.init(document.getElementById('line-echarts')).setOption({
+          color: ['#409EFF'],
+          title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
+          tooltip: { axisPointer: { type: 'shadow' }},
+          grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
+          xAxis: [{ type: 'category', data: val.bugDisByDate.xAxis ? val.bugDisByDate.xAxis : ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'], axisTick: { alignWithLabel: true }}],
+          yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
+          series: val.bugDisByDate.yAxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data3
+
+        })
+      }, 200)
+
       const data = val.bugDisByMember.yAxis.map(item => ({
         ...item,
         type: 'bar',
@@ -143,6 +162,28 @@ export default {
       if (res1.code === 200) {
         this.report_bugList = res1.data
       }
+
+      const res6 = await bugGetReportDisDataByDate(data)
+      if (res6.code === 200) {
+        const data = res6.data.yaxis.map(item => ({
+          ...item,
+          type: 'line',
+          smooth: true
+        }))
+        setTimeout(() => {
+          echarts.init(document.getElementById('line-echarts')).setOption({
+            color: ['#409EFF'],
+            title: { text: '新增缺陷趋势图', x: 'center', textStyle: { fontSize: 14, fontStyle: 'normal', fontWeight: 'normal' }},
+            tooltip: { axisPointer: { type: 'shadow' }},
+            grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
+            xAxis: [{ type: 'category', data: res6.data.xaxis === null ? ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期七'] : res6.data.xaxis, axisTick: { alignWithLabel: true }}],
+            yAxis: [{ type: 'value', axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: true, lineStyle: { type: 'dashed' }}}],
+            series: res6.data.yaxis[0].data <= 0 ? [{ name: '直接访问', type: 'line', smooth: true, data: [0, 0, 0, 0, 0, 0, 0] }] : data
+
+          })
+        }, 200)
+      }
+
       const res2 = await bugGetReportDisDataByMember(data) // 获取缺陷责任人分布
       if (res2.code === 200) {
         const data = res2.data.yaxis.map(item => ({
@@ -195,6 +236,10 @@ export default {
     border-radius: 4px;
     margin: 10px 0;
   }
+  .line-echarts {
+     width: 100%;
+     height:400px;
+  }
   .backTop {
     width: 350px;
     height:350px;

+ 1 - 1
src/views/reportManagement/daily/dailyTemplate.vue

@@ -21,7 +21,7 @@
       </div>
 
       <el-form-item label="标题" prop="reportName"><br>
-        <el-input v-model="fromCreateData.reportName" size="small" style="width: 100%;" placeholder="请输入报告名称" />
+        <el-input v-model="fromCreateData.reportName" type="text" maxlength="50" size="small" style="width: 100%;" placeholder="请输入报告名称" />
       </el-form-item>
 
       <el-form-item label="报告内容" prop="content"><br>