index.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div style="margin: 0 30px;">
  3. <el-table v-if="title === '状态停留分布图数据' || title === '需求分布图数据' || title === '需求方向分布图数据' || title === '任务分布图数据' || title === '状态累积流量图数据' || title === '周期统计数据' || title === '人力统计数据' || title === '新增趋势图数据' || title === '上线趋势图数据' || title === 'PRD评审趋势图数据' || title === '技术准入趋势图数据' || title === '所属需求方向分布图数据' || title === `模块分布图数据` || title === '累计新增' && type === '需求' || title === '累计新增' && type === '任务' || title === '技术准入' && type === '需求' || title === '技术准入' && type === '任务' || title === '累计上线' && type === '需求' || title === '累计上线' && type === '任务' || title === '累计hold' && type === '需求' || title === '累计hold' && type === '任务'" :data="data" style="width: 100%;" :height="setTitleHeight()" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  4. <el-table-column label="优先级" min-width="80" align="left">
  5. <template slot-scope="scope" style="text-align: center;">
  6. <span class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ 'P'+scope.row.priority }}</span>
  7. </template>
  8. </el-table-column>
  9. <el-table-column v-if="type === '需求' || type === '需求状态' || type === '需求等级' || type === '需求类型' || title === '需求分布图数据' && type === '跟版客户端' || type === 'pm' || title === '状态累积流量图数据' && type === '需求' || title === '周期统计数据' && type === '需求' || title === '人力统计数据' && type === '需求' || title === '新增趋势图数据' && type === '需求' || title === '上线趋势图数据' && type === '需求' || title === 'PRD评审趋势图数据' || title === '技术准入趋势图数据' || title === '需求方向分布图数据' || title === '累计新增' && type === '需求' || title === '技术准入' && type === '需求' || title === '累计上线' && type === '需求' || title === '累计hold' && type === '需求'" label="需求名称" :min-width="title === '周期统计数据' || title === '人力统计数据' ? '120' : '360'" align="left" show-overflow-tooltip>
  10. <template slot-scope="scope">
  11. <div class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
  12. <div class="drawer-name" @click="jumper(scope.row, '需求')">{{ scope.row.name }}</div>
  13. </template>
  14. </el-table-column>
  15. <el-table-column v-if="type === '任务' || type === '任务状态' || title === '所属需求方向分布图数据' || type === '任务等级' || type === '开发负责人' || type === '测试负责人' || title === '任务分布图数据' && type === '跟版客户端' || type === '直接归属' || title === '状态累积流量图数据' && type === '任务' || title === '周期统计数据' && type === '任务' || title === '新增趋势图数据' && type === '任务' || title === '上线趋势图数据' && type === '任务' || title === '人力统计数据' && type === '任务' || title === `模块分布图数据` || title === '累计新增' && type === '任务' || title === '技术准入' && type === '任务' || title === '累计上线' && type === '任务' || title === '累计hold' && type === '任务'" label="任务名称" :min-width="title === '周期统计数据' || title === '人力统计数据' ? '120' : '360'" align="left" show-overflow-tooltip>
  16. <template slot-scope="scope">
  17. <div class="drawer-id">{{ scope.row.taskIdSting }}</div>
  18. <div class="drawer-name" @click="jumper(scope.row, '任务')">{{ scope.row.name }}</div>
  19. </template>
  20. </el-table-column>
  21. <el-table-column v-if="title === '周期统计数据' && mintitle !== ''" :label="mintitle" min-width="150" align="center">
  22. <template slot="header">
  23. <span>{{ mintitle }}</span>
  24. <el-tooltip placement="top" popper-class="cycleStatistic-tips">
  25. <i class="el-icon-info" style="cursor: pointer;color:rgba(121,132,150,0.8);margin-left:5px;" />
  26. <div slot="content" class="tooltip-content">
  27. <div v-if="mintitle === '产品技术侧总周期'">'产品技术侧总周期定义:需求从BRD评审通过到交付的总周期。计算条件:仅计算需求计划里 BRD评审通过时间不为空,且需求状态已变更为“已排期”且排期不为空的需求。(没有BRD评审通过状态的业务线按需求创建时间计算)'</div>
  28. <div v-if="mintitle === '产品侧总周期'">'产品侧总周期定义:需求从BRD评审通过到技术准入的总周期。计算条件:仅计算需求计划里BRD评审通过时间和技术准入时间均不为空的需求。(没有BRD评审通过状态的业务线按需求创建时间计算、没有技术准入状态的业务线按PRD评审通过时间计算)'</div>
  29. <div v-if="mintitle === '技术侧总周期'">'技术侧总周期定义:需求从技术准入到交付的总周期。计算条件:仅计算需求计划里技术准入时间不为空,且需求状态已变更为“已排期”且需求排期不为空的需求。(没有技术准入状态的业务线按PRD评审通过时间计算)'</div>
  30. <div v-if="mintitle === '研发交付周期'">'研发交付周期定义:{{ type }}排期里开发、联调、上线类型排期的总周期。计算条件:仅计算{{ type }}状态已变更为“已排期”且{{ type }}排期不为空的{{ type }}。'</div>
  31. <div v-if="mintitle === '研发周期'">'研发周期定义:{{ type }}排期里开发、联调类型排期的总周期。计算条件:仅计算需求状态已变更为“已排期”且{{ type }}排期不为空的{{ type }}。计算规则:'</div>
  32. <div v-if="mintitle === '测试周期'">'测试周期定义:{{ type }}排期里测试类型排期的总周期。计算条件:仅计算{{ type }}状态已变更为“已排期”且需求排期不为空的{{ type }}。'</div>
  33. <div v-if="mintitle === '提测等待测试时长'">'提测等待测试时长定义:任务排期里提测排期结束日期距离测试排期开始日期的天数。计算条件:仅计算任务状态已变更为“已排期”且排期不为空,且提测、测试类型排期不为空的任务。'</div>
  34. </div>
  35. </el-tooltip>
  36. </template>
  37. <template slot-scope="scope">{{ getCountDataList(scope.row) }}</template>
  38. </el-table-column>
  39. <el-table-column v-if="title === '人力统计数据' && mintitle !== ''" :label="mintitle" min-width="150" align="center">
  40. <template slot-scope="scope">
  41. {{ getCountDataList(scope.row) }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column v-if="type === '开发负责人'" label="开发负责人" min-width="100" align="center">
  45. <template slot-scope="scope">{{ scope.row.rdObject !== null? scope.row.rdObject.name: '' }}</template>
  46. </el-table-column>
  47. <el-table-column v-if="type === '测试负责人'" label="测试负责人" min-width="100" align="center">
  48. <template slot-scope="scope">{{ scope.row.qaObject !== null?scope.row.qaObject.name: '' }}</template>
  49. </el-table-column>
  50. <el-table-column v-if="title === '需求分布图数据' && type === '跟版客户端'" label="跟版客户端" min-width="100" align="center">
  51. {{ oftype }}
  52. </el-table-column>
  53. <el-table-column v-if="title === '任务分布图数据' && type === '跟版客户端'" label="跟版客户端" min-width="100" align="center">
  54. {{ oftype }}
  55. </el-table-column>
  56. <el-table-column v-if="type === '直接归属'" label="直接归属" min-width="110" align="center" show-overflow-tooltip>
  57. {{ oftype }}
  58. </el-table-column>
  59. <el-table-column v-if="type === 'pm'" label="PM" min-width="100" show-overflow-tooltip align="center">
  60. <template v-if="scope.row.pmMemberInfoResponse" slot-scope="scope">
  61. <span>{{ scope.row.pmMemberInfoResponse.name }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column v-if="type === '需求类型'" label="需求类型" min-width="100" show-overflow-tooltip align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.typeName }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column v-if="type === '需求' || type === '需求状态' || type === '需求等级' || title === '状态累积流量图数据' && type === '需求' || title === '周期统计数据' && type === '需求' || title === '人力统计数据' && type === '需求' || title === '新增趋势图数据' && type === '需求' || title === '上线趋势图数据' && type === '需求' || title === 'PRD评审趋势图数据' || title === '技术准入趋势图数据' || title === '需求方向分布图数据' || title === '累计新增' && type === '需求' || title === '技术准入' && type === '需求' || title === '累计上线' && type === '需求' || title === '累计hold'" label="状态" prop="statusName" min-width="100" align="center" />
  70. <el-table-column v-if="type === '任务' || type === '任务状态' || type === '任务等级' || title === '状态累积流量图数据' && type === '任务' || title === '周期统计数据' && type === '任务' || title === '人力统计数据' && type === '任务' || title === '新增趋势图数据' && type === '任务' || title === '上线趋势图数据' && type === '任务' || title === '所属需求方向分布图数据' || title === `模块分布图数据` || title === '累计新增' && type === '任务' || title === '技术准入' && type === '任务' || title === '累计上线' && type === '任务' || title === '累计hold' && type === '任务'" label="状态" prop="statusString" min-width="100" align="center" />
  71. </el-table>
  72. <el-table v-if="title === '去除节假日的修复时长区间数据' || title === '不去除节假日的修复时长区间数据'" :data="data" style="width: auto;" height="calc(100vh - 355px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  73. <el-table-column label="缺陷等级" min-width="80" align="left">
  74. <template slot-scope="scope" style="text-align: center;">
  75. <span class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ scope.row.priorityName }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  79. <template slot-scope="scope">
  80. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  81. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column v-if="title === '不去除节假日的修复时长区间数据'" prop="devFixTime" label="缺陷修复时长" min-width="80" align="center">
  85. <template slot-scope="scope">
  86. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column v-if="title === '去除节假日的修复时长区间数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" min-width="80" align="center">
  90. <template slot-scope="scope">
  91. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center">
  95. <template slot-scope="scope">
  96. {{ scope.row.bugStatusName }}
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <el-table v-if="title === '分布图数据' || title === '去除节假日的修复时长数据' || title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据' || title === '趋势图数据' || title === '累计修复' && type === '缺陷' || title === '累计reopen' && type === '缺陷' || title === '累计新增' && type === '缺陷'" :data="data" style="width: auto;" :height="setTitleHeight()" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  101. <el-table-column label="缺陷等级" min-width="80" align="left">
  102. <template slot-scope="scope" style="text-align: center;">
  103. <span class="div_priority" :style="{background: priorityColors[scope.row.priority % priorityColors.length]}">{{ scope.row.priorityName }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  109. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column v-if="title === '模块分布数据' || title === '缺陷统计数据' || title === '责任人分布数据' || title === '平均修复时长数据'" prop="devFixTime" label="缺陷修复时长" min-width="110" align="center">
  113. <template slot-scope="scope">
  114. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}
  115. </template>
  116. </el-table-column>
  117. <el-table-column v-if="title === '模块分布数据' || title === '去除节假日的修复时长数据' || title === '责任人分布数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" :min-width="title === '模块分布数据' || title === '责任人分布数据' ? '110': '80'" align="center">
  118. <template slot-scope="scope">
  119. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}
  120. </template>
  121. </el-table-column>
  122. <el-table-column v-if="type === '端类型' || type === '发现方式' || type === '发现阶段' || type === '缺陷类型'" :label="type" min-width="100" align="center">
  123. {{ oftype }}
  124. </el-table-column>
  125. <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center">
  126. <template slot-scope="scope">
  127. {{ scope.row.bugStatusName }}
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <el-table v-if="title === '报告统计数据'" :data="data" style="width: auto;" height="calc(100vh - 296px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  132. <el-table-column label="报告名称" min-width="200" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <span v-if="scope.row.typeString === '日报'" class="drawer-name" @click.stop="jumper(scope.row, '日报')">{{ scope.row.reportName || '' }}</span>
  135. <span v-if="scope.row.typeString === '准出'" class="drawer-name" @click.stop="jumper(scope.row, '准出')">{{ scope.row.reportName || '' }}</span>
  136. <span v-if="scope.row.typeString === '提测报告'" class="drawer-name" @click.stop="jumper(scope.row, '提测')">{{ scope.row.reportName || '' }}</span>
  137. <div v-if="scope.row.typeString === '准出' && scope.row.passStatus === 1" style="color: red;">不通过</div>
  138. <div v-if="scope.row.typeString === '提测报告' && scope.row.returnReason" style="color: red;">打回报告:{{ scope.row.returnReason }}</div>
  139. </template>
  140. </el-table-column>
  141. <el-table-column prop="statusString" label="状态" min-width="110">
  142. <template slot-scope="scope">
  143. {{ scope.row.statusString }}
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="报告人" min-width="110">
  147. <template slot-scope="scope">
  148. {{ scope.row.creatorObject.name || '' }}
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="typeString" label="类型" min-width="110" />
  152. </el-table>
  153. </div>
  154. </template>
  155. <script>
  156. import '@/styles/PublicStyle/index.scss'
  157. import { EncryptId } from '@/utils/crypto-js.js'
  158. export default {
  159. filters: {
  160. numFilter(value) {
  161. let realVal = ''
  162. if (!isNaN(value) && value !== '' && value !== 0) {
  163. realVal = parseFloat(value).toFixed(1) + 'H' // 截取当前数据到小数点后两位
  164. } else {
  165. realVal = '--'
  166. }
  167. return realVal
  168. }
  169. },
  170. props: {
  171. data: { type: Array, default: null },
  172. title: { type: String, required: true },
  173. type: { type: String, default: null },
  174. oftype: { type: String, default: null },
  175. mintitle: { type: String, default: '' }
  176. },
  177. data() {
  178. return {
  179. priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD']
  180. }
  181. },
  182. methods: {
  183. getCountDataList(list) {
  184. let str = ''
  185. if (list.countDataList) {
  186. list.countDataList.map(item => {
  187. if ('平均' + this.mintitle === item.label) {
  188. str = item.countStr
  189. }
  190. })
  191. }
  192. return str + '天'
  193. },
  194. setTitleHeight() {
  195. if (this.title === '状态停留分布图数据' || this.title === '状态累积流量图数据') {
  196. return 'calc(100vh - 363px)'
  197. } else if (this.title === '需求方向分布图数据' || this.title === `模块分布图数据`) {
  198. return 'calc(100vh - 200px)'
  199. } else if (this.title === '累计新增' || this.title === '技术准入' || this.title === '累计上线' || this.title === '累计hold' || this.title === '累计修复' || this.title === '累计reopen') {
  200. return 'calc(100vh - 134px)'
  201. } else if (this.title === '模块分布数据') {
  202. return 'calc(100vh - 175px)'
  203. } else {
  204. return 'calc(100vh - 318px)'
  205. }
  206. },
  207. jumper(val, name) { // 需求、任务、缺陷跳转
  208. const { bizId = null } = this.$store.state.global || {}
  209. const bizId_id = EncryptId(`${bizId}_${val.id}`)
  210. const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
  211. window.open(newTab.href, '_blank')
  212. }
  213. }
  214. }
  215. </script>
  216. <style lang="scss" scoped>
  217. .div_priority {
  218. color: #ffffff;
  219. width:fit-content;
  220. padding: 0 12px;
  221. border-radius: 4px;
  222. margin-left: 4px;
  223. }
  224. .drawer-name:hover {
  225. color: #409eff;
  226. cursor: pointer;
  227. }
  228. .drawer-id {
  229. color: rgb(167, 174, 188);
  230. font-size: 10px;
  231. }
  232. </style>
  233. <style>
  234. .cycleStatistic-tips {
  235. width: 500px !important;
  236. background:rgba(121,132,150,0.8) !important;
  237. color: #FFF !important;
  238. }
  239. </style>