|
@@ -241,6 +241,7 @@ import fanlocalAnimate from "../fanlocalAnimate/fanlocalAnimate2.vue";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ timer: undefined,
|
|
tableData: [], //监测数据
|
|
tableData: [], //监测数据
|
|
typeList: [], //展示字段
|
|
typeList: [], //展示字段
|
|
itemId: "", // 初始化 itemId
|
|
itemId: "", // 初始化 itemId
|
|
@@ -283,24 +284,29 @@ export default {
|
|
this.ndoorcount = 2;
|
|
this.ndoorcount = 2;
|
|
},
|
|
},
|
|
components: { doorAnimate, windowAnimate,windrectAnimate,fanlocalAnimate },
|
|
components: { doorAnimate, windowAnimate,windrectAnimate,fanlocalAnimate },
|
|
- created() {
|
|
|
|
- this.getShowList(this.TabCur);
|
|
|
|
- this.getDeviceInfo(this.itemId);
|
|
|
|
- this.getVideoUrlById(this.itemId);
|
|
|
|
|
|
+ async created() {
|
|
|
|
+ await this.getShowList(this.TabCur);
|
|
|
|
+ await this.getDeviceInfo(this.itemId);
|
|
|
|
+ await this.getVideoUrlById(this.itemId);
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.startTimer();
|
|
|
|
|
|
+ this.startTimer(false);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- startTimer() {
|
|
|
|
- this.timer = setInterval(() => {
|
|
|
|
|
|
+ startTimer(flag = true) {
|
|
|
|
+ this.timer = setTimeout(async() => {
|
|
// 执行定时任务
|
|
// 执行定时任务
|
|
- this.getDeviceInfo(this.itemId);
|
|
|
|
- }, 5000);
|
|
|
|
|
|
+ await this.getShowList(this.TabCur);
|
|
|
|
+ await this.getDeviceInfo(this.itemId);
|
|
|
|
+ if(this.timer){
|
|
|
|
+ this.startTimer()
|
|
|
|
+ }
|
|
|
|
+ }, !flag ? 0 : 2000);
|
|
},
|
|
},
|
|
stopTimer() {
|
|
stopTimer() {
|
|
// 停止定时器
|
|
// 停止定时器
|
|
- clearInterval(this.timer);
|
|
|
|
|
|
+ clearTimeout(this.timer);
|
|
|
|
+ this.timer = undefined
|
|
},
|
|
},
|
|
// 返回上一个页面
|
|
// 返回上一个页面
|
|
backPage() {
|
|
backPage() {
|
|
@@ -317,7 +323,7 @@ export default {
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
};
|
|
};
|
|
- new Promise((resolve, reject) => {
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
api
|
|
api
|
|
.getShowColumList(params)
|
|
.getShowColumList(params)
|
|
.then((response) => {
|
|
.then((response) => {
|
|
@@ -336,7 +342,7 @@ export default {
|
|
//获取详情数据
|
|
//获取详情数据
|
|
getDeviceInfo(ID) {
|
|
getDeviceInfo(ID) {
|
|
let IDString = String(ID); // 将 ID 转换为字符串
|
|
let IDString = String(ID); // 将 ID 转换为字符串
|
|
- new Promise((resolve, reject) => {
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
api
|
|
api
|
|
.getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
|
|
.getDeviceMonitor({ devicetype: this.TabCur, ids: IDString })
|
|
.then((response) => {
|
|
.then((response) => {
|
|
@@ -344,6 +350,7 @@ export default {
|
|
var result = response.data.result.msgTxt[0].datalist[0];
|
|
var result = response.data.result.msgTxt[0].datalist[0];
|
|
this.tableData =
|
|
this.tableData =
|
|
result.readData;
|
|
result.readData;
|
|
|
|
+ console.log('监测数据------------>', result)
|
|
if (this.tableData.frontGateOpen == "1") {
|
|
if (this.tableData.frontGateOpen == "1") {
|
|
this.tableData.frontGateOpen = "打开";
|
|
this.tableData.frontGateOpen = "打开";
|
|
} else {
|
|
} else {
|
|
@@ -377,6 +384,7 @@ export default {
|
|
this.windowAngle1 =
|
|
this.windowAngle1 =
|
|
(this.tableData.rearArea / maxarea) * 100 * 0.9;
|
|
(this.tableData.rearArea / maxarea) * 100 * 0.9;
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
|
|
+ resolve(null)
|
|
} else {
|
|
} else {
|
|
resolve(response);
|
|
resolve(response);
|
|
}
|
|
}
|
|
@@ -389,7 +397,7 @@ export default {
|
|
//获取监控URL 通过ID获取
|
|
//获取监控URL 通过ID获取
|
|
getVideoUrlById(ID) {
|
|
getVideoUrlById(ID) {
|
|
let IDString = String(ID); // 将 ID 转换为字符串
|
|
let IDString = String(ID); // 将 ID 转换为字符串
|
|
- new Promise((resolve, reject) => {
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
api
|
|
api
|
|
.getCameraById({ deviceid: IDString })
|
|
.getCameraById({ deviceid: IDString })
|
|
.then((response) => {
|
|
.then((response) => {
|
|
@@ -454,7 +462,7 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
|
|
|
+<style lang="scss">
|
|
passwordPopup {
|
|
passwordPopup {
|
|
height: 300rpx;
|
|
height: 300rpx;
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
@@ -502,13 +510,14 @@ passwordPopup {
|
|
border: 1rpx solid #000000;
|
|
border: 1rpx solid #000000;
|
|
border-radius: 20rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
}
|
|
-.flex-containe {
|
|
|
|
|
|
+.flex-container {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
}
|
|
}
|
|
.itemback {
|
|
.itemback {
|
|
- flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
|
|
|
|
|
|
+ width: calc(48% - 5px);
|
|
|
|
+ // flex: 0 0 calc(33.33% - 10px); /* 使用calc函数计算每个项目的宽度,减去间距 */
|
|
margin: 5px; /* 间距设置为5px */
|
|
margin: 5px; /* 间距设置为5px */
|
|
}
|
|
}
|
|
.datacardtime {
|
|
.datacardtime {
|
|
@@ -528,10 +537,10 @@ passwordPopup {
|
|
}
|
|
}
|
|
.datacard {
|
|
.datacard {
|
|
display: flex;
|
|
display: flex;
|
|
- width: 48%;
|
|
|
|
|
|
+ /* width: 48%; */
|
|
flex: 1;
|
|
flex: 1;
|
|
margin: 1%;
|
|
margin: 1%;
|
|
- float: left;
|
|
|
|
|
|
+ /* float: left; */
|
|
height: 100rpx;
|
|
height: 100rpx;
|
|
text-align: center;
|
|
text-align: center;
|
|
background: linear-gradient(
|
|
background: linear-gradient(
|