OverallOverviewOfTheServer.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div class="OverallOverviewOfTheServer">
  3. <!-- <div>
  4. <headTitle style="margin-top: 40px; margin-bottom: 10px;" title="整体概览" />
  5. </div> -->
  6. <table>
  7. <tr>
  8. <td class="first" colspan="1" rowspan="2">
  9. <canvas
  10. ref="myCanvas"
  11. style="border:0px solid #d3d3d3;height: max-content;width:inherit; display: block;"
  12. />
  13. <span class="title1">指标</span>
  14. <span class="title2">业务线</span>
  15. </td>
  16. <td colspan="3" class="color_1">线上质量</td>
  17. <td colspan="5" class="color_2">发布</td>
  18. <td colspan="8" class="color_3">线下质量及研究效率</td>
  19. </tr>
  20. <tr>
  21. <td class="col color_1_sub">P5+</td>
  22. <td class="col color_1_sub">P6</td>
  23. <td class="col color_1_sub">非定级</td>
  24. <td class="col color_2_sub">全量回滚数</td>
  25. <td class="col color_2_sub">小流量回滚数</td>
  26. <td class="col color_2_sub">裸奔上线数</td>
  27. <td class="col color_2_sub">免测上线数</td>
  28. <td class="col color_2_sub">上线数</td>
  29. <td class="col color_3_sub">P0问题</td>
  30. <td class="col color_3_sub">P1问题</td>
  31. <td class="col color_3_sub">P0&P1平均修复时长</td>
  32. <td class="col color_3_sub">Reopen次数</td>
  33. <td class="col color_3_sub">提测打回</td>
  34. <td class="col color_3_sub">准出不通过</td>
  35. <td class="col color_3_sub">提测延期</td>
  36. <td class="col color_3_sub">发布延期</td>
  37. </tr>
  38. <tr v-for="(item, index) in tableList" :key="index">
  39. <td style="color: #333333;font-weight: 500;">{{ item.name }}</td>
  40. <td
  41. v-for="(elm, elmIndex) in item.tableRow"
  42. :key="elmIndex"
  43. :class="{ col_red: isShowColor(elmIndex, elm) }"
  44. >
  45. {{ elm }}
  46. </td>
  47. </tr>
  48. </table>
  49. </div>
  50. </template>
  51. <script>
  52. import { getOverallOverview } from '@/api/qualityMonthlyReport/edit'
  53. // import headTitle from '@/components/headTitle'
  54. export default {
  55. name: 'OverallOverviewOfTheServer',
  56. // components: {
  57. // headTitle
  58. // },
  59. data() {
  60. return {
  61. tableList: null
  62. }
  63. },
  64. mounted() {
  65. this.init()
  66. this.setCanvas()
  67. },
  68. methods: {
  69. async init() {
  70. // this.$route.query.reportId
  71. const res = await getOverallOverview(this.$route.query.reportId)
  72. // const res = await getOverallOverview(4)
  73. // console.log(res.data)
  74. this.tableList = res.data
  75. },
  76. setCanvas() {
  77. var c = this.$refs.myCanvas
  78. var ctx = c.getContext('2d')
  79. ctx.fillStyle = '#e9e9e9'
  80. ctx.lineWidth = 2
  81. ctx.strokeStyle = '#e9e9e9'
  82. ctx.moveTo(0, 0)
  83. ctx.lineTo(c.clientHeight * 3 + 20, c.clientWidth * 3)
  84. ctx.stroke()
  85. },
  86. isShowColor(index, value) {
  87. if (index === 0 || index === 3 || index === 8 || index === 11 || index === 12 || index === 13 || index === 14 || index === 15) {
  88. return value > 0
  89. }
  90. return false
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="less" scoped>
  96. .OverallOverviewOfTheServer {
  97. margin-top: 30px;
  98. table {
  99. border-collapse: collapse;
  100. width: 100%;
  101. }
  102. table,
  103. tr,
  104. td {
  105. border: 1px solid #e9e9e9;
  106. }
  107. td {
  108. text-align: center;
  109. height: 50px; /*这里需要自己调整,根据自己的需求调整高度*/
  110. position: relative;
  111. }
  112. td[class='first'] {
  113. width: 80px;
  114. min-width: 80px;
  115. background-color: rgba(214, 214, 214, 0.12);
  116. color: #333333;
  117. font-weight: 500;
  118. }
  119. // td[class='first']:before {
  120. // content: '';
  121. // position: absolute;
  122. // width: 1px;
  123. // height: 104px;
  124. // top: 0;
  125. // left: 0;
  126. // background-color: #000;
  127. // display: block;
  128. // transform: rotate(-75deg);
  129. // transform-origin: top;
  130. // -ms-transform: rotate(-75deg);
  131. // -ms-transform-origin: top;
  132. // }
  133. // td[class='first']:after {
  134. // content: '';
  135. // position: absolute;
  136. // width: 1px;
  137. // height: 140px;
  138. // top: 0;
  139. // left: 0;
  140. // background-color: #e9e9e9;
  141. // display: block;
  142. // transform: rotate(-34deg);
  143. // transform-origin: top;
  144. // -ms-transform: rotate(-34deg);
  145. // -ms-transform-origin: top;
  146. // }
  147. td.col {
  148. min-width: 40px;
  149. // height: 67px;
  150. //width: 100%;
  151. padding: 10px;
  152. color: #333333;
  153. font-weight: 500;
  154. }
  155. .title1 {
  156. position: absolute;
  157. top: 12px;
  158. right: 12px;
  159. }
  160. .title2 {
  161. position: absolute;
  162. bottom: 12px;
  163. left: 12px;
  164. }
  165. .color_1 {
  166. color: #333333;
  167. font-weight: 500;
  168. background: rgba(250, 173, 20, 0.15);
  169. }
  170. .color_1_sub {
  171. background: rgba(250, 173, 20, 0.08);
  172. }
  173. .color_2 {
  174. color: #333333;
  175. font-weight: 500;
  176. background: rgba(250, 126, 20, 0.15);
  177. }
  178. .color_2_sub {
  179. background: rgba(250, 126, 20, 0.08);
  180. }
  181. .color_3 {
  182. color: #333333;
  183. font-weight: 500;
  184. background: rgba(98, 217, 170, 0.15);
  185. }
  186. .color_3_sub {
  187. background: rgba(98, 217, 170, 0.08);
  188. }
  189. .col_red {
  190. color: #f5222d;
  191. }
  192. }
  193. </style>