From 6f554a260a396fb6767fdbd19d424b5cd3adf1b8 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 9 Dec 2021 18:00:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- .env.production.sit | 4 +- public/index.html | 6 +- src/assets/img/shuju/weiwanjie.png | Bin 0 -> 2193 bytes src/assets/img/shuju/yiwanjie.png | Bin 0 -> 2169 bytes .../scss/modules/visual/processAnalyze.scss | 67 +- .../scss/modules/visual/typeAnalyze.scss | 135 ++++ .../visual/communityGovern/processAnalyze.vue | 182 +++-- .../visual/communityGovern/typeAnalyze.vue | 646 ++++++++---------- .../visual/communityGovern/typePieOption.js | 179 +++++ .../visual/components/screen-map/index.vue | 107 +-- 11 files changed, 881 insertions(+), 449 deletions(-) create mode 100644 src/assets/img/shuju/weiwanjie.png create mode 100644 src/assets/img/shuju/yiwanjie.png create mode 100644 src/assets/scss/modules/visual/typeAnalyze.scss create mode 100644 src/views/modules/visual/communityGovern/typePieOption.js diff --git a/.env.development b/.env.development index b3e49ab5f..2ad1156bb 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,6 @@ NODE_ENV=development -# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api -VUE_APP_API_SERVER = http://192.168.1.140/api +VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api +# VUE_APP_API_SERVER = http://192.168.1.140/api # VUE_APP_API_SERVER = http://192.168.51.36:8080/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api VUE_APP_NODE_ENV=dev diff --git a/.env.production.sit b/.env.production.sit index b0c600ea6..de86de77c 100644 --- a/.env.production.sit +++ b/.env.production.sit @@ -1,5 +1,5 @@ NODE_ENV=production -# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api -VUE_APP_API_SERVER = http://192.168.1.140/api +VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api +# VUE_APP_API_SERVER = http://192.168.1.140/api VUE_APP_NODE_ENV=prod:sit VUE_APP_PUBLIC_PATH=epmet-oper \ No newline at end of file diff --git a/public/index.html b/public/index.html index be512c579..ef957a4cf 100644 --- a/public/index.html +++ b/public/index.html @@ -36,9 +36,9 @@ <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> <% } %> diff --git a/src/assets/img/shuju/weiwanjie.png b/src/assets/img/shuju/weiwanjie.png new file mode 100644 index 0000000000000000000000000000000000000000..582766fbfe50f5a4437c88552f00cc6242535ff6 GIT binary patch literal 2193 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 img { + margin-left: 58px; + height: 35px; + width: 40px; + } + + > span { + margin-left: 3px; + font-size: 16px; + font-family: PingFang SC; + font-weight: 400; + color: #d2e7ff; + } + } + .r-legend:hover { + cursor: pointer; } } diff --git a/src/assets/scss/modules/visual/typeAnalyze.scss b/src/assets/scss/modules/visual/typeAnalyze.scss new file mode 100644 index 000000000..a5c3918e1 --- /dev/null +++ b/src/assets/scss/modules/visual/typeAnalyze.scss @@ -0,0 +1,135 @@ +@import '../../c/config'; +@import '../../c/function'; +@import './c/common'; + +.title { + padding: 10px; + font-size: 22px; + font-family: PingFang SC; + font-weight: 800; + color: #ffffff; + display: flex; + align-items: center; + position: relative; + + img { + display: block; + margin-right: 5px; + } + span { + display: block; + } + + .second-select { + margin: 0 10px 0 40px; + + ::v-deep .el-input { + width: 140px; + height: 36px; + .el-input__inner { + height: 100%; + padding: 0 10px; + color: #fff; + line-height: 36px; + background: #06186d; + border: 1px solid #1a64cc; + } + .el-icon-arrow-up:before { + content: '\e78f'; + } + } + ::v-deep .el-date-editor { + .el-input__prefix { + left: unset; + right: 5px; + } + } + } + + .cascader { + ::v-deep .el-input { + width: 220px; + } + } + .status-select { + position: absolute; + top: 20px; + right: 10px; + } + .second-select:last-child { + margin-left: 0; + } +} + +.g-cpt-resi { + display: flex; + flex-direction: row; + // flex-wrap: wrap; + // justify-content: center; + height: calc(100vh - 130px); + + .g-l { + flex-shrink: 0; + width: 600px; + height: calc(100vh - 190px); + } + + .g-r { + text-align: center; + margin: 40px 19px 20px; + width: calc(100vw - 60px - 600px); + height: calc(100vh - 140px - 20px); + } +} + +.g-r { + .tb { + position: relative; + height: calc(100vh - 220px); + overflow-y: auto; + @include scrollBar; + + .m-pagination { + position: absolute; + box-sizing: border-box; + right: 0; + bottom: 0; + + 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; + } + } + } +} + +.echart-wr { + margin-left: 30px; + // margin-top: 100px; + text-align: center; + position: relative; + width: 500px; + height: 100%; + box-sizing: border-box; + .echart-org { + width: 100%; + height: 90%; + } +} diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index beae8fdc8..88fe8925d 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/src/views/modules/visual/communityGovern/processAnalyze.vue @@ -54,11 +54,29 @@
+
+ +
+
已完结
+
未完结
+
+
+ + + 已完结 + + 未完结 +
- - +
@@ -66,6 +84,7 @@ + + diff --git a/src/views/modules/visual/communityGovern/typePieOption.js b/src/views/modules/visual/communityGovern/typePieOption.js new file mode 100644 index 000000000..64b6ad984 --- /dev/null +++ b/src/views/modules/visual/communityGovern/typePieOption.js @@ -0,0 +1,179 @@ + +export function pieOption (_charts) { +const center= ['50%', '250px'] + return { + title: { + text: '0', + top: 220, + left: 'center', + textStyle: { + width: '100%', + fontSize: 32, + color: '#FFFFFF', + fontWeight: 400 + }, + itemGap: 5, + subtext: '总数', + subtextStyle: { + fontSize: 20, + color: '#fff', + fontWeight: 400 + } + }, + tooltip: { + show: false + }, + legend: { + top: 500, + bottom: 0, + itemWidth: 20, + itemHeight: 10, + textStyle: { + color: '#D2E7FF', + fontSize: 16, + lineHeight: 20, + }, + + }, + series: [ + // 外侧圆环 + { + type: 'pie', + // 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。 + startAngle: 0, + hoverAnimation: false, + // tooltip: { + // }, + center: center, + radius: ['55%', '55.3%'], + label: { + show: false + }, + labelLine: { + show: false + }, + data: [{ + value: 360, + itemStyle: { + color: 'rgba(40, 101, 250, 0)', + width:0, + borderColor: 'rgba(40, 101, 250, 0.5)', + borderWidth: 1, + borderType: 'dotted' + } + } + ] + }, + + // 突出的 + { + hoverAnimation: false, + // name: 'Access From', + type: 'pie', + center: center, + radius: ['40%', '60%'], + avoidLabelOverlap: false, + // top: top + '%', + // height: '80%', + selectedMode: 'single', + left: 'center', + width: 400, + label: { + // show: false, + position: 'outside', + alignTo: 'edge', + // formatter: '{a|{c}}\n\n{name|{b}}', + formatter: '{a|{c}}\n{r|}\n{name|{b}}', + minMargin: 5, + edgeDistance: 1, + lineHeight: 15, + color: '#fff', + fontSize: 12, + // distanceToLabelLine: -60, + rich: { + name: { + padding: [0, 6, 0, 6] + }, + a: { + fontSize: 30, + color: '#fff', + padding: [0, 6, 6, 6] + }, + r: { + backgroundColor: 'auto', + borderRadius: 6, + width: 6, + height: 6, + // padding: [3, 3, 0, -12] + } + } + }, + labelLine: { + show: false, + smooth: 0.2, + length: 30, + length2: 0, + maxSurfaceAngle: 80 + }, + labelLayout: function (params) { + + const isLeft = params.labelRect.x < _charts.getWidth() / 2; + const points = params.labelLinePoints; + // Update the end point. + if (points) { + points[2][0] = isLeft + ? params.labelRect.x + : params.labelRect.x + params.labelRect.width; + } + + return { + labelLinePoints: points + }; + }, + itemStyle: { + // color:function(params) { + // //自定义颜色 + // var colorList = [ + // '#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463', + // ]; + // return colorList[params.dataIndex] + // } + }, + data: [], + + }, + // 中间圆环 + { + type: 'pie', + // 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。 + startAngle: 0, + hoverAnimation: false, + center: center, + // tooltip: { + // }, + radius: ['0%', '25%'], + label: { + + show: false + + }, + labelLine: { + + show: false + + }, + data: [{ + value: 360, + itemStyle: { + normal: { + color: 'rgba(8, 37, 134, 1)', + + } + } + } + ] + }, + ] + + } +} diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index 541bd3762..dc0252add 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/src/views/modules/visual/components/screen-map/index.vue @@ -23,6 +23,7 @@ import Overlay from 'ol/Overlay'; import { defaults as defaultInteractions, Select, DoubleClickZoom } from 'ol/interaction.js'; import { getCenter, boundingExtent } from 'ol/extent.js'; import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js'; +import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; import { mapGetters } from "vuex"; import { Loading } from 'element-ui'; //引入Loading服务 @@ -50,37 +51,13 @@ let select;//选中标注 //url图标 -let textColorArray = [ - 'rgba(236, 69, 4, 0.66)', - 'rgba(0, 146, 238, 0.75)', - 'rgba(238, 151, 0, 0.8)' -]; + let polygonColorArray = [ 'rgba(210, 2, 2, 0.24)', 'rgba(43, 231, 253, 0.25)', 'rgba(183, 185, 0, 0.16)' ]; -//变电站标注的文字样式 -var createTextStyle = function (feature) { - return new Text({ - textAlign: undefined, - font: "18px Arial", - //fontFamily: "Courier New, monospace", - // fontWeight: "bold", - text: feature.values_.name, - backgroundFill: new Fill({ - // color: 'rgba(0, 146, 238, 0.75)' - color: textColorArray[feature.values_.index - 1] - }), - padding: [4, 10, 4, 10], - //text: "变电站名称", - fill: new Fill({ color: "#ffffff" }), - // stroke: new Stroke({ color: "#ffffff", width: 3 }), - offsetY: -30, - offsetX: -50, - overflow: true, - }); -}; + //变电站标注样式 @@ -146,6 +123,7 @@ const vueGis = { iconArrays: [ ], + iconTextStyle: {}, //policon图标样式 polIconUrlArray: [ @@ -155,6 +133,7 @@ const vueGis = { ], //icon图标样式 iconUrlArray: [], + iconTextColor: '#ffffff', } }, @@ -164,12 +143,13 @@ const vueGis = { }, methods: { //加载地图 - loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray) { + loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle) { this.mapInfo = mapInfo this.polygonArray = polygonArray this.polIconUrlArray = polIconUrlArray this.iconArrays = iconArrays this.iconUrlArray = iconUrlArray + this.iconTextStyle = iconTextStyle //初始化地图 this.initMap() @@ -185,31 +165,37 @@ const vueGis = { //初始化多边形标注图层 this.initPolygonLayer() //加载当前园区的标注 - this.loadPolygon() + this.loadPolIcon() } if (this.showIconLayer) { //初始化icon图层 this.initIconLayer() + this.loadIcon() } }, //刷新地图 - async refreshMap (isRefreshView) { + async refreshMap (polygonArray, iconArrays) { + this.polygonArray = polygonArray + this.iconArrays = iconArrays - //加载组织数据 - await this.loadOrgData() + if (this.showPolygonLayer) { - //加载当前园区的标注 - await this.loadPolygon() + //加载当前园区的标注 + this.loadPolygon() + } + if (this.showPolIconLayer) { + + //加载当前园区的标注 + this.loadPolIcon() + } + + if (this.showIconLayer) { - //重置地图中心点 - if (isRefreshView) { - this.setMapLocation() - mapView.setCenter(this.centerPoint); - mapView.setZoom(this.zoom); + this.loadIcon() } @@ -323,15 +309,15 @@ const vueGis = { if (this.iconArrays && this.iconArrays.length > 0) { let iconFeatures = []; - this.iconArrays.forEach(oneIcon => { - + this.iconArrays.forEach((oneIcon, index) => { + let urlNum = this.getRndBetween(1, 3) //添加标注 let iconItem = new Feature({ geometry: new Point([oneIcon.longitude, oneIcon.latitude]), id: oneIcon.id, properties: { type: "icon", - info: { ...oneIcon.info } + info: { ...oneIcon } } }); @@ -339,9 +325,10 @@ const vueGis = { image: new Icon({ // anchor: [0.5, 0.5], // imgSize: [32, 32], - scale: 0.5, - src: iconUrlArray[oneIcon.values_.index - 1] - }) + // scale: 0.5, + src: this.iconUrlArray[oneIcon.urlIndex] + }), + text: this.createTextStyle(oneIcon) }); iconItem.setStyle(iconStyle); @@ -353,6 +340,15 @@ const vueGis = { } }, + //icon文字样式 + createTextStyle (feature) { + + let iconTextStyle = { ...this.iconTextStyle } + iconTextStyle.text = feature.values_.name + return new Text({ ...iconTextStyle }) + + }, + //初始化地图 initMap () { this.setMapLocation() @@ -385,9 +381,19 @@ const vueGis = { //目标加载到map中 }) + let that = this map.on('singleclick', function (e) { - // console.log(e.coordinate) - // console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326')); + const feature = map.forEachFeatureAtPixel(e.pixel, function (feature) { + return feature; + }); + if (feature) { + console.log(feature) + that.$emit('clickFeature', feature) + + } + + + }) //去除双击放大效果 @@ -472,6 +478,7 @@ const vueGis = { map.addLayer(polygonLayer) map.addInteraction(select); + }, //初始化多边形icon图层 @@ -491,6 +498,7 @@ const vueGis = { //初始化icon图层 initIconLayer () { + iconSource = new VectorSource({ //features: (new GeoJSON()).readFeatures(geojsonObject) }); @@ -501,9 +509,16 @@ const vueGis = { }); map.addLayer(iconLayer); + // select = new Select({ condition: click, }); + // map.addInteraction(select); + + // select.on('select', e => { + // this.$emit('clickFeature', e) + // }); }, + //取随机数 getRndBetween (lowerLimit, upperLimit) { return Math.floor(Math.random() * (upperLimit - lowerLimit + 1)) + lowerLimit; From 7bd6cce135bd11d5cb5c60bd47804cd461bcb1ae Mon Sep 17 00:00:00 2001 From: jiangyy Date: Thu, 9 Dec 2021 18:59:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/visual/distributionAnalyze.scss | 135 ++++++ .../scss/modules/visual/processAnalyze.scss | 2 +- src/router/index.js | 2 +- .../communityGovern/distributionAnalyze.vue | 436 ++++++++++++++++++ .../communityGovern/distributionLineOption.js | 77 ++++ .../visual/communityGovern/processAnalyze.vue | 35 +- .../visual/communityGovern/resiPieOption.js | 2 +- .../visual/communityGovern/resibuzz.vue | 21 +- .../visual/communityGovern/typeAnalyze.vue | 180 ++++---- 9 files changed, 780 insertions(+), 110 deletions(-) create mode 100644 src/assets/scss/modules/visual/distributionAnalyze.scss create mode 100644 src/views/modules/visual/communityGovern/distributionLineOption.js diff --git a/src/assets/scss/modules/visual/distributionAnalyze.scss b/src/assets/scss/modules/visual/distributionAnalyze.scss new file mode 100644 index 000000000..a5c3918e1 --- /dev/null +++ b/src/assets/scss/modules/visual/distributionAnalyze.scss @@ -0,0 +1,135 @@ +@import '../../c/config'; +@import '../../c/function'; +@import './c/common'; + +.title { + padding: 10px; + font-size: 22px; + font-family: PingFang SC; + font-weight: 800; + color: #ffffff; + display: flex; + align-items: center; + position: relative; + + img { + display: block; + margin-right: 5px; + } + span { + display: block; + } + + .second-select { + margin: 0 10px 0 40px; + + ::v-deep .el-input { + width: 140px; + height: 36px; + .el-input__inner { + height: 100%; + padding: 0 10px; + color: #fff; + line-height: 36px; + background: #06186d; + border: 1px solid #1a64cc; + } + .el-icon-arrow-up:before { + content: '\e78f'; + } + } + ::v-deep .el-date-editor { + .el-input__prefix { + left: unset; + right: 5px; + } + } + } + + .cascader { + ::v-deep .el-input { + width: 220px; + } + } + .status-select { + position: absolute; + top: 20px; + right: 10px; + } + .second-select:last-child { + margin-left: 0; + } +} + +.g-cpt-resi { + display: flex; + flex-direction: row; + // flex-wrap: wrap; + // justify-content: center; + height: calc(100vh - 130px); + + .g-l { + flex-shrink: 0; + width: 600px; + height: calc(100vh - 190px); + } + + .g-r { + text-align: center; + margin: 40px 19px 20px; + width: calc(100vw - 60px - 600px); + height: calc(100vh - 140px - 20px); + } +} + +.g-r { + .tb { + position: relative; + height: calc(100vh - 220px); + overflow-y: auto; + @include scrollBar; + + .m-pagination { + position: absolute; + box-sizing: border-box; + right: 0; + bottom: 0; + + 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; + } + } + } +} + +.echart-wr { + margin-left: 30px; + // margin-top: 100px; + text-align: center; + position: relative; + width: 500px; + height: 100%; + box-sizing: border-box; + .echart-org { + width: 100%; + height: 90%; + } +} diff --git a/src/assets/scss/modules/visual/processAnalyze.scss b/src/assets/scss/modules/visual/processAnalyze.scss index 82b0e3119..2f228f2e5 100644 --- a/src/assets/scss/modules/visual/processAnalyze.scss +++ b/src/assets/scss/modules/visual/processAnalyze.scss @@ -200,10 +200,10 @@ } .status-closed { - border-radius: 5px 0 0 0; } .status-pending { + border-radius: 5px 0 0 0; } .sel-status { background-color: #082586; diff --git a/src/router/index.js b/src/router/index.js index bc43c78a3..fff616d17 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -274,7 +274,7 @@ router.beforeEach((to, from, next) => { }, { url: "/visual/communityGovern/distributionAnalyze", - name: "项目分布分析", + name: "事件分类分析", id: "distributionAnalyze", }, ], diff --git a/src/views/modules/visual/communityGovern/distributionAnalyze.vue b/src/views/modules/visual/communityGovern/distributionAnalyze.vue index e69de29bb..c4e04f5ca 100644 --- a/src/views/modules/visual/communityGovern/distributionAnalyze.vue +++ b/src/views/modules/visual/communityGovern/distributionAnalyze.vue @@ -0,0 +1,436 @@ + + + + + + + diff --git a/src/views/modules/visual/communityGovern/distributionLineOption.js b/src/views/modules/visual/communityGovern/distributionLineOption.js new file mode 100644 index 000000000..ef7dec010 --- /dev/null +++ b/src/views/modules/visual/communityGovern/distributionLineOption.js @@ -0,0 +1,77 @@ +import * as echarts from 'echarts' +export function lineOption () { + + return { + + xAxis: { + type: 'category', + // boundaryGap: false, + axisLabel: { + color: '#8ec7dc', + fontSize: 16 + }, + axisTick: { + show: false + }, + axisLine: { + lineStyle: { + color: '#0c4b59' + } + } + }, + yAxis: { + nameTextStyle: { + color: '#8ec7dc', + fontSize: 18 + }, + splitNumber: 4, + minInterval: 1, + show: true, + type: 'value', + axisLabel: { + color: '#8ec7dc', + fontSize: 18 + }, + axisTick: { + show: false + }, + splitLine: { + lineStyle: { + color: ['#145968'], + type: 'dotted' + } + }, + axisLine: { + show: true, + symbol: ['none', 'arrow'], + symbolOffset: [0, 15], + lineStyle: { + color: '#0c4b59' + } + } + }, + series: [ + { + name: '项目数', + type: 'line', + barWidth: 15, + areaStyle: {}, + itemStyle: { + color: new echarts.graphic.LinearGradient( + 0, 1, 0, 0, + [ + { offset: 0, color: 'rgba(121, 55, 255, 0)' }, + { offset: 1, color: '#6339FF' } + ] + ) + } + }, + // { + // data: [820, 932, 901, 934, 1290, 1330, 1320], + // type: 'line', + // areaStyle: {} + // } + ] + + } +} diff --git a/src/views/modules/visual/communityGovern/processAnalyze.vue b/src/views/modules/visual/communityGovern/processAnalyze.vue index 88fe8925d..f4c6f7e50 100644 --- a/src/views/modules/visual/communityGovern/processAnalyze.vue +++ b/src/views/modules/visual/communityGovern/processAnalyze.vue @@ -19,6 +19,7 @@ @@ -60,20 +61,20 @@ @clickFeature="clickProject" :showIconLayer="true">
-
已完结
未完结
+ @click="handleChangeStatus('pending')">未结案
+
已结案
+
- - - 已完结 - 未完结 + 未结案 + + 已结案 +
@@ -127,7 +128,7 @@ export default { dateId: '', agencyId: '', - status: 'closed',//状态:待处理 pending,结案closed + status: 'pending',//状态:待处理 pending,结案closed agencyInfo: {}, projectList: [], projectList1: [ @@ -196,6 +197,8 @@ export default { async mounted () { this.userId = this.uid; this.initData() + await this.getWorkUserInfo() + await this.getAgencylist()//获取组织级别 this.getApiData(); }, @@ -206,14 +209,17 @@ export default { }, async getApiData () { - await this.getWorkUserInfo() - // await this.getAgencylist()//获取组织级别 await this.getProjectTotal() await this.loadProjectlist() await this.getLine() }, + handleChangeDate (value) { + this.dateId = value + this.getApiData() + }, + // 获取当前管理员信息 getWorkUserInfo () { const url = '/epmetuser/customerstaff/staffbasicinfo' @@ -239,7 +245,8 @@ export default { // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' const params = { - customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + customerId: '0c41b272ee9ee95ac6f184ad548a30eb' } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -471,7 +478,6 @@ export default { }); - this.pieOption.title.text = this.pieTotal this.clickPie(0) @@ -527,6 +533,7 @@ export default { this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' + this.getApiData() console.log(this.agencyIdArray) }, diff --git a/src/views/modules/visual/communityGovern/resiPieOption.js b/src/views/modules/visual/communityGovern/resiPieOption.js index 64b6ad984..7d195966b 100644 --- a/src/views/modules/visual/communityGovern/resiPieOption.js +++ b/src/views/modules/visual/communityGovern/resiPieOption.js @@ -85,7 +85,7 @@ const center= ['50%', '250px'] // formatter: '{a|{c}}\n\n{name|{b}}', formatter: '{a|{c}}\n{r|}\n{name|{b}}', minMargin: 5, - edgeDistance: 1, + edgeDistance: -20, lineHeight: 15, color: '#fff', fontSize: 12, diff --git a/src/views/modules/visual/communityGovern/resibuzz.vue b/src/views/modules/visual/communityGovern/resibuzz.vue index 8b7406b6e..f042af0b4 100644 --- a/src/views/modules/visual/communityGovern/resibuzz.vue +++ b/src/views/modules/visual/communityGovern/resibuzz.vue @@ -93,7 +93,7 @@ export default { { count: 300, categoryName: '环境保护', color: '#FF7800' }, { count: 1048, categoryName: '建设管理', color: '#FFBA00' }, { count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, - { count: 580, categoryName: '社会治安综合', color: '#2A00FF' }, + { count: 1580, categoryName: '社会治安综合', color: '#2A00FF' }, { count: 484, categoryName: '公安交通管理', color: '#C600FF' }, { count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, { count: 484, categoryName: '民生', color: '#3DDA83' }, @@ -215,7 +215,8 @@ export default { // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' const params = { - customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + customerId: '0c41b272ee9ee95ac6f184ad548a30eb' } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -275,12 +276,24 @@ export default { this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] } - this.pieData.forEach(item => { + let maxValue = this.pieData[0].count + let maxIndex = 0 + this.pieData[0].selected = true + + this.pieData.forEach((item, index) => { item.name = item.categoryName item.value = item.count this.colorArray.push(item.color) this.pieTotal = this.pieTotal + item.value + if (item.value > maxValue) { + maxValue = item.value + maxIndex = index + item.selected = true + } else if (index !== 0) { + item.selected = false + } + }); @@ -290,7 +303,7 @@ export default { return _that.colorArray[params.dataIndex] } } - this.clickPie(0) + this.clickPie(maxIndex) let fun = function (params) { _that.clickPie(params.dataIndex) diff --git a/src/views/modules/visual/communityGovern/typeAnalyze.vue b/src/views/modules/visual/communityGovern/typeAnalyze.vue index 69a2c7668..8e77ebdb0 100644 --- a/src/views/modules/visual/communityGovern/typeAnalyze.vue +++ b/src/views/modules/visual/communityGovern/typeAnalyze.vue @@ -2,7 +2,7 @@
- 居民热议 + 事件分类分析
@@ -15,17 +15,17 @@ @change="handleChangeAgency" clearable>
-
- - - - +
+ + + +
@@ -70,7 +70,7 @@ import cptCard from "@/views/modules/visual/cpts/card"; import cptTb from "@/views/modules/visual/cpts/tb"; import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; -import { pieOption } from './resiPieOption.js' +import { pieOption } from './typePieOption.js' export default { @@ -86,41 +86,23 @@ export default { pieTotal: 0, colorArray: [], pieData: [ - { count: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, - { count: 735, categoryName: '为民服务', color: '#00E5ED' }, - { count: 580, categoryName: '安全监管', color: '#7800FF' }, - { count: 484, categoryName: '民政', color: '#16D783' }, - { count: 300, categoryName: '环境保护', color: '#FF7800' }, - { count: 1048, categoryName: '建设管理', color: '#FFBA00' }, - { count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, - { count: 580, categoryName: '社会治安综合', color: '#2A00FF' }, - { count: 484, categoryName: '公安交通管理', color: '#C600FF' }, - { count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, - { count: 484, categoryName: '民生', color: '#3DDA83' }, - { count: 300, categoryName: '街道安全', color: '#FAC126' } - ], - //voting 已转项目:shift_project 已关闭:closed,全部:all - stateArray: [ - { - label: '全部', - value: 'all' - }, - { - label: '表决中', - value: 'voting' - }, - { - label: '已转项目', - value: 'shift_project' - }, - { - label: '已关闭', - value: 'closed' - }, + { total: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, + { total: 735, categoryName: '为民服务', color: '#00E5ED' }, + { total: 580, categoryName: '安全监管', color: '#7800FF' }, + { total: 484, categoryName: '民政', color: '#16D783' }, + { total: 300, categoryName: '环境保护', color: '#FF7800' }, + { total: 1049, categoryName: '建设管理', color: '#FFBA00' }, + { total: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, + { total: 580, categoryName: '社会治安综合', color: '#2A00FF' }, + { total: 484, categoryName: '公安交通管理', color: '#C600FF' }, + { total: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, + { total: 484, categoryName: '民生', color: '#3DDA83' }, + { total: 300, categoryName: '街道安全', color: '#FAC126' } ], - status: 'all', - orgId: '', + agencyId: '', + dateId: '', + categoryCode: '', demand: { loading: true, colList: [ @@ -132,18 +114,10 @@ export default { align: "center", width: "10%", }, - { - align: "center", - width: "20%", - }, { align: "center", width: "10%", }, - { - align: "center", - width: "5%", - }, { align: "center", width: "10%", @@ -154,22 +128,22 @@ export default { }, { align: "center", - width: "15%", + width: "5%", }, { align: "center", - width: "5%", + width: "20%", }, { align: "center", - width: "5%", + width: "10%", }, { align: "center", width: "10%", }, ], - header: ["序号", "议题标题", "处理意见", "分类", "状态", "创建时间", "发起人", "已表态/应表态", "支持", "反对", "操作"], + header: ["序号", "项目编号", "类别", "反映渠道", "所属网格", "状态", "项目标题", "转成项目时间", "操作"], list: [], pageSize: 10, pageNo: 1, @@ -199,13 +173,19 @@ export default { async mounted () { this.userId = this.uid; + this.initData() + await this.getAgencylist()//获取组织级别 this.getApiData(); }, methods: { + initData () { + var time = (new Date).getTime() - 24 * 60 * 60 * 1000; + this.dateId = new Date(time); // 获取的是前一天日期 + }, async getApiData () { - await this.getAgencylist()//获取组织级别 + await this.getPie() await this.getTable(); }, @@ -215,7 +195,8 @@ export default { // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist' const params = { - customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + // customerId: '613cc61a6b8ce4c70d21bd413dac72cc' + customerId: '0c41b272ee9ee95ac6f184ad548a30eb' } const { data, code, msg } = await requestPost(url, params) if (code === 0) { @@ -232,6 +213,12 @@ export default { } }, + handleChangeDate (value) { + + this.dateId = value + this.getApiData() + }, + pieInitOk (dom) { console.log('pie准备好了', dom) @@ -254,17 +241,16 @@ export default { this.pieTotal = 0 const _that = this // this.$refs.pieChart.showLoading() - // const url ="/gov/issue/issue/resibuzz-leftpiechart"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart"; + // const url ="/data/aggregator/project/projectcategorylist"; + const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist"; let params = { - orgId: this.orgId, + agencyId: this.agencyId, + dateId: this.dateId, }; const { data, code, msg } = await requestPost(url, params); // 获取pieChart配置 - - if (code === 0) { // 获取pieChart配置 this.pieOption = pieOption(this.pieChartS) @@ -272,35 +258,50 @@ export default { // this.pieData = data } else { - this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }] + this.pieData = [{ total: 0, categoryName: '无分类', color: '#00E5ED' }] } - this.pieData.forEach(item => { + let maxValue = this.pieData[0].total + let maxIndex = 0 + this.pieData[0].selected = true + this.pieData.forEach((item, index) => { item.name = item.categoryName - item.value = item.count + item.value = item.total this.colorArray.push(item.color) this.pieTotal = this.pieTotal + item.value + if (item.value > maxValue) { + maxValue = item.value + maxIndex = index + item.selected = true + } else if (index !== 0) { + item.selected = false + } + }); + this.pieOption.title.text = this.pieTotal this.pieOption.series[1].itemStyle = { color: function (params) { return _that.colorArray[params.dataIndex] } } - this.clickPie(0) + let fun = function (params) { _that.clickPie(params.dataIndex) + + _that.categoryCode = _that.pieData[params.dataIndex].categoryCode + _that.getTable() } this.$refs.pieChart.handleClick(fun) + this.clickPie(maxIndex) } else { this.$message.error(msg); } - }, clickPie (seriesIndex) { @@ -341,26 +342,25 @@ export default { }, - handleChangeState (index) { - this.getTable() - }, - handleChangeAgency (value) { - console.log(value) + this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label - this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' + this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' + this.getApiData() console.log(this.agencyIdArray) }, //加载组织数据 async getTable () { - // const url = "/gov/issue/issue/resibuzz"; - const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz"; + // const url = "/data/aggregator/project/categoryprojectlist"; + const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist"; let params = { - status: this.status, - orgId: this.orgId, + dateId: this.dateId, + agencyId: this.agencyId, + categoryCode: this.categoryCode, pageNo: this.demand.pageNo, pageSize: this.demand.pageSize, + isPage: true }; const { data, code, msg } = await requestPost(url, params); @@ -369,17 +369,19 @@ export default { if (code === 0) { this.demand.total = data.total; this.demand.list = data.list.map((item) => { + //楼院小组:issue; 项目立项:agency 事件上报:resi_event【也可控制点击查看时里边三个按钮的显示】 + item.originShow = item.origin === 'issue' ? '楼院小组' : item.origin === 'agency' ? '项目立项' : '事件上报' + //状态:待处理 pending,已结案closed + item.statusShow = item.status === 'pending' ? '待处理' : '已结案' return [ { type: "index" }, - item.issueTitle, - item.suggestion, - item.categoryName, - item.status, - item.createdTime, - item.issueOriginator, - item.voteAccount, - item.supportCount, - item.oppositionCount, + item.projectCode, + item.categoryNames.join(','), + item.originShow, + item.gridName, + item.statusShow, + item.title, + item.time, { type: "operate", list: ["查看"] }, ]; }); From fe7c3a29e0329f86ffedabc6783346defd2d07f1 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Fri, 10 Dec 2021 09:27:24 +0800 Subject: [PATCH 3/4] dd --- public/index.html | 4 +- .../visual/communityParty/community.vue | 7 + .../visual/communityParty/dialogInfo.vue | 186 ++++++++++++++++++ .../visual/components/screen-table/index.vue | 5 +- 4 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 src/views/modules/visual/communityParty/dialogInfo.vue diff --git a/public/index.html b/public/index.html index be512c579..99efda61b 100644 --- a/public/index.html +++ b/public/index.html @@ -36,8 +36,8 @@ <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> diff --git a/src/views/modules/visual/communityParty/community.vue b/src/views/modules/visual/communityParty/community.vue index 466ee5428..28bb7fa1b 100644 --- a/src/views/modules/visual/communityParty/community.vue +++ b/src/views/modules/visual/communityParty/community.vue @@ -95,6 +95,10 @@
+ @@ -103,15 +107,18 @@ import { requestPost } from "@/js/dai/request"; 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' export default { name: "warning-box", components: { cptCard, screenTable, + dialogInfo }, data() { return { + showedMoreInfo: true, tableLoading: false, warningList: [], headerList: [ diff --git a/src/views/modules/visual/communityParty/dialogInfo.vue b/src/views/modules/visual/communityParty/dialogInfo.vue new file mode 100644 index 000000000..d81a21b49 --- /dev/null +++ b/src/views/modules/visual/communityParty/dialogInfo.vue @@ -0,0 +1,186 @@ + + + + + + diff --git a/src/views/modules/visual/components/screen-table/index.vue b/src/views/modules/visual/components/screen-table/index.vue index cd75b9439..9d1861acb 100644 --- a/src/views/modules/visual/components/screen-table/index.vue +++ b/src/views/modules/visual/components/screen-table/index.vue @@ -42,7 +42,7 @@ --> -
查看
+
查看
加载中
@@ -296,6 +296,9 @@ export default { } } } + .td-btn { + color: #e4dc00; + } &-tr:nth-child(2n) { background: rgba(16, 75, 164, 0.24); From 30f0cc32285dbbf79a179037f3a82a6a8a7f56a0 Mon Sep 17 00:00:00 2001 From: 13176889840 <13176889840@163.com> Date: Fri, 10 Dec 2021 09:52:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E9=9C=80=E6=B1=82=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityService/measure/index.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue index a249a9538..2582b9294 100644 --- a/src/views/modules/communityService/measure/index.vue +++ b/src/views/modules/communityService/measure/index.vue @@ -17,7 +17,7 @@ @@ -448,6 +448,7 @@ export default { ], reportOptions: [], demandOptions: [], + searchdemandOptions: [], demandUserList: [], optionsG: [], optionsEditG: [], @@ -918,6 +919,16 @@ export default { }) return arr }, + getFlagData(data, flag) { + if (!Array.isArray(data)) return [] + let arr1 = data.filter(item => item[flag]) + let arr2 = arr1.map(item => { + if (item.children) return { ...item, children: this.getFlagData(item.children, flag) } + else return item + }) + // console.log('arrr-oppp', arr2) + return arr2 + }, async getGridList(type, agencyId) { const { user } = await this.$store.state console.log('user---ppp', user) @@ -969,7 +980,8 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - this.demandOptions = this.getTreeData(res.data) + this.searchdemandOptions = this.getTreeData(res.data) + this.demandOptions = this.getFlagData(this.getTreeData(res.data), 'usableFlag') } }) .catch(() => {