Browse Source

地图优化

master
mk 2 years ago
parent
commit
7ffff53e6c
  1. 102
      src/views/screenCenter/screenCenter.vue

102
src/views/screenCenter/screenCenter.vue

@ -102,15 +102,16 @@
<div class="tabs">
<div :class="['item', { 'item-active': active === 'all' }]" @click="handleClickTabs('all')">全部</div>
<!-- -->
<div :class="['item', { 'item-active': active === 'dy' }]" @click="handleClickTabs('dy')" >
党员{{ dyTotal ||0 }}</div>
<div :class="['item', { 'item-active': active === 'gyg' }]" @click="handleClickTabs('gyg')" >公益岗0
<div :class="['item', { 'item-active': active === 'dy' }]" @click="handleClickTabs('dy')">
党员{{ dyTotal || 0 }}</div>
<div :class="['item', { 'item-active': active === 'gyg' }]" @click="handleClickTabs('gyg')">公益岗0
</div>
<div :class="['item', { 'item-active': active === 'xfdw' }]" @click="handleClickTabs('xfdw')" >先锋队伍0
<div :class="['item', { 'item-active': active === 'xfdw' }]" @click="handleClickTabs('xfdw')">先锋队伍0
</div>
<div :class="['item', { 'item-active': active === 'hshhr' }]" @click="handleClickTabs('hshhr')" >红色合伙人0
<div :class="['item', { 'item-active': active === 'hshhr' }]" @click="handleClickTabs('hshhr')">
红色合伙人0
</div>
</div>
@ -300,7 +301,7 @@ export default {
showHouseTable: false,
houseList: [],
active: 'all',
dyTotal:0
dyTotal: 0
}
},
mounted() {
@ -360,13 +361,13 @@ export default {
},
},
methods: {
handleClickTabs(val){
handleClickTabs(val) {
this.active = val
if(val == 'all' || val == 'dy'){
this.getScreenUserList()
if (val == 'all' || val == 'dy') {
this.getScreenUserList()
}else{
this.resiList = []
} else {
this.resiList = []
}
},
@ -381,8 +382,6 @@ export default {
}
if (dotLayer) {
scene.removeLayer(dotLayer);
} if (dotLayerBto) {
scene.removeLayer(dotLayerBto);
}
this.buttonIndex = value
if (value == 1) {
@ -411,7 +410,7 @@ export default {
fontWeight: '500',
stroke: "#000",
textOffset: this.buttonIndex === 3 ? [10, 60] : [-30, 60],
raisingHeight: 700,
raisingHeight: 300,
heightfixed: true,
textAnchor: "center-left",
});
@ -425,7 +424,7 @@ export default {
.size(100)
.style({
layerType: "fillImage",
raisingHeight: 700,
raisingHeight: 300,
heightfixed: true
});
scene.addLayer(dotLayer);
@ -502,7 +501,7 @@ export default {
level: this.level == 'street' ? 'community' : this.level == 'community' ? 'grid' : 'street',
pageSize: this.pageSize,
pageNo: this.pageNo,
dangyuan:'1'
dangyuan: '1'
}
console.log(params);
const { data, msg, code } = await getScreenUserList(params)
@ -518,7 +517,7 @@ export default {
level: this.level == 'street' ? 'community' : this.level == 'community' ? 'grid' : 'street',
pageSize: this.pageSize,
pageNo: this.pageNo,
dangyuan:this.active == 'dy'?'1':''
dangyuan: this.active == 'dy' ? '1' : ''
}
console.log(params);
const { data, msg, code } = await getScreenUserList(params)
@ -617,6 +616,7 @@ export default {
features: data,
}
if (this.level) {
// this.selAgency
obj.features.forEach(f => {
f.type = 'Feature';
f.properties = {};
@ -657,6 +657,8 @@ export default {
delete f.count;
});
}
console.log(obj,'居民点位数据伪装转');
this.initDot(obj)
} else {
console.log(msg);
@ -664,10 +666,13 @@ export default {
},
getDangzhibuDot() {
console.log(this.selAgency);
if( this.selAgency[0].type != 'grid'){
return
}
const selAgency = JSON.parse(JSON.stringify(this.selAgency));
let obj = {
type: 'FeatureCollection',
features: this.selAgency,
features:selAgency,
}
obj.features.forEach(f => {
f.type = 'Feature';
@ -679,10 +684,11 @@ export default {
f.properties.count = `${f.subName}党支部`;
f.geometry.type = "Point";
f.geometry.coordinates = [...JSON.parse(f.subCenterMark)[0]];
delete f.agencyName;
delete f.agencyId;
delete f.count;
delete f.subAreaMarks;
delete f.subCenterMark;
delete f.agencyLevel;
delete f.subId;
delete f.subName;
});
this.initDot(obj)
},
@ -740,7 +746,7 @@ export default {
logoVisible: false,
map: myMap,
});
scene.on("loaded", () => {
scene.on("loaded", () => {
this.iniMapGrid(shibeiJson);
});
},
@ -837,7 +843,6 @@ export default {
scene.addLayer(textLayer);
let _this = this
polygonLayer.on("click", (e) => {
console.log(e);
if (e.feature.properties.name.indexOf("党工委") != -1) {
_this.level = e.feature.properties.level
_this.agencyId = e.feature.properties.adcode
@ -866,7 +871,17 @@ export default {
if (dotLayerBto) {
scene.removeLayer(dotLayerBto);
}
this.getBoundary(e.feature.properties.adcode || e.feature.properties.subId)
if (_this.buttonIndex == 1) {
_this.getScreenUserStatistics()
} else if (_this.buttonIndex == 2) {
_this.getScreenHouseStatistics()
} else if (_this.buttonIndex == 3 && _this.level == 'community') {
setTimeout(()=> {
_this.getDangzhibuDot()
}, 500)
}
});
// posLayer.on("click", (e) => {
// console.log(e);
@ -922,10 +937,10 @@ export default {
delete f.subId
delete f.subName
})
this.iniMapGrid(obj)
this.iniMapGrid(obj)
if(this.level == 'community'){
}
if (this.level == 'community') {
}
}).catch(f => {
console.log(f);
})
@ -941,7 +956,7 @@ export default {
},
async getSearchByGridId(id) {
let params = {
gridId:id// "1224135071215190018",
gridId: id// "1224135071215190018",
}
const { data, msg, code } = await getSearchByGridId(params)
if (code == 0) {
@ -1132,22 +1147,27 @@ export default {
white-space: nowrap;
width: 539px;
height: 49px;
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
height: 2px;
/*滚动条整体样式*/
width: 6px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 2px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%);
border-radius: 3px;
/*滚动条里面小方块*/
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%);
border-radius: 3px;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #428ba2;
border-radius: 3px;
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #428ba2;
border-radius: 3px;
}
.item {
display: inline-block;
color: #fff;
@ -1168,6 +1188,4 @@ export default {
font-weight: 400;
}
}
</style>
}</style>
Loading…
Cancel
Save