index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 v-if="type === '需求' || type === '需求状态' || type === '需求等级' || type === '需求类型' || title === '需求分布图数据' && type === '跟版客户端' || type === 'pm'" label="需求名称" min-width="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 === '任务状态' || type === '任务等级' || type === '开发负责人' || type === '测试负责人' || title === '任务分布图数据' && type === '跟版客户端' || type === '直接归属'" label="任务名称" min-width="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="type === '开发负责人'" label="开发负责人" min-width="100" align="center">
  22. <template slot-scope="scope">{{ scope.row.rdObject !== null? scope.row.rdObject.name: '' }}</template>
  23. </el-table-column>
  24. <el-table-column v-if="type === '测试负责人'" label="测试负责人" min-width="100" align="center">
  25. <template slot-scope="scope">{{ scope.row.qaObject !== null?scope.row.qaObject.name: '' }}</template>
  26. </el-table-column>
  27. <el-table-column v-if="title === '需求分布图数据' && type === '跟版客户端'" label="跟版客户端" min-width="100" align="center">
  28. {{ oftype }}
  29. </el-table-column>
  30. <el-table-column v-if="title === '任务分布图数据' && type === '跟版客户端'" label="跟版客户端" min-width="100" align="center">
  31. {{ oftype }}
  32. </el-table-column>
  33. <el-table-column v-if="type === '直接归属'" label="直接归属" min-width="110" align="center" show-overflow-tooltip>
  34. {{ oftype }}
  35. </el-table-column>
  36. <el-table-column v-if="type === 'pm'" label="PM" min-width="100" show-overflow-tooltip align="center">
  37. <template v-if="scope.row.pmMemberInfoResponse" slot-scope="scope">
  38. <span>{{ scope.row.pmMemberInfoResponse.name }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column v-if="type === '需求类型'" label="需求类型" min-width="100" show-overflow-tooltip align="center">
  42. <template slot-scope="scope">
  43. <span>{{ scope.row.typeName }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column v-if="type === '需求' || type === '需求状态' || type === '需求等级'" label="状态" prop="statusName" min-width="100" align="center" />
  47. <el-table-column v-if="type === '任务' || type === '任务状态' || type === '任务等级'" label="状态" prop="statusString" min-width="100" align="center" />
  48. </el-table>
  49. <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' }">
  50. <el-table-column label="优先级" prop="priorityCode" min-width="80" align="left">
  51. <template slot-scope="scope" style="text-align: center;">
  52. <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
  53. {{ scope.row.priorityLevel.substring(0, 1) }}
  54. </span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  58. <template slot-scope="scope">
  59. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  60. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column v-if="title === '不去除节假日的修复时长区间数据'" prop="devFixTime" label="缺陷修复时长" min-width="80" align="center">
  64. <template slot-scope="scope">
  65. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}H
  66. </template>
  67. </el-table-column>
  68. <el-table-column v-if="title === '去除节假日的修复时长区间数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" min-width="80" align="center">
  69. <template slot-scope="scope">
  70. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="bugStatusName" label="状态" min-width="100" align="center" />
  74. </el-table>
  75. <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' }">
  76. <el-table-column label="优先级" prop="priorityCode" min-width="80" align="left">
  77. <template slot-scope="scope" style="text-align: center;">
  78. <span class="div_priority" :class="[{'priority_color': scope.row.priorityLevel === 'High'},{'priority_color1': scope.row.priorityLevel === 'Medium'},{'priority_color3': scope.row.priorityLevel === 'Low'}]">
  79. {{ scope.row.priorityLevelShortName }}
  80. </span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="bugName" label="缺陷名称" min-width="200" align="left" show-overflow-tooltip>
  84. <template slot-scope="scope">
  85. <div class="drawer-id">{{ 'BUG-' + scope.row.id }}</div>
  86. <span class="drawer-name" @click.stop="jumper(scope.row, '缺陷')">{{ scope.row.bugName }}</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column v-if="title === '模块分布数据' || title === '缺陷统计数据'" prop="devFixTime" label="缺陷修复时长" min-width="110" align="center">
  90. <template slot-scope="scope">
  91. {{ scope.row.devFixTime/(1000 * 3600) | numFilter }}H
  92. </template>
  93. </el-table-column>
  94. <el-table-column v-if="title === '模块分布数据' || title === '去除节假日的修复时长数据'" prop="fixTimePurgeNH" label="缺陷修复时长(去除节假日)" :min-width="title === '模块分布数据' ? '110': '80'" align="center">
  95. <template slot-scope="scope">
  96. {{ scope.row.devFixTimePurgeNH/(1000 * 3600) | numFilter }}H
  97. </template>
  98. </el-table-column>
  99. <el-table-column v-if="type === '缺陷状态' || type === '优先级' " prop="bugStatusName" label="状态" min-width="100" align="center">
  100. <template slot-scope="scope">
  101. {{ scope.row.bugStatusName }}
  102. </template>
  103. </el-table-column>
  104. <el-table-column v-if="type === '缺陷等级'" prop="bugStatusName" label="缺陷等级" min-width="100" align="center">
  105. <template slot-scope="scope">
  106. {{ scope.row.priorityName }}
  107. </template>
  108. </el-table-column>
  109. <el-table-column v-if="type === '端类型' || type === '发现方式' || type === '发现阶段' || type === '缺陷类型'" :label="type" min-width="100" align="center">
  110. {{ oftype }}
  111. </el-table-column>
  112. </el-table>
  113. <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' }">
  114. <el-table-column label="报告名称" min-width="200" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. <span v-if="scope.row.typeString === '日报'" class="drawer-name" @click.stop="jumper(scope.row, '日报')">{{ scope.row.reportName || '' }}</span>
  117. <span v-if="scope.row.typeString === '准出'" class="drawer-name" @click.stop="jumper(scope.row, '准出')">{{ scope.row.reportName || '' }}</span>
  118. <span v-if="scope.row.typeString === '提测报告'" class="drawer-name" @click.stop="jumper(scope.row, '提测')">{{ scope.row.reportName || '' }}</span>
  119. <div v-if="scope.row.typeString === '准出' && scope.row.passStatus === 1" style="color: red;">不通过</div>
  120. <div v-if="scope.row.typeString === '提测报告' && scope.row.returnReason" style="color: red;">打回报告:{{ scope.row.returnReason }}</div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column prop="statusString" label="状态" min-width="110">
  124. <template slot-scope="scope">
  125. {{ scope.row.statusString }}
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="报告人" min-width="110">
  129. <template slot-scope="scope">
  130. {{ scope.row.creatorObject.name || '' }}
  131. </template>
  132. </el-table-column>
  133. <el-table-column prop="typeString" label="类型" min-width="110" />
  134. </el-table>
  135. </div>
  136. </template>
  137. <script>
  138. import '@/styles/PublicStyle/index.scss'
  139. import { EncryptId } from '@/utils/crypto-js.js'
  140. export default {
  141. filters: {
  142. numFilter(value) {
  143. let realVal = ''
  144. if (!isNaN(value) && value !== '') {
  145. realVal = parseFloat(value).toFixed(1) // 截取当前数据到小数点后两位
  146. } else {
  147. realVal = '--'
  148. }
  149. return realVal
  150. }
  151. },
  152. props: {
  153. data: { type: Array, default: null },
  154. title: { type: String, required: true },
  155. type: { type: String, default: null },
  156. oftype: { type: String, default: null }
  157. },
  158. data() {
  159. return {
  160. priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD']
  161. }
  162. },
  163. methods: {
  164. jumper(val, name) { // 需求、任务、缺陷跳转
  165. const { bizId = null } = this.$store.state.global || {}
  166. const bizId_id = EncryptId(`${bizId}_${val.id}`)
  167. const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
  168. window.open(newTab.href, '_blank')
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .div_priority {
  175. color: #ffffff;
  176. width:fit-content;
  177. padding: 0 12px;
  178. border-radius: 4px;
  179. margin-left: 4px;
  180. }
  181. .drawer-name:hover {
  182. color: #409eff;
  183. cursor: pointer;
  184. }
  185. .drawer-id {
  186. color: rgb(167, 174, 188);
  187. font-size: 10px;
  188. }
  189. </style>