Ver Fonte

电度大屏日报月报

hfxc226 há 2 anos atrás
pai
commit
9c1e99e21e

+ 20 - 3
src/api/big/screen.js

@@ -1,4 +1,5 @@
 import { axios } from '@/utils/request'
+import { stringify } from 'qs'
 
 /**
  * fetch single func
@@ -6,12 +7,28 @@ import { axios } from '@/utils/request'
  * @param parameter
  * @returns {*}
  */
-export function getGroupByLine (parameter) {
+export function getMeasureByLine (parameter) {
   return axios({
-    url: '/big/screens/sb/' + parameter.lineNum,
+    url: '/big/screens/remote/measure/' + parameter.lineNum,
     method: 'get',
     headers: {
       'Content-Type': 'application/json;charset=UTF-8'
     }
   })
-}
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getDegreeByDayOrMonth (parameter) {
+  return axios({
+    url: '/big/screens/remote/degree/' + parameter.isDay + '?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 1 - 0
src/utils/tool.js

@@ -47,6 +47,7 @@ BaseTool.Moment = moment
 BaseTool.Date = {
   PICKER_NORM_YEAR: 'YYYY',
   PICKER_NORM_MONTH: 'MM',
+  PICKER_NORM_MONTH_ONE: 'M',
   PICKER_NORM_YEAR_MONTH: 'YYYY-MM',
   PICKER_NORM_DATE_PATTERN: 'YYYY-MM-DD',
   PICKER_NORM_DATE_PATTERN_CHINESE: 'YYYY年MM月DD日',

+ 14 - 0
src/views/statisticView/DayStatistics.vue

@@ -59,6 +59,8 @@
 </template>
 
 <script>
+import { getDegreeByDayOrMonth } from '@/api/big/screen'
+
 export default {
   data () {
     return {
@@ -70,7 +72,19 @@ export default {
         { 'title': '温度', 'value': '56度' }, { 'title': '预警次数', 'value': '10次' }]
     }
   },
+  created () {
+    const now = new Date()
+    const year = now.getFullYear()
+    const month = now.getMonth() + 1
+    const day = now.getDate()
+    this.getDatas(year, month, day)
+  },
   methods: {
+    getDatas (year, month, day) {
+      getDegreeByDayOrMonth({ isDay: 1, year: year, month: month, day: day }).then(res => {
+        console.log(res.data)
+      })
+    },
     onDateChange (value, dateString) {
       this.dateVisual = true
     },

+ 14 - 0
src/views/statisticView/MonthStatistics.vue

@@ -55,6 +55,8 @@
 </template>
 
 <script>
+import { getDegreeByDayOrMonth } from '@/api/big/screen'
+
 export default {
   data () {
     return {
@@ -66,7 +68,19 @@ export default {
         { 'title': '温度', 'value': '56度' }, { 'title': '预警次数', 'value': '10次' }]
     }
   },
+  created () {
+    const now = new Date()
+    const year = now.getFullYear()
+    const month = now.getMonth() + 1
+    const day = now.getDate()
+    this.getDatas(year, month)
+  },
   methods: {
+    getDatas (year, month) {
+      getDegreeByDayOrMonth({ isDay: 0, year: year, month: month }).then(res => {
+        console.log(res.data)
+      })
+    },
     onDateChange (value, dateString) {
       this.dateVisual = true
     },

+ 13 - 9
src/views/statisticView/SwitchingRoom.vue

@@ -8,11 +8,12 @@
       <div @click="handleMonthView">月统计</div>
     </div>
     <div class="adress">
-      <div class="address-opt">梅康一路</div>
-      <div>梅康二路</div>
-      <div>梅康三路</div>
-      <div>梅康四路</div>
-      <div>梅康五路</div>
+      <div class="address-opt" @click="getDatas(1)">一路</div>
+      <div @click="getDatas(2)">二路</div>
+      <div @click="getDatas(3)">三路</div>
+      <div @click="getDatas(4)">四路</div>
+      <div @click="getDatas(5)">五路</div>
+      <div @click="getDatas(6)">六路</div>
     </div>
     <div class="sb">
       <a-row type="flex" justify="space-between" :gutter="[20,20]">
@@ -188,12 +189,10 @@
 </template>
 
 <script>
-import { getGroupByLine } from '@/api/big/screen'
+import { getMeasureByLine } from '@/api/big/screen'
 export default {
   created () {
-    getGroupByLine({ lineNum: 1 }).then(res => {
-      console.log(res.data)
-    })
+    this.getDatas(1)
   },
   data () {
     return {
@@ -201,6 +200,11 @@ export default {
     }
   },
   methods: {
+    getDatas (lineNum) {
+      getMeasureByLine({ lineNum: lineNum }).then(res => {
+        console.log(res.data)
+      })
+    },
     handleView () {
       this.$router.push('/TransformerDetailBigScreen')
     },