diff --git a/src/assets/scss/modules/visual/personCategory.scss b/src/assets/scss/modules/visual/personCategory.scss new file mode 100644 index 000000000..509dc2aa7 --- /dev/null +++ b/src/assets/scss/modules/visual/personCategory.scss @@ -0,0 +1,166 @@ +.warning-box { + box-sizing: border-box; + // width: 1881px; + width: 100%; + // height: 100%; + min-height: 100%; + margin: auto; + color: #fff; + // background: url("../../../img/modules/visual/warning-box.png") no-repeat center; + background-size: 100% 100%; + padding: 45px 21px 35px 24px; + + &-top { + display: flex; + // justify-content: space-around; + justify-content: flex-start; + flex-wrap: wrap; + min-height: 190px; + + .top-item-active { + background: linear-gradient(0deg, #1a5afd86, #26c5ff75); + } + + .top-item { + box-sizing: border-box; + width: 280px; + height: 190px; + padding: 10px 22px 14px 21px; + // background: rgba(255, 255, 255, 0); + border: 1px solid #1043c0; + box-shadow: 0px 83px 150px 0px #002790; + border-radius: 8px; + margin-top: 10px; + margin-left: 10px; + margin-right: 15px; + margin-bottom: 15px; + cursor: pointer; + + &-img { + display: flex; + align-items: center; + + img { + width: 78px; + height: 78px; + margin-right: 16px; + margin-bottom: 10px; + } + + .top-item-left { + display: flex; + flex-direction: column; + + span { + display: inline-block; + } + + span:nth-child(1) { + font-size: 18px; + font-weight: 400; + color: #ffffff; + } + + span:nth-child(2) { + font-size: 28px; + font-weight: bold; + color: #00fffc; + margin-top: 10px; + } + } + } + + &-num { + width: 100%; + display: flex; + position: relative; + flex-direction: column; + align-items: space-between; + // border: 1px solid red; + + .num-item { + position: relative; + width: 100%; + height: 35px; + display: flex; + border-radius: 4px; + align-items: center; + justify-content: space-between; + padding: 0 10px 0 9px; + + // &::after { + // display: block; + // content: ""; + // width: 8px; + // height: 8px; + // background: #f0f3f7; + // border-radius: 50%; + // position: absolute; + // left: 12px; + // top: 50%; + // transform: translate(0, -50%); + // } + + div:nth-child(1) { + font-size: 16px; + font-family: PingFang SC; + font-weight: 400; + color: #ffffff; + } + + div:nth-child(2) { + // width: 70%; + display: flex; + font-size: 20px; + font-family: PingFang SC; + font-weight: 500; + color: #ffffff; + + .right-icon { + width: 10px; + height: 14px; + } + } + } + + .num-item:nth-child(2) { + margin-top: 10px; + } + } + } + } + + &-bottom { + box-sizing: border-box; + width: 100%; + height: calc(100% - 300px); + min-height: 300px; + margin-top: 60px; + + .pagination { + box-sizing: border-box; + margin-top: 20px; + width: 100%; + height: 40px; + display: flex; + justify-content: flex-end; + + /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active { + background: #0266d1; + color: #000d3f; + } + + /deep/ .el-pagination .el-pager li { + background: #002e74; + } + + /deep/ .el-pagination .btn-prev { + background: #002e74; + } + + /deep/ .el-pagination .btn-next { + background: #002e74; + } + } + } +} diff --git a/src/router/index.js b/src/router/index.js index edcfb0201..228413045 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -226,19 +226,19 @@ router.beforeEach((to, from, next) => { icon: "icon-setting", id: "22213213", name: "基础信息", - url: "visual/basicinfo/basicInfoMain", - // children: [ - // // { - // // url: "/visual/basicinfo/basicInfoMain", - // // name: "基础信息", - // // id: "5feawfwaefwa5", - // // }, - // // { - // // url: "/visual/basicinfo/basicInfoMain", - // // name: "人员类别分析", - // // id: "5fwaefwaefawef5", - // // }, - // ], + // url: "visual/basicinfo/basicInfoMain", + children: [ + { + url: "/visual/basicinfo/basicInfoMain", + name: "基础信息", + id: "5feawfwaefwa5", + }, + { + url: "/visual/basicinfo/personCategory/index", + name: "人员类别分析", + id: "5fwaefwaefawef5", + }, + ], }, { icon: "icon-setting", diff --git a/src/views/components/scoreRecord.vue b/src/views/components/scoreRecord.vue new file mode 100644 index 000000000..128e06c0d --- /dev/null +++ b/src/views/components/scoreRecord.vue @@ -0,0 +1,347 @@ + + + + diff --git a/src/views/modules/base/community/roomForm.vue b/src/views/modules/base/community/roomForm.vue index 9b595dc5f..548762b72 100644 --- a/src/views/modules/base/community/roomForm.vue +++ b/src/views/modules/base/community/roomForm.vue @@ -137,7 +137,7 @@ export default { houseId: '', //房屋ID houseType: '1', purpose: '1', - rentFlag: 1, + rentFlag: 0, dataForm: { neighborHoodId: '', // 所属小区ID buildingId: '',//所属楼栋ID diff --git a/src/views/modules/communityParty/regionalParty/finishList.vue b/src/views/modules/communityParty/regionalParty/finishList.vue new file mode 100644 index 000000000..e6eaaad22 --- /dev/null +++ b/src/views/modules/communityParty/regionalParty/finishList.vue @@ -0,0 +1,552 @@ + + + + + + diff --git a/src/views/modules/communityParty/regionalParty/units.vue b/src/views/modules/communityParty/regionalParty/units.vue index a9ff9dc60..09331bc01 100644 --- a/src/views/modules/communityParty/regionalParty/units.vue +++ b/src/views/modules/communityParty/regionalParty/units.vue @@ -103,9 +103,9 @@ :http-request="uploadFile"> 导入 --> + type="red">导入 - + --> @@ -126,19 +126,19 @@ header-align="center" align="center" label="单位名称" - width="180"> + min-width="100"> + min-width="80"> + min-width="250"> @@ -245,6 +280,8 @@ import unitsForm from './unitsForm' import unitsDetail from './unitsDetail' +import finishList from './finishList' +import scoreRecord from '../../../components/scoreRecord.vue' import { requestPost } from "@/js/dai/request"; import { mapGetters } from 'vuex' @@ -298,6 +335,13 @@ export default { formTitle: '新增单位', detailShow: false, + //完成情况 + finishDiaTitle: '区域化党建单位完成情况', + finishDiaShow: false, + //积分记录 + scoreDiaTitle: '积分记录', + scoreDiaShow: false, + files: "", fileName: "", uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import' @@ -305,7 +349,7 @@ export default { } }, components: { - unitsForm, unitsDetail + unitsForm, unitsDetail, finishList, scoreRecord }, async created () { @@ -390,14 +434,14 @@ export default { this.tableLoading = false }, - - - diaClose () { + editDiaClose () { this.$refs.ref_form.resetData() this.formShow = false }, - detailClosed () { + diaClose () { this.detailShow = false + this.finishDiaShow = false + this.scoreDiaShow = false }, handleDetail (row) { @@ -407,6 +451,22 @@ export default { }) }, + //完成情况 + handleFinish (row) { + this.finishDiaTitle = row.unitName + '完成情况' + this.finishDiaShow = true + this.$nextTick(() => { + this.$refs.ref_finish.initTable(row) + }) + }, + //积分记录 + handleScore (row) { + this.scoreDiaShow = true + this.$nextTick(() => { + this.$refs.ref_score.initForm(row) + }) + }, + handleAdd () { this.formTitle = '新增' this.formShow = 'edit' diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue index 66af8c1e0..ac413f23c 100644 --- a/src/views/modules/communityService/measure/index.vue +++ b/src/views/modules/communityService/measure/index.vue @@ -33,6 +33,19 @@ + + +
+ + + + + + +
- - - - - - + 查询 - 重置 + 重置
@@ -1119,6 +1124,8 @@ export default { diff --git a/src/views/modules/systemManagement/serviceMatter/serviceForm.vue b/src/views/modules/systemManagement/serviceMatter/serviceForm.vue new file mode 100644 index 000000000..7a5c420a7 --- /dev/null +++ b/src/views/modules/systemManagement/serviceMatter/serviceForm.vue @@ -0,0 +1,232 @@ + + + + + + diff --git a/src/views/modules/visual/basicinfo/basicInfoMain.vue b/src/views/modules/visual/basicinfo/basicInfoMain.vue index e538d41ef..adae7b0e4 100644 --- a/src/views/modules/visual/basicinfo/basicInfoMain.vue +++ b/src/views/modules/visual/basicinfo/basicInfoMain.vue @@ -121,6 +121,8 @@ let loading;//加载动画 let map; let mapView; let gaodeMapLayer;//背景地图图层 +let parentLayer;//上级组织图层 +let parentSource;//上级组织多边形 let polygonLayer;//变电站标注图层 let iconLayer; // icon标注图层 let iconSource; // icon @@ -155,7 +157,7 @@ var createTextStyle = function (feature) { text: feature.values_.name, backgroundFill: new Fill({ // color: 'rgba(0, 146, 238, 0.75)' - color: textColorArray[feature.values_.index - 1] + color: textColorArray[feature.values_.colorIndex] }), padding: [4, 10, 4, 10], //text: "变电站名称", @@ -167,17 +169,34 @@ var createTextStyle = function (feature) { }); }; -//变电站标注样式 +//上级组织标注样式 +var parentStyleFunction = (function () { + return function (feature) { + return new Style({ + // fill: new Fill({ + // color: [255, 255, 255, 0.3] + // }), + stroke: new Stroke({ + color: [0, 103, 182, 1], + width: 2 + }), + + // text: createTextStyle(feature) + });; + }; +})() + +//变电站标注样式 var polygonStyleFunction = (function () { return function (feature) { return new Style({ fill: new Fill({ // color: [255, 255, 255, 0.3] - color: polygonColorArray[feature.values_.index - 1] + color: polygonColorArray[feature.values_.colorIndex] }), stroke: new Stroke({ - color: polygonColorArray[feature.values_.index - 1], + color: polygonColorArray[feature.values_.colorIndex], width: 3 }), @@ -214,17 +233,22 @@ const vueGis = { runNum: 0, runAgencyArray: [], selUserId: '', + center: [], + zoom: null, + parentPolygon: [], } }, async mounted () { + //加载组织数据 await this.loadOrgData() //初始化地图 this.initMap() - + this.addParentLayer() + this.loadParentPolygon() //添加标注图层 this.addPolygonLayer() @@ -289,12 +313,14 @@ const vueGis = { //下钻到下一级 type点击的类型:polygon 点击多边形(分为点击组织/小区) search 点击搜索 people 点击详情 async toSubAgency (type, e, searchName) { - console.log(e) - this.runNum++ - this.runAgencyArray.push(this.orgData) + if (!e) { + return false + } + //点击小区neighborHood显示楼栋,点击非小区,进入下一级地图 if (type === 'people') { - + this.runNum++ + this.runAgencyArray.push(this.orgData) this.orgLevel = 'people' this.selUserId = e this.orgId = '' @@ -305,9 +331,11 @@ const vueGis = { } this.searchName = searchName - } else if (type === 'search') { + } else if (type === 'search') { + this.runNum++ + this.runAgencyArray.push(this.orgData) this.orgLevel = 'search' this.orgId = '' this.orgData = { @@ -320,8 +348,17 @@ const vueGis = { }); } else { - this.subAgencyArray.forEach(item => { + if (!e.selected[0]) { + return false + } + this.runNum++ + this.orgData.center = map.getView().getCenter() + 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 => { if (item.id === e.selected[0].values_.id) { this.orgId = item.id this.orgLevel = item.level @@ -332,7 +369,6 @@ const vueGis = { if (this.orgLevel === 'neighborHood') { this.loadList() this.$nextTick(() => { - // 小区id,小区名称 this.$refs.ref_community.initData(this.orgData.id, this.orgData.name); }); @@ -343,7 +379,6 @@ const vueGis = { } - }, //刷新地图 @@ -351,16 +386,17 @@ const vueGis = { //加载组织数据 await this.loadOrgData() + this.loadParentPolygon() //加载当前园区的标注 await this.loadPolygon(this.subAgencyArray) - //重置地图中心点 - if (isRefreshView) { - this.setMapLocation() - mapView.setCenter(this.centerPoint); - mapView.setZoom(this.zoom); - } + // //重置地图中心点 + // if (isRefreshView) { + // this.setMapLocation() + // mapView.setCenter(this.centerPoint); + // mapView.setZoom(this.zoom); + // } await this.loadList() @@ -378,6 +414,8 @@ const vueGis = { this.orgId = this.orgData.id this.orgLevel = this.orgData.level + this.center = this.orgData.center + this.zoom = this.orgData.zoom if (this.orgLevel === 'people') { @@ -415,7 +453,8 @@ const vueGis = { this.orgData = data this.orgId = this.orgData.id this.orgLevel = this.orgData.level - + this.parentPolygon = [] + this.parentPolygon.push(data) if (data.children && data.children.length > 0) { this.subAgencyArray = data.children } else { @@ -428,6 +467,63 @@ const vueGis = { }, + //加载父级组织多边形 + loadParentPolygon () { + parentSource.clear()//清空变电站标注 + + let featureData = []//标注数据 + if (this.parentPolygon && this.parentPolygon.length > 0) {//判断是否存在下级标注 + let oneData = {} + + this.parentPolygon.forEach(agencyItem => { + + if (agencyItem.coordinates && agencyItem.coordinates !== '') {//如果有坐标 + oneData = { + type: 'Feature', + id: agencyItem.id, + properties: { + id: agencyItem.id, + level: agencyItem.level, + name: agencyItem.name + }, + geometry: { + type: 'Polygon', + coordinates: [], + }, + } + let coorArray = agencyItem.coordinates.split(',')//坐标数组 + + let itemArray = []//单个点位的[lon,lat],数组 + let polygonArray = []//整个多边形的[[lon,lat],[lon,lat],[lon,lat]]数组 + + coorArray.forEach((item, index) => { + itemArray.push(item) + if (index % 2 == 0) {//偶 + + } else {//奇 + polygonArray.push(itemArray) + itemArray = [] + } + + }); + oneData.geometry.coordinates.push(polygonArray) + featureData.push(oneData) + } + }); + } + + if (featureData && featureData.length > 0) { + var geojsonObject = { + 'type': 'FeatureCollection', + 'features': featureData + }; + let feature = (new GeoJSON()).readFeatures(geojsonObject) + parentSource.addFeatures(feature) + + } + + }, + //加载当前园区的标注 loadPolygon (subAgencyArray) { polygonSource.clear()//清空多边形标注 @@ -437,10 +533,14 @@ const vueGis = { if (subAgencyArray && subAgencyArray.length > 0) {//判断是否存在下级标注 let oneData = {} - subAgencyArray.forEach(agencyItem => { + let count = 0 + for (let i = 0; i < subAgencyArray.length; i++) { + const agencyItem = subAgencyArray[i] + if (agencyItem.coordinates && agencyItem.coordinates !== '') {//如果有坐标 - let urlNum = this.getRndBetween(1, 3) + let urlNum = count % 3 + count++ oneData = { type: 'Feature', @@ -449,7 +549,7 @@ const vueGis = { id: agencyItem.id, level: agencyItem.level, name: agencyItem.name, - index: urlNum//颜色随机的索引 + colorIndex: urlNum//颜色随机的索引 }, geometry: { type: 'Polygon', @@ -474,7 +574,7 @@ const vueGis = { oneData.geometry.coordinates.push(polygonArray) featureData.push(oneData) } - }); + } } if (featureData && featureData.length > 0) { @@ -515,7 +615,7 @@ const vueGis = { scale: 0.5, // src: "/img/largeScreen/icon_camra.png" // src: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png" - src: iconUrlArray[oneIcon.values_.index - 1] + src: iconUrlArray[oneIcon.values_.colorIndex] }) }); @@ -532,18 +632,20 @@ const vueGis = { }, //设置地图定位的中心点和缩放级别 setMapLocation () { + this.centerPoint = [] + if (this.center && this.center.length > 0) { + this.centerPoint = this.center + } else if (this.orgData.longitude && this.orgData.latitude) { - if (this.orgData.longitude && this.orgData.latitude) { - this.centerPoint = [] this.centerPoint.push(this.orgData.longitude) this.centerPoint.push(this.orgData.latitude) } else { - this.centerPoint = centerPointGlobal } - - this.setZoom(this.orgData.agencyLevel) + if (!this.zoom) { + this.setZoom(this.orgData.agencyLevel) + } }, //根据组织层级设置缩放级别 @@ -604,6 +706,23 @@ const vueGis = { }); map.removeInteraction(dblClickInteraction); + }, + //添加变电站标注图层 + addParentLayer () { + parentSource = new VectorSource({ + //features: (new GeoJSON()).readFeatures(geojsonObject) + }); + + parentLayer = new VectorLayer({ + source: parentSource, + style: parentStyleFunction, + zIndex: 50 + }); + + + map.addLayer(parentLayer) + + }, //添加变电站标注图层 diff --git a/src/views/modules/visual/basicinfo/personCategory/components/screen-loading/index.vue b/src/views/modules/visual/basicinfo/personCategory/components/screen-loading/index.vue new file mode 100644 index 000000000..cc8bda6fe --- /dev/null +++ b/src/views/modules/visual/basicinfo/personCategory/components/screen-loading/index.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/src/views/modules/visual/basicinfo/personCategory/components/screen-table/index.vue b/src/views/modules/visual/basicinfo/personCategory/components/screen-table/index.vue new file mode 100644 index 000000000..d8c0a8541 --- /dev/null +++ b/src/views/modules/visual/basicinfo/personCategory/components/screen-table/index.vue @@ -0,0 +1,358 @@ + + + + + diff --git a/src/views/modules/visual/basicinfo/personCategory/index.vue b/src/views/modules/visual/basicinfo/personCategory/index.vue new file mode 100644 index 000000000..807d66c32 --- /dev/null +++ b/src/views/modules/visual/basicinfo/personCategory/index.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/src/views/modules/visual/communityGovern/resibuzz.vue b/src/views/modules/visual/communityGovern/resibuzz.vue index 92d1c819b..1a5c75161 100644 --- a/src/views/modules/visual/communityGovern/resibuzz.vue +++ b/src/views/modules/visual/communityGovern/resibuzz.vue @@ -449,7 +449,7 @@ export default { this.tableList = data.list this.demand.list = data.list.map((item) => { return [ - { type: "index" }, + item.sort ? item.sort : '--', item.issueTitle ? item.issueTitle : '', item.suggestion ? item.suggestion : '', item.categoryName.join(','), diff --git a/src/views/modules/visual/communityGovern/typeAnalyze.vue b/src/views/modules/visual/communityGovern/typeAnalyze.vue index 0c17367ae..4099e5b81 100644 --- a/src/views/modules/visual/communityGovern/typeAnalyze.vue +++ b/src/views/modules/visual/communityGovern/typeAnalyze.vue @@ -153,7 +153,7 @@ export default { width: "10%", }, ], - header: ["序号", "类别", "反映渠道", "所属网格", "状态", "项目标题", "转成项目时间", "操作"], + header: ["序号", "类别", "反映渠道", "所属组织", "状态", "项目标题", "转成项目时间", "操作"], list: [], pageSize: 10, pageNo: 1, @@ -426,11 +426,11 @@ export default { { type: "index" }, // item.projectCode ? item.projectCode : '', item.categoryNames.join(','), - item.originShow ? item.originShow : '', - item.gridName ? item.gridName : '', - item.statusShow ? item.statusShow : '', - item.title ? item.title : '', - item.time ? item.time : '', + item.originShow ? item.originShow : '--', + item.orgName ? item.orgName : '--', + item.statusShow ? item.statusShow : '--', + item.title ? item.title : '--', + item.time ? item.time : '--', { type: "operate", list: ["查看"] }, ]; }); diff --git a/src/views/modules/visual/measure/volunteer.vue b/src/views/modules/visual/measure/volunteer.vue index 8608bf8a8..1f4030cc6 100644 --- a/src/views/modules/visual/measure/volunteer.vue +++ b/src/views/modules/visual/measure/volunteer.vue @@ -16,11 +16,11 @@
- +
- -
+ +
志愿者服务情况
@@ -77,12 +77,12 @@
- - +
+
- -
+ +
多元化治理平面图
@@ -108,7 +108,7 @@
- +
@@ -619,6 +619,7 @@ export default { // display: flex; .box-wr { display: flex; + margin-top: 40px; } .card-wr { flex: 1; @@ -785,15 +786,35 @@ export default { text-align: center; .card-map { - margin-top: 10px; + margin-top: 30px; width: 100%; // height: calc(100vh - 285px); - height: calc(100vh - 315px); - + height: calc(100vh - 335px); + padding-left: 20px; .map { width: 100%; height: 100%; } } } + +.card-left-title { + position: relative; + padding-left: 40px; + font-size: 16px; + font-weight: 500; + color: #fff; +} +.card-left-title::after { + content: ''; + position: absolute; + top: 50%; + left: 20px; + width: 12px; + height: 12px; + box-sizing: border-box; + margin-top: -6px; + background: #2865FA; + border-radius: 50%; +} diff --git a/src/views/modules/workSys/mapConfig.vue b/src/views/modules/workSys/mapConfig.vue index d60f7930a..6569f3e50 100644 --- a/src/views/modules/workSys/mapConfig.vue +++ b/src/views/modules/workSys/mapConfig.vue @@ -83,6 +83,8 @@ let projection = new Projection({ let map; let mapView; let gaodeMapLayer;//背景地图图层 +let parentLayer;//上级组织图层 +let parentSource;//上级组织多边形 let polygonLayer;//变电站标注图层 let polygonSource;//变电站标注多边形 @@ -106,7 +108,22 @@ var createTextStyle = function (feature) { overflow: true, }); }; -//变电站标注样式 +//上级组织标注样式 +var parentStyleFunction = (function () { + return function (feature) { + return new Style({ + // fill: new Fill({ + // color: [255, 255, 255, 0.3] + // }), + stroke: new Stroke({ + color: [0, 103, 182, 1], + width: 2 + }), + + // text: createTextStyle(feature) + });; + }; +})() var polygonStyleFunction = (function () { return function (feature) { @@ -151,6 +168,9 @@ const vueGis = { //下钻层级记录 runNum: 0, runAgency: [], + center: [], + zoom: null, + parentPolygon: [], } }, @@ -162,6 +182,10 @@ const vueGis = { //初始化地图 this.initMap() + //上级组织多边形图层 + this.addParentLayer() + this.loadParentPolygon() + //添加标注图层 this.addPolygonLayer() @@ -172,11 +196,12 @@ const vueGis = { methods: { //切换下级组织 orgChange (index) { + this.selAgencyIndex = index selectedFeatures.clear() - if (index || index === 0) { + if (this.subAgencyArray.length > 0 && (index || index === 0)) { this.showBtn = true this.selAgency = this.subAgencyArray[index] if (this.selAgency.coordinates) { @@ -196,23 +221,27 @@ const vueGis = { async refreshMap (isRefreshView) { //加载组织数据 await this.loadOrgData() - + this.loadParentPolygon() //加载当前园区的标注 this.loadPolygon(this.subAgencyArray) //重置地图中心点 - if (isRefreshView) { - this.setMapLocation() - mapView.setCenter(this.centerPoint); - mapView.setZoom(this.zoom); - } + // if (isRefreshView) { + // this.setMapLocation() + // mapView.setCenter(this.centerPoint); + // mapView.setZoom(this.zoom); + // } }, //返回上一级组织 handleBack () { + + this.center = this.runAgency[this.runNum - 1].center + this.zoom = this.runAgency[this.runNum - 1].zoom this.selAgencyId = '' this.runNum-- this.runAgency.pop() + if (this.runNum === 0) { this.orgId = '' this.orgLevel = '' @@ -243,6 +272,8 @@ const vueGis = { this.subAgencyArray.push(data) // this.selAgencyId = data.id } else { + this.parentPolygon = [] + this.parentPolygon.push(data) if (data.children && data.children.length > 0) { this.subAgencyArray = data.children @@ -259,6 +290,62 @@ const vueGis = { }, + //加载父级组织多边形 + loadParentPolygon () { + parentSource.clear()//清空变电站标注 + + let featureData = []//标注数据 + if (this.parentPolygon && this.parentPolygon.length > 0) {//判断是否存在下级标注 + let oneData = {} + + this.parentPolygon.forEach(agencyItem => { + + if (agencyItem.coordinates && agencyItem.coordinates !== '') {//如果有坐标 + oneData = { + type: 'Feature', + id: agencyItem.id, + properties: { + id: agencyItem.id, + level: agencyItem.level, + name: agencyItem.name + }, + geometry: { + type: 'Polygon', + coordinates: [], + }, + } + let coorArray = agencyItem.coordinates.split(',')//坐标数组 + + let itemArray = []//单个点位的[lon,lat],数组 + let polygonArray = []//整个多边形的[[lon,lat],[lon,lat],[lon,lat]]数组 + + coorArray.forEach((item, index) => { + itemArray.push(item) + if (index % 2 == 0) {//偶 + + } else {//奇 + polygonArray.push(itemArray) + itemArray = [] + } + + }); + oneData.geometry.coordinates.push(polygonArray) + featureData.push(oneData) + } + }); + } + + if (featureData && featureData.length > 0) { + var geojsonObject = { + 'type': 'FeatureCollection', + 'features': featureData + }; + let feature = (new GeoJSON()).readFeatures(geojsonObject) + parentSource.addFeatures(feature) + + } + + }, //加载当前园区的标注 loadPolygon (subAgencyArray) { polygonSource.clear()//清空变电站标注 @@ -336,8 +423,12 @@ const vueGis = { }, //下钻到下一级 toSubAgency (e) { + if (!e.selected[0]) { + return false + } if (this.method != 'mAddPolygon' && this.level != 'neighborHood') { + this.selAgencyId = '' //下钻到下一级 this.subAgencyArray.forEach(item => { @@ -351,6 +442,12 @@ const vueGis = { }); this.runNum++ + this.selPolygon.center = map.getView().getCenter() + this.selPolygon.zoom = map.getView().getZoom() + console.log('center', map.getView().getCenter()) + console.log('zoom', map.getView().getZoom()) + + this.runAgency.push(this.selPolygon) this.selAgencyIndex = 0 this.refreshMap(true) @@ -358,7 +455,6 @@ const vueGis = { } }, - //高亮某个标注 highlightPolygon () { @@ -374,9 +470,12 @@ const vueGis = { }, //设置地图定位的中心点和缩放级别 setMapLocation () { + this.centerPoint = [] + + if (this.center && this.center.length > 0) { + this.centerPoint = this.center + } else if (this.orgData.longitude && this.orgData.latitude) { - if (this.orgData.longitude && this.orgData.latitude) { - this.centerPoint = [] this.centerPoint.push(this.orgData.longitude) this.centerPoint.push(this.orgData.latitude) } else { @@ -384,7 +483,9 @@ const vueGis = { this.centerPoint = centerPointGlobal } - this.setZoom(this.orgData.agencyLevel) + if (!this.zoom) { + this.setZoom(this.orgData.agencyLevel) + } }, //根据组织层级设置缩放级别 @@ -447,6 +548,23 @@ const vueGis = { }, + //添加变电站标注图层 + addParentLayer () { + parentSource = new VectorSource({ + //features: (new GeoJSON()).readFeatures(geojsonObject) + }); + + parentLayer = new VectorLayer({ + source: parentSource, + style: parentStyleFunction, + zIndex: 50 + }); + + + map.addLayer(parentLayer) + + + }, //添加变电站标注图层 addPolygonLayer () { polygonSource = new VectorSource({