|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<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 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>
|
|
@@ -19,40 +19,45 @@
|
|
|
|
|
|
<el-dialog v-model="visible" :title="timeTitle" width="1200">
|
|
|
<time-detail :rowData="rowData" v-if="visible"/>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="visible=false">关闭</el-button>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import {hsTimeList} from "@/api/hl/hs"
|
|
|
+import {hsDayList, hsTimeList} from "@/api/hl/hs"
|
|
|
import {onMounted, reactive} from "vue";
|
|
|
import timeDetail from "./widget/timeDetail.vue"
|
|
|
+
|
|
|
const {proxy} = getCurrentInstance()
|
|
|
-const props = defineProps(['modelId'])
|
|
|
+const props = defineProps(['modelId', 'dialogType'])
|
|
|
const hsTimeData = ref([])
|
|
|
const total = ref(0)
|
|
|
const loading = ref(false)
|
|
|
-const timeTitle=ref('')
|
|
|
-const visible=ref(false)
|
|
|
+const timeTitle = ref('')
|
|
|
+const visible = ref(false)
|
|
|
const rowData = ref({})
|
|
|
const queryParams = reactive({
|
|
|
- pageNum:1,
|
|
|
- pageSize:10,
|
|
|
- modelId:props.modelId
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ modelId: props.modelId
|
|
|
})
|
|
|
|
|
|
-onMounted(()=>{
|
|
|
+onMounted(() => {
|
|
|
getHlList()
|
|
|
})
|
|
|
|
|
|
-function handleDetail(row){
|
|
|
+function handleDetail(row) {
|
|
|
timeTitle.value = row.hlDate + "明细"
|
|
|
visible.value = true
|
|
|
rowData.value = row
|
|
|
}
|
|
|
|
|
|
-async function getHlList(){
|
|
|
+async function getHlList() {
|
|
|
loading.value = true
|
|
|
- const res = await hsTimeList(queryParams)
|
|
|
+ const request = props.dialogType === "history" ? hsTimeList : hsDayList
|
|
|
+ const res = await request(queryParams)
|
|
|
hsTimeData.value = res.rows
|
|
|
total.value = res.total
|
|
|
loading.value = false
|