From 3aa1284cfb8b8f81ab331f20a70c35400be5f4b3 Mon Sep 17 00:00:00 2001 From: gaoyuanwei <2826352639@qq.com> Date: Wed, 7 Sep 2022 14:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E6=B0=B4=E7=82=B9echarts=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/waterPoints.js | 33 +- .../waterPoints/components/ComplaintEvent.vue | 152 +++--- .../waterPoints/components/WaterHistory.vue | 445 ++++++++++++++++++ .../waterPoints/components/WaterPointPop.vue | 251 +++++----- 4 files changed, 689 insertions(+), 192 deletions(-) create mode 100644 src/views/pages/waterPoints/components/WaterHistory.vue diff --git a/src/api/waterPoints.js b/src/api/waterPoints.js index 3c7cff4..2c4d460 100644 --- a/src/api/waterPoints.js +++ b/src/api/waterPoints.js @@ -8,7 +8,6 @@ export function selectWaterPoint(params) { }) } - export function selectWaterCamera(params) { return request({ url: 'api/project/water/selectWaterCamera', @@ -65,3 +64,35 @@ export function selectWaterPoliceList(params) { params }) } +// 根据积水点查询该点存在积水情况的日期 +export function selectWaterPondingDate(params) { + return request({ + url: 'api/project/water/selectWaterPondingDate', + method: 'get', + params + }) +} +// 查询当天的积水点深度情况 +export function selectWaterPondingInDay(params) { + return request({ + url: 'api/project/water/selectWaterPondingInDay', + method: 'get', + params + }) +} +// 查询积水点当月内每天最深深度 +export function selectWaterPondingInMonth(params) { + return request({ + url: 'api/project/water/selectWaterPondingInMonth', + method: 'get', + params + }) +} +// 查询积水点当月内每天积水时长 +export function selectWaterPondingHoursInMonth(params) { + return request({ + url: 'api/project/water/selectWaterPondingHoursInMonth', + method: 'get', + params + }) +} diff --git a/src/views/pages/waterPoints/components/ComplaintEvent.vue b/src/views/pages/waterPoints/components/ComplaintEvent.vue index 007c5e0..d09a821 100644 --- a/src/views/pages/waterPoints/components/ComplaintEvent.vue +++ b/src/views/pages/waterPoints/components/ComplaintEvent.vue @@ -23,6 +23,7 @@ +
总数:{{allNum}}个
import dayjs from 'dayjs' import { selectRaise, getAndSaveRecords, selectNoiceEvent } from '@/api/construction/index' -import { selectWaterPoint,selectWaterCamera,selectReportOrigin, selectWaterPoliceList } from '@/api/waterPoints' +import { selectWaterPoint, selectWaterCamera, selectReportOrigin, selectWaterPoliceList } from '@/api/waterPoints' import StatisticalAnalysis from './StatisticalAnalysis.vue' import bus from '@/views/layout/bus' import { @@ -75,33 +76,33 @@ export default { return { tabsButton: [ { - title:'全部', - id:'all' + title: '全部', + id: 'all' }, { - title:'水务局', - id:'auditorReport' + title: '水务局', + id: 'auditorReport' }, { - title:'城管局', - id:'case' + title: '交警', + id: 'trafficPolice' }, { - title:'智能算法识别', - id:'video' + title: '群众上报', + id: 'commonReport' }, { - title:'水务集团', - id:'null' + title: '智能算法识别', + id: 'video' }, { - title:'群众上报', - id:'commonReport' - }, - { - title:'交警', - id:'trafficPolice' - }, + title: '城管局', + id: 'case' + } + // { + // title:'水务集团', + // id:'null' + // }, ], tabsActiveName: '全部', statisticalAnalysisIsShow: false, @@ -124,10 +125,12 @@ export default { // topType: '物联感知', // type: '影响车辆(>30cm)', // text: '液位:12cm' - // }, + // }, ], - listAll:[], - policeList: [] + listAll: [], + policeList: [], + // 单项总数 + allNum: 0 } }, components: { @@ -137,8 +140,8 @@ export default { const currentDate = new Date() currentDate.setTime(currentDate.getTime()) currentDate.setTime(currentDate.getTime() - 24 * 60 * 60 * 1000) - const yMonth = currentDate.getMonth() > 8 ? currentDate.getMonth() + 1: '0' + (currentDate.getMonth()+1) - const yDate = currentDate.getDate() > 9 ? currentDate.getDate(): '0' + currentDate.getDate() + const yMonth = currentDate.getMonth() > 8 ? currentDate.getMonth() + 1 : '0' + (currentDate.getMonth() + 1) + const yDate = currentDate.getDate() > 9 ? currentDate.getDate() : '0' + currentDate.getDate() this.preTime = currentDate.getFullYear() + '-' + @@ -154,13 +157,14 @@ export default { // this.selectRaise() // this.selectNoiceEvent() - selectWaterPoint().then( (res) => { + selectWaterPoint().then((res) => { selectWaterPoliceList().then((policeRes) => { - this.policeList = policeRes.data.data || [] - let dataAll = [...res.data.data, ...policeRes.data.data] + this.policeList = policeRes.data.data || [] + const dataAll = [...res.data.data, ...policeRes.data.data] this.list = dataAll this.listAll = dataAll - bus.$emit('waterPoint',dataAll) + this.allNum = this.list.length + bus.$emit('waterPoint', dataAll) }) // this.list = res.data.data // this.listAll = res.data.data @@ -173,9 +177,9 @@ export default { // }) }, methods: { - getDesc(item) { - let deepth = item.waterPointDepth ? parseFloat(item.waterPointDepth) * 100 : 0 - switch(item.pointLevel) { + getDesc (item) { + const deepth = item.waterPointDepth ? (parseFloat(item.waterPointDepth) * 100).toFixed(0) : 0 + switch (item.pointLevel) { case 'traffic': return `影响车辆(${deepth}cm)` break @@ -190,76 +194,80 @@ export default { selectType (item) { if (this.filterButton.typeActive.indexOf(item) > -1) { this.filterButton.typeActive.splice(this.filterButton.typeActive.indexOf(item), 1) - if(this.filterButton.typeActive.length == 0){ + if (this.filterButton.typeActive.length == 0) { this.list = [] - } else{ - switch(item){ + } else { + switch (item) { case '影响车辆(>30cm)': - this.list = this.list.filter( v => v.pointLevel != 'traffic') - break; + this.list = this.list.filter(v => v.pointLevel != 'traffic') + break case '影响行人(<30cm)': - this.list = this.list.filter( v => v.pointLevel != 'pedestrian') - break; + this.list = this.list.filter(v => v.pointLevel != 'pedestrian') + break case '无积水(<10cm)': - this.list = this.list.filter( v => v.pointLevel != 'non') - break; + this.list = this.list.filter(v => v.pointLevel != 'non') + break } } } else { this.filterButton.typeActive.push(item) - if(this.filterButton.typeActive.length == 3){ + if (this.filterButton.typeActive.length == 3) { this.list = this.listAll } else { - switch(item){ + switch (item) { case '影响车辆(>30cm)': - this.list = this.list.concat(this.listAll.filter( v => v.pointLevel == 'traffic')) - break; + this.list = this.list.concat(this.listAll.filter(v => v.pointLevel == 'traffic')) + break case '影响行人(<30cm)': - this.list = this.list.concat(this.listAll.filter( v => v.pointLevel == 'pedestrian')) - break; + this.list = this.list.concat(this.listAll.filter(v => v.pointLevel == 'pedestrian')) + break case '无积水(<10cm)': - this.list = this.list.concat(this.listAll.filter( v => v.pointLevel == 'non')) - break; + this.list = this.list.concat(this.listAll.filter(v => v.pointLevel == 'non')) + break } } } - bus.$emit('waterPoint',this.list) + bus.$emit('waterPoint', this.list) this.$parent.eventCheckList = this.filterButton.typeActive }, tabHandleClick (item) { + this.allNum = 0 this.tabsActiveName = item.title this.filterButton.typeActive = ['影响车辆(>30cm)', '影响行人(<30cm)', '无积水(<10cm)'] if (item.title == '全部') { - selectWaterPoint().then( (res) => { + selectWaterPoint().then((res) => { selectWaterPoliceList().then((policeRes) => { - let dataAll = [...res.data.data, ...policeRes.data.data] + const dataAll = [...res.data.data, ...policeRes.data.data] this.list = dataAll // this.listAll = dataAll - bus.$emit('waterPoint',dataAll) + bus.$emit('waterPoint', dataAll) + this.allNum = this.list.length }) }) - } else if(item.title == '交警') { + } else if (item.title == '交警') { this.list = this.policeList - bus.$emit('waterPoint',this.list) - } else if(item.id == 'auditorReport') { + this.allNum = this.list.length + bus.$emit('waterPoint', this.list) + } else if (item.id == 'auditorReport') { this.list = [] this.listAll.forEach(tempItem => { - if(tempItem.reportOrigin === 'auditorReport') { + if (tempItem.reportOrigin === 'auditorReport') { this.list.push(tempItem) } }) - bus.$emit('waterPoint',this.list) + this.allNum = this.list.length + bus.$emit('waterPoint', this.list) } else { - selectReportOrigin({reportOrigin:item.id}).then( (res) => { - + selectReportOrigin({ reportOrigin: item.id }).then((res) => { this.list = res.data.data - bus.$emit('waterPoint',res.data.data) + this.allNum = this.list.length + bus.$emit('waterPoint', res.data.data) }) } }, - reportOrigin(reportOrigin){ + reportOrigin (reportOrigin) { switch (reportOrigin) { case 'auditorReport': return '水务集团上报' @@ -272,7 +280,6 @@ export default { default: return '未知' } - }, openStatisticalAnalysis () { this.statisticalAnalysisIsShow = true @@ -347,8 +354,8 @@ export default { } }, - openDialog(item) { - bus.$emit("openWaterPointDialog", item); + openDialog (item) { + bus.$emit('openWaterPointDialog', item) } } } @@ -494,7 +501,10 @@ export default { cursor: pointer; } } - + .allNum { + color: #ffffff; + margin: 12px 0px 0 12px; + } .filter-btn-box { margin-top: 16px; .filter-btn-typeSelect { @@ -535,17 +545,17 @@ export default { margin-left: 8px; } } - .processStateSelect-btn:nth-child(1){ + .processStateSelect-btn:nth-child(1) { .select-circle { border: 1px solid #f74b3f; } } - .processStateSelect-btn:nth-child(2){ + .processStateSelect-btn:nth-child(2) { .select-circle { border: 1px solid #ffae2b; } } - .processStateSelect-btn:nth-child(3){ + .processStateSelect-btn:nth-child(3) { .select-circle { border: 1px solid #31d779; } @@ -565,17 +575,17 @@ export default { border-radius: 50%; } } - .processStateSelect-btn-active:nth-child(1){ + .processStateSelect-btn-active:nth-child(1) { .select-circle::after { background: #f74b3f; } } - .processStateSelect-btn-active:nth-child(2){ + .processStateSelect-btn-active:nth-child(2) { .select-circle::after { background: #ffae2b; } } - .processStateSelect-btn-active:nth-child(3){ + .processStateSelect-btn-active:nth-child(3) { .select-circle::after { background: #31d779; } @@ -691,7 +701,7 @@ export default { .box3 { color: #fff; margin-top: 10px; - height: 620px; + height: 600px; overflow-y: scroll; cursor: pointer; .item { diff --git a/src/views/pages/waterPoints/components/WaterHistory.vue b/src/views/pages/waterPoints/components/WaterHistory.vue new file mode 100644 index 0000000..8346b3e --- /dev/null +++ b/src/views/pages/waterPoints/components/WaterHistory.vue @@ -0,0 +1,445 @@ + + + + + diff --git a/src/views/pages/waterPoints/components/WaterPointPop.vue b/src/views/pages/waterPoints/components/WaterPointPop.vue index e86b53d..4566ddf 100644 --- a/src/views/pages/waterPoints/components/WaterPointPop.vue +++ b/src/views/pages/waterPoints/components/WaterPointPop.vue @@ -17,7 +17,7 @@
+