timeDetail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div class="time-detail-container">
  3. <el-table :data="hsData" border :style="`width: ${hmsVisible?50:100}%`" max-height="500">
  4. <el-table-column label="对象类型" width="130">
  5. <template #default="scope">
  6. <dict-tag :options="biz_type" :value="scope.row.objType"/>
  7. </template>
  8. </el-table-column>
  9. <el-table-column label="业务对象">
  10. <template #default="scope">
  11. <span v-for="(item,index) in scope.row.hlObjList">
  12. {{item.objName}}<span v-if="index != scope.row.hlObjList.length-1">,</span>
  13. </span>
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="分值" width="80" prop="hlScore" />
  17. <el-table-column label="得分" prop="score" width="80"/>
  18. <el-table-column label="操作" width="80" align="center">
  19. <template #default="scope">
  20. <el-button type="primary" link icon="edit" @click="handleDetail(scope.row)">明细</el-button>
  21. </template>
  22. </el-table-column>
  23. </el-table>
  24. <el-table :data="hmsDetailData" style="width: 48%" border v-if="hmsVisible">
  25. <el-table-column label="指标名称" prop="metricsName" width="150"/>
  26. <el-table-column label="指标编码" prop="metricsCode"/>
  27. <el-table-column label="健康度分值" prop="hlScore" width="100"/>
  28. <el-table-column label="评分标准" width="120">
  29. <template #default="scope">
  30. <dict-tag :options="score_stand" :value="scope.row.hlStand"/>
  31. </template>
  32. </el-table-column>
  33. <el-table-column label="得分" width="60" align="center">
  34. <template #default="scope">
  35. <span :class="{'error':scope.row.score != scope.row.hlScore}" @click="handleScoreDetails(scope.row)">
  36. {{scope.row.score}}
  37. </span>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. <el-dialog v-model="scoreVisible" title="得分明细" width="800">
  43. <score-detail :scoreData="scoreData"/>
  44. </el-dialog>
  45. </template>
  46. <script setup lang="ts">
  47. const {proxy} = getCurrentInstance()
  48. import {onMounted} from "vue";
  49. import {hcsDetails} from "@/api/hl/hcs"
  50. import {listHmsDetails,getHmsList} from "@/api/hl/hms"
  51. import scoreDetail from "./scoreDetail.vue"
  52. const props = defineProps(['rowData'])
  53. const {biz_type,metrics_small_type} = proxy.useDict('biz_type','metrics_small_type');
  54. const { score_stand } = proxy.useDict('score_stand');
  55. const hsData = ref([])
  56. const hmsDetailData = ref([])
  57. const hmsVisible = ref(false)
  58. const scoreVisible = ref(false)
  59. const scoreData = ref([])
  60. onMounted(()=>{
  61. getDetail()
  62. })
  63. async function handleDetail(row){
  64. const res = await listHmsDetails(row.scoreClassId)
  65. hmsDetailData.value = res.data
  66. hmsVisible.value = true
  67. }
  68. async function getDetail(){
  69. hmsDetailData.value = []
  70. const res = await hcsDetails(props.rowData.hlScoreId)
  71. hsData.value = res.data
  72. }
  73. async function handleScoreDetails(row){
  74. const res = await getHmsList(row.scoreMetricsId)
  75. scoreVisible.value = true
  76. scoreData.value = res.data
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .time-detail-container{
  81. min-height: 400px;
  82. display: flex;
  83. justify-content: space-between;
  84. align-items: flex-start;
  85. .error{
  86. cursor: pointer;
  87. color:#e43;
  88. font-weight: bold;
  89. &:hover{
  90. text-decoration: underline;
  91. }
  92. }
  93. }
  94. </style>