zhangwenya 9 сар өмнө
parent
commit
c1105a3157

+ 23 - 2
src/api/hl/bm.js

@@ -86,14 +86,35 @@ export function getBmConfig(modelId){
 // 日健康度历史记录
 export function dayHistory() {
     return request({
-        url: 'hl/bm/day/history',
+        url: '/hl/bm/day/history',
         method: 'get',
     })
 }// 健康度历史记录
 export function timeHistory() {
     return request({
-        url: 'hl/bm/time/history',
+        url: '/hl/bm/time/history',
         method: 'get',
     })
 }
 
+export function getCheckHistory(query){
+    return request({
+        url: '/hl/bm/check/history/report',
+        method: 'get',
+        params: query
+    })
+}
+
+export function getCheckProj(id){
+    return request({
+        url: '/hl/bm/check/proj/' + id,
+        method: 'get'
+    })
+}
+
+export function getCheckMetrics(id){
+    return request({
+        url: '/hl/bm/check/metrics/' + id,
+        method: 'get'
+    })
+}

+ 7 - 0
src/api/hl/hms.js

@@ -42,3 +42,10 @@ export function delHms(scoreMetricsId) {
         method: 'delete'
     })
 }
+
+export function listHmsDetails(scoreClassId) {
+    return request({
+        url: '/hl/hms/list/'+scoreClassId,
+        method: 'get',
+    })
+}

+ 1 - 1
src/views/hl/bm/component/historyHealth.vue

@@ -17,7 +17,7 @@
       @pagination="getHlList"
   />
 
-  <el-dialog v-model="visible" :title="timeTitle" width="1100">
+  <el-dialog v-model="visible" :title="timeTitle" width="1200">
     <time-detail :rowData="rowData" v-if="visible"/>
   </el-dialog>
 

+ 40 - 27
src/views/hl/bm/component/widget/timeDetail.vue

@@ -1,29 +1,37 @@
 <template>
   <div class="time-detail-container">
-    <div class="time-detail-left">
-        <el-table :data="hsData" border style="width: 100%" max-height="500">
-          <el-table-column label="对象类型" width="130">
-            <template #default="scope">
-              <dict-tag :options="biz_type" :value="scope.row.objType"/>
-            </template>
-          </el-table-column>
-          <el-table-column label="业务对象">
-            <template #default="scope">
-            </template>
-          </el-table-column>
-          <el-table-column label="分值" width="80">
-            <template #default="scope">
-              <el-input v-model="scope.row.hlScore"/>
-            </template>
-          </el-table-column>
-          <el-table-column label="得分" prop="score"  width="80"/>
-          <el-table-column label="操作" width="80" align="center">
-            <template #default="scope">
-              <el-button type="primary" link icon="edit">明细</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-    </div>
+    <el-table :data="hsData" border :style="`width: ${hmsDetailData.length?50:100}%`" max-height="500">
+      <el-table-column label="对象类型" width="130">
+        <template #default="scope">
+          <dict-tag :options="biz_type" :value="scope.row.objType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="业务对象">
+        <template #default="scope">
+          <span v-for="(item,index) in scope.row.hlObjList">
+            {{item.objName}}<span v-if="index != scope.row.hlObjList.length-1">,</span>
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column label="分值" width="80">
+        <template #default="scope">
+          <el-input v-model="scope.row.hlScore" readonly/>
+        </template>
+      </el-table-column>
+      <el-table-column label="得分" prop="score"  width="80"/>
+      <el-table-column label="操作" width="80" align="center">
+        <template #default="scope">
+          <el-button type="primary" link icon="edit" @click="handleDetail(scope.row)">明细</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-table :data="hmsDetailData" style="width: 48%" border>
+      <el-table-column label="指标名称" prop="metricsName"/>
+      <el-table-column label="指标编码" prop="metricsCode" width="100"/>
+      <el-table-column label="健康度分值" prop="metricsName" width="100"/>
+      <el-table-column label="评分标准" prop="metricsName" width="80"/>
+      <el-table-column label="得分" prop="metricsName" width="80"/>
+    </el-table>
   </div>
 
 </template>
@@ -31,15 +39,23 @@
 const {proxy} = getCurrentInstance()
 import {onMounted} from "vue";
 import {hcsDetails} from "@/api/hl/hcs"
+import {listHmsDetails} from "@/api/hl/hms"
 const props = defineProps(['rowData'])
 const {biz_type,metrics_small_type} = proxy.useDict('biz_type','metrics_small_type');
 const hsData = ref([])
+const hmsDetailData = ref([])
 
 onMounted(()=>{
   getDetail()
 })
 
+async function handleDetail(row){
+  const res = await listHmsDetails(row.scoreClassId)
+  hmsDetailData.value = res.data
+}
+
 async function getDetail(){
+  hmsDetailData.value = []
   const res = await hcsDetails(props.rowData.hlScoreId)
   hsData.value = res.data
 }
@@ -51,8 +67,5 @@ async function getDetail(){
   display: flex;
   justify-content: space-between;
   align-items: flex-start;
-  .time-detail-left{
-    width: 48%;
-  }
 }
 </style>

+ 16 - 0
src/views/hl/check/css/style.scss

@@ -170,4 +170,20 @@
       transform: rotate(360deg); /* 旋转一圈(360度) */
     }
   }
+  .btn-center-row{
+    @include flexCenter();
+    margin:20px 0;
+  }
+  .check-report{
+    @include flexBetween();
+    align-items: flex-start;
+    .error{
+      font-weight: bold;
+      color: #e43;
+    }
+    .normal{
+      font-weight: bold;
+      color: green;
+    }
+  }
 }

+ 13 - 0
src/views/hl/check/index.vue

