|
|
@@ -146,10 +146,27 @@ function handleSizeChange() {
|
|
|
const exportLoading = ref(false)
|
|
|
|
|
|
const handleExport = useDebounceFn(async function () {
|
|
|
+ if (!query.value.deviceName && !query.value.deviceCode) {
|
|
|
+ ElMessage.warning('请输入设备名称或设备编码')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!query.value.time || query.value.time.length !== 2) {
|
|
|
+ ElMessage.warning('请选择时间范围')
|
|
|
+ return
|
|
|
+ }
|
|
|
exportLoading.value = true
|
|
|
try {
|
|
|
- const data = await IotDeviceApi.exportMonitoringQuery(query.value)
|
|
|
- download.excel(data, '运维监控查询.xls')
|
|
|
+ const { time, ...other } = query.value
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ ...other,
|
|
|
+ beginTime: time?.[0],
|
|
|
+ endTime: time?.[1]
|
|
|
+ }
|
|
|
+
|
|
|
+ const data = await IotDeviceApi.exportMonitoringQuery(params)
|
|
|
+ download.excel(data, '监控查询.xls')
|
|
|
} finally {
|
|
|
exportLoading.value = false
|
|
|
}
|
|
|
@@ -255,7 +272,15 @@ const handleExport = useDebounceFn(async function () {
|
|
|
align="center"
|
|
|
min-width="100"
|
|
|
/>
|
|
|
- <zm-table-column prop="value" title="值" label="值" align="center" min-width="100" />
|
|
|
+ <zm-table-column
|
|
|
+ prop="value"
|
|
|
+ title="值"
|
|
|
+ label="值"
|
|
|
+ align="center"
|
|
|
+ min-width="100"
|
|
|
+ cover-formatter
|
|
|
+ :real-value="(row: ListItem) => row.value"
|
|
|
+ />
|
|
|
<zm-table-column
|
|
|
prop="ts"
|
|
|
title="时间"
|