Browse Source

优化

master
blank 10 months ago
parent
commit
df7bf2e0fa
  1. 17
      src/views/index.vue

17
src/views/index.vue

@ -653,19 +653,22 @@ export default {
}, },
// //
toggle(e) { async toggle(e) {
let showMem = this.showLevel.filter(item => item.flag) let showMem = this.showLevel.filter(item => item.flag)
if(!e.flag && showMem > 4) return if(!e.flag && showMem > 4) return
e.flag = !e.flag e.flag = !e.flag
showMem = this.showLevel.filter(item => item.flag) showMem = this.showLevel.filter(item => item.flag)
let id = showMem.length? showMem.map(item => item.id).join(): this.showLevel[0].id let id = showMem.length? showMem.map(item => item.id).join(): this.showLevel[0].id
fetch(this.api + 'waterLevelTrend?ids=' + id) // fetch(this.api + 'waterLevelTrend?ids=' + id)
.then(e => e.json()) // .then(e => e.json())
.then(e => { // .then(e => {
this.level = e.data // this.level = e.data
// this.setLine()
// })
// .catch(e => { console.error(e) })
let res = await this.$axiosGet('/api/daping/station/waterLevelTrend?ids='+id);
this.level = res.data
this.setLine() this.setLine()
})
.catch(e => { console.error(e) })
} }
} }
}; };

Loading…
Cancel
Save