Browse Source

地图

shibei_master
13176889840 3 years ago
parent
commit
a4f32ac3c1
  1. 60
      src/views/modules/visual/communityParty/community.vue
  2. 6
      src/views/modules/visual/communityParty/unitInfo.vue
  3. 10
      src/views/modules/visual/components/screen-map/index.vue

60
src/views/modules/visual/communityParty/community.vue

@ -216,7 +216,7 @@ export default {
headerTypeList: [ headerTypeList: [
{ title: "序号", coulmn: 'index' }, { title: "序号", coulmn: 'index' },
{ title: "单位名称", coulmn: 'unitName' }, { title: "单位名称", coulmn: 'unitName' },
{ title: "单位类型", coulmn: 'type' }, { title: "单位类型", coulmn: 'typeName' },
], ],
headerStyle: [ headerStyle: [
{ {
@ -290,14 +290,15 @@ export default {
await nextTick(100); await nextTick(100);
await this.getAgencyList() await this.getAgencyList()
await this.loadOrgData() await this.loadOrgData()
await this.getCateType(this.agencyId)
this.loadUnit() this.loadUnit()
this.getList(this.agencyId) this.getList(this.agencyId)
this.getUnitList(this.agencyId) this.getUnitList(this.agencyId)
this.getCateCount(this.agencyId) this.getCateCount(this.agencyId)
this.getCateType(this.agencyId)
await this.getWorkUserInfo() await this.getWorkUserInfo()
await this.getMapUnitList(this.agencyId) // await this.getMapUnitList(this.agencyId)
}, },
watch: { watch: {
timeRange (val) { timeRange (val) {
@ -490,6 +491,12 @@ export default {
index: index + 1 index: index + 1
} }
}) })
const url = require('../../../../assets/img/shuju/measure/other.png')
this.iconUrlArray = [url, url, url, url, url, url, url, url]
//false
this.loadMap()
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }
@ -676,7 +683,7 @@ export default {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
handleCascader (val) { async handleCascader (val) {
console.log('val-vvv', val) console.log('val-vvv', val)
if (val.length > 0) { if (val.length > 0) {
const _arr = val[val.length - 1].split('-') const _arr = val[val.length - 1].split('-')
@ -684,10 +691,11 @@ export default {
this.agencyId = _arr[0] this.agencyId = _arr[0]
this.unitType = '' this.unitType = ''
this.getList(_arr[0]) this.getList(_arr[0])
await this.getCateType(_arr[0])
this.getUnitList(_arr[0]) this.getUnitList(_arr[0])
this.getMapUnitList(_arr[0]) this.getMapUnitList(_arr[0])
this.getCateCount(_arr[0]) this.getCateCount(_arr[0])
this.getCateType(_arr[0])
} }
}, },
@ -818,18 +826,18 @@ export default {
item.urlIndex = 7 item.urlIndex = 7
} }
}); });
const url = require('../../../../assets/img/shuju/measure/other.png')
// this.iconUrlArray = [
this.iconUrlArray = [ // require('../../../../assets/img/shuju/measure/lxdj.png'),//
require('../../../../assets/img/shuju/measure/lxdj.png'),// // require('../../../../assets/img/shuju/measure/lxzz.png'),//
require('../../../../assets/img/shuju/measure/lxzz.png'),// // require('../../../../assets/img/shuju/measure/qydw.png'),//
require('../../../../assets/img/shuju/measure/qydw.png'),// // require('../../../../assets/img/shuju/measure/jgzs.png'),//
require('../../../../assets/img/shuju/measure/jgzs.png'),// // require('../../../../assets/img/shuju/measure/qita.png'),//
require('../../../../assets/img/shuju/measure/qita.png'),// // require('../../../../assets/img/shuju/measure/minban.png'),//
require('../../../../assets/img/shuju/measure/minban.png'),// // require('../../../../assets/img/shuju/measure/jijin.png'),//
require('../../../../assets/img/shuju/measure/jijin.png'),// // require('../../../../assets/img/shuju/measure/other.png')//
require('../../../../assets/img/shuju/measure/other.png')// // ]
] this.iconUrlArray = [url, url, url, url, url, url, url, url]
//false //false
@ -848,22 +856,12 @@ export default {
loadMap () { loadMap () {
if (this.isfirstInit) { if (this.isfirstInit) {
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray //mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
const _arr = [{
"orgId": "6e511da6816e53af4cda952365a26eb9",
"count": 3,
"longitude": 120.361234,
"latitude": 36.094239,
"coordinates": "120.37347632357346,36.09504294565885,120.37521581993865,36.08259177518083,120.38620214806365,36.08240866726736,120.39343481896871,36.08039450117393,120.40158302420245,36.08048605775001,120.40194921907464,36.08240866726736,120.40085059254857,36.08506369796122,120.39947730153294,36.087535620741605,120.39792091831991,36.08973288950982,120.39801245917992,36.09284567689063,120.39892798303121,36.094859837745375,120.39892798303121,36.096782447262726,120.3927939491296,36.0965993419686,120.37347632357346,36.09504294565885",
"color": "#00E5ED",
"fillColor": "rgba(0, 229, 237, 0.16)"
}]
const polIconUrlArray = [ const polIconUrlArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png', 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png'
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a775d15e62374350b80e5cdf1912a4eb.png',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/884efcf6d6b44224a7fda599dd1b14cb.png'
] ]
console.log('this.unitTableData', this.unitTableData)
this.$refs.map.loadMap(this.agencyInfo, this.parentPolygon, polIconUrlArray, this.unitMapList, this.iconUrlArray, null) this.$refs.map.loadMap(this.agencyInfo, this.parentPolygon, polIconUrlArray, this.unitTableData, this.iconUrlArray, null)
} else { } else {
this.$refs.map.refreshMap(null, this.unitMapList) this.$refs.map.refreshMap(null, this.unitMapList)

6
src/views/modules/visual/communityParty/unitInfo.vue

@ -108,9 +108,9 @@ import { requestPost } from "@/js/dai/request";
export default { export default {
name: "dialogInfo", name: "dialogInfo",
props: { props: {
userId: { list: {
type: String, type: Array,
default: "", default: () => [],
}, },
gridName: { gridName: {
type: String, type: String,

10
src/views/modules/visual/components/screen-map/index.vue

@ -251,7 +251,6 @@ const vueGis = {
this.addOverlay() this.addOverlay()
} }
console.log('showPolIconLayer-----------------------', this.showPolIconLayer)
this.addMapClick() this.addMapClick()
}, },
@ -362,7 +361,7 @@ const vueGis = {
id: oneIcon.id_ id: oneIcon.id_
} }
}); });
console.log('oneIcon----', oneIcon) // console.log('oneIcon----', oneIcon)
let polyIconStyle = new Style({ let polyIconStyle = new Style({
image: new Icon({ image: new Icon({
// anchor: [0.5, 0.5], // anchor: [0.5, 0.5],
@ -383,7 +382,6 @@ const vueGis = {
//icon //icon
loadIcon () { loadIcon () {
iconSource.clear()// iconSource.clear()//
if (this.iconArrays && this.iconArrays.length > 0) { if (this.iconArrays && this.iconArrays.length > 0) {
let iconFeatures = []; let iconFeatures = [];
@ -399,13 +397,13 @@ const vueGis = {
info: { ...oneIcon } info: { ...oneIcon }
} }
}); });
console.log('oneIcon-----ttt', oneIcon)
let iconStyle = new Style({ let iconStyle = new Style({
image: new Icon({ image: new Icon({
// anchor: [0.5, 0.5], // anchor: [0.5, 0.5],
// imgSize: [32, 32], // imgSize: [32, 32],
// scale: 0.5, // scale: 0.5,
src: this.iconUrlArray[oneIcon.urlIndex] src: oneIcon.urlIndex && this.iconUrlArray[oneIcon.urlIndex] || this.iconUrlArray[0]
}), }),
// text: createTextStyle(oneIcon) // text: createTextStyle(oneIcon)
}); });
@ -591,7 +589,7 @@ const vueGis = {
//icon //icon
initIconLayer () { initIconLayer () {
console.log('initttttt-----icon')
iconSource = new VectorSource({ iconSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject) //features: (new GeoJSON()).readFeatures(geojsonObject)
}); });

Loading…
Cancel
Save