Browse Source

地图bug修改

shibei_master
jiangyy 4 years ago
parent
commit
23f192b947
  1. 40
      src/assets/scss/modules/visual/basicInfoMain.scss
  2. 7
      src/views/modules/base/community/buildForm.vue
  3. 8
      src/views/modules/base/community/communityForm.vue
  4. 10
      src/views/modules/visual/basicinfo/basicInfoCommunity.vue
  5. 60
      src/views/modules/visual/basicinfo/basicInfoMain.vue

40
src/assets/scss/modules/visual/basicInfoMain.scss

@ -51,21 +51,35 @@
.div_search {
width: 100%;
height: 56px;
background: #011168;
border-radius: 4px;
text-align: center;
background-color: #011168;
border-radius: 4px 0 0 4px;
border: none;
box-shadow: 0 0 10px inset #1a5afd;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
opacity: 0.7;
display: flex;
justify-content: flex-end;
.icon {
justify-content: space-between;
.div_search_left {
display: flex;
align-items: center;
margin-left: 29px;
margin-top: 16px;
justify-content: flex-start;
.icon {
display: flex;
align-items: center;
margin-left: 29px;
> img {
width: 24px;
height: 24px;
}
}
> img {
width: 24px;
height: 24px;
> span {
line-height: 56px;
margin-left: 10px;
}
}
@ -83,6 +97,10 @@
}
}
.div_search:hover {
cursor: pointer;
}
.div_info {
box-sizing: border-box;
width: 100%;

7
src/views/modules/base/community/buildForm.vue

@ -168,13 +168,16 @@ export default {
this.dataForm.gridId = agencyObj.gridId
this.dataForm.neighborHoodId = agencyObj.id
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.formType = type
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.buildingId = this.dataForm.buildingId
this.buildType = this.dataForm.buildingTypeKey
map.setCenter(new TMap.LatLng(this.dataForm.latitude, this.dataForm.longitude))
this.setMarker(this.dataForm.latitude, this.dataForm.longitude)
} else {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
}

8
src/views/modules/base/community/communityForm.vue

@ -277,14 +277,16 @@ export default {
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
// debugger
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
this.formType = type
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.neighborHoodId = this.dataForm.neighborHoodId
map.setCenter(new TMap.LatLng(this.dataForm.latitude, this.dataForm.longitude))
this.setMarker(this.dataForm.latitude, this.dataForm.longitude)
} else {
map.setCenter(new TMap.LatLng(agencyObj.latitude, agencyObj.longitude))
}

10
src/views/modules/visual/basicinfo/basicInfoCommunity.vue

@ -11,11 +11,11 @@
<el-select v-model="selBuildingId"
:popper-append-to-body="false"
placeholder="请选择">
<el-option v-for="item in buildingArray"
<el-option v-for="(item,index) in buildingArray"
:key="item.buildingId"
:label="item.buildingName"
:value="item.buildingId"
@click="handleClickBuilding(index)">
@click.native="handleClickBuilding(index)">
</el-option>
</el-select>
</div>
@ -393,10 +393,14 @@ export default {
},
//
handleClickBuilding (index) {
async handleClickBuilding (index) {
this.selBuildingId = this.buildingArray[index].buildingId
this.selBuildingName = this.buildingArray[index].buildingName
await this.loadRoom()
this.roomLoaded = true
this.$emit('refreshInfoList', this.selBuildingId, 'building')
},
//

60
src/views/modules/visual/basicinfo/basicInfoMain.vue

@ -38,20 +38,18 @@
</div>
<div class="div_data">
<div class="div_search">
<el-input size="mini"
@focus="handleSearch"
WarningColor='warning'
placeholder="请输入姓名">
<div @click="handleSearch"
class="div_search">
<div class="div_search_left">
<i slot="prefix"
class="icon">
<img src="../../../../assets/img/modules/visual/sousuo.png"
alt />
</i>
</el-input>
<span>请输入姓名</span>
</div>
<div class="btn"
@click="handleSearch">搜索</div>
<div class="btn">搜索</div>
</div>
@ -291,11 +289,12 @@ const vueGis = {
// type:polygon / search people
async toSubAgency (type, e, searchName) {
//neighborHood
console.log(e)
this.runNum++
this.runAgencyArray.push(this.orgData)
//neighborHood
if (type === 'people') {
this.orgLevel = 'people'
this.selUserId = e
this.orgId = ''
@ -307,6 +306,8 @@ const vueGis = {
this.searchName = searchName
} else if (type === 'search') {
this.orgLevel = 'search'
this.orgId = ''
this.orgData = {
@ -320,7 +321,8 @@ const vueGis = {
} else {
this.subAgencyArray.forEach(item => {
if (item.id === e.selected[0].id_) {
if (item.id === e.selected[0].values_.id) {
this.orgId = item.id
this.orgLevel = item.level
this.orgData = item
@ -338,6 +340,7 @@ const vueGis = {
} else {
this.refreshMap(true)
}
}
@ -365,7 +368,6 @@ const vueGis = {
//
handleClickAgency (index) {
const cutNum = this.runAgencyArray.length - index//
this.runNum = this.runNum - cutNum
this.orgData = this.runAgencyArray[index]
@ -379,10 +381,8 @@ const vueGis = {
if (this.orgLevel === 'people') {
} else if (this.orgLevel === 'search') {
this.$nextTick(() => {
this.$refs.ref_search.loadByName(this.searchName);
});
@ -430,7 +430,8 @@ const vueGis = {
//
loadPolygon (subAgencyArray) {
polygonSource.clear()//
polygonSource.clear()//
iconSource.clear()//
let featureData = []//
if (subAgencyArray && subAgencyArray.length > 0) {//
@ -473,9 +474,7 @@ const vueGis = {
oneData.geometry.coordinates.push(polygonArray)
featureData.push(oneData)
}
});
}
if (featureData && featureData.length > 0) {
@ -489,6 +488,7 @@ const vueGis = {
let iconFeatures = [];
feature.forEach(oneIcon => {
var extent = boundingExtent(oneIcon.getGeometry().getCoordinates()[0]); //[minx,miny,maxx,maxy]
// var center = getCenter(extent); //
//
@ -497,19 +497,17 @@ const vueGis = {
let oneArray = [x, y]
this.iconCoordinators.push(oneArray)
// debugger
//
let oneCctv = new Feature({
geometry: new Point([x, y]),
id: oneIcon.id,
id: oneIcon.id_,
properties: {
type: "icon",
id: oneIcon.id
id: oneIcon.id_
}
});
console.log(oneIcon.values_)
let iconStyle = new Style({
image: new Icon({
// anchor: [0.5, 0.5],
@ -525,9 +523,7 @@ const vueGis = {
iconFeatures.push(oneCctv);
});
console.log(iconFeatures)
iconSource.clear(); //cctyv
iconSource.addFeatures(iconFeatures);
}
@ -591,7 +587,7 @@ const vueGis = {
})
map.on('singleclick', function (e) {
console.log(e.coordinate)
// console.log(e.coordinate)
// console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326'));
})
@ -745,19 +741,7 @@ export default vueGis;
.ol-overlaycontainer-stopevent {
display: none;
}
.el-input__inner[WarningColor="warning"] {
background-color: #011168;
border-radius: 4px 0 0 4px;
height: 56px;
border: none;
box-shadow: 0 0 10px inset #1a5afd;
padding-left: 70px;
font-size: 18px;
font-family: PingFang SC;
font-weight: 400;
color: #ffffff;
opacity: 0.7;
}
.el-scrollbar__wrap {
overflow-x: hidden !important;
}

Loading…
Cancel
Save