CaseQualityBox.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="caseQualityBox">
  3. <div class="score-box">
  4. {{ data.score }}分
  5. <span class="level">{{ scoreLevel }}</span>
  6. </div>
  7. <el-table
  8. :data="tableData"
  9. default-expand-all
  10. style="width: 100%">
  11. <el-table-column type="expand">
  12. <template slot-scope="props">
  13. <el-card v-for="(item, index) of props.row.children" :key="index" class="box-card" shadow="hover">
  14. <el-row>
  15. <el-col :span="24">
  16. <el-descriptions title="" :column="1" direction="vertical">
  17. <el-descriptions-item label="质控项目">
  18. <el-tag>{{ item.error_field }}</el-tag>
  19. <span class="koufen">-{{ item.score }}分</span>
  20. </el-descriptions-item>
  21. <el-descriptions-item label="错误描述">{{ item.notice }}</el-descriptions-item>
  22. <el-descriptions-item label="质控依据">
  23. <div v-for="(yItem, yIndex) of item.basis" :key="yIndex" style="margin-bottom: 10px;">
  24. <div v-for="(cItem, cIndex) of yItem" :key="cIndex">{{ cItem }}</div>
  25. </div>
  26. </el-descriptions-item>
  27. </el-descriptions>
  28. </el-col>
  29. </el-row>
  30. </el-card>
  31. </template>
  32. </el-table-column>
  33. <el-table-column
  34. label=""
  35. prop="category">
  36. </el-table-column>
  37. </el-table>
  38. </div>
  39. </template>
  40. <script>
  41. export default {
  42. props: {
  43. data: {
  44. type: Object,
  45. default() {
  46. return {
  47. score: 0,
  48. data: {}
  49. }
  50. }
  51. }
  52. },
  53. computed: {
  54. tableData() {
  55. let arr = []
  56. const keys = Object.keys(this.data.data)
  57. for(let i=0; i<keys.length; i++) {
  58. let obj = {
  59. category: keys[i],
  60. children: this.data.data[keys[i]]
  61. }
  62. arr.push(obj)
  63. }
  64. return arr
  65. },
  66. scoreLevel() {
  67. /**
  68. * 甲>90分
  69. * 乙75-90分
  70. * 丙<75分
  71. * */
  72. let str
  73. const { score } = this.data
  74. if (score > 90) {
  75. str = '甲'
  76. } else if (score < 75) {
  77. str = '丙'
  78. } else {
  79. str = '乙'
  80. }
  81. return str
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .caseQualityBox {
  88. width: 340px;
  89. height: 820px;
  90. overflow-x: hidden;
  91. overflow-y: scroll;
  92. background: #ffffff;
  93. border: 1px solid #e2e2e2;
  94. box-sizing: border-box;
  95. padding: 20px;
  96. ::v-deep .el-descriptions-item__container .el-descriptions-item__content {
  97. display: block;
  98. }
  99. ::v-deep .el-descriptions-item__label:not(.is-bordered-label) {
  100. font-weight: 600;
  101. display: inline-table;
  102. }
  103. ::v-deep .el-descriptions-item__content {
  104. padding-top: 12px;
  105. }
  106. .box-card {
  107. margin-bottom: 10px;
  108. }
  109. .score-box {
  110. width: 100%;
  111. height: 120px;
  112. line-height: 120px;
  113. font-size: 32px;
  114. font-weight: bold;
  115. text-align: center;
  116. border-radius: 5px;
  117. border: 1px solid #dddddd;
  118. position: relative;
  119. overflow: hidden;
  120. &::before {
  121. content: "";
  122. position: absolute;
  123. width: 200px;
  124. height: 200px;
  125. top: -120px;
  126. right: -160px;
  127. z-index: 1;
  128. background-color: red;
  129. transform: rotate(45deg);
  130. }
  131. .level {
  132. position: absolute;
  133. top: 5px;
  134. right: 10px;
  135. z-index: 2;
  136. line-height: 30px;
  137. color: #ffffff;
  138. font-size: 16px;
  139. }
  140. }
  141. }
  142. .koufen {
  143. color: red;
  144. float: right;
  145. line-height: 32px;
  146. font-size: 16px;
  147. font-weight: bold;
  148. }
  149. </style>