ZaiZai 1 éve
szülő
commit
b17ad88e8c

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240821140053"
+  "value": "20240821140958"
 }

+ 11 - 2
src/views/tentative/acquisition/model/equipment-data.vue

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