diff --git a/src/apis/index.js b/src/apis/index.js
index ba262e5..12f8c9b 100644
--- a/src/apis/index.js
+++ b/src/apis/index.js
@@ -13,11 +13,8 @@ export const getDevices = () => http.get(`${corrosion}/devices`);
// 获取设备列表 完整信息
export const getDevicesAll = () => http.get(`${corrosion}/devices/all`);
-// 获取数据统计 积分电量
-export const getIntegralElectric = () => http.get(`${corrosion}/monthes/integralElectric`);
+// 获取月累计数据分析
+export const getMonthesDate = params => http.get(`${corrosion}/statistics/monthes`, { params });
-// 获取数据统计 月累计腐蚀
-export const getTotalCorrosion = () => http.get(`${corrosion}/monthes/totalCorrosion`);
-
-// 获取数据统计 月累计湿润时间图
-export const getMoistTime = () => http.get(`${corrosion}/monthes/moistTime`);
+// 获取实时数据统计
+export const getRealtimeData = params => http.get(`${corrosion}/statistics/realtime`, { params });
diff --git a/src/components/data-search-bar.vue b/src/components/data-search-bar.vue
new file mode 100644
index 0000000..e9fbebe
--- /dev/null
+++ b/src/components/data-search-bar.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
diff --git a/src/components/history-data.vue b/src/components/history-data.vue
new file mode 100644
index 0000000..7bf4e1b
--- /dev/null
+++ b/src/components/history-data.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/integral-electric.vue b/src/components/integral-electric.vue
index be11f5c..6ffd492 100644
--- a/src/components/integral-electric.vue
+++ b/src/components/integral-electric.vue
@@ -1,51 +1,51 @@
-
+
+ 积分电量(C)
+
+
+
diff --git a/src/components/moist-time.vue b/src/components/moist-time.vue
new file mode 100644
index 0000000..a9e7e6a
--- /dev/null
+++ b/src/components/moist-time.vue
@@ -0,0 +1,53 @@
+
+
+ 月累计湿润时间(h)
+
+
+
+
+
+
diff --git a/src/components/realtime-data.vue b/src/components/realtime-data.vue
new file mode 100644
index 0000000..7bf4e1b
--- /dev/null
+++ b/src/components/realtime-data.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/total-corrosion.vue b/src/components/total-corrosion.vue
new file mode 100644
index 0000000..ba3ed64
--- /dev/null
+++ b/src/components/total-corrosion.vue
@@ -0,0 +1,52 @@
+
+
+ 月累计腐蚀(g/m²)
+
+
+
+
+
+
diff --git a/src/routers/index.js b/src/routers/index.js
index 6990027..000ada8 100644
--- a/src/routers/index.js
+++ b/src/routers/index.js
@@ -33,6 +33,18 @@ export const routes = [
meta: { title: '月累计数据分析' },
component: () => import('@/views/month-data.vue'),
},
+ {
+ path: '/statistical-realtime',
+ name: 'statistical-realtime',
+ meta: { title: '实时数据统计' },
+ component: () => import('@/views/statistical-realtime.vue'),
+ },
+ {
+ path: '/statistical-history',
+ name: 'statistical-history',
+ meta: { title: '历史数据统计' },
+ component: () => import('@/views/statistical-history.vue'),
+ },
{
path: '/test',
name: 'test',
diff --git a/src/store/statistics.js b/src/store/statistics.js
index 3582071..54bead7 100644
--- a/src/store/statistics.js
+++ b/src/store/statistics.js
@@ -1,4 +1,4 @@
-import { getIntegralElectric, getTotalCorrosion, getMoistTime } from 'apis/index';
+import { getMonthesDate, getRealtimeData } from 'apis/index';
export default {
namespaced: true,
@@ -7,6 +7,7 @@ export default {
electricData: null,
corrosionData: null,
moistTimeData: null,
+ realtimeData: null,
},
getters: {},
@@ -18,7 +19,6 @@ export default {
* @param {array} data
*/
setElectricData(state, data) {
- console.log('data: ', data);
state.electricData = data;
},
@@ -39,36 +39,36 @@ export default {
setMoistTimeData(state, data) {
state.moistTimeData = data;
},
+
+ /**
+ * 设置实时数据统计的数据
+ * @param {*} state
+ * @param {*} data
+ */
+ setRealtimeData(state, data) {
+ state.realtimeData = data;
+ },
},
actions: {
// 获取积分电量数据
- async getElectricData({ commit }) {
- try {
- const data = await getIntegralElectric();
- commit('setElectricData', data || null);
- return data;
- } catch (error) {
- throw new Error(error);
- }
- },
-
- // 获取月累计腐蚀数据
- async getCorrosionData({ commit }) {
+ async getMonthesDate({ commit }, params) {
try {
- const data = await getTotalCorrosion();
- commit('setCorrosionData', data || null);
+ const data = await getMonthesDate(params);
+ commit('setElectricData', data.powers || null);
+ commit('setCorrosionData', data.corrosions || null);
+ commit('setMoistTimeData', data.humids || null);
return data;
} catch (error) {
throw new Error(error);
}
},
- // 获取月累计湿润时间图数据
- async getMoistTimeData({ commit }) {
+ // 获取实时数据统计数据
+ async getRealtimeData({ commit }, params) {
try {
- const data = await getMoistTime();
- commit('setMoistTimeData', data || null);
+ const data = await getRealtimeData(params);
+ commit('setRealtimeData', data || null);
return data;
} catch (error) {
throw new Error(error);
diff --git a/src/views/month-data.vue b/src/views/month-data.vue
index a1e7dd1..18ce51e 100644
--- a/src/views/month-data.vue
+++ b/src/views/month-data.vue
@@ -1,9 +1,50 @@
-
-
+
+
+
+
diff --git a/src/views/statistical-history.vue b/src/views/statistical-history.vue
new file mode 100644
index 0000000..3d73a60
--- /dev/null
+++ b/src/views/statistical-history.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
diff --git a/src/views/statistical-realtime.vue b/src/views/statistical-realtime.vue
new file mode 100644
index 0000000..5011b4b
--- /dev/null
+++ b/src/views/statistical-realtime.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+