diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+ 本年
+ 本季
本月
- 近7日
- 昨日
+ 本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
deleted file mode 100644
index 33d596a..0000000
--- a/src/views/layout/components/Sidebar/index.vue
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
deleted file mode 100644
index 33d596a..0000000
--- a/src/views/layout/components/Sidebar/index.vue
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/ScrollPane.vue b/src/views/layout/components/TagsView/ScrollPane.vue
deleted file mode 100644
index 0ec76e7..0000000
--- a/src/views/layout/components/TagsView/ScrollPane.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
deleted file mode 100644
index 33d596a..0000000
--- a/src/views/layout/components/Sidebar/index.vue
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/ScrollPane.vue b/src/views/layout/components/TagsView/ScrollPane.vue
deleted file mode 100644
index 0ec76e7..0000000
--- a/src/views/layout/components/TagsView/ScrollPane.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/index.vue b/src/views/layout/components/TagsView/index.vue
deleted file mode 100644
index 5839f2d..0000000
--- a/src/views/layout/components/TagsView/index.vue
+++ /dev/null
@@ -1,287 +0,0 @@
-
-
-
-
- {{ tag.title }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
deleted file mode 100644
index 33d596a..0000000
--- a/src/views/layout/components/Sidebar/index.vue
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/ScrollPane.vue b/src/views/layout/components/TagsView/ScrollPane.vue
deleted file mode 100644
index 0ec76e7..0000000
--- a/src/views/layout/components/TagsView/ScrollPane.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/index.vue b/src/views/layout/components/TagsView/index.vue
deleted file mode 100644
index 5839f2d..0000000
--- a/src/views/layout/components/TagsView/index.vue
+++ /dev/null
@@ -1,287 +0,0 @@
-
-
-
-
- {{ tag.title }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/index.js b/src/views/layout/components/index.js
deleted file mode 100644
index 52d35e3..0000000
--- a/src/views/layout/components/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as Navbar } from './Navbar'
-export { default as Sidebar } from './Sidebar'
-export { default as AppMain } from './AppMain'
-export { default as AppHeader } from './AppHeader'
diff --git a/src/api/dashboard.js b/src/api/dashboard.js
index e69de29..0a4ddfc 100644
--- a/src/api/dashboard.js
+++ b/src/api/dashboard.js
@@ -0,0 +1,73 @@
+/**
+ * 井总览模块接口
+ */
+import request from '@/utils/request'
+
+// 用水量、噪声统计数据
+export function getWatchStatistic() {
+ return request({
+ url: 'waterStatistic/overview',
+ method: 'get'
+ })
+}
+// 水表数量
+export function waterMeterCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+// 阀门数量
+export function valveCount() {
+ return request({
+ url: 'waterMeterData/count',
+ method: 'get'
+ })
+}
+
+// 查询一级分区各区用水量
+export function countByFirstArea(params) {
+ return request({
+ url: 'waterStatistic/countByFirstArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询一级分区7日用水量
+export function countByDayFirst(params) {
+ return request({
+ url: 'waterStatistic/countByDayFirst',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区各区用水量
+export function countBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/countBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 查询二级分区水表告警
+export function alarmBySecondArea(params) {
+ return request({
+ url: 'waterStatistic/alarmBySecondArea',
+ method: 'get',
+ params
+ })
+}
+
+// 设备7日报警趋势
+export function alarmCountByDay(params) {
+ return request({
+ url: 'waterStatistic/alarmCountByDay',
+ method: 'get',
+ params
+ })
+}
+
+
diff --git a/src/components/BigData/Card/index.vue b/src/components/BigData/Card/index.vue
index d71e609..45359c9 100644
--- a/src/components/BigData/Card/index.vue
+++ b/src/components/BigData/Card/index.vue
@@ -10,6 +10,7 @@
{{ context }}
+ {{unit}}
@@ -39,6 +40,10 @@
color: {
type: String,
default: '#40c9c6'
+ },
+ unit:{
+ type: String,
+ default:''
}
},
computed: {
diff --git a/src/components/BigData/Card1/index.vue b/src/components/BigData/Card1/index.vue
index 030b2dc..aa46454 100644
--- a/src/components/BigData/Card1/index.vue
+++ b/src/components/BigData/Card1/index.vue
@@ -1,10 +1,11 @@
-
-
-
+
+
+
-
+
+
- {{ title[0] }} {{ context[0] }}
+ {{ title[0] }} {{ context[0] }}{{unit}}
-
- {{ title[1] }}
{{ context[1] }}
+
+ {{ title[1] }} {{ context[1] }}{{unit}}
{{ title[0] }}
-
- {{ context[0] }}
+
+ {{ context[0] }}{{unit}}
@@ -33,42 +36,46 @@
\ No newline at end of file
diff --git a/src/icons/svg/icon-valve.svg b/src/icons/svg/icon-valve.svg
new file mode 100644
index 0000000..f5d96e2
--- /dev/null
+++ b/src/icons/svg/icon-valve.svg
@@ -0,0 +1,2 @@
+
\ No newline at end of file
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index b72d289..332cbf9 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -1,12 +1,12 @@
-
+
@@ -16,7 +16,7 @@
import Card1 from '@/components/BigData/Card1'
import Card from '@/components/BigData/Card'
// 首页
-import { getWatchStatistic , waterMeterCount } from '@/api/overview'
+import { getWatchStatistic , waterMeterCount, valveCount } from '@/api/dashboard'
// 根据布防数量统计井数量
import { wellCountByBfzt } from '@/api/well'
// 当前报警数
@@ -36,30 +36,33 @@
context: ['--', '--'],
icon: 'icon-water',
color: '#40c9c6',
+ unit: '吨',
index: 0
},
{
- title: ['今日用水量', '昨日用水量'],
+ title: ['今日用水量', '生产厂区用水量'],
context: ['--', '--'],
- icon: 'icon-water',
+ icon: '',
color: '#36a3f7',
+ unit: '吨',
index: 1
},
{
- title: ['实时噪声'],
+ title: ['滑道实时噪声'],
context: ['--'],
- icon: 'icon-device',
+ icon: 'icon-noise',
color: '#f1c353',
+ unit: 'db',
index: 2
}
],
dataGroup: [
{
- title: '设备总数',
+ title: '阀门数量',
context: '--',
- icon: 'icon-device',
+ icon: 'icon-valve',
color: '#40c9c6',
- path: '/deviceList',
+ path: '/deviceList?deviceType=20',
permission: '/device/list'
},
{
@@ -67,11 +70,11 @@
context: '--',
icon: 'icon-watch',
color: '#9694f7',
- path: '/deviceList',
+ path: '/deviceList?deviceType=13',
permission: '/device/list'
},
{
- title: '当前报警数',
+ title: '报警信息',
context: '--',
icon: 'icon-alarm',
color: '#f4516c',
@@ -83,10 +86,10 @@
},
mounted() {
this.getWater()
- this.getWellCount()
+ // this.getWellCount()
this.getDeviceCount()
this.getAlarmCount()
- this.getJobCount()
+ // this.getJobCount()
},
methods: {
refresh() {
@@ -97,24 +100,31 @@
this.$router.push(path)
},
getWater() {
+ // 用水量
getWatchStatistic().then(response => {
- this.dataGroup1[0].context = [response.data.total, response.data.month]
- this.dataGroup1[1].context = [response.data.today, response.data.yesterday]
- this.dataGroup1[2].context = [Number(response.data.sound).toFixed(2)]
+ this.dataGroup1[0].context = [response.data.total?parseFloat(response.data.total).toFixed(0):'--', response.data.month?parseFloat(response.data.month).toFixed(0):'--']
+ this.dataGroup1[1].context = [response.data.today?parseFloat(response.data.today).toFixed(0):'--', response.data.yesterday?parseFloat(response.data.yesterday).toFixed(0):'--']
+ this.dataGroup1[2].context = [response.data.sound?Number(response.data.sound).toFixed(2):'--']
})
- waterMeterCount().then(response => {
- this.dataGroup[1].context = response.data
- })
+
},
- getWellCount() {
- wellCountByBfzt().then(response => {
- this.dataGroup[0].context = response.data.total
- })
- },
+ // getWellCount() {
+ // wellCountByBfzt().then(response => {
+ // this.dataGroup[0].context = response.data.total
+ // })
+ // },
getDeviceCount() {
// deviceStaticByStatus().then(response => {
// this.dataGroup[1].context = response.data.total
// })
+ // 阀门数量
+ valveCount().then(response => {
+ this.dataGroup[0].context = response.data
+ })
+ // 水表数量
+ waterMeterCount().then(response => {
+ this.dataGroup[1].context = response.data
+ })
},
getAlarmCount() {
alarmNowStatic().then(response => {
@@ -159,7 +169,7 @@
// &:hover {
// .card-panel-icon-wrapper {
// color: #fff;
-
+
// }
// .icon-people {
diff --git a/src/views/dashboard/components/waterCountByAreaBar.vue b/src/views/dashboard/components/waterCountByAreaBar.vue
index 1bdac48..c488923 100644
--- a/src/views/dashboard/components/waterCountByAreaBar.vue
+++ b/src/views/dashboard/components/waterCountByAreaBar.vue
@@ -1,9 +1,10 @@
+
本年
+
本季
本月
-
近7日
-
昨日
+
本周
今日
{
this.isShow = false
this.chartData.rows = response.data
@@ -153,7 +155,21 @@
})
},
setDefaultTime(val) {
- if (val === 'month') {
+ if (val === 'year') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ const beginTime = tYear + '-01-01'
+ const endTime = getDayTime(new Date().getTime())
+ this.timeRange = [beginTime, endTime.Format('yyyy-MM-dd')]
+ }if (val === 'season') {
+ var today = new Date()
+ var tYear = today.getFullYear()
+ var tMonth = today.getMonth() + 1
+ const oldMonth = tMonth<4?'01':(tMonth<7?'04':(tMonth<10?'07':'10'))
+ 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
@@ -164,7 +180,8 @@
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')]
+ const nowDayOfWeek = new Date().getDay()-1
+ this.timeRange = [getDayTime(new Date().getTime() - 24 * nowDayOfWeek * 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') {
diff --git a/src/views/dashboard/components/waterCountByDay.vue b/src/views/dashboard/components/waterCountByDay.vue
index 8e12f02..78d1f7c 100644
--- a/src/views/dashboard/components/waterCountByDay.vue
+++ b/src/views/dashboard/components/waterCountByDay.vue
@@ -1,12 +1,12 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
@@ -17,6 +17,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDay',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -52,8 +64,13 @@
}
},
mounted() {
- this.changeTime('month')
- this.fetchArea()
+ // this.changeTime('month')
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -73,7 +90,7 @@
})
},
fetchData() {
- countByDayFirst(this.listQuery).then(response => {
+ countByDayFirst(this.query).then(response => {
const arr = response.data.map(function(item) {
for (let i = 0; i < item.data.length; i++) {
item[item.data[i].areaName] = item.data[i].count
diff --git a/src/views/dashboard/components/waterCountByDept.vue b/src/views/dashboard/components/waterCountByDept.vue
index a0c82cf..02e27cd 100644
--- a/src/views/dashboard/components/waterCountByDept.vue
+++ b/src/views/dashboard/components/waterCountByDept.vue
@@ -1,22 +1,22 @@
-
- 近1年
- 近6月
- 近3月
- 近1月
- 近1周
-
+
+
+
+
+
+
+
-
- {{item.name}}
-
+
+
+
+
+
+
+
+
@@ -25,6 +25,18 @@
import { getDoorAreaTree } from '@/api/system/area'
export default {
name: 'WaterCountByDepy',
+ props:{
+ query: {
+ type: Object,
+ default:()=>{
+ return {
+ areaId: '',
+ startTime: '',
+ endTime: ''
+ }
+ }
+ }
+ },
data() {
return {
listQuery: {
@@ -69,7 +81,12 @@
},
mounted() {
// TODO:待调试真接口
- this.fetchArea()
+ // this.fetchArea()
+ },
+ watch:{
+ query(val){
+ this.fetchData()
+ }
},
methods: {
fetchArea() {
@@ -104,8 +121,7 @@
// { 'areaName': '码头作业区', 'count': 78 },
// { 'areaName': '车间生产区', 'count': 78 }
// ]
- this.listQuery.areaId = this.areaId
- countBySecondArea(this.listQuery).then(response => {
+ countBySecondArea(this.query).then(response => {
this.chartData.rows = response.data
})
},
diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue
new file mode 100644
index 0000000..aa0f448
--- /dev/null
+++ b/src/views/dashboard/components/waterNote.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index fdbc38a..831dbc3 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,31 +1,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -64,20 +66,22 @@
import DeviceCountByOnline from './components/DeviceCountByOnline'
import AlarmByDays from './components/AlarmByDays'
import JobByStatus from './components/JobByStatus'
-import WaterCountByDepy from './components/waterCountByDept'
+import WaterCountByDept from './components/waterCountByDept'
import WaterCountByDeptBar from './components/waterCountByDeptBar'
import WaterCountByDay from './components/waterCountByDay'
import WaterCountByAreaBar from "./components/waterCountByAreaBar";
import WatchAlarmBar from "./components/watchAlarmBar";
+import WaterNote from "./components/waterNote";
export default {
name: 'Dashboard',
components: {
+ WaterNote,
WatchAlarmBar,
WaterCountByAreaBar,
WaterCountByDay,
WaterCountByDeptBar,
- WaterCountByDepy,
+ WaterCountByDept,
JobByStatus,
AlarmByDays,
PanelGroup,
@@ -108,12 +112,25 @@
state.needRefresh = needRefresh
}
},
+ data(){
+ return {
+ listQuery1:{
+ areaId:'110000',
+ startTime:new Date().Format('yyyy-MM-dd'),
+ endTime:new Date().Format('yyyy-MM-dd')
+ },// 分区用水量查询条件
+ listQuery2:{
+ areaId:'',
+ startTime:'',
+ endTime:''
+ } // 分区报警查询条件
+ }
+ },
watch: {
needRefresh(val) {
// 需要刷新
if (val) {
console.log('refresh dashboard')
- debugger
this.$refs.panelgroup.refresh()
}
}
@@ -124,6 +141,10 @@
methods: {
webSocket() {
this.$store.dispatch('initWebSocket')
+ },
+ // 切换分区查询条件
+ changeWaterQuery(listQuery1){
+ this.listQuery1 = listQuery1
}
}
}
diff --git a/src/views/dashboard/index_bak.vue b/src/views/dashboard/index_bak.vue
new file mode 100644
index 0000000..fdbc38a
--- /dev/null
+++ b/src/views/dashboard/index_bak.vue
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue
deleted file mode 100644
index 7c3d46d..0000000
--- a/src/views/layout/Layout.vue
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue
deleted file mode 100644
index 8d8912e..0000000
--- a/src/views/layout/components/AppHeader.vue
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue
deleted file mode 100644
index 2ea268e..0000000
--- a/src/views/layout/components/AppMain.vue
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Navbar.vue b/src/views/layout/components/Navbar.vue
deleted file mode 100644
index 24ea99b..0000000
--- a/src/views/layout/components/Navbar.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Settings/index.vue b/src/views/layout/components/Settings/index.vue
deleted file mode 100644
index cf3023d..0000000
--- a/src/views/layout/components/Settings/index.vue
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
Page style setting
-
-
- Theme Color
-
-
-
-
- Open Tags-View
-
-
-
-
- Fixed Header
-
-
-
-
- Sidebar Logo
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/Item.vue b/src/views/layout/components/Sidebar/Item.vue
deleted file mode 100644
index 4ed6b5f..0000000
--- a/src/views/layout/components/Sidebar/Item.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue
deleted file mode 100644
index bff45cd..0000000
--- a/src/views/layout/components/Sidebar/Link.vue
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue
deleted file mode 100644
index 988d662..0000000
--- a/src/views/layout/components/Sidebar/SidebarItem.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue
deleted file mode 100644
index 33d596a..0000000
--- a/src/views/layout/components/Sidebar/index.vue
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/ScrollPane.vue b/src/views/layout/components/TagsView/ScrollPane.vue
deleted file mode 100644
index 0ec76e7..0000000
--- a/src/views/layout/components/TagsView/ScrollPane.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/TagsView/index.vue b/src/views/layout/components/TagsView/index.vue
deleted file mode 100644
index 5839f2d..0000000
--- a/src/views/layout/components/TagsView/index.vue
+++ /dev/null
@@ -1,287 +0,0 @@
-
-
-
-
- {{ tag.title }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/layout/components/index.js b/src/views/layout/components/index.js
deleted file mode 100644
index 52d35e3..0000000
--- a/src/views/layout/components/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-export { default as Navbar } from './Navbar'
-export { default as Sidebar } from './Sidebar'
-export { default as AppMain } from './AppMain'
-export { default as AppHeader } from './AppHeader'
diff --git a/src/views/layout/mixin/ResizeHandler.js b/src/views/layout/mixin/ResizeHandler.js
deleted file mode 100644
index 604fe3d..0000000
--- a/src/views/layout/mixin/ResizeHandler.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import store from '@/store'
-
-const { body } = document
-const WIDTH = 992 // refer to Bootstrap's responsive design
-
-export default {
- watch: {
- $route(route) {
- if (this.device === 'mobile' && this.sidebar.opened) {
- store.dispatch('CloseSideBar', { withoutAnimation: false })
- }
- }
- },
- beforeMount() {
- window.addEventListener('resize', this.resizeHandler)
- },
- mounted() {
- const isMobile = this.isMobile()
- if (isMobile) {
- store.dispatch('ToggleDevice', 'mobile')
- store.dispatch('CloseSideBar', { withoutAnimation: true })
- }
- },
- methods: {
- isMobile() {
- const rect = body.getBoundingClientRect()
- return rect.width - 1 < WIDTH
- },
- resizeHandler() {
- if (!document.hidden) {
- const isMobile = this.isMobile()
- store.dispatch('ToggleDevice', isMobile ? 'mobile' : 'desktop')
-
- if (isMobile) {
- store.dispatch('CloseSideBar', { withoutAnimation: true })
- }
- }
- }
- }
-}