Browse Source

Merge branch 'dev_pli_power_axis'

shibei_master
YUJT 3 years ago
parent
commit
81320367a9
  1. 50
      src/views/modules/visual/plugin/power/components/screen-org-map.vue
  2. 3
      src/views/modules/visual/plugin/power/components/screen-org-tree.vue
  3. 5
      src/views/modules/visual/plugin/power/organization.vue

50
src/views/modules/visual/plugin/power/components/screen-org-map.vue

@ -35,16 +35,14 @@ let markerLayer
let parentLayer;//
let parentSource;//
let parentPolygon = []
let subAgencyArray = []
// let coordinates = "120.37330480288234,36.09522923236327,120.37414203308269,36.08471360544846,120.37538113592544,36.08156561138691,120.37856261681883,36.08273773673343,120.380806397435,36.082838206810294,120.38244737292013,36.082804716145915,120.3844902172151,36.082804716145915,120.38552838373664,36.08277122739781,120.38991547489212,36.08166608146377,120.39209227801209,36.08099629692024,120.3958095865403,36.080192555468,120.39912502242612,36.080192555468,120.40110089305742,36.08025953296422,120.40197160817334,36.082369356671684,120.4011678667211,36.08457964662348,120.40006272270334,36.08665598158284,120.3979863858277,36.08889976219901,120.39751753952164,36.09037329011105,120.39785243083527,36.09161239295379,120.3990245561818,36.09419106584173,120.39775196842349,36.09573157124999,120.3975845208504,36.09646833520601,120.37330480288234,36.09522923236327"
let polygonSource;//
let iconSource; // icon
let polygonLayer;//
let select;//
let iconLayer; // icon
let iconCoordinators = []
var centerPointGlobal = [120.38945519, 36.0722275]
const iconArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png',
@ -126,9 +124,13 @@ export default {
name: "screen-org-map",
data() {
return {
centerPoint: [120.38945519, 36.0722275], //
zoom: 15, // 14
centerPoint: [], //
zoom: 14, // 14
minZoom: 1, //
orgData: {},//
iconCoordinators: [],
parentPolygon: [],
subAgencyArray: []
}
},
async mounted() {
@ -149,6 +151,8 @@ export default {
},
methods: {
initMap () {
this.firstCenterMap()
gaodeMapLayer = new TileLayer({
title: "地图",
source: new XYZ({
@ -175,6 +179,16 @@ export default {
// console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326'));
})
},
firstCenterMap () {
this.centerPoint = []
if (this.orgData.longitude && this.orgData.latitude) {
this.centerPoint.push(this.orgData.longitude)
this.centerPoint.push(this.orgData.latitude)
} else {
this.centerPoint = centerPointGlobal
}
},
addMarker (list, icon=iconArray[0], scale=1) {
markerSource = new VectorSource({
// features: new GeoJSON().readFeatures(geojsonObject)
@ -244,15 +258,15 @@ export default {
if (code === 0) {
// this.orgData = data
this.orgData = data
// this.orgId = this.orgData.id
// this.orgLevel = this.orgData.level
parentPolygon = []
parentPolygon.push(data)
this.parentPolygon = []
this.parentPolygon.push(data)
if (data.children && data.children.length > 0) {
subAgencyArray = data.children
this.subAgencyArray = data.children
} else {
subAgencyArray = []
this.subAgencyArray = []
}
} else {
@ -265,10 +279,10 @@ export default {
parentSource.clear()//
let featureData = []//
if (parentPolygon && parentPolygon.length > 0) {//
if (this.parentPolygon && this.parentPolygon.length > 0) {//
let oneData = {}
parentPolygon.forEach(agencyItem => {
this.parentPolygon.forEach(agencyItem => {
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
oneData = {
@ -320,12 +334,12 @@ export default {
loadPolygon () {
let featureData = []//
if (subAgencyArray && subAgencyArray.length > 0) {//
if (this.subAgencyArray && this.subAgencyArray.length > 0) {//
let oneData = {}
let count = 0
for (let i = 0; i < subAgencyArray.length; i++) {
const agencyItem = subAgencyArray[i]
for (let i = 0; i < this.subAgencyArray.length; i++) {
const agencyItem = this.subAgencyArray[i]
if (agencyItem.coordinates && agencyItem.coordinates !== '') {//
@ -384,7 +398,7 @@ export default {
let y = (parseFloat(extent[1]) + parseFloat(extent[3])) / 2
let oneArray = [x, y]
iconCoordinators.push(oneArray)
this.iconCoordinators.push(oneArray)
// debugger
//icon
let oneCctv = new Feature({

3
src/views/modules/visual/plugin/power/components/screen-org-tree.vue

@ -249,6 +249,9 @@ export default {
.screen-org-tree {
width: 100%;
height: 100%;
.level-row{
overflow: auto;
}
.level-1-row {
width: 100%;
display: flex;

5
src/views/modules/visual/plugin/power/organization.vue

@ -170,7 +170,7 @@ export default {
// this.agencyId = user.agencyId
// console.log('agencyId-------', this.agencyId)
// this.agencyId = '50140d770c578100328792121aa7b3c5'
this.axisStructId = '1518062548749725697'
// this.axisStructId = '1518062548749725697'
await nextTick(100)
await this.getAgencylist()//
await this.getStructTree()
@ -179,6 +179,7 @@ export default {
},
methods: {
onClickNode (e) {
this.pageNo = 1
this.axisStructId = e.id
this.getList()
},
@ -465,6 +466,7 @@ export default {
position: relative;
flex: 1;
height: 100%;
width: 50%;
&-top {
width: 100%;
height: 550px;
@ -510,6 +512,7 @@ export default {
position: relative;
flex: 1;
height: 100%;
width: 50%;
&-top {
width: 100%;
height: 100px;

Loading…
Cancel
Save