|
@@ -1,13 +1,146 @@
|
|
|
<template>
|
|
|
- health
|
|
|
+ <div style="font-size: 14px;">
|
|
|
+ 当前总分:{{countEs}} <span style="margin:0 20px">/</span> 细项总分:{{countIz}}
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="hlbData"
|
|
|
+ :span-method="objectSpanMethod"
|
|
|
+ border
|
|
|
+ style="width: 100%; margin-top: 20px"
|
|
|
+ >
|
|
|
+ <el-table-column prop="bri" label="业务风险项" width="180" />
|
|
|
+ <el-table-column prop="es" label="评价分值" width="100" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-model="scope.row.es" @change="changeEs(scope.row)"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="eo" label="评价对象" width="180" />
|
|
|
+ <el-table-column prop="ri" label="风险指标" width="180" />
|
|
|
+ <el-table-column prop="pds" label="扣分标准" width="180" />
|
|
|
+ <el-table-column prop="iz" label="细项分" width="180" />
|
|
|
+ <el-table-column label="当前健康评分标准" width="240">
|
|
|
+ <template #default="scope">
|
|
|
+ <div v-html="scope.row.chss" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="日健康评分标准">
|
|
|
+ <template #default="scope">
|
|
|
+ <div v-html="scope.row.stand" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import {watchEffect} from "vue";
|
|
|
-
|
|
|
+import { watchEffect} from "vue";
|
|
|
+import {hlbDetails} from "@/api/hl/hlb"
|
|
|
+import {updateHld} from "@/api/hl/hld"
|
|
|
const props = defineProps(['modelId'])
|
|
|
+const hlbData = ref([])
|
|
|
+const countEs=ref(0)
|
|
|
+const countIz=ref(0)
|
|
|
watchEffect(()=>{
|
|
|
- console.log(props.modelId)
|
|
|
+ getHtlData()
|
|
|
})
|
|
|
+
|
|
|
+function calcCountEs(){
|
|
|
+ let count = 0;
|
|
|
+ hlbData.value.forEach(p=>{
|
|
|
+ if(p.length === p.lowLength){
|
|
|
+ count += Number(p.es)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ countEs.value = count
|
|
|
+}
|
|
|
+
|
|
|
+async function changeEs(row){
|
|
|
+ const {hlDetailId,es} = row;
|
|
|
+ await updateHld({hlDetailId,hlDetailScore:Number(es)})
|
|
|
+ calcCountEs()
|
|
|
+}
|
|
|
+
|
|
|
+function objectSpanMethod ({row,column,rowIndex,columnIndex,}) {
|
|
|
+ if (columnIndex === 0||columnIndex === 1||columnIndex === 2||columnIndex === 6) {
|
|
|
+ const f=row.length===row.lowLength
|
|
|
+ if(f){
|
|
|
+ return {
|
|
|
+ rowspan: row.length,
|
|
|
+ colspan: 1
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(columnIndex===7){
|
|
|
+ if(rowIndex===0){
|
|
|
+ return {
|
|
|
+ rowspan: hlbData.value.length,
|
|
|
+ colspan: 1
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return {
|
|
|
+ rowspan: 0,
|
|
|
+ colspan: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function getHtlData(){
|
|
|
+ hlbDetails(props.modelId).then(res=>{
|
|
|
+ if(res.data){
|
|
|
+ formattedData(res.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function formattedData(data) {
|
|
|
+ data.hlClassList.forEach(item=>{
|
|
|
+ if(item.hlObjList.length){
|
|
|
+ item.hlObjList.forEach((cItem,cIndex)=>{
|
|
|
+ if(cItem.hlDetailList.length){
|
|
|
+ cItem.hlDetailList.forEach((ccItem,ccIndex)=>{
|
|
|
+ hlbData.value.push({
|
|
|
+ es:cItem.hlObjScore,
|
|
|
+ eo:cItem.hlObjName,
|
|
|
+ length:cItem.hlDetailList.length,
|
|
|
+ lowLength:cItem.hlDetailList.length-ccIndex,
|
|
|
+ chss:cItem.hlObjStand.replace(/\n/g, '<br/>'),
|
|
|
+ bri:item.className,
|
|
|
+ data:item,
|
|
|
+ ri:ccItem.hlDetailName,
|
|
|
+ pds:ccItem.remark,
|
|
|
+ iz:ccItem.hlDetailScore,
|
|
|
+ stand:data.stand.replace(/\n/g, '<br/>'),
|
|
|
+ hlDetailId:ccItem.hlDetailId
|
|
|
+ })
|
|
|
+ countIz.value+=ccItem.hlDetailScore
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ hlbData.value.push({
|
|
|
+ es:cItem.hlObjScore,
|
|
|
+ bri:item.className,
|
|
|
+ data:item,
|
|
|
+ eo:cItem.hlObjName,
|
|
|
+ length:cItem.hlDetailList.length,
|
|
|
+ lowLength:cItem.hlDetailList.length-cIndex,
|
|
|
+ chss:cItem.hlObjStand,
|
|
|
+ stand:data.stand.replace(/\n/g, '<br/>')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ hlbData.value.push({
|
|
|
+ bri:item.className,
|
|
|
+ data:item
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ calcCountEs()
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
</style>
|