diff --git a/src/api/area.js b/src/api/area.js index 462fa96..719064c 100644 --- a/src/api/area.js +++ b/src/api/area.js @@ -70,4 +70,32 @@ export function selectMonthAreaEvent(params) { }) } +// 数据统计--分类 +export function selectEventType(params) { + return request({ + url: 'api/project/keyArea/selectEventType', + method: 'get', + params + }) +} + + +// 弹窗--近7天 +export function selectLocalWeekArea(params) { + return request({ + url: 'api/project/keyArea/selectLocalWeekArea', + method: 'get', + params + }) +} + +// 弹窗--近30天 +export function selectLocalMonthArea(params) { + return request({ + url: 'api/project/keyArea/selectLocalMonthArea', + method: 'get', + params + }) +} + \ No newline at end of file diff --git a/src/views/pages/area/components/ImportantAreaPop.vue b/src/views/pages/area/components/ImportantAreaPop.vue index d86a326..7df2bb8 100644 --- a/src/views/pages/area/components/ImportantAreaPop.vue +++ b/src/views/pages/area/components/ImportantAreaPop.vue @@ -100,7 +100,7 @@ import bus from "@/views/layout/bus"; import 'viewerjs/dist/viewer.css' import { directive as viewer } from "v-viewer" import * as echarts from 'echarts' -import {selectWeekPmAndNoice,selectMonthPmAndNoice} from '@/api/construction/index.js' +import {selectLocalWeekArea, selectLocalMonthArea} from '@/api/area.js' export default { name: "", props: { @@ -112,15 +112,22 @@ export default { }, }, mounted() { - selectWeekPmAndNoice({buildLicense:this.feature.data.buildLicense}).then((res) => { - console.log(res) - }) - selectMonthPmAndNoice({buildLicense:this.feature.data.buildLicense}).then((res) => { - console.log(res) - }) - this.$nextTick( () => { + selectLocalWeekArea({areaName: this.feature.data.areaName}).then((res) => { + res.data.data.forEach((item) => { + this.weekData.time.unshift(item.pushTime) + this.weekData.local.unshift(item.localNums) + this.weekData.outer.unshift(item.nonlocalNums) + }) + this.chartData = this.weekData this.initCharts() }) + selectLocalMonthArea({areaName: this.feature.data.areaName}).then((res) => { + res.data.data.forEach((item) => { + this.monthData.time.unshift(item.pushTime) + this.monthData.local.unshift(item.localNums) + this.monthData.outer.unshift(item.nonlocalNums) + }) + }) }, data() { return { @@ -128,8 +135,18 @@ export default { typeSelect:['近7天','近30天',], typeSelectActive:'近7天', }, - cameraData: [] - + cameraData: [], + weekData:{ + time:[], + local:[], + outer:[], + }, + monthData:{ + time:[], + local:[], + outer:[], + }, + chartData:{}, }; }, methods: { @@ -148,10 +165,17 @@ export default { }, typeSelect(item) { this.filterButton.typeSelectActive = item + if(item == '近7天'){ + this.chartData = this.weekData + } + if(item == '近30天'){ + this.chartData = this.monthData + } this.initCharts() }, initCharts () { + console.log('this.chartData---', this.chartData) const option = { grid: { bottom: 34, @@ -171,7 +195,7 @@ export default { show: false, }, boundaryGap: ['2%', '2%'], - data: ['1', '2', '3', '4', '5', '6', '7'] + data: this.chartData.time }, yAxis: [ { @@ -196,26 +220,7 @@ export default { color: ['#1d3556','#18334c'] } } - }, - { - type: 'value', - name: '人', - nameTextStyle: { - color: 'rgba(255, 255, 255,.8)' - }, - axisLabel: { - color: 'rgba(255, 255, 255,.8)', - show: true, - }, - axisLine: { - show: false, - }, - splitLine: { - show: false, - }, - max:100, - min: 0, - }, + } ], color: ['#309afe','#fab228'], legend: { @@ -230,7 +235,7 @@ export default { series: [ { name: '本地人数', - data: [60, 30, 60, 70, 40, 60, 70], + data: this.chartData.local, type: 'bar', symbol: 'none', lineStyle: { @@ -252,7 +257,7 @@ export default { }, { name: '外地人数', - data: [30, 40, 50, 80, 90, 40, 60], + data: this.chartData.outer, type: 'bar', symbol: 'none', lineStyle: { diff --git a/src/views/pages/area/components/SiteList.vue b/src/views/pages/area/components/SiteList.vue index b2c1ee9..b1941f7 100644 --- a/src/views/pages/area/components/SiteList.vue +++ b/src/views/pages/area/components/SiteList.vue @@ -148,9 +148,9 @@ export default { // 行点击 analyse(row) { // bus.$emit("openCauseAnalysis", row); + this.$parent.hiMapFun.removerPolygon() + this.$parent.removeRoadCauseAnalysis() if(row.latitude && row.longitude) { - this.$parent.hiMapFun.removerPolygon() - this.$parent.removeRoadCauseAnalysis() this.$parent.hiMapFun.removeLayerByLayerName("roadPoint"); this.$parent.hiMap.mapObj.map.flyTo({ lat: row.latitude, lng: row.longitude }); let dataEvent = [{ @@ -164,20 +164,29 @@ export default { "roadPoint", createImportantAreaPop ); - } else { - selectByAreaName({areaName:row.areaName}).then((res) => { - if(res.data.data){ - let areaLatLng = [] - res.data.data.forEach((item) => { - let lonLat = gcjLL2wgs84LL(item.longitude, item.latitude); - areaLatLng.push([lonLat[1],lonLat[0]]) - }) - this.$parent.hiMapFun.removerPolygon() - this.$parent.removeRoadCauseAnalysis() - this.$parent.hiMapFun.addAreaToMap(areaLatLng) - } - }) - } + } else if(row.point) { + let arr = JSON.parse(row.point) + let areaLatLng = [] + arr.forEach((item) => { + let lonLat = gcjLL2wgs84LL(item[0], item[1]); + areaLatLng.push([lonLat[1],lonLat[0]]) + }) + this.$parent.hiMapFun.addAreaToMap(areaLatLng) + } + // else { + // selectByAreaName({areaName:row.areaName}).then((res) => { + // if(res.data.data){ + // let areaLatLng = [] + // res.data.data.forEach((item) => { + // let lonLat = gcjLL2wgs84LL(item.longitude, item.latitude); + // areaLatLng.push([lonLat[1],lonLat[0]]) + // }) + // this.$parent.hiMapFun.removerPolygon() + // this.$parent.removeRoadCauseAnalysis() + // this.$parent.hiMapFun.addAreaToMap(areaLatLng) + // } + // }) + // } }, // 关闭基本信息窗口 informationClose() { diff --git a/src/views/pages/area/components/StatisticalAnalysis.vue b/src/views/pages/area/components/StatisticalAnalysis.vue index d95403d..17470af 100644 --- a/src/views/pages/area/components/StatisticalAnalysis.vue +++ b/src/views/pages/area/components/StatisticalAnalysis.vue @@ -75,7 +75,7 @@