|
@@ -38,7 +38,7 @@
|
|
range-separator="至" start-placeholder="开始日期时间" end-placeholder="结束日期时间"
|
|
range-separator="至" start-placeholder="开始日期时间" end-placeholder="结束日期时间"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- <el-button type="primary" @click="getTableData">搜索</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="searchClick">搜索</el-button>
|
|
</template>
|
|
</template>
|
|
<template #extra>
|
|
<template #extra>
|
|
<el-button @click="toBackClick">
|
|
<el-button @click="toBackClick">
|
|
@@ -164,6 +164,10 @@ const setDeviceData = ({ temperature, humidity }) => {
|
|
|
|
|
|
//搜索表单
|
|
//搜索表单
|
|
const searchForm = ref({ nodeId: -1, startTime: '', endTime: '', deviceAddr: null })
|
|
const searchForm = ref({ nodeId: -1, startTime: '', endTime: '', deviceAddr: null })
|
|
|
|
+const searchClick = () => {
|
|
|
|
+ getDateTime()
|
|
|
|
+ getTableData()
|
|
|
|
+}
|
|
|
|
|
|
//历史记录表格
|
|
//历史记录表格
|
|
const tableColumn = [
|
|
const tableColumn = [
|
|
@@ -184,10 +188,15 @@ const getTableData = async () => {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
isLoading.value = true
|
|
isLoading.value = true
|
|
- const { data } = await mainApi.getHistoryList(token, {
|
|
|
|
|
|
+ const { code, msg, data } = await mainApi.getHistoryList(token, {
|
|
...searchForm.value,
|
|
...searchForm.value,
|
|
deviceAddr: deviceAddr,
|
|
deviceAddr: deviceAddr,
|
|
})
|
|
})
|
|
|
|
+ if (code !== 1000) {
|
|
|
|
+ tableData.value = []
|
|
|
|
+ window.$message.error(msg)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
//判断数据是否为空
|
|
//判断数据是否为空
|
|
const arr = getArrValue(data)
|
|
const arr = getArrValue(data)
|
|
if (arr.length <= 0) {
|
|
if (arr.length <= 0) {
|