提交 93b2dc8b authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 删除行政区划代码前端缓存

上级 3ace9e6d
...@@ -68,7 +68,7 @@ public class MapUtils { ...@@ -68,7 +68,7 @@ public class MapUtils {
AreaEntity china = root(); AreaEntity china = root();
maps.parallelStream().forEach(map -> { maps.stream().forEach(map -> {
// maps.stream().forEach(map -> { // maps.stream().forEach(map -> {
String province_code = map.get(Constants.PROVINCE_CODE).toString(); String province_code = map.get(Constants.PROVINCE_CODE).toString();
String city_code = map.get(Constants.CITY_CODE).toString(); String city_code = map.get(Constants.CITY_CODE).toString();
......
...@@ -128,6 +128,9 @@ export default { ...@@ -128,6 +128,9 @@ export default {
console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo)) console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo))
return trackMenuInfo return trackMenuInfo
}, },
chartType() {
return this.chart.type
},
...mapState([ ...mapState([
'canvasStyleData', 'canvasStyleData',
'nowPanelTrackInfo' 'nowPanelTrackInfo'
...@@ -174,6 +177,11 @@ export default { ...@@ -174,6 +177,11 @@ export default {
if (val1 > 0) { if (val1 > 0) {
this.getData(this.element.propValue.viewId) this.getData(this.element.propValue.viewId)
} }
},
'chartType': function(newVal, oldVal) {
if (newVal === 'map' && newVal !== oldVal) {
this.initAreas()
}
} }
}, },
...@@ -181,7 +189,7 @@ export default { ...@@ -181,7 +189,7 @@ export default {
this.refId = uuid.v1 this.refId = uuid.v1
// this.filter.filter = this.$store.getters.conditions // this.filter.filter = this.$store.getters.conditions
this.getData(this.element.propValue.viewId) this.getData(this.element.propValue.viewId)
this.initAreas() // this.initAreas()
}, },
mounted() { mounted() {
}, },
...@@ -349,14 +357,14 @@ export default { ...@@ -349,14 +357,14 @@ export default {
} }
}, },
initAreas() { initAreas() {
let mapping // let mapping
if ((mapping = localStorage.getItem('areaMapping')) !== null) { // if ((mapping = localStorage.getItem('areaMapping')) !== null) {
this.places = JSON.parse(mapping) // this.places = JSON.parse(mapping)
return // return
} // }
Object.keys(this.places).length === 0 && areaMapping().then(res => { Object.keys(this.places).length === 0 && areaMapping().then(res => {
this.places = res.data this.places = res.data
localStorage.setItem('areaMapping', JSON.stringify(res.data)) // localStorage.setItem('areaMapping', JSON.stringify(res.data))
}) })
}, },
doMapLink(linkFilters) { doMapLink(linkFilters) {
......
...@@ -711,7 +711,8 @@ export default { ...@@ -711,7 +711,8 @@ export default {
}, },
moveId: -1, moveId: -1,
chart: { chart: {
id: 'echart' id: 'echart',
type: null
}, },
dimensionFilterEdit: false, dimensionFilterEdit: false,
dimensionItem: {}, dimensionItem: {},
...@@ -754,6 +755,9 @@ export default { ...@@ -754,6 +755,9 @@ export default {
// this.getData(this.$store.state.chart.viewId) // this.getData(this.$store.state.chart.viewId)
// return this.$store.state.chart.viewId // return this.$store.state.chart.viewId
// } // }
chartType() {
return this.chart.type
}
}, },
watch: { watch: {
'param': function() { 'param': function() {
...@@ -766,11 +770,16 @@ export default { ...@@ -766,11 +770,16 @@ export default {
}, },
searchField(val) { searchField(val) {
this.fieldFilter(val) this.fieldFilter(val)
},
'chartType': function(newVal, oldVal) {
if (newVal === 'map' && newVal !== oldVal) {
this.initAreas()
}
} }
}, },
created() { created() {
// this.get(this.$store.state.chart.viewId); // this.get(this.$store.state.chart.viewId);
this.initAreas() // this.initAreas()
}, },
mounted() { mounted() {
// this.get(this.$store.state.chart.viewId); // this.get(this.$store.state.chart.viewId);
...@@ -1327,14 +1336,14 @@ export default { ...@@ -1327,14 +1336,14 @@ export default {
}, },
initAreas() { initAreas() {
let mapping // let mapping
if ((mapping = localStorage.getItem('areaMapping')) !== null) { // if ((mapping = localStorage.getItem('areaMapping')) !== null) {
this.places = JSON.parse(mapping) // this.places = JSON.parse(mapping)
return // return
} // }
Object.keys(this.places).length === 0 && areaMapping().then(res => { Object.keys(this.places).length === 0 && areaMapping().then(res => {
this.places = res.data this.places = res.data
localStorage.setItem('areaMapping', JSON.stringify(res.data)) // localStorage.setItem('areaMapping', JSON.stringify(res.data))
}) })
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论