Zimo 1 неделя назад
Родитель
Сommit
bea02259a7
1 измененных файлов с 28 добавлено и 3 удалено
  1. 28 3
      src/views/oli-connection/monitoring-query/index.vue

+ 28 - 3
src/views/oli-connection/monitoring-query/index.vue

@@ -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="时间"