You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
3.5 KiB
Vue

<template>
<el-dialog
class="infoDialog"
title="装置信息"
:visible.sync="isShow"
:close-on-click-modal="false"
width="50%"
2 years ago
@close="handleclose"
v-loading="loading"
>
<div class="infoTable">
2 years ago
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions-item>
<template slot="label"> 装置编号 </template>{{ cmdid }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 电池电量 </template
>{{ infornr.batteryCapacity }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 电池电压 </template
>{{ infornr.batteryVoltage }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> MEID </template>{{ infornr.cmld }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 网络连接状态 </template
>{{ infornr.connectionState }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 浮充状态 </template
>{{ infornr.floatingCharge }}
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 工作总时间小时 </template
>{{ infornr.totalWorkingTime }}
2 years ago
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 本次连续工作时间小时 </template
>{{ infornr.workingTime }}
2 years ago
</el-descriptions-item>
<el-descriptions-item>
2 years ago
<template slot="label"> 工作状态更新时间 </template
>{{  $moment(infornr.wsUpdateTime).format("yy-MM-DD HH:mm:ss") }}
</el-descriptions-item>
</el-descriptions>
</div>
<div slot="footer" class="dialog-footer">
<!-- <el-button @click="isShow = false"> </el-button> -->
<el-button type="primary" @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
2 years ago
import { getDeviceList, getNewDeviceList } from "@/utils/api/index";
export default {
props: {
title: String,
},
data() {
return {
loading: true,
isShow: false,
2 years ago
infornr: {}, //装置信息内容
timer: null,
queryTime:'',//查询ID
cmdid:''
};
},
2 years ago
mounted() {},
methods: {
2 years ago
//获取第一次数据
getListData(val,cmdid) {
this.cmdid = cmdid
2 years ago
getDeviceList({
termId: val,
})
2 years ago
.then((res) => {
this.queryTime = res.data.queryTime
this.getNewListData(val);
2 years ago
this.timer = window.setInterval(() => {
this.getNewListData(val);
}, 10000);
})
.catch((err) => {});
2 years ago
},
//最新数据
2 years ago
getNewListData(val) {
2 years ago
getNewDeviceList({
queryTime: this.queryTime,
2 years ago
termId: val,
})
2 years ago
.then((res) => {
this.loading = false
if (res.data.isNew == true) {
2 years ago
this.infornr = res.data;
this.$message({
message: "装置信息已更新",
type: "success",
});
clearInterval(this.timer);
}else{
this.infornr = res.data;
2 years ago
}
})
.catch((err) => {});
2 years ago
},
display() {
this.isShow = true;
},
hide() {
this.isShow = false;
},
2 years ago
handleclose() {
2 years ago
clearInterval(this.timer);
2 years ago
},
},
};
</script>
<style lang="less">
.infoDialog {
}
</style>