Browse Source

优化

master
blank 2 years ago
parent
commit
1fe574efac
  1. 17
      src/views/index.vue

17
src/views/index.vue

@ -111,10 +111,10 @@ export default { @@ -111,10 +111,10 @@ export default {
level: {},
status: [],
dist: {
stnms: ['鄞州公园', '横溪镇-上'],
stnms: [],
values: [
{ isLive: '在线', value: [1, 2]},
{ isLive: '离线', value: [1, 1]}
{ isLive: '离线', value: []}
]
},
@ -163,7 +163,6 @@ export default { @@ -163,7 +163,6 @@ export default {
.then(e => e.json())
.then(e => {
this.station = e
console.log(this.station)
e.forEach(station => {
if(this.showLevel.some(item => item.id == station.id)) return
this.showLevel.push({
@ -180,7 +179,6 @@ export default { @@ -180,7 +179,6 @@ export default {
.then(e => e.json())
.then(e => {
this.level = e.data
this.dist.stnms = e.data.stnms
this.setLine()
})
.catch(e => { console.error(e) })
@ -196,19 +194,20 @@ export default { @@ -196,19 +194,20 @@ export default {
.then(e => {
this.status = e.data
this.setPie()
this.setDist()
})
.catch(e => { console.error(e) })
//
fetch(this.api + 'count')
.then(e => e.json())
.then(e => {
console.log(e)
this.dist.stnms = e.data.stnms
this.dist.values[0].value = e.data.zx
this.dist.values[1].value = e.data.lx
this.setDist()
})
.catch(e => { console.log(e) })
.catch(e => { console.error(e) })
return this.getList
},
//
setTime() {
var t = null;

Loading…
Cancel
Save