修改界面

master
夜笙歌 5 months ago
parent cd90ec25ab
commit 433df36af4

@ -312,6 +312,7 @@ export default {
data() { data() {
return { return {
containerPic, containerPic,
isTown:false,
value: [], value: [],
loading: false, loading: false,
options: [], options: [],
@ -561,7 +562,6 @@ export default {
sortArr = sortArr.sort((a, b) => { sortArr = sortArr.sort((a, b) => {
return new Date(a).getTime() - new Date(b).getTime() return new Date(a).getTime() - new Date(b).getTime()
}) })
console.log(sortArr)
let x = sortArr let x = sortArr
let y = sortArr.map(e => { let y = sortArr.map(e => {
return onlineDevicesTrend[e] return onlineDevicesTrend[e]
@ -627,7 +627,6 @@ export default {
}, },
dispose(e) { dispose(e) {
this.warInfo = e this.warInfo = e
console.log(e)
this.textarea = '' this.textarea = ''
this.isDispose = true this.isDispose = true
this.disposeNo = e.no this.disposeNo = e.no
@ -838,10 +837,14 @@ export default {
}, },
chartClick() { chartClick() {
this.$refs.mapChart.chart.on('click', async (params) => { this.$refs.mapChart.chart.on('click', async (params) => {
this.isTown = (this.cityJson[params.dataIndex].properties.adcode || gsByMap.features[params.dataIndex].properties.unique_id).toString().length === 9
this.code = this.cityJson[params.dataIndex].properties.adcode || this.code || gsByMap.features[params.dataIndex].properties.unique_id this.code = this.cityJson[params.dataIndex].properties.adcode || this.code || gsByMap.features[params.dataIndex].properties.unique_id
let mapData let mapData
if (this.code !== 620400 && this.code.toString().startsWith('6204')) { if (this.code !== 620400 && this.code.toString().startsWith('6204')) {
mapData = {features: gsByMap.features.filter(e => e.properties.pid === this.code.toString())} mapData = {features: gsByMap.features.filter(e => e.properties.pid === this.code.toString())}
if (this.isTown) {
mapData = {features: mapData.features.filter(v => v.properties.name === params.name)}
}
} else { } else {
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`)
mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data.data mapData = this.cityJson[params.dataIndex].properties.adcode === 100000 ? ChinaMapData : data.data
@ -853,7 +856,12 @@ export default {
}); });
}, },
goBack() { goBack() {
if(this.isTown){
this.getMap({features: gsByMap.features.filter(e => e.properties.pid === this.code.toString())})
this.isTown = false
}else{
this.chartDblClick(this.code) this.chartDblClick(this.code)
}
}, },
async chartDblClick(val) { async chartDblClick(val) {
let a = val.toString().substr(0, 2) let a = val.toString().substr(0, 2)
@ -988,7 +996,6 @@ export default {
fillColor: '#1791fc', fillColor: '#1791fc',
// fillColor: val > 0 ? '#ff0000' : '#1791fc', // fillColor: val > 0 ? '#ff0000' : '#1791fc',
}); });
console.log(thisPolygon)
map.add(thisPolygon) map.add(thisPolygon)
map.setFitView(thisPolygon) map.setFitView(thisPolygon)
polygons.push(thisPolygon) polygons.push(thisPolygon)
@ -1048,7 +1055,6 @@ export default {
}) })
} }
}) })
console.log(option)
this.options = option this.options = option
}, },
exTable() { exTable() {
@ -1282,6 +1288,7 @@ export default {
fill: #3D93FD; fill: #3D93FD;
} }
} }
@keyframes an2 { @keyframes an2 {
0% { 0% {
fill: #ff0000; fill: #ff0000;

Loading…
Cancel
Save