Browse Source

缺陷统计页面修改

wangziqian 5 years ago
parent
commit
1a94780701

+ 16 - 0
src/api/defectStatistics.js

@@ -25,6 +25,14 @@ export function getRepairTimeSumData(data) {
     data
     data
   })
   })
 }
 }
+// 去除节假日平均平均修复时长头部数据
+export function getRepairTimePurgeNhSumData(data) {
+  return request({
+    url: TeamManagement + '/bug/getRepairTimePurgeNhSumData',
+    method: 'post',
+    data
+  })
+}
 // 平均修复时长表数据
 // 平均修复时长表数据
 export function getRepairTimeDetailData(data) {
 export function getRepairTimeDetailData(data) {
   return request({
   return request({
@@ -33,6 +41,14 @@ export function getRepairTimeDetailData(data) {
     data
     data
   })
   })
 }
 }
+// 去除平均修复时长表数据
+export function getRepairTimePurgeNhDetailData(data) {
+  return request({
+    url: TeamManagement + '/bug/getRepairTimePurgeNhDetailData',
+    method: 'post',
+    data
+  })
+}
 // 获取模块数据
 // 获取模块数据
 export function getModuleDistributeData(data) {
 export function getModuleDistributeData(data) {
   return request({
   return request({

+ 112 - 11
src/views/quality/defectStatistics.vue

@@ -114,7 +114,7 @@
               />
               />
             </el-select>
             </el-select>
           </el-col>
           </el-col>
-          <el-col :span="4" :offset="16" class="col-flex">
+          <el-col :span="4" :offset="16" class="col-flex-end">
             <div class="bar-pie" :class="[barOrPie==='bar'?'active':'']" @click="changeBarOrPie('bar')">柱状图</div>
             <div class="bar-pie" :class="[barOrPie==='bar'?'active':'']" @click="changeBarOrPie('bar')">柱状图</div>
             <div class="bar-pie" :class="[barOrPie==='pie'?'active':'']" @click="changeBarOrPie('pie')">环状图</div>
             <div class="bar-pie" :class="[barOrPie==='pie'?'active':'']" @click="changeBarOrPie('pie')">环状图</div>
           </el-col>
           </el-col>
@@ -141,8 +141,25 @@
             </div>
             </div>
           </div>
           </div>
         </el-row>
         </el-row>
+        <h3>去除节假日的修复时长</h3>
         <el-row type="flex" align="middle">
         <el-row type="flex" align="middle">
-          <el-col :span="4" :offset="20" class="col-flex">
+          <div class="repair-list">
+            <div v-for="(item, index) in repairTimeListNoHoliday" :key="'time'+index" class="repair-item" :class="[Number(item.relativeRatio)<0?'repair-slow':'repair-rise']">
+              <div class="repair-item-point" :class="['point'+index]" />
+              <span>{{ item.label }}</span>
+              <div class="repair-time">{{ item.total }}</div>
+              <div v-show="Number(item.relativeRatio)>=0" class="repair-up">环比:<i class="el-icon-caret-top" /><span>{{ item.relativeRatio }}%</span></div>
+              <div v-show="Number(item.relativeRatio)<0" class="repair-down">环比:<i class="el-icon-caret-bottom" /><span>{{ item.relativeRatio.substring(1,item.relativeRatio.length) }}%</span></div>
+              <div v-show="item.relativeRatio === '--'" class="repair-up">环比:<span>{{ item.relativeRatio }}%</span></div>
+            </div>
+          </div>
+        </el-row>
+        <el-row type="flex" align="middle">
+          <el-col :span="4" class="col-flex-start">
+            <div class="off-holiday" :class="[offOnholiday==='off'?'selected':'']" @click="changeHoliday('off')">去除节假日</div>
+            <div class="on-holiday" :class="[offOnholiday==='on'?'selected':'']" @click="changeHoliday('on')">不去除节假日</div>
+          </el-col>
+          <el-col :span="4" :offset="16" class="col-flex-end">
             <div class="bar-line" :class="[barOrLine==='line'?'active':'']" @click="changeBarOrLine('line')">折线图</div>
             <div class="bar-line" :class="[barOrLine==='line'?'active':'']" @click="changeBarOrLine('line')">折线图</div>
             <div class="bar-line" :class="[barOrLine==='bar'?'active':'']" @click="changeBarOrLine('bar')">柱状图</div>
             <div class="bar-line" :class="[barOrLine==='bar'?'active':'']" @click="changeBarOrLine('bar')">柱状图</div>
           </el-col>
           </el-col>
@@ -190,10 +207,17 @@
               <span class="repair-span">{{ scope.row.repairTimeAvgData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
               <span class="repair-span">{{ scope.row.repairTimeAvgData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
+          <el-table-column prop="time" label="平均修复时长(去除节假日)">
+            <template slot-scope="scope">
+              <span class="table-repair-item4 repair-span">{{ scope.row.repairTimeAvgPurgeNhData.total }}</span>/
+              <span class="repair-span">{{ scope.row.repairTimeAvgPurgeNhData.detail[0].label }}:{{ scope.row.repairTimeAvgData.detail[0].total }}</span>
+              <span class="repair-span">{{ scope.row.repairTimeAvgPurgeNhData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
+            </template>
+          </el-table-column>
         </el-table>
         </el-table>
       </div>
       </div>
       <div class="chart-item">
       <div class="chart-item">
-        <h3>责任人</h3>
+        <h3>责任人分布</h3>
         <el-table
         <el-table
           :data="memberData"
           :data="memberData"
           style="width: 100%;margin-bottom: 20px;"
           style="width: 100%;margin-bottom: 20px;"
@@ -227,6 +251,13 @@
               <span class="repair-span">{{ scope.row.repairTimeAvgData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
               <span class="repair-span">{{ scope.row.repairTimeAvgData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
+          <el-table-column prop="time" label="平均修复时长(去除节假日)">
+            <template slot-scope="scope">
+              <span class="table-repair-item4 repair-span">{{ scope.row.repairTimeAvgPurgeNhData.total }}</span>/
+              <span class="repair-span">{{ scope.row.repairTimeAvgPurgeNhData.detail[0].label }}:{{ scope.row.repairTimeAvgData.detail[0].total }}</span>
+              <span class="repair-span">{{ scope.row.repairTimeAvgPurgeNhData.detail[1].label }}:{{ scope.row.repairTimeAvgData.detail[1].total }}</span>
+            </template>
+          </el-table-column>
         </el-table>
         </el-table>
       </div>
       </div>
     </el-main>
     </el-main>
@@ -237,7 +268,16 @@ import moment from 'moment'
 moment.locale('zh-cn')
 moment.locale('zh-cn')
 import { settingQueryBizModuleList } from '@/api/defectManage'
 import { settingQueryBizModuleList } from '@/api/defectManage'
 import { teamQueryTeamInfoList } from '@/api/configure'
 import { teamQueryTeamInfoList } from '@/api/configure'
-import { getSummary, getDistributeData, getRepairTimeSumData, getRepairTimeDetailData, getModuleDistributeData, getMemberDistributeData } from '@/api/defectStatistics'
+import {
+  getSummary,
+  getDistributeData,
+  getRepairTimeSumData,
+  getRepairTimePurgeNhSumData,
+  getRepairTimeDetailData,
+  getRepairTimePurgeNhDetailData,
+  getModuleDistributeData,
+  getMemberDistributeData
+} from '@/api/defectStatistics'
 import normalEchart from '@/components/chart/normalEchart'
 import normalEchart from '@/components/chart/normalEchart'
 export default {
 export default {
   components: { normalEchart },
   components: { normalEchart },
@@ -257,6 +297,7 @@ export default {
       defectStatus: 1, // 缺陷状态
       defectStatus: 1, // 缺陷状态
       barOrPie: 'bar', // 柱状图or饼图
       barOrPie: 'bar', // 柱状图or饼图
       barOrLine: 'line', // 柱状图or折线
       barOrLine: 'line', // 柱状图or折线
+      offOnholiday: 'off', // 是否去除节假日
       defectStatusList: [ // 缺陷状态列表
       defectStatusList: [ // 缺陷状态列表
         { code: 1, label: '缺陷状态' },
         { code: 1, label: '缺陷状态' },
         { code: 2, label: '缺陷等级' },
         { code: 2, label: '缺陷等级' },
@@ -266,8 +307,11 @@ export default {
         { code: 6, label: '发现阶段' },
         { code: 6, label: '发现阶段' },
         { code: 7, label: '缺陷类型' }
         { code: 7, label: '缺陷类型' }
       ],
       ],
-      repairTimeList: [],
+      repairTimeList: [], // 修复时长头部列表
+      repairTimeListNoHoliday: [], // 去除节假日修复时长头部列表
       Summary: [], // 顶部数据
       Summary: [], // 顶部数据
+      onHoliday: [], // 有假期数据
+      offHoliday: [], // 无假期数据
       chart1Data: null, // 图表1数据
       chart1Data: null, // 图表1数据
       chart2Data: null, // 图表2数据
       chart2Data: null, // 图表2数据
       moduleSort: 2, // 模块数据排序
       moduleSort: 2, // 模块数据排序
@@ -288,8 +332,9 @@ export default {
     onSubmit() {
     onSubmit() {
       this.getSummary()
       this.getSummary()
       this.defectStatusChange()
       this.defectStatusChange()
-      this.getRepairTimeSumData()
+      this.getSumData()
       this.getRepairTimeDetailData()
       this.getRepairTimeDetailData()
+      this.getRepairTimePurgeNhDetailData()
       this.getModuleDistributeData()
       this.getModuleDistributeData()
       this.getMemberDistributeData()
       this.getMemberDistributeData()
     },
     },
@@ -343,8 +388,9 @@ export default {
       }
       }
       this.activeName === 'first' ? this.activeTab = 1 : this.activeTab = 2
       this.activeName === 'first' ? this.activeTab = 1 : this.activeTab = 2
       this.defectStatusChange()
       this.defectStatusChange()
-      this.getRepairTimeSumData()
+      this.getSumData()
       this.getRepairTimeDetailData()
       this.getRepairTimeDetailData()
+      this.getRepairTimePurgeNhDetailData()
       this.getModuleDistributeData()
       this.getModuleDistributeData()
       this.getMemberDistributeData()
       this.getMemberDistributeData()
     },
     },
@@ -412,7 +458,7 @@ export default {
         }
         }
       }
       }
     },
     },
-    async getRepairTimeSumData() { // 平均修复时长头部数据
+    async getSumData() { // 头部数据
       const moduleIds = this.defectForm.moduleIds
       const moduleIds = this.defectForm.moduleIds
       const params = {
       const params = {
         startTime: this.stratAndEnd[0] || null,
         startTime: this.stratAndEnd[0] || null,
@@ -422,9 +468,31 @@ export default {
         type: this.activeTab,
         type: this.activeTab,
         moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
         moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
       }
       }
+      this.getRepairTimeSumData(params)
+      this.getRepairTimePurgeNhSumData(params)
+    },
+    async getRepairTimeSumData(params) { // 平均修复时长头部数据
       const res = await getRepairTimeSumData(params)
       const res = await getRepairTimeSumData(params)
       this.repairTimeList = res.data || []
       this.repairTimeList = res.data || []
     },
     },
+    async getRepairTimePurgeNhSumData(params) { // 去除平均修复时长头部数据
+      const res = await getRepairTimePurgeNhSumData(params)
+      this.repairTimeListNoHoliday = res.data || []
+    },
+    async getRepairTimePurgeNhDetailData() { // 去除平均修复时长表数据
+      const moduleIds = this.defectForm.moduleIds
+      const params = {
+        startTime: this.stratAndEnd[0] || null,
+        endTime: this.stratAndEnd[1] || null,
+        bizId: Number(localStorage.getItem('bizId')),
+        teamIds: this.defectForm.team || null,
+        type: this.activeTab,
+        moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
+      }
+      const res = await getRepairTimePurgeNhDetailData(params)
+      this.offHoliday = res.data || []
+      this.changeHoliday(this.offOnholiday)
+    },
     async getRepairTimeDetailData() { // 平均修复时长表数据
     async getRepairTimeDetailData() { // 平均修复时长表数据
       const moduleIds = this.defectForm.moduleIds
       const moduleIds = this.defectForm.moduleIds
       const params = {
       const params = {
@@ -436,7 +504,12 @@ export default {
         moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
         moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
       }
       }
       const res = await getRepairTimeDetailData(params)
       const res = await getRepairTimeDetailData(params)
-      this.chart2Data = res.data || []
+      this.onHoliday = res.data || []
+      this.changeHoliday(this.offOnholiday)
+    },
+    changeHoliday(type) {
+      this.offOnholiday = type
+      type === 'off' ? this.chart2Data = this.offHoliday : this.chart2Data = this.onHoliday
       this.changeBarOrLine(this.barOrLine)
       this.changeBarOrLine(this.barOrLine)
     },
     },
     changeBarOrLine(type) { // 柱状图折线图切换
     changeBarOrLine(type) { // 柱状图折线图切换
@@ -668,7 +741,11 @@ export default {
     }
     }
     .chart-item {
     .chart-item {
       padding: 0 20px;
       padding: 0 20px;
-      .col-flex {
+      .col-flex-start {
+        display: flex;
+        justify-content: flex-start;
+      }
+      .col-flex-end {
         display: flex;
         display: flex;
         justify-content: flex-end;
         justify-content: flex-end;
       }
       }
@@ -744,6 +821,30 @@ export default {
         text-align: center;
         text-align: center;
         cursor: pointer;
         cursor: pointer;
       }
       }
+      .off-holiday, .on-holiday{
+        width: 90px;
+        height: 30px;
+        font-size: 14px;
+        border:1px solid #D9D9D9;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        cursor: pointer;
+      }
+      .off-holiday {
+        border-right: none;
+        border-top-left-radius: 4px;
+        border-bottom-left-radius: 4px;
+      }
+      .on-holiday{
+        border-left: none;
+        border-top-right-radius: 4px;
+        border-bottom-right-radius: 4px;
+      }
+      .selected {
+        color:#4089FF;
+        border:1px solid #4089FF;
+      }
       .active {
       .active {
         color: #ffffff;
         color: #ffffff;
         background: #50A6FF;
         background: #50A6FF;
@@ -751,7 +852,7 @@ export default {
       .repair-span {
       .repair-span {
         padding-right: 5px;
         padding-right: 5px;
       }
       }
-      .table-repair-item1 {
+      .table-repair-item1,.table-repair-item4 {
         color:#4089FF;
         color:#4089FF;
       }
       }
       .table-repair-item2 {
       .table-repair-item2 {

+ 1 - 0
src/views/workbench/team/components/needsList.vue

@@ -125,6 +125,7 @@ export default {
   methods: {
   methods: {
     setStatus(val) {
     setStatus(val) {
       this.status = val
       this.status = val
+      this.pages.curIndex = 1
       this.getNeedsList()
       this.getNeedsList()
     },
     },
     handleSizeChange(val) {
     handleSizeChange(val) {

+ 1 - 0
src/views/workbench/team/components/projectList.vue

@@ -122,6 +122,7 @@ export default {
   methods: {
   methods: {
     setStatus(val) {
     setStatus(val) {
       this.status = val
       this.status = val
+      this.pages.curIndex = 1
       this.getProjectList()
       this.getProjectList()
     },
     },
     handleSizeChange(val) {
     handleSizeChange(val) {

+ 1 - 0
src/views/workbench/team/components/taskList.vue

@@ -195,6 +195,7 @@ export default {
   methods: {
   methods: {
     setStatus(val) {
     setStatus(val) {
       this.status = val
       this.status = val
+      this.pages.curIndex = 1
       this.get_allTask()
       this.get_allTask()
     },
     },
     handleSizeChange(val) {
     handleSizeChange(val) {