@@ -80,12 +80,20 @@
       </el-table>
     </div>
 
+    <div class="btn-center-row"  v-if="checkFlag">
+      <el-button type="primary" plain @click="visible=true">巡查报告查看</el-button>
+    </div>
+
+    <el-dialog v-model="visible" width="1000" title="巡检报告查看">
+      <check-history />
+    </el-dialog>
   </div>
 </template>
 <script setup lang="ts">
 import {getCheckList,getCheckModel} from "@/api/hl/bm"
 import {onMounted} from "vue";
 import {Timer,Compass,Warning,Loading,CircleCheck,WarnTriangleFilled} from "@element-plus/icons-vue"
+import checkHistory from "./widget/checkHistory.vue"
 const checkList = ref([])
 const cLoading = ref(false)
 const currentProgress = ref(0)
@@ -94,6 +102,8 @@ const listData = ref([])
 const checkTime = ref(null)
 const totalError=ref(0)
 const totalErrorCount = ref(0)
+const checkFlag = ref(false)
+const visible = ref(false)
 
 const colors = [
   { color: '#bbdefb', percentage: 20 },
@@ -143,6 +153,7 @@ function getRandomInt(min, max) {
 
 function handleNowCheck(sub){
   if(!cLoading.value){
+    checkFlag.value = false
     if(localStorage.getItem("listData")){
       removeCache()
       getListData()
@@ -176,6 +187,7 @@ function saveCache(){
   localStorage.setItem("listData", JSON.stringify(listData.value))
   localStorage.setItem("errorInfo",JSON.stringify({totalErrorCount:totalErrorCount.value,totalError:totalError.value,checkTime:checkTime.value}))
   localStorage.setItem("checkList",JSON.stringify(checkList.value))
+  checkFlag.value = true
 }
 
 function removeCache(){
@@ -193,6 +205,7 @@ function restoreCache(){
   totalError.value = errorInfo.totalError
   checkTime.value = errorInfo.checkTime
   currentProgress.value = 100
+  checkFlag.value = true
 }
 
 

+ 55 - 0
src/views/hl/check/widget/checkHistory.vue

@@ -0,0 +1,55 @@
+<template>
+  <el-table :data="historyData" style="width: 100%" border>
+    <el-table-column prop="id" label="ID" width="80"/>
+    <el-table-column prop="time" label="巡检时间" />
+    <el-table-column label="操作" width="120">
+      <template #default="scope">
+        <el-button type="primary" link icon="document" @click="handleReport(scope.row)">查看报告</el-button>
+      </template>
+    </el-table-column>
+  </el-table>
+  <pagination
+      v-show="total>0"
+      :total="total"
+      v-model:page="query.pageNum"
+      v-model:limit="query.pageSize"
+      @pagination="getHistoryData"
+  />
+
+  <el-dialog v-model="visible" title="查看报告" width="1200" >
+      <check-report :ids="ids" ref="crRef"/>
+  </el-dialog>
+
+</template>
+<script setup lang="ts">
+import checkReport from "./checkReport.vue"
+import {getCheckHistory} from "@/api/hl/bm"
+import {onMounted, reactive} from "vue";
+const { proxy } = getCurrentInstance()
+const historyData = ref([])
+const ids = ref(null)
+const visible = ref(false)
+const total = ref(1)
+const query = reactive({
+  pageNum: 1,
+  pageSize: 10
+})
+onMounted(()=>{
+  getHistoryData()
+})
+
+async function getHistoryData(){
+  const res = await getCheckHistory(query)
+  historyData.value = res.data
+}
+
+function handleReport(row){
+  ids.value = row.id
+  visible.value = true
+  proxy.$nextTick(()=>{
+    proxy.$refs['crRef'].checkProjData()
+  })
+}
+</script>
+<style scoped lang="scss">
+</style>

+ 58 - 0
src/views/hl/check/widget/checkReport.vue

@@ -0,0 +1,58 @@
+<template>
+  <div class="check-report">
+    <el-table :data="reportData" border :style="`width: ${visibleDetail?50:100}%`">
+      <el-table-column prop="class" label="分类" width="100" />
+      <el-table-column prop="option" label="巡检项"  />
+      <el-table-column prop="total" label="指标数量" width="80" />
+      <el-table-column prop="num" label="问题指标" width="80" />
+      <el-table-column label="操作" width="80" >
+        <template #default="scope">
+          <el-button type="primary" link icon="edit" @click="handleDetails(scope.row)">明细</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-table :data="reportDetail" v-show="visibleDetail" style="width: 48%" border>
+      <el-table-column label="指标名称" width="120" prop="name"/>
+      <el-table-column label="检查描述" prop="remark"/>
+      <el-table-column label="当前值" width="100">
+        <template #default="scope">
+          <span :class="scope.row.status === '异常'?'error':'normal'">
+            {{scope.row.value}}
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column label="巡查结果" width="100">
+        <template #default="scope">
+          <span :class="scope.row.status === '异常'?'error':'normal'">{{ scope.row.status }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+
+</template>
+<script setup lang="ts">
+import {getCheckProj,getCheckMetrics} from "@/api/hl/bm"
+const props = defineProps(["ids"])
+const reportData = ref([])
+const visibleDetail = ref(false)
+const reportDetail = ref([])
+
+
+async function checkProjData(){
+  visibleDetail.value = false
+  const res = await getCheckProj(props.ids)
+  reportData.value = res.data
+}
+
+async function handleDetails(row){
+  const res = await getCheckMetrics(row.id)
+  reportDetail.value = res.data
+  visibleDetail.value = true
+}
+
+defineExpose({checkProjData})
+
+</script>
+<style scoped lang="scss">
+@import "../css/style.scss";
+</style>