zhangwenya 11 сар өмнө
parent
commit
884d1f30f3

+ 11 - 0
src/api/hl/hlScore.js

@@ -0,0 +1,11 @@
+import request from '@/utils/request'
+
+
+// 查询健康度分数记录列表
+export function hlsList(modelId,query) {
+    return request({
+        url: '/hl/hlScore/list/'+modelId,
+        method: 'get',
+        params: query
+    })
+}

+ 3 - 0
src/views/hl/bm/component/healthSetting.vue

@@ -91,12 +91,15 @@ function  objectSpanMethod ({row,column,rowIndex,columnIndex,})  {
 function getHtlData(){
   hlbDetails(props.modelId).then(res=>{
     if(res.data){
+      countEs.value = 0
+      hlbData.value = []
       formattedData(res.data)
     }
   })
 }
 
 function formattedData(data) {
+  countIz.value = 0
   data.hlClassList.forEach(item=>{
     if(item.hlObjList.length){
       item.hlObjList.forEach((cItem,cIndex)=>{

+ 49 - 0
src/views/hl/bm/component/historyHealth.vue

@@ -0,0 +1,49 @@
+<template>
+  <el-table
+      :data="hlsData"
+      border
+      style="width: 100%; margin-top: 20px"
+  >
+    <el-table-column prop="hlScoreId" label="ID" width="80" align="center" />
+    <el-table-column prop="updateTime" label="评分时间" />
+    <el-table-column prop="hlScore" label="健康度得分" width="200"  align="center" />
+    <el-table-column label="操作" width="100" align="center">
+      <template #default="scope">
+        <el-button type="text" plain icon="Tickets">明细</el-button>
+      </template>
+    </el-table-column>
+  </el-table>
+  <pagination
+      v-show="total>0"
+      :total="total"
+      v-model:page="params.pageNum"
+      v-model:limit="params.pageSize"
+      @pagination="getHlsData"
+  />
+</template>
+<script setup lang="ts">
+import {hlsList} from "@/api/hl/hlScore"
+const props = defineProps(['modelId'])
+const hlsData = ref([])
+const total = ref(0)
+const params=reactive({
+  pageNum: 1,
+  pageSize: 10,
+})
+
+watchEffect(()=>{
+  getHlsData()
+})
+
+
+
+function getHlsData(){
+  hlsList(props.modelId,params).then(res=>{
+    hlsData.value = res.rows
+    total.value = res.total
+  })
+}
+
+</script>
+<style scoped lang="scss">
+</style>

+ 14 - 10
src/views/hl/bm/index.vue

@@ -39,7 +39,9 @@
       </el-table-column>
       <el-table-column label="操作" class-name="small-padding fixed-width" align="left" >
         <template #default="scope">
-          <el-button link type="primary" icon="Edit" @click="handleHealthSet(scope.row)">健康度配置</el-button>
+          <el-button link type="primary" icon="Position" @click="handleHealthSet(scope.row,'health')">健康度配置</el-button>
+          <el-button link type="primary" icon="Calendar" @click="handleHealthSet(scope.row,'history')">历史健康度</el-button>
+          <el-button link type="primary" icon="Clock">日健康度</el-button>
           <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['hl:bm:edit']">修改</el-button>
           <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['hl:bm:remove']">删除</el-button>
         </template>
@@ -55,13 +57,9 @@
     />
 
     <!-- 添加或修改业务模型对话框 -->
-    <el-dialog :title="title" v-model="open"
-               :width="dialogType==='add'?'800px':'1600px'"
-               append-to-body
-               :style="dialogType!=='add'?'margin-top:2px!important;':''"
-    >
+    <el-dialog :title="title" v-model="open" :width="dialogType ==='health'?'1600px':'800px'" append-to-body :style="dialogType ==='health'?'margin-top:2px!important;':''">
       <add-bm-info ref="bmRef" @cancel="open = false" @success="getList" v-if="dialogType==='add'"/>
-      <health-setting v-if="dialogType==='health'" :modelId="modelId"/>
+      <component :is="activeComponent[currentActive]" v-else :modelId="modelId" />
     </el-dialog>
   </div>
 </template>
@@ -71,6 +69,7 @@
 import { listBm, getBm, delBm, addBm, updateBm } from "@/api/hl/bm";
 import addBmInfo from "./component/addBm.vue"
 import healthSetting from "./component/healthSetting.vue"
+import historyHealth from "./component/historyHealth.vue"
 const { proxy } = getCurrentInstance();
 
 const bmList = ref([]);
@@ -84,6 +83,8 @@ const total = ref(0);
 const title = ref("");
 const dialogType = ref("add")
 const modelId = ref(0)
+const activeComponent = [healthSetting,historyHealth]
+const currentActive=ref(0)
 
 const data = reactive({
   form: {},
@@ -106,13 +107,16 @@ const data = reactive({
 
 const { queryParams, form, rules } = toRefs(data);
 
-function handleHealthSet(row){
+function handleHealthSet(row,type){
   modelId.value = row.modelId
-  dialogType.value = "health"
+  currentActive.value = type === "health" ? 0 : 1
+  dialogType.value = type
   open.value = true
-  title.value = "健康度配置"
+  title.value = type === "health" ? "健康度配置" : row.modelName+"健康度"
 }
 
+
+
 /** 查询业务模型列表 */
 function getList() {
   loading.value = true;