Browse Source

地图配置修改

shibei_master
jiangyy 4 years ago
parent
commit
b9c66c29a3
  1. 46
      src/views/modules/workSys/mapConfig.vue

46
src/views/modules/workSys/mapConfig.vue

@ -4,7 +4,7 @@
<div class="div_search">
<el-select v-model="selAgencyId"
placeholder="无下级组织">
placeholder="请选择或点击区域选择">
<el-option @click.native="orgChange(index)"
v-for="(item,index) in subAgencyArray"
:key="item.id"
@ -12,7 +12,7 @@
:value="item.id">
</el-option>
</el-select>
<div v-if="subAgencyArray.length>0">
<div v-if="selAgencyId && subAgencyArray.length>0">
<el-button v-if="showBtn&&!hasPolygon"
style="margin-left:10px"
type="primary"
@ -198,7 +198,7 @@ const vueGis = {
await this.loadOrgData()
//
await this.loadPolygon(this.subAgencyArray)
this.loadPolygon(this.subAgencyArray)
//
if (isRefreshView) {
@ -210,7 +210,7 @@ const vueGis = {
//
handleBack () {
this.selAgencyId = ''
this.runNum--
this.runAgency.pop()
if (this.runNum === 0) {
@ -241,14 +241,15 @@ const vueGis = {
this.subAgencyArray = []
if (this.runNum === 0) {//
this.subAgencyArray.push(data)
this.selAgencyId = data.id
// this.selAgencyId = data.id
} else {
if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children
this.selAgencyId = this.subAgencyArray[0].id
// this.selAgencyId = this.subAgencyArray[0].id
} else {
this.subAgencyArray = []
this.selAgencyId = ''
// this.selAgencyId = ''
}
}
@ -300,9 +301,7 @@ const vueGis = {
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
});
}
if (featureData && featureData.length > 0) {
@ -320,23 +319,26 @@ const vueGis = {
//feature
selectFeature (e) {
if (this.method === undefined || this.method === '') {
this.selAgencyId = e.selected[0].id_
this.subAgencyArray.forEach((element, index) => {
if (element.id === e.selected[0].id_) {
this.selAgencyIndex = index
this.orgChange(index)
}
if (e.selected.length > 0) {
console.log("selectFeature22222222222222222222222")
if (this.method === undefined || this.method === '') {
this.selAgencyId = e.selected[0].id_
this.subAgencyArray.forEach((element, index) => {
if (element.id === e.selected[0].id_) {
this.selAgencyIndex = index
this.orgChange(index)
}
});
});
}
}
},
//
toSubAgency (e) {
if (this.method != 'mAddPolygon' && this.level != 'neighborHood') {
this.selAgencyId = ''
//
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
@ -359,10 +361,12 @@ const vueGis = {
//
highlightPolygon () {
let features = polygonSource.getFeatures()
features.forEach(element => {
if (element.id_ === this.selAgencyId) {
selectedFeatures.push(element)
}
});
@ -383,11 +387,11 @@ const vueGis = {
//
setZoom (agencyLevel) {
if (agencyLevel === 'district') {
this.zoom = 14
this.zoom = 13
} else if (agencyLevel === 'street') {
this.zoom = 15
this.zoom = 14
} else if (agencyLevel === 'community') {
this.zoom = 16
this.zoom = 15
}
},

Loading…
Cancel
Save