|
|
@@ -101,7 +101,7 @@ export default {
|
|
|
})
|
|
|
this.$globalEventBus.$on('closePlanDialog', (data) => {
|
|
|
this.checkedNodes = []
|
|
|
- const ids = data.map(item=>item.id);
|
|
|
+ const ids = data.map((item) => item.id)
|
|
|
this.cancelCheckNode(ids)
|
|
|
})
|
|
|
},
|
|
|
@@ -118,27 +118,27 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
//关闭防汛预案弹窗后取消选中
|
|
|
- cancelCheckNode(ids) {
|
|
|
- const currentCheckedKeys = this.$refs.treeRef.getCheckedKeys(true);
|
|
|
- const newArray= currentCheckedKeys.filter(item=> !ids.includes(item))
|
|
|
- this.$refs.treeRef.setCheckedKeys(newArray);
|
|
|
- },
|
|
|
+ cancelCheckNode(ids) {
|
|
|
+ const currentCheckedKeys = this.$refs.treeRef.getCheckedKeys(true)
|
|
|
+ const newArray = currentCheckedKeys.filter((item) => !ids.includes(item))
|
|
|
+ this.$refs.treeRef.setCheckedKeys(newArray)
|
|
|
+ },
|
|
|
onExpandChange() {
|
|
|
this.isExpanded = !this.isExpanded
|
|
|
},
|
|
|
|
|
|
- async onCheckChange(node, checked,) {
|
|
|
+ async onCheckChange(node, checked) {
|
|
|
const checkedNodes = this.$refs.treeRef.getCheckedNodes()
|
|
|
this.checkedNodes = []
|
|
|
- checkedNodes.map((item)=>{
|
|
|
- if(item.type && item.type == 'plan' && !item.children){
|
|
|
+ checkedNodes.map((item) => {
|
|
|
+ if (item.type && item.type == 'plan' && !item.children) {
|
|
|
this.checkedNodes.push(item)
|
|
|
}
|
|
|
})
|
|
|
const id = node.id
|
|
|
if (checked) {
|
|
|
if (node.type && node.type == 'plan') {
|
|
|
- this.$globalEventBus.$emit('showPlanDialog',{list:this.checkedNodes})
|
|
|
+ this.$globalEventBus.$emit('showPlanDialog', { list: this.checkedNodes })
|
|
|
} else {
|
|
|
if (!node.meta?.url) {
|
|
|
return
|
|
|
@@ -158,7 +158,8 @@ export default {
|
|
|
url: node.meta.url,
|
|
|
crs: 'EPSG:4326',
|
|
|
clampToGround: true,
|
|
|
- symbol: this.getStyleByName(node.label)
|
|
|
+ symbol: this.getStyleByName(node.label),
|
|
|
+ flyTo: true
|
|
|
})
|
|
|
window.map.addLayer(layer)
|
|
|
this.bindEvent(layer)
|
|
|
@@ -177,7 +178,7 @@ export default {
|
|
|
} else {
|
|
|
// 取消勾选 -> 销毁
|
|
|
if (node.type && node.type == 'plan') {
|
|
|
- this.$globalEventBus.$emit('showPlanDialog',{list:this.checkedNodes})
|
|
|
+ this.$globalEventBus.$emit('showPlanDialog', { list: this.checkedNodes })
|
|
|
} else {
|
|
|
if (layerCache[id]) {
|
|
|
window.map.removeLayer(layerCache[id])
|
|
|
@@ -209,6 +210,20 @@ export default {
|
|
|
distanceDisplayCondition: new this.Cesium.DistanceDisplayCondition(0.0, 500000) // 按视距显示
|
|
|
}
|
|
|
}
|
|
|
+ } else if (name.indexOf('采砂区') > -1) {
|
|
|
+ return {
|
|
|
+ type: 'polygon',
|
|
|
+ styleOptions: {
|
|
|
+ materialType: this.mars3d.MaterialType.Grid,
|
|
|
+ materialOptions: {
|
|
|
+ color: '#cc9648',
|
|
|
+ cellAlpha: 0.5
|
|
|
+ },
|
|
|
+ outline: true,
|
|
|
+ outlineWidth: 1,
|
|
|
+ outlineColor: '#cc9648'
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 处理水文站数据
|
|
|
@@ -233,7 +248,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- destroyed(){
|
|
|
+ destroyed() {
|
|
|
this.$globalEventBus.$off('closePlanDialog')
|
|
|
}
|
|
|
}
|