|
|
@ -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 |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|