style:能源报表-更换子列表渲染字段

main
黄伟杰 3 weeks ago
parent c9286c4a7f
commit 8998160f7a

@ -8,8 +8,8 @@ VITE_DEV=true
# 线上环境
# VITE_BASE_URL='https://besure.ngsk.tech:7001'
# 本地联调
VITE_BASE_URL='http://localhost:48081'
# VITE_BASE_URL='http://192.168.5.135:48081'
# VITE_BASE_URL='http://192.168.5.107:48081'
VITE_BASE_URL='http://192.168.5.131:48081'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务

@ -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)

Loading…
Cancel
Save