Ver código fonte

feat: 历史健康开发

zhangwenya 9 meses atrás
pai
commit
f1f33939ef

+ 8 - 0
src/api/hl/hcs.js

@@ -42,3 +42,11 @@ export function delHcs(scoreClassId) {
         method: 'delete'
     })
 }
+
+
+export function hcsDetails(hlScoreId) {
+    return request({
+        url: '/hl/hcs/list/'+hlScoreId,
+        method: 'get',
+    })
+}

+ 10 - 0
src/api/hl/hs.js

@@ -42,3 +42,13 @@ export function delHs(hlScoreId) {
         method: 'delete'
     })
 }
+
+
+export function hsTimeList(query) {
+    return request({
+        url: '/hl/hs/time/list/',
+        method: 'get',
+        params: query
+    })
+}
+

+ 47 - 5
src/views/hl/bm/component/historyHealth.vue

@@ -1,19 +1,61 @@
 <template>
-  history {{modelId}}
+  <el-table v-loading="loading" :data="hsTimeData" border style="width: 100%">
+    <el-table-column prop="hlScoreId" label="ID" width="80"/>
+    <el-table-column prop="hlDate" label="评分时间" />
+    <el-table-column prop="hlScore" label="健康度得分" />
+    <el-table-column label="操作" width="120">
+      <template #default="scope">
+        <el-button type="primary" link icon="Document" @click="handleDetail(scope.row)">明细</el-button>
+      </template>
+    </el-table-column>
+  </el-table>
+  <pagination
+      v-show="total>0"
+      :total="total"
+      v-model:page="queryParams.pageNum"
+      v-model:limit="queryParams.pageSize"
+      @pagination="getHlList"
+  />
+
+  <el-dialog v-model="visible" :title="timeTitle" width="1100">
+    <time-detail :rowData="rowData" v-if="visible"/>
+  </el-dialog>
+
 </template>
 <script setup lang="ts">
-import {hlsList} from "@/api/hl/hlScore"
-import {onMounted} from "vue";
+import {hsTimeList} from "@/api/hl/hs"
+import {onMounted, reactive} from "vue";
+import timeDetail from "./widget/timeDetail.vue"
 const {proxy} = getCurrentInstance()
 const props = defineProps(['modelId'])
+const hsTimeData = ref([])
+const total = ref(0)
+const loading = ref(false)
+const timeTitle=ref('')
+const visible=ref(false)
+const rowData = ref({})
+const queryParams = reactive({
+  pageNum:1,
+  pageSize:10,
+  modelId:props.modelId
+})
 
 onMounted(()=>{
   getHlList()
 })
 
+function handleDetail(row){
+  timeTitle.value = row.hlDate + "明细"
+  visible.value = true
+  rowData.value = row
+}
+
 async function getHlList(){
- const res =  await hlsList(props.modelId,{})
-  console.log(res)
+  loading.value = true
+  const res =  await hsTimeList(queryParams)
+  hsTimeData.value = res.rows
+  total.value = res.total
+  loading.value = false
 }
 
 </script>

+ 58 - 0
src/views/hl/bm/component/widget/timeDetail.vue

@@ -0,0 +1,58 @@
+<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>
+  </div>
+
+</template>
+<script setup lang="ts">
+const {proxy} = getCurrentInstance()
+import {onMounted} from "vue";
+import {hcsDetails} from "@/api/hl/hcs"
+const props = defineProps(['rowData'])
+const {biz_type,metrics_small_type} = proxy.useDict('biz_type','metrics_small_type');
+const hsData = ref([])
+
+onMounted(()=>{
+  getDetail()
+})
+
+async function getDetail(){
+  const res = await hcsDetails(props.rowData.hlScoreId)
+  hsData.value = res.data
+}
+
+</script>
+<style scoped lang="scss">
+.time-detail-container{
+  min-height: 400px;
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-start;
+  .time-detail-left{
+    width: 48%;
+  }
+}
+</style>