|
@@ -3,6 +3,7 @@ import { IotDeviceApi } from '@/api/pms/device'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
|
import { rangeShortcuts } from '@/utils/formatTime'
|
|
import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
|
|
+import { formatIotValue } from '@/utils/useSocketBus'
|
|
|
import { useDebounceFn } from '@vueuse/core'
|
|
import { useDebounceFn } from '@vueuse/core'
|
|
|
import { dayjs, ElMessage } from 'element-plus'
|
|
import { dayjs, ElMessage } from 'element-plus'
|
|
|
import { computed, ref } from 'vue'
|
|
import { computed, ref } from 'vue'
|
|
@@ -171,6 +172,16 @@ const handleExport = useDebounceFn(async function () {
|
|
|
exportLoading.value = false
|
|
exportLoading.value = false
|
|
|
}
|
|
}
|
|
|
}, 300)
|
|
}, 300)
|
|
|
|
|
+
|
|
|
|
|
+function formatterValue(row: ListItem) {
|
|
|
|
|
+ const { value, suffix, isText } = formatIotValue(row.value)
|
|
|
|
|
+
|
|
|
|
|
+ if (isText) {
|
|
|
|
|
+ return value
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return `${Number(value).toFixed(2)}${suffix}`
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -278,8 +289,8 @@ const handleExport = useDebounceFn(async function () {
|
|
|
label="值"
|
|
label="值"
|
|
|
align="center"
|
|
align="center"
|
|
|
min-width="100"
|
|
min-width="100"
|
|
|
- cover-formatter
|
|
|
|
|
- :real-value="(row: ListItem) => row.value"
|
|
|
|
|
|
|
+ coverFormatter
|
|
|
|
|
+ :real-value="formatterValue"
|
|
|
/>
|
|
/>
|
|
|
<zm-table-column
|
|
<zm-table-column
|
|
|
prop="ts"
|
|
prop="ts"
|