From 3bef9ab3ef67b6f8b5b70b63100d3d61f32e5cde Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 26 Jan 2022 08:52:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visual/basicinfo/basicInfoMain.vue | 106 +++++++++++++----- 1 file changed, 79 insertions(+), 27 deletions(-) diff --git a/src/views/modules/visual/basicinfo/basicInfoMain.vue b/src/views/modules/visual/basicinfo/basicInfoMain.vue index fd637b06..48084fde 100644 --- a/src/views/modules/visual/basicinfo/basicInfoMain.vue +++ b/src/views/modules/visual/basicinfo/basicInfoMain.vue @@ -246,6 +246,7 @@ const vueGis = { zoom: null, parentPolygon: [], + centerFlag: 'point',//定义中心点的flag point点 fit 自适应 } }, @@ -266,7 +267,7 @@ const vueGis = { //加载当前园区的标注 this.loadPolygon(this.subAgencyArray) - + this.setMapLocation() await this.loadList() }, @@ -366,6 +367,7 @@ const vueGis = { this.orgData.zoom = map.getView().getZoom() console.log('center', map.getView().getCenter()) console.log('zoom', map.getView().getZoom()) + this.runAgencyArray.push(this.orgData) this.subAgencyArray.forEach(item => { @@ -396,20 +398,73 @@ const vueGis = { //加载组织数据 await this.loadOrgData() + + //绘制父级组织数据 this.loadParentPolygon() + //绘制本级组织数据 + this.loadPolygon(this.subAgencyArray) - //加载当前园区的标注 - await this.loadPolygon(this.subAgencyArray) + //重置地图中心点 - // //重置地图中心点 // if (isRefreshView) { - // this.setMapLocation() - // mapView.setCenter(this.centerPoint); - // mapView.setZoom(this.zoom); + this.setMapLocation() + // } await this.loadList() + }, + + //设置地图定位的中心点和缩放级别 + setMapLocation () { + if (!this.zoom) { + this.setZoom(this.orgData.agencyLevel) + } + this.centerPoint = [] + + + //如果存在中心点(返回时赋值) + if (this.center && this.center.length > 0) { + this.centerPoint = this.center + this.centerFlag = 'point' + this.center = [] + + } else if (polygonLayer.getSource().getFeatures()[0]) {//如果是初次进入,存在下级组织 + this.centerFlag = 'flag_polygon' + + } else if (parentLayer.getSource().getFeatures()[0]) {//如果是初次进入,不存在下级组织,用父级组织 + this.centerFlag = 'flag_parent' + + + } else if (this.orgData.longitude && this.orgData.latitude) { + this.centerPoint.push(this.orgData.longitude) + this.centerPoint.push(this.orgData.latitude) + this.centerFlag = 'point' + + } else { + this.centerPoint = centerPointGlobal + this.centerFlag = 'point' + } + // debugger + if (this.centerFlag === 'flag_parent') { + let parentFeatures = parentLayer.getSource().getFeatures()[0] + let polygon = parentFeatures.getGeometry(); + map.getView().fit(polygon, map.getSize()); + + } + else if (this.centerFlag === 'flag_polygon') { + let polygonFeatures = polygonLayer.getSource().getFeatures()[0] + let polygon = polygonFeatures.getGeometry(); + map.getView().fit(polygon, map.getSize()); + + } + else { + mapView.setCenter(this.centerPoint); + mapView.setZoom(this.zoom); + } + + + }, //返回所选组织 @@ -608,7 +663,7 @@ const vueGis = { let oneArray = [x, y] this.iconCoordinators.push(oneArray) // debugger - //视频监控样式 + //地图icon样式 let oneCctv = new Feature({ geometry: new Point([x, y]), id: oneIcon.id_, @@ -637,26 +692,8 @@ const vueGis = { iconSource.addFeatures(iconFeatures); } - // this.addGif() - }, - //设置地图定位的中心点和缩放级别 - setMapLocation () { - this.centerPoint = [] - if (this.center && this.center.length > 0) { - this.centerPoint = this.center - } else if (this.orgData.longitude && this.orgData.latitude) { - - this.centerPoint.push(this.orgData.longitude) - this.centerPoint.push(this.orgData.latitude) - } else { - this.centerPoint = centerPointGlobal - } - if (!this.zoom) { - this.setZoom(this.orgData.agencyLevel) - } - }, //根据组织层级设置缩放级别 setZoom (agencyLevel) { @@ -670,8 +707,23 @@ const vueGis = { }, + 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 + } + + if (!this.zoom) { + this.setZoom(this.orgData.agencyLevel) + } + }, + initMap () { - this.setMapLocation() + this.firstCenterMap() gaodeMapLayer = new TileLayer({ title: "地图", From 4834ced4398d2555a649dc3291680b55157301ad Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 26 Jan 2022 10:32:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scss/modules/visual/personCategory.scss | 2 +- src/views/components/resiTransfer.vue | 31 ++-- src/views/components/scoreRecord.vue | 2 +- src/views/modules/base/resi.vue | 2 +- .../regionalParty/activitys.vue | 1 - .../regionalParty/activitysForm.vue | 30 +++- .../communityParty/regionalParty/units.vue | 20 +-- .../regionalParty/unitsForm.vue | 28 +++- .../visual/basicinfo/basicInfoCommunity.vue | 141 +++++++++--------- .../visual/basicinfo/basicInfoMain.vue | 17 ++- .../visual/communityGovern/processAnalyze.vue | 80 +--------- .../visual/communityGovern/resibuzz.vue | 14 +- 12 files changed, 159 insertions(+), 209 deletions(-) diff --git a/src/assets/scss/modules/visual/personCategory.scss b/src/assets/scss/modules/visual/personCategory.scss index af300198..7af912e5 100644 --- a/src/assets/scss/modules/visual/personCategory.scss +++ b/src/assets/scss/modules/visual/personCategory.scss @@ -35,7 +35,7 @@ margin-top: 10px; margin-left: 10px; margin-right: 15px; - margin-bottom: 15px; + margin-bottom: 20px; cursor: pointer; &-img { diff --git a/src/views/components/resiTransfer.vue b/src/views/components/resiTransfer.vue index e3368060..94178f4f 100644 --- a/src/views/components/resiTransfer.vue +++ b/src/views/components/resiTransfer.vue @@ -19,7 +19,7 @@ style="display: block"> - {{'迁往'+rootAgency.rootAgencyName+'内其他区域'}} + {{'迁往'+rootAgency.organizationName+'内其他区域'}} 其他 @@ -150,7 +150,7 @@ export default { remark: '' //备注 }, - staffId: '',//工作人员id + customerId: '',//客户id userId: '',//操作人员id gridName: '', rootAgency: {}, @@ -179,7 +179,8 @@ export default { methods: { async initForm (row) { - this.staffId = localStorage.getItem("staffId"); + + this.customerId = localStorage.getItem("customerId"); this.$refs.ref_form.resetFields(); @@ -195,22 +196,16 @@ export default { //根据人员id获取根组织信息 async loadRootAgency () { - const url = '/gov/org/customeragency/root-orglist-by-staffid' - - let params = { - staffId: this.staffId - } - - const { data, code, msg } = await requestPost(url, params) + await this.$http.post('/gov/org/agency/customerrootagency/' + this.customerId).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } - if (code === 0) { - if (data && data.length > 0) { - this.rootAgency = data[0] + if (res.data) { + this.rootAgency = res.data } + }).catch(() => { }) - } else { - this.$message.error(msg) - } }, async getAgencylist () { @@ -219,7 +214,7 @@ export default { const params = { - agencyId: this.rootAgency.rootAgencyId + agencyId: this.rootAgency.id } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -419,7 +414,7 @@ export default { remark: '' //备注 } - this.staffId = ''//工作人员id + this.customerId = ''//客户id this.userId = ''//操作人员id this.gridName = '' this.rootAgency = {} diff --git a/src/views/components/scoreRecord.vue b/src/views/components/scoreRecord.vue index 63b3eca2..62c02c52 100644 --- a/src/views/components/scoreRecord.vue +++ b/src/views/components/scoreRecord.vue @@ -121,7 +121,7 @@ export default { pickerOptions: { //控制时间范围 disabledDate (time) { - return time.getTime() > (Date.now() - (24 * 60 * 60 * 1000)) + return time.getTime() > (Date.now()) } }, diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index ef67f6b6..4f9c4663 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -69,7 +69,7 @@ 调动记录 + class="btn-color-look">变更记录