|
|
|
@ -653,19 +653,22 @@ export default {
@@ -653,19 +653,22 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 更改显示水位数据 |
|
|
|
|
toggle(e) { |
|
|
|
|
async toggle(e) { |
|
|
|
|
let showMem = this.showLevel.filter(item => item.flag) |
|
|
|
|
if(!e.flag && showMem > 4) return |
|
|
|
|
e.flag = !e.flag |
|
|
|
|
showMem = this.showLevel.filter(item => item.flag) |
|
|
|
|
let id = showMem.length? showMem.map(item => item.id).join(): this.showLevel[0].id |
|
|
|
|
fetch(this.api + 'waterLevelTrend?ids=' + id) |
|
|
|
|
.then(e => e.json()) |
|
|
|
|
.then(e => { |
|
|
|
|
this.level = e.data |
|
|
|
|
// fetch(this.api + 'waterLevelTrend?ids=' + id) |
|
|
|
|
// .then(e => e.json()) |
|
|
|
|
// .then(e => { |
|
|
|
|
// 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() |
|
|
|
|
}) |
|
|
|
|
.catch(e => { console.error(e) }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|