diff --git a/src/api/dashboard.js b/src/api/dashboard.js index 6ad37f1..8c8bfd5 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -34,10 +34,19 @@ }) } -// 查询一级分区7日用水量 -export function countByDayFirst(params) { +// 查询二级分区各区用水量对比 +export function waterCompare(params) { return request({ - url: 'waterStatistic/countByDayFirst', + url: 'waterStatistic/waterCompare', + method: 'get', + params + }) +} + +// 查询一级分区7日用水量 +export function countByDaySecond(params) { + return request({ + url: 'waterStatistic/countByDay', method: 'get', params }) diff --git a/src/api/dashboard.js b/src/api/dashboard.js index 6ad37f1..8c8bfd5 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -34,10 +34,19 @@ }) } -// 查询一级分区7日用水量 -export function countByDayFirst(params) { +// 查询二级分区各区用水量对比 +export function waterCompare(params) { return request({ - url: 'waterStatistic/countByDayFirst', + url: 'waterStatistic/waterCompare', + method: 'get', + params + }) +} + +// 查询一级分区7日用水量 +export function countByDaySecond(params) { + return request({ + url: 'waterStatistic/countByDay', method: 'get', params }) diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue index 45359c9..8320d47 100644 --- a/src/components/BigData/Card/index.vue +++ b/src/components/BigData/Card/index.vue @@ -10,7 +10,7 @@
{{ context }} - {{unit}} + {{unit}}
diff --git a/src/api/dashboard.js b/src/api/dashboard.js index 6ad37f1..8c8bfd5 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -34,10 +34,19 @@ }) } -// 查询一级分区7日用水量 -export function countByDayFirst(params) { +// 查询二级分区各区用水量对比 +export function waterCompare(params) { return request({ - url: 'waterStatistic/countByDayFirst', + url: 'waterStatistic/waterCompare', + method: 'get', + params + }) +} + +// 查询一级分区7日用水量 +export function countByDaySecond(params) { + return request({ + url: 'waterStatistic/countByDay', method: 'get', params }) diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue index 45359c9..8320d47 100644 --- a/src/components/BigData/Card/index.vue +++ b/src/components/BigData/Card/index.vue @@ -10,7 +10,7 @@
{{ context }} - {{unit}} + {{unit}}
diff --git a/src/views/dashboard/components/AlarmCountByDept.vue b/src/views/dashboard/components/AlarmCountByDept.vue index 91df51d..4347727 100644 --- a/src/views/dashboard/components/AlarmCountByDept.vue +++ b/src/views/dashboard/components/AlarmCountByDept.vue @@ -66,7 +66,6 @@ // 获取统计数据 fetchData() { alarmBySecondArea(this.query).then(response => { - debugger this.chartData.rows = response.data }) } diff --git a/src/api/dashboard.js b/src/api/dashboard.js index 6ad37f1..8c8bfd5 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -34,10 +34,19 @@ }) } -// 查询一级分区7日用水量 -export function countByDayFirst(params) { +// 查询二级分区各区用水量对比 +export function waterCompare(params) { return request({ - url: 'waterStatistic/countByDayFirst', + url: 'waterStatistic/waterCompare', + method: 'get', + params + }) +} + +// 查询一级分区7日用水量 +export function countByDaySecond(params) { + return request({ + url: 'waterStatistic/countByDay', method: 'get', params }) diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue index 45359c9..8320d47 100644 --- a/src/components/BigData/Card/index.vue +++ b/src/components/BigData/Card/index.vue @@ -10,7 +10,7 @@
{{ context }} - {{unit}} + {{unit}}
diff --git a/src/views/dashboard/components/AlarmCountByDept.vue b/src/views/dashboard/components/AlarmCountByDept.vue index 91df51d..4347727 100644 --- a/src/views/dashboard/components/AlarmCountByDept.vue +++ b/src/views/dashboard/components/AlarmCountByDept.vue @@ -66,7 +66,6 @@ // 获取统计数据 fetchData() { alarmBySecondArea(this.query).then(response => { - debugger this.chartData.rows = response.data }) } diff --git a/src/views/dashboard/components/FunctionArea.vue b/src/views/dashboard/components/FunctionArea.vue index e628c12..9ab2e01 100644 --- a/src/views/dashboard/components/FunctionArea.vue +++ b/src/views/dashboard/components/FunctionArea.vue @@ -5,10 +5,10 @@ --> @@ -54,8 +54,8 @@ init(){ this.setDefaultTime(this.select) }, - change(){ - this.$emit('change', this.timeRange) + change(type){ + this.$emit('change', this.timeRange, type ) }, setDefaultTime(val) { if (val === 'year') { @@ -72,16 +72,18 @@ const beginTime = tYear + '-' + oldMonth + '-01' const endTime = getDayTime(new Date().getTime()) this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] - }else if (val === 'month') { - var today = new Date() - var tYear = today.getFullYear() - var tMonth = today.getMonth() + 1 - if (tMonth.toString().length === 1) { - tMonth = '0' + tMonth - } - const beginTime = tYear + '-' + tMonth + '-01' - const endTime = getDayTime(new Date().getTime()) - this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] + }else if (val === 'month') { // 30日 + // var today = new Date() + // var tYear = today.getFullYear() + // var tMonth = today.getMonth() + 1 + // if (tMonth.toString().length === 1) { + // tMonth = '0' + tMonth + // } + // const beginTime = tYear + '-' + tMonth + '-01' + // const endTime = getDayTime(new Date().getTime()) + // this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] + this.timeRange = [getDayTime(new Date().getTime() - 24 * 29 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')] + } else if (val === 'week') { // const nowDayOfWeek = new Date().getDay()-1 const nowDayOfWeek = 6 @@ -91,7 +93,7 @@ } else if (val === 'today') { this.timeRange = [getDayTime(new Date().getTime()).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')] } - this.change() + this.change(val) } } } diff --git a/src/api/dashboard.js b/src/api/dashboard.js index 6ad37f1..8c8bfd5 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -34,10 +34,19 @@ }) } -// 查询一级分区7日用水量 -export function countByDayFirst(params) { +// 查询二级分区各区用水量对比 +export function waterCompare(params) { return request({ - url: 'waterStatistic/countByDayFirst', + url: 'waterStatistic/waterCompare', + method: 'get', + params + }) +} + +// 查询一级分区7日用水量 +export function countByDaySecond(params) { + return request({ + url: 'waterStatistic/countByDay', method: 'get', params }) diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue index 45359c9..8320d47 100644 --- a/src/components/BigData/Card/index.vue +++ b/src/components/BigData/Card/index.vue @@ -10,7 +10,7 @@
{{ context }} - {{unit}} + {{unit}}
diff --git a/src/views/dashboard/components/AlarmCountByDept.vue b/src/views/dashboard/components/AlarmCountByDept.vue index 91df51d..4347727 100644 --- a/src/views/dashboard/components/AlarmCountByDept.vue +++ b/src/views/dashboard/components/AlarmCountByDept.vue @@ -66,7 +66,6 @@ // 获取统计数据 fetchData() { alarmBySecondArea(this.query).then(response => { - debugger this.chartData.rows = response.data }) } diff --git a/src/views/dashboard/components/FunctionArea.vue b/src/views/dashboard/components/FunctionArea.vue index e628c12..9ab2e01 100644 --- a/src/views/dashboard/components/FunctionArea.vue +++ b/src/views/dashboard/components/FunctionArea.vue @@ -5,10 +5,10 @@ --> @@ -54,8 +54,8 @@ init(){ this.setDefaultTime(this.select) }, - change(){ - this.$emit('change', this.timeRange) + change(type){ + this.$emit('change', this.timeRange, type ) }, setDefaultTime(val) { if (val === 'year') { @@ -72,16 +72,18 @@ const beginTime = tYear + '-' + oldMonth + '-01' const endTime = getDayTime(new Date().getTime()) this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] - }else if (val === 'month') { - var today = new Date() - var tYear = today.getFullYear() - var tMonth = today.getMonth() + 1 - if (tMonth.toString().length === 1) { - tMonth = '0' + tMonth - } - const beginTime = tYear + '-' + tMonth + '-01' - const endTime = getDayTime(new Date().getTime()) - this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] + }else if (val === 'month') { // 30日 + // var today = new Date() + // var tYear = today.getFullYear() + // var tMonth = today.getMonth() + 1 + // if (tMonth.toString().length === 1) { + // tMonth = '0' + tMonth + // } + // const beginTime = tYear + '-' + tMonth + '-01' + // const endTime = getDayTime(new Date().getTime()) + // this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')] + this.timeRange = [getDayTime(new Date().getTime() - 24 * 29 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')] + } else if (val === 'week') { // const nowDayOfWeek = new Date().getDay()-1 const nowDayOfWeek = 6 @@ -91,7 +93,7 @@ } else if (val === 'today') { this.timeRange = [getDayTime(new Date().getTime()).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')] } - this.change() + this.change(val) } } } diff --git a/src/views/dashboard/components/watchAlarmBar.vue b/src/views/dashboard/components/watchAlarmBar.vue index 6a18ef6..10824ee 100644 --- a/src/views/dashboard/components/watchAlarmBar.vue +++ b/src/views/dashboard/components/watchAlarmBar.vue @@ -1,24 +1,25 @@