index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div style="margin: 0 30px;">
  3. <el-table v-if="title === '状态停留分布图数据' || title === '需求分布图数据' || title === '任务分布图数据'" :data="data" style="width: 100%;" :height="title === '状态停留分布图数据' ? 'calc(100vh - 363px)': 'calc(100vh - 318px)'" :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 :label="`${type}名称`" min-width="360" align="left" show-overflow-tooltip>
  10. <template slot-scope="scope">
  11. <div v-if="type === '需求'" class="drawer-id">{{ scope.row.requirementDisplayId }}</div>
  12. <div v-if="type === '任务'" class="drawer-id">{{ scope.row.taskIdSting }}</div>
  13. <div class="drawer-name" @click="jumper(scope.row, type)">{{ scope.row.name }}</div>
  14. </template>
  15. </el-table-column>
  16. <!-- <el-table-column v-if="type === '需求'" prop="typeName" label="需求类型" min-width="110" align="center" />
  17. <el-table-column v-if="type === '需求'" label="PM" min-width="100" show-overflow-tooltip align="center">
  18. <template v-if="scope.row.pmMemberInfoResponse" slot-scope="scope">
  19. <span>{{ scope.row.pmMemberInfoResponse.name }}</span>
  20. </template>
  21. </el-table-column> -->
  22. <el-table-column v-if="type === '需求'" label="状态" prop="statusName" min-width="100" align="center" />
  23. <el-table-column v-if="type === '任务'" label="状态" prop="statusString" min-width="100" align="center" />
  24. </el-table>
  25. <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' }">
  26. <el-table-column label="优先级" prop="priorityCode" min-width="80" align="left">
  27. <template slot-scope="scope" style="text-align: center;">
  28. <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
  29. {{ scope.row.priorityLevel.substring(0, 1) }}
  30. </span>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  34. <template slot-scope="scope">
  35. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  36. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column v-if="title === '不去除节假日的修复时长区间数据'" prop="devFixTime" label="缺陷修复时长" min-width="80" align="center">
  40. <template slot-scope="scope">
  41. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}H
  42. </template>
  43. </el-table-column>
  44. <el-table-column v-if="title === '去除节假日的修复时长区间数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" min-width="80" align="center">
  45. <template slot-scope="scope">
  46. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center" />
  50. </el-table>
  51. <el-table v-if="title === '分布图数据' || title === '去除节假日的修复时长数据' || title === '模块分布数据' || title === '缺陷统计数据'" :data="data" style="width: auto;" :height="title === '模块分布数据' ? 'calc(100vh - 175px)': 'calc(100vh - 318px)'" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  52. <el-table-column label="优先级" prop="priorityCode" min-width="80" align="left">
  53. <template slot-scope="scope" style="text-align: center;">
  54. <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
  55. {{ scope.row.priorityLevelShortName }}
  56. </span>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  60. <template slot-scope="scope">
  61. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  62. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column v-if="title === '模块分布数据' || title === '缺陷统计数据'" prop="devFixTime" label="缺陷修复时长" min-width="110" align="center">
  66. <template slot-scope="scope">
  67. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}H
  68. </template>
  69. </el-table-column>
  70. <el-table-column v-if="title === '模块分布数据' || title === '去除节假日的修复时长数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" :min-width="title === '模块分布数据' ? '110': '80'" align="center">
  71. <template slot-scope="scope">
  72. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center" />
  76. </el-table>
  77. <el-table v-if="title === '报告统计数据'" :data="data" style="width: auto;" height="calc(100vh - 318px)" :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }">
  78. <el-table-column label="报告名称" min-width="200" show-overflow-tooltip>
  79. <template slot-scope="scope">
  80. <div class="drawer-id">{{ scope.row.id }}</div>
  81. <span class="drawer-name" @click.stop="jumper(scope.row, '报告')">{{ scope.row.reportName || '' }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="statusString" label="状态" min-width="110">
  85. <template slot-scope="scope">
  86. {{ scope.row.statusString }}
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="报告人" min-width="110">
  90. <template slot-scope="scope">
  91. {{ scope.row.creatorObject.name || '' }}
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="typeString" label="类型" min-width="110" />
  95. </el-table>
  96. </div>
  97. </template>
  98. <script>
  99. import '@/styles/PublicStyle/index.scss'
  100. import { EncryptId } from '@/utils/crypto-js.js'
  101. export default {
  102. filters: {
  103. numFilter(value) {
  104. let realVal = ''
  105. if (!isNaN(value) && value !== '') {
  106. realVal = parseFloat(value).toFixed(1) // 截取当前数据到小数点后两位
  107. } else {
  108. realVal = '--'
  109. }
  110. return realVal
  111. }
  112. },
  113. props: {
  114. data: { type: Array, default: null },
  115. title: { type: String, required: true },
  116. type: { type: String, default: null }
  117. },
  118. data() {
  119. return {
  120. priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD']
  121. }
  122. },
  123. methods: {
  124. deleteChild(arr) { // 删除无用子属性
  125. const bfs = arr => {
  126. arr.forEach(item => {
  127. if (!item.childrenEnums || item.childrenEnums.length === 0) {
  128. delete item.childrenEnums
  129. } else {
  130. this.deleteChild(item.childrenEnums)
  131. }
  132. })
  133. }
  134. bfs(arr)
  135. return arr
  136. },
  137. jumper(val, name) { // 需求、任务、缺陷跳转
  138. const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
  139. const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
  140. window.open(newTab.href, '_blank')
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .div_priority {
  147. color: #ffffff;
  148. width:fit-content;
  149. padding: 0 12px;
  150. border-radius: 4px;
  151. margin-left: 4px;
  152. }
  153. .drawer-name:hover {
  154. color: #409eff;
  155. cursor: pointer;
  156. }
  157. .drawer-id {
  158. color: rgb(167, 174, 188);
  159. font-size: 10px;
  160. }
  161. </style>