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

Loading…
Cancel
Save