修改问题

master
夜笙歌 1 month ago
parent b531a4f47c
commit 8ddd4e5cfc

@ -396,13 +396,18 @@ export default {
}, },
async mounted() { async mounted() {
await this.getData() await this.getData()
setInterval(async ()=>{
await this.setAlarmInfos()
await this.getAubDevice()
await this.getTable2Data()
})
}, },
methods: { methods: {
async getData() { async getData() {
if (this.$store.getters.sceneId === null) return if (this.$store.getters.sceneId === null) return
await this.createMap() await this.createMap()
await this.getAlarmStats() await this.getAlarmStats()
await this.getAubDevice()
await this.setAlarmInfos() await this.setAlarmInfos()
await this.setElectronicNumVo() await this.setElectronicNumVo()
await this.getTable2Data() await this.getTable2Data()

@ -21,10 +21,10 @@
<span>名称</span> <span>名称</span>
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitName }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitName }}</span>
</p> </p>
<!-- <p>--> <!-- <p>-->
<!-- <span>ID</span>--> <!-- <span>ID</span>-->
<!-- <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitId }}</span>--> <!-- <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitId }}</span>-->
<!-- </p>--> <!-- </p>-->
<p> <p>
<span>状态</span> <span>状态</span>
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitStatus === '1' ? '正常' : '异常' }}</span>
@ -34,8 +34,8 @@
<span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeName }}</span> <span style="color: #d9dee3">{{ MonitorInfo.monitorUnitTypeName }}</span>
</p> </p>
<p v-for="i in propList"> <p v-for="i in propList">
<span>{{ i.attributeName }}</span> <span>{{ (i||{}).attributeName || '' }}</span>
<span style="color: #d9dee3">{{ i.attributeValue }}</span> <span style="color: #d9dee3">{{ (i || {}).attributeValue }}</span>
</p> </p>
</div> </div>
<div v-if="show" <div v-if="show"
@ -112,7 +112,7 @@
</div> </div>
</div> </div>
<el-dialog title="历史记录" :visible.sync="historyDialog"> <el-dialog title="历史记录" :visible.sync="historyDialog" width="50%">
<el-form :inline="true" :model="form" class="demo-form-inline"> <el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item label="查询时间"> <el-form-item label="查询时间">
<el-date-picker <el-date-picker
@ -339,7 +339,7 @@ export default {
} }
}, },
async treeClick(e) { async treeClick(e) {
if (!e.children?.length > 0) { // if (!e.children?.length > 0) {
this.monitorUnitId = e.id this.monitorUnitId = e.id
await this.getDevice(e.id) await this.getDevice(e.id)
await this.setMonitorById(e) await this.setMonitorById(e)
@ -351,7 +351,7 @@ export default {
getDeviceInterval = setInterval(() => { getDeviceInterval = setInterval(() => {
this.getDevice(e.id) this.getDevice(e.id)
}, 30 * 1000) }, 30 * 1000)
} // }
}, },
async getDevice(e) { async getDevice(e) {
if (this.$store.getters.sceneId) { if (this.$store.getters.sceneId) {
@ -379,7 +379,7 @@ export default {
time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()], time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()],
type: "2", type: "2",
} }
this.getHistoryData() // this.getHistoryData()
}, },
async getHistoryData() { async getHistoryData() {
this.loading1 = true this.loading1 = true

@ -580,8 +580,10 @@ export default {
this.setChart1() this.setChart1()
this.setChart2() this.setChart2()
this.setAllNums() this.setAllNums()
this.setTable3()
this.setDeviceOperations() this.setDeviceOperations()
setInterval(()=>{
this.setTable3()
},5000)
// let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`) // let data = await axios.get(`https://geo.datav.aliyun.com/areas_v3/bound/${this.code}_full.json`)
// let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`) // let data = await axios.get(`http://124.223.15.102:3333/componentLib/getMap?id=${this.code}`)
@ -1190,6 +1192,14 @@ export default {
clearInterval(time2) clearInterval(time2)
} }
time2 = null time2 = null
if(name.length === 0){
const data = await getDeviceByAreaId(this.$store.getters.tenantId)
this.markerData = data.data.map(e => e.devicesList).flat(1)
data.data.map(e => e.devicesList).flat(1).forEach(e => {
this.setMarker(e)
})
}else{
time2 = setInterval(async () => { time2 = setInterval(async () => {
const {data} = await selectDeviceByName({name: name}) const {data} = await selectDeviceByName({name: name})
this.markerData = data this.markerData = data
@ -1213,6 +1223,7 @@ export default {
} }
}) })
this.options = option this.options = option
}
}, },
exTable() { exTable() {
let query = {} let query = {}

Loading…
Cancel
Save