-
- 本年
- 本季
- 本月
- 本周
- 今日
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,8 +38,10 @@
import { alarmBySecondArea } from '@/api/overview'
import { getDayTime } from '@/utils/dateutils'
import { getDoorAreaTree } from '@/api/system/area'
+import FunctionArea from "./FunctionArea";
export default {
name: 'WatchAlarmBar',
+ components: {FunctionArea},
data() {
return {
title:{
@@ -108,7 +111,8 @@
}
},
mounted() {
- this.setDefaultTime('today')
+ this.$refs.func.init()
+ // this.setDefaultTime('today')
// this.fetchArea()
},
methods: {
@@ -130,11 +134,11 @@
// this.areaId = val
// this.fetchData()
// },
- fetchData() {
+ fetchData(timeRange) {
const params = {
areaId: '110000',
- startTime: this.timeRange[0],
- endTime: this.timeRange[1]
+ startTime: timeRange[0],
+ endTime: timeRange[1]
}
this.$emit('change', params)
alarmBySecondArea(params).then(response => {
@@ -160,26 +164,6 @@
// ]
this.isShow = true
})
- },
- setDefaultTime(val) {
- 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 === 'week') {
- this.timeRange = [getDayTime(new Date().getTime() - 24 * 6 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')]
- } else if (val === 'yesterday') {
- this.timeRange = [getDayTime(new Date().getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd')]
- } else if (val === 'today') {
- this.timeRange = [getDayTime(new Date().getTime()).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')]
- }
- this.fetchData()
}
}
}
diff --git a/src/views/dashboard/components/waterCompare.vue b/src/views/dashboard/components/waterCompare.vue
index 8e34936..b06d288 100644
--- a/src/views/dashboard/components/waterCompare.vue
+++ b/src/views/dashboard/components/waterCompare.vue
@@ -9,7 +9,7 @@
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 @@
-
- 本年
- 本季
- 本月
- 本周
- 今日
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,8 +38,10 @@
import { alarmBySecondArea } from '@/api/overview'
import { getDayTime } from '@/utils/dateutils'
import { getDoorAreaTree } from '@/api/system/area'
+import FunctionArea from "./FunctionArea";
export default {
name: 'WatchAlarmBar',
+ components: {FunctionArea},
data() {
return {
title:{
@@ -108,7 +111,8 @@
}
},
mounted() {
- this.setDefaultTime('today')
+ this.$refs.func.init()
+ // this.setDefaultTime('today')
// this.fetchArea()
},
methods: {
@@ -130,11 +134,11 @@
// this.areaId = val
// this.fetchData()
// },
- fetchData() {
+ fetchData(timeRange) {
const params = {
areaId: '110000',
- startTime: this.timeRange[0],
- endTime: this.timeRange[1]
+ startTime: timeRange[0],
+ endTime: timeRange[1]
}
this.$emit('change', params)
alarmBySecondArea(params).then(response => {
@@ -160,26 +164,6 @@
// ]
this.isShow = true
})
- },
- setDefaultTime(val) {
- 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 === 'week') {
- this.timeRange = [getDayTime(new Date().getTime() - 24 * 6 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')]
- } else if (val === 'yesterday') {
- this.timeRange = [getDayTime(new Date().getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd'), getDayTime(new Date().getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd')]
- } else if (val === 'today') {
- this.timeRange = [getDayTime(new Date().getTime()).Format('yyyy-MM-dd'), getDayTime(new Date().getTime()).Format('yyyy-MM-dd')]
- }
- this.fetchData()
}
}
}
diff --git a/src/views/dashboard/components/waterCompare.vue b/src/views/dashboard/components/waterCompare.vue
index 8e34936..b06d288 100644
--- a/src/views/dashboard/components/waterCompare.vue
+++ b/src/views/dashboard/components/waterCompare.vue
@@ -9,7 +9,7 @@
diff --git a/static/project.config.json b/static/project.config.json
index 756d185..fe03293 100644
--- a/static/project.config.json
+++ b/static/project.config.json
@@ -1,6 +1,6 @@
{
"title": "供水管理系统",
- "baseUrl": "http://111.198.10.15:11639/",
+ "baseUrl": "http://111.198.10.15:20104/",
"mainPage": "http://111.198.10.15:11404/dcms/#",
"singleSys": true,
"city":"青岛市",