From 11d04a7738a8edf94d56c1c8a7d1b2b0aa9c1123 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Fri, 10 Dec 2021 10:41:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=8C=96=E5=85=9A=E5=BB=BA?= =?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/communityGovern/processAnalyze.vue | 15 +- .../visual/communityParty/community.vue | 307 ++++++++--- .../components/screen-map/index copy.vue | 516 ------------------ .../visual/components/screen-map/index.vue | 10 +- 4 files changed, 257 insertions(+), 591 deletions(-) delete mode 100644 src/views/modules/visual/components/screen-map/index copy.vue diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index f4c6f7e5..da631cf2 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/src/views/modules/visual/communityGovern/processAnalyze.vue @@ -48,7 +48,7 @@
-
党建单位分类统计
+
近12月新增项目数
@@ -229,9 +229,16 @@ export default { params, (data, rspMsg) => { this.agencyInfo = data - this.agencyInfo.latitude = 36.072227 - this.agencyInfo.longitude = 120.389455 - this.agencyInfo.level = 'street' + if (!data.latitude) { + this.agencyInfo.latitude = 36.072227 + } + if (!data.longitude) { + this.agencyInfo.longitude = 120.389455 + } + if (!data.level) { + this.agencyInfo.level = 'street' + } + }, (rspMsg, data) => { this.$message.error(rspMsg) diff --git a/src/views/modules/visual/communityParty/community.vue b/src/views/modules/visual/communityParty/community.vue index 28bb7fa1..f04d0a83 100644 --- a/src/views/modules/visual/communityParty/community.vue +++ b/src/views/modules/visual/communityParty/community.vue @@ -2,7 +2,8 @@
- +
区域化党建
@@ -10,28 +11,28 @@
党建单位分类统计
- - + +
- +
@@ -48,22 +49,18 @@
- +
@@ -75,16 +72,26 @@
-
+
{{ item.name }}
-
{{ item.value }}
+
{{ item.value }}
- +
-
这是地图容器
-
-
+
+ +
+
+
@@ -95,10 +102,8 @@
- +
@@ -108,17 +113,20 @@ import screenTable from "../components/screen-table/index"; import cptCard from "@/views/modules/visual/cpts/card"; import nextTick from "dai-js/tools/nextTick"; import dialogInfo from './dialogInfo.vue' +import screenMap from "@/views/modules/visual/components/screen-map"; export default { name: "warning-box", components: { cptCard, screenTable, - dialogInfo + dialogInfo, + screenMap }, - data() { + data () { return { - showedMoreInfo: true, + + showedMoreInfo: false, tableLoading: false, warningList: [], headerList: [ @@ -172,19 +180,64 @@ export default { icon: require('../../../../assets/img/shuju/measure/qita.png') } ], + + //地图相关数据 + isfirstInit: true,//记录是否是首次加载地图 + agencyInfo: {},//登陆者的组织信息:主要为了获取地图中心点和level + unitMapList: [], + unitMapList1: [ + { + type: '党建楼宇', + name: '建联单位1', + latitude: 36.062227, + longitude: 120.389455, + }, + { + type: '党建楼宇', + name: '建联单位2', + latitude: 36.082227, + longitude: 120.389455, + }, + { + type: '机关直属部门', + name: '建联单位3', + latitude: 36.062227, + longitude: 120.379455, + }, + { + type: '两新党建', + name: '建联单位4', + latitude: 36.082227, + longitude: 120.379455, + }, + { + type: '辖区单位', + name: '建联单位5', + latitude: 36.092227, + longitude: 120.379455, + }, + { + type: '其他', + name: '建联单位6', + latitude: 36.102227, + longitude: 120.379455, + } + ], }; }, - async mounted() { + async mounted () { const { user } = this.$store.state this.agencyId = user.agencyId await nextTick(100); this.loadUnit() this.getList(); + await this.getWorkUserInfo() + await this.getMapUnitList() }, methods: { - + //具体人员列表 - async getList() { + async getList () { this.visibleLoading = true const url = "/heart/icpartyactivity/search" @@ -195,7 +248,7 @@ export default { pageNo: this.pageNo, serviceMatter: this.serviceMatter, startTime: this.timeRange.length > 0 && this.timeRange[0] || '', - endTime: this.timeRange.length > 0 && this.timeRange[1] || '' + endTime: this.timeRange.length > 0 && this.timeRange[1] || '' } const { data, code, msg } = await requestPost(url, params) @@ -226,15 +279,131 @@ export default { } }, - handleSelectChange() { + + // 获取当前管理员信息 + getWorkUserInfo () { + const url = '/epmetuser/customerstaff/staffbasicinfo' + let params = {} + window.app.ajax.post( + url, + params, + (data, rspMsg) => { + this.agencyInfo = data + if (!data.latitude) { + this.agencyInfo.latitude = 36.072227 + } + if (!data.longitude) { + this.agencyInfo.longitude = 120.389455 + } + if (!data.level) { + this.agencyInfo.level = 'street' + } + + }, + (rspMsg, data) => { + this.$message.error(rspMsg) + } + ) + + }, + + // //获取分类 + // async loadType () { + // const url = "/sys/dict/data/dictlist" + + // let params = { + // dictType: 'party_unit_type' + // } + + // const { data, code, msg } = await requestPost(url, params) + + // if (code === 0) { + // this.typeList = data + + // } else { + // this.$message.error(msg) + // } + + // }, + + //获取联建单位分布图 + async getMapUnitList () { + // const url = "/heart/icpartyunit/distribution" + const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" + + let params = { + agencyId: this.agencyId + } + + const { data, code, msg } = await requestPost(url, params) + + if (code === 0) { + // this.unitMapList = data + this.unitMapList = this.unitMapList1 + + this.unitMapList.forEach(item => { + + if (item.type === '党建楼宇') { + item.urlIndex = 0 + } else if (item.type === '两新党建') { + item.urlIndex = 1 + } else if (item.type === '辖区单位') { + item.urlIndex = 2 + } else if (item.type === '机关直属部门') { + item.urlIndex = 3 + } else if (item.type === '其他') { + item.urlIndex = 4 + } + }); + + + this.iconUrlArray = [ + require('../../../../assets/img/shuju/measure/ly@2x.png'),//未处理 + require('../../../../assets/img/shuju/measure/jgzs@2x.png'),//已处理 + require('../../../../assets/img/shuju/measure/lxdj@2x.png'),//已处理 + require('../../../../assets/img/shuju/measure/xq@2x.png'),//已处理 + require('../../../../assets/img/shuju/measure/qita.png')//已处理 + ] + + + //第一次加载完置为false + this.loadMap() + + this.isfirstInit = false + + } else { + this.$message.error(msg) + } + + }, + + + //加载地图数据 + loadMap () { + if (this.isfirstInit) { + //mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray + this.$refs.map.loadMap(this.agencyInfo, null, null, this.unitMapList, this.iconUrlArray, null) + } else { + this.$refs.map.refreshMap(null, this.unitMapList) + + } + }, + + //点击项目 + clickProject (feature) { + console.log('标注信息', feature.values_.properties) + }, + + + handleSelectChange () { this.getList(); }, - pageSizeChangeHandleNew(val) { + pageSizeChangeHandleNew (val) { this.pageNo = 1; this.pageSize = val; this.getList(); }, - pageCurrentChangeHandleNew(val) { + pageCurrentChangeHandleNew (val) { this.pageNo = val; this.getList(); }, @@ -277,7 +446,6 @@ export default { color: #fff; font-weight: 800; } - } .second-title { display: flex; @@ -291,7 +459,7 @@ export default { color: #fff; } .second-title-label::after { - content: ''; + content: ""; position: absolute; top: 50%; left: 20px; @@ -299,7 +467,7 @@ export default { height: 12px; box-sizing: border-box; margin-top: -6px; - background: #2865FA; + background: #2865fa; border-radius: 50%; } .second-select { @@ -312,12 +480,12 @@ export default { padding: 0 10px; color: #fff; line-height: 36px; - background: #06186D; - border: 1px solid #1A64CC; + background: #06186d; + border: 1px solid #1a64cc; } - + .el-icon-arrow-up:before { - content: "\e78f" + content: "\e78f"; } // .el-select__caret:before { // content: '\E790' @@ -326,11 +494,11 @@ export default { ::v-deep .el-date-editor { width: 360px; position: relative; - background: #06186D; - border: 1px solid #1A64CC; + background: #06186d; + border: 1px solid #1a64cc; .el-range-input { color: #fff; - background: #06186D; + background: #06186d; } .el-range-separator { color: #fff; @@ -360,7 +528,7 @@ export default { .box-left-item { .box-label { font-size: 16px; - color: rgba(255, 255, 255, .72); + color: rgba(255, 255, 255, 0.72); } .box-num { font-size: 32px; @@ -373,7 +541,12 @@ export default { flex: 1; .box-map { height: 400px; - border: 1px solid #2865FA; + // border: 1px solid #2865fa; + + .map { + height: 100%; + width: 100%; + } } } .box-left-w400 { @@ -400,7 +573,6 @@ export default { } } - .map-tips { width: 100%; display: flex; @@ -432,5 +604,4 @@ export default { } } } - diff --git a/src/views/modules/visual/components/screen-map/index copy.vue b/src/views/modules/visual/components/screen-map/index copy.vue deleted file mode 100644 index 09217e02..00000000 --- a/src/views/modules/visual/components/screen-map/index copy.vue +++ /dev/null @@ -1,516 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index dc0252ad..20ee5fad 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/src/views/modules/visual/components/screen-map/index.vue @@ -342,10 +342,14 @@ const vueGis = { //icon文字样式 createTextStyle (feature) { + if (this.iconTextStyle) { + let iconTextStyle = { ...this.iconTextStyle } + iconTextStyle.text = feature.values_.name + return new Text({ ...iconTextStyle }) + } else { + return null + } - let iconTextStyle = { ...this.iconTextStyle } - iconTextStyle.text = feature.values_.name - return new Text({ ...iconTextStyle }) },