|
@@ -85,7 +85,7 @@
|
|
|
:class="{ emptyhistory: historyData.length === 0 }"
|
|
|
class="historycontainer"
|
|
|
>
|
|
|
- <template v-if="historyData && historyData.length > 0">
|
|
|
+ <template v-if="historyData.length > 0">
|
|
|
<u-list-item
|
|
|
class="itemback"
|
|
|
v-for="(item, index) in historyData"
|
|
@@ -411,12 +411,12 @@ export default {
|
|
|
},
|
|
|
//查询历史数据 getDeviceHistory
|
|
|
checkHistory() {
|
|
|
- if (this.stationType !== "redis") {
|
|
|
- this.getHistoryData();
|
|
|
- } else {
|
|
|
- this.getHistoryData2();
|
|
|
- }
|
|
|
- // this.getHistoryData2();
|
|
|
+ // if (this.stationType !== "redis") {
|
|
|
+ // this.getHistoryData();
|
|
|
+ // } else {
|
|
|
+ // this.getHistoryData2();
|
|
|
+ // }
|
|
|
+ this.getHistoryData2();
|
|
|
},
|
|
|
// 查询历史数据
|
|
|
getHistoryData() {
|
|
@@ -466,7 +466,11 @@ export default {
|
|
|
.getDeviceHistory2(params)
|
|
|
.then((response) => {
|
|
|
if (response.data.code == 200) {
|
|
|
- this.historyData = response.data.result.records;
|
|
|
+ this.historyData =
|
|
|
+ (response.data &&
|
|
|
+ response.data.result &&
|
|
|
+ response.data.result.records) ||
|
|
|
+ [];
|
|
|
// this.pageNo = response.data.result.datalist.current;
|
|
|
} else {
|
|
|
resolve(response);
|
|
@@ -520,7 +524,7 @@ export default {
|
|
|
onReachBottom() {
|
|
|
// uni-app提供的页面滚动到底部钩子函数
|
|
|
console.log("上拉加载更多数据");
|
|
|
- this.loadMoreData();
|
|
|
+ // this.loadMoreData();
|
|
|
},
|
|
|
};
|
|
|
</script>
|