_deviceListPage() {
let params = {
pageSize: this.devicePageSize,
pageNum: this.devicePageNum,
kw: "", //查询条件(通配查询条件)
type: this.deviceType, //设备类型(下拉)2.1.6接口获取
code: this.deviceCode, //设备编号
areaId: this.deviceareaId, //位置区域
status: this.deviceStatus, //状态 1:在线(正常),0:未激活,2已离线,3.告警
imei: "" //imei编号
};
deviceListPage(params).then(res => {
if (res.code == 200) {
this.devicePageTotal = res.body.total;
this.devicePageSize = res.body.pageSize;
this.devicePageNum = res.body.pageNum;
this.devicePageTotalPages = parseInt(
(this.devicePageTotal + this.devicePageSize - 1) /
this.devicePageSize
);
if (this.devicePageTotal == 0) {
// console.log("没有数据");
//没有数据
this.deviceListnodata = true;
this.deviceListIsLoad = false;
this.deviceListIsFinish = true;
this.devicePageNum = 1;
this.deviceTip = "暂无数据";
return false;
}
this.deviceList = this.deviceList.concat(res.body.datas);
// console.log(this.devicePageNum, this.devicePageTotalPages);
if (this.devicePageNum == this.devicePageTotalPages) {
//没有更多
this.deviceListIsLoad = false;
this.deviceListIsFinish = true;
this.devicePageNum = 1;
this.deviceTip = "没有更多了~";
// console.log("没有更多了");
} else {
// console.log("下一页");
//下一页
this.deviceListIsLoad = true;
this.deviceListIsFinish = false;
this.devicePageNum++;
this.deviceTip = "正在加载中~";
}
// console.log("deviceList", this.deviceList);
} else {
// this.deviceList = [];
this.deviceListIsLoad = false;
this.deviceListIsFinish = true;
this.devicePageNum = 1;
this.deviceTip = "数据加载失败~";
}
});
},
devicePageSize: 10, //每页显示
devicePageNum: 1, //当前页
devicePageTotal: 0, //总条数
devicePageTotalPages: 0, //总页数
deviceListIsFinish: false, //是否加载完成
deviceListIsLoad: false, //是否加载更多
deviceListnodata: false, //是否有数据
deviceTip: "",