|
|
|
|
@ -39,10 +39,14 @@
|
|
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
<el-table-column type="expand" width="52">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-table v-if="getOperationRuleRows(scope.row).length" :data="getOperationRuleRows(scope.row)"
|
|
|
|
|
<el-table v-if="getPointDetailsRows(scope.row).length" :data="getPointDetailsRows(scope.row)"
|
|
|
|
|
:show-overflow-tooltip="true" size="small" border>
|
|
|
|
|
<el-table-column label="指标" prop="name" min-width="140" />
|
|
|
|
|
<el-table-column label="值" prop="value" min-width="120" />
|
|
|
|
|
<el-table-column label="参数名称" prop="pointName" min-width="140" />
|
|
|
|
|
<el-table-column label="最早采集值" prop="earliestValue" min-width="120" />
|
|
|
|
|
<el-table-column label="最早采集时间" prop="earliestTime" min-width="170" />
|
|
|
|
|
<el-table-column label="最新值" prop="latestValue" min-width="120" />
|
|
|
|
|
<el-table-column label="最新采集时间" prop="latestTime" min-width="170" />
|
|
|
|
|
<el-table-column label="能耗用量" prop="difference" min-width="120" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
@ -116,20 +120,18 @@ const queryParams = reactive({
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
|
|
|
|
|
const getOperationRuleRows = (row: EnergyDeviceDataRecordVO) => {
|
|
|
|
|
const map = row?.operationRulesVOMap
|
|
|
|
|
if (!map) return []
|
|
|
|
|
const entries = Object.entries(map).filter(([k]) => !!k)
|
|
|
|
|
if (!entries.length) return []
|
|
|
|
|
return entries.map(([name, value]) => ({ name, value: value ?? '-' }))
|
|
|
|
|
const getPointDetailsRows = (row: EnergyDeviceDataRecordVO) => {
|
|
|
|
|
const list = (row as any)?.pointDetails
|
|
|
|
|
if (!Array.isArray(list)) return []
|
|
|
|
|
return list
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getRowClassName = ({ row }: { row: EnergyDeviceDataRecordVO }) => {
|
|
|
|
|
return getOperationRuleRows(row).length ? '' : 'row-no-expand'
|
|
|
|
|
return getPointDetailsRows(row).length ? '' : 'row-no-expand'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleRowClick = (row: EnergyDeviceDataRecordVO) => {
|
|
|
|
|
const rows = getOperationRuleRows(row)
|
|
|
|
|
const rows = getPointDetailsRows(row)
|
|
|
|
|
if (!rows.length) return
|
|
|
|
|
const key = row.id
|
|
|
|
|
const idx = expandRowKeys.value.findIndex((k) => k === key)
|
|
|
|
|
|