Explorar el Código

平均任务使用人力

洪海涛 hace 4 años
padre
commit
fca179817e

+ 8 - 0
src/api/dataMarket.js

@@ -126,6 +126,14 @@ export function getRequireAvgData(data) {
     data
   })
 }
+// 需求平均交付周期:/dataMarket/efficiency/getRequireAvgData
+export function getTaskPeopleData(data) {
+  return request({
+    url: TeamManagement + '/dataMarket/efficiency/getTaskPeopleDataDetail',
+    method: 'post',
+    data
+  })
+}
 // 任务平均交付周期:/dataMarket/efficiency/getTaskData
 export function getTaskData(data) {
   return request({

+ 62 - 0
src/views/dataBigManage/components/drawerModal/drawerModalData.js

@@ -388,6 +388,68 @@ export const columns = {
         align: 'center'
       }
     ],
+    // 任务人力
+    taskPeopleColumns: [
+      {
+        label: '优先级',
+        key: 'priorityStr',
+        minWidth: 50,
+        type: 'level',
+        align: 'left'
+      },
+      {
+        label: '任务名称',
+        key: 'name',
+        minWidth: 200,
+        align: 'left',
+        type: 'topTitle',
+        topName: 'REQUIREMENT',
+        topKey: 'id'
+      },
+      {
+        label: '任务使用人力',
+        key: 'title',
+        minWidth: 90,
+        tips: '团队成员参与的在统计时间范围内任务状态在"已排期"到"已上线"(不包含)状态的任务,或在统计时间范围内变更为已上线的任务',
+        align: 'center'
+      },
+      {
+        label: '状态',
+        key: 'statusStr',
+        minWidth: 90,
+        align: 'center'
+      }
+    ],
+    taskPeopleColumnsTips: [
+      {
+        label: '任务使用人力',
+        key: 'title',
+        minWidth: 90,
+        tips: '团队成员参与的在统计时间范围内需求状态在"已排期"到"已上线"(不包含)状态的需求,或在统计时间范围内变更为已上线的需求',
+        align: 'center'
+      },
+      {
+        label: '开发人力',
+        key: 'title',
+        minWidth: 90,
+        tips: '计算范围内任务,开发、联调、提测、上线排期人日总量 / 参与计算的任务总量',
+        align: 'center'
+      },
+      {
+        label: '测试人力',
+        key: 'title',
+        minWidth: 90,
+        tips: '计算范围内任务,任务用例、测试、准出、上线排期人日总量 / 参与计算的任务总量',
+        align: 'center'
+      },
+      {
+        label: '联调人力',
+        key: 'title',
+        minWidth: 90,
+        tips: '计算范围内任务,任务联调排期人日总量 / 参与计算的任务总量',
+        align: 'center'
+      }
+    ],
     // 缺陷修复时长
     bugRepairDataColumns: [
       {

+ 40 - 4
src/views/dataBigManage/components/drawerModal/index.vue

@@ -127,6 +127,7 @@ import {
   getRequireAvgData, // 需求平均交付周期
   getTaskData, // 任务平均交付周期
   getRequirePeopleData, // 平均需求使用人力
+  getTaskPeopleData, // 平均任务使用人力
   getDelayLaunchData, // 延期提测率
   getDelayReleaseData, // 延期准出率
   bugRepairData, // 缺陷24小时修复率
@@ -272,6 +273,9 @@ export default {
         if (this.drawerData.label === '平均需求使用人力') {
           this.title = '需求人力'
         }
+        if (this.drawerData.label === '平均任务使用人力') {
+          this.title = '任务人力'
+        }
         if (this.drawerData.label === '缺陷平均修复时长') {
           this.title = '缺陷修复时长'
         }
@@ -386,6 +390,9 @@ export default {
                   if (label === '平均需求使用人力') {
                     label = '需求使用人力'
                   }
+                  if (label === '平均任务使用人力') {
+                    label = '任务使用人力'
+                  }
                   if (this.drawerData.label === '缺陷平均修复时长') {
                     label = '全部'
                   }
@@ -408,7 +415,7 @@ export default {
       paging.pageSize = value
       this.paging = _.cloneDeep(paging)
       window.localStorage.setItem('pageSize', value)
-      if (this.headerTitle === '效率' && this.title !== '需求人力') {
+      if (this.headerTitle === '效率' && this.title !== '需求人力' && this.title !== '任务人力') {
         this.tableListPagination()
       } else {
         this.setTableList()
@@ -420,7 +427,7 @@ export default {
       paging.curIndex = value
       this.paging = _.cloneDeep(paging)
       // console.log(this.title)
-      if (this.headerTitle === '效率' && this.title !== '需求人力') {
+      if (this.headerTitle === '效率' && this.title !== '需求人力' && this.title !== '任务人力') {
         this.tableListPagination()
       } else {
         this.setTableList()
@@ -471,6 +478,9 @@ export default {
         if (this.title === '需求人力') {
           columnsKey = 'requirementPeopleColumns'
         }
+        if (this.title === '任务人力') {
+          columnsKey = 'taskPeopleColumns'
+        }
         if (this.title === '延期提测率') {
           columnsKey = 'delayLaunchDataColumns'
         }
@@ -482,7 +492,7 @@ export default {
         }
         const columnsTipsKey = `${columnsKey}Tips`
         this.column = columns.efficiency[columnsKey].map((elm, index) => {
-          if (index === 2 && this.title.search(/任务周期|需求人力|需求周期/) > -1) {
+          if (index === 2 && this.title.search(/任务周期|需求人力|任务人力|需求周期/) > -1) {
             return columns.efficiency[columnsTipsKey][this.timelineData.firstActive || 0]
           }
           return elm
@@ -607,6 +617,12 @@ export default {
             this.setRequirePeopleData()
           }
         }
+        if (this.title === '任务人力') {
+          if (this.sourceData[0].IdList.length) {
+            this.loading = true
+            this.setTaskPeopleData()
+          }
+        }
         if (this.title === '缺陷修复时长') {
           if (this.sourceData[0].IdList.length) {
             this.loading = true
@@ -810,6 +826,26 @@ export default {
         this.loading = false
       }
     },
+    // 平均任务使用人力
+    async setTaskPeopleData() {
+      const paging = this.paging
+      const params = {
+        ...paging,
+        title: this.timelineData.first[this.timelineData.firstActive],
+        ids: this.sourceData[0].IdList
+      }
+      delete params.pageTotal
+      const res = await getTaskPeopleData(params)
+      if (res.code === 200) {
+        // console.log(res.data)
+        this.tableList = res.data
+        // this.tableListOld = res.data.length && res.data.map(e => e)
+        // this.tableListPagination()
+        paging.pageTotal = this.sourceData[0].IdList.length
+        this.paging = { ...paging }
+        this.loading = false
+      }
+    },
     // 缺陷平均修复时长
     async setBugRepair2Data() {
       const paging = this.paging
@@ -915,7 +951,7 @@ export default {
         this.tableHeight = 'calc(100vh - 290px)'
       } else if (this.title.search(/状态停留分布图数据|状态累积流量图数据/) > -1) {
         this.tableHeight = 'calc(100vh - 363px)'
-      } else if (this.title.search(/需求周期|新增项目|新增任务|reopen|新增缺陷|需求人力|任务周期|缺陷修复时长|延期准出率|延期提测率/) > -1) {
+      } else if (this.title.search(/需求周期|新增项目|新增任务|reopen|新增缺陷|需求人力|任务人力|任务周期|缺陷修复时长|延期准出率|延期提测率/) > -1) {
         this.tableHeight = 'calc(100vh - 288px)'
       } else if (this.title.search(/需求|任务|项目/) > -1) {
         // 吞吐量: 需求

+ 49 - 7
src/views/dataBigManage/components/efficiencyModule/index.vue

@@ -204,15 +204,57 @@
       </div>
     </el-col>
     <el-col :span="7">
-      <div
-        v-if="Object.keys(mainData).filter(t => mainData[t]).length >= 7"
-        class="itemBox"
-        style="border-left-color: #999999; background: #FAFAFA"
-      >
-        <div class="empty">
-          <svg-icon icon-class="empty" />
+      <div v-if="mainData.requirementPeopleData" class="itemBox" style="border-left-color: #999999; background: #F7FDF2">
+        <div class="titleLevel3" style="color: #999999;">平均任务使用人力</div>
+        <div class="content">
+          <div class="item effic" style="color: #999999;">
+            <span
+              class="num"
+              @click.stop="$emit(
+                'checkDetialModal',
+                { ...mainData.taskPeopleData, activeLabel: mainData.taskPeopleData.label }
+              )"
+            >{{ mainData.taskPeopleData.countStr }}</span>
+            <span class="unit">人/日</span>
+          </div>
+          <div class="item point" style="margin-bottom: 20px;">
+            <span class="title">环比:</span>
+            <span
+              :class="Number(mainData.taskPeopleData.chainRatio) > 0 ? 'item-up num' : 'item-down num'"
+              @click.stop="$emit(
+                'checkDetialModal',
+                { ...mainData.taskPeopleData, activeLabel: mainData.taskPeopleData.label }
+              )"
+            >
+              <i v-if="Number(mainData.taskPeopleData.chainRatio) > 0" class="el-icon-caret-top" />
+              <i v-else class="el-icon-caret-bottom" />
+              {{ mainData.taskPeopleData.chainRatio }}%
+            </span>
+          </div>
+        </div>
+        <div class="foot">
+          <div
+            v-for="item in mainData.taskPeopleData.subCountList"
+            :key="item.label"
+            class="item"
+            @click.stop="$emit(
+              'checkDetialModal',
+              { ...mainData.taskPeopleData, activeLabel: item.label }
+            )"
+          >
+            <span class="title">{{ item.label }}:</span><span class="value"><span class="num">{{ item.countStr }}</span>{{ item.unit }}</span>
+          </div>
         </div>
       </div>
+<!--      <div-->
+<!--        v-if="Object.keys(mainData).filter(t => mainData[t]).length >= 7"-->
+<!--        class="itemBox"-->
+<!--        style="border-left-color: #999999; background: #FAFAFA"-->
+<!--      >-->
+<!--        <div class="empty">-->
+<!--          <svg-icon icon-class="empty" />-->
+<!--        </div>-->
+<!--      </div>-->
     </el-col>
     <el-col :span="6">
       <div v-if="mainData.bugAvgOneDataRepairData" class="itemBox" style="border-left-color: #C97DE9; background: #FCF8FE">