소스 검색

建筑用能接口对接

yuhan 1 년 전
부모
커밋
b1ba3172fb

+ 6 - 16
src/views/module_ems/energyAnalyse/demandAnalysis/index.vue

@@ -9,7 +9,6 @@
 import * as echarts from 'echarts'
 import commonSearch from '../components/commonSearch.vue'
 import { httpAction, getAction } from '@/api/manage'
-import { emsdata } from '../emsdata';
 export default {
   name: 'demandAnalysis',
   components: {
@@ -22,7 +21,7 @@ export default {
       echartsHeight: window.innerHeight - 84 - 60 - 30,
       myChart: null,
       url: {
-        list: '/ems/statistics/demandanalysis',
+        list: '/emsStatistics/demandanalysis',
       },
       monthsplit: [],
       mubiao: [153, 160, 145, 145, 125],
@@ -32,27 +31,19 @@ export default {
   created() {},
   mounted() {
     this.$nextTick(() => {
-      this.getTest()
-      // this.getDemandanalysis()
+      this.getDemandanalysis()
     })
   },
   methods: {
-    // 后端好了需要删掉
-    getTest() {
-      this.monthsplit = emsdata.demanddata.monthsplit
-      this.mubiao = emsdata.demanddata.mubiao
-      this.shiji = emsdata.demanddata.shiji
-      this.initEcharts()
-    },
     async getDemandanalysis() {
       this.loading = true
       var data = this.$refs.commonSearch.queryParams
       console.log(data)
       getAction(this.url.list, data).then((response) => {
         console.log(response)
-        this.monthsplit = response.data.monthsplit
-        this.mubiao = response.data.mubiao
-        this.shiji = response.data.shiji
+        this.monthsplit = response.result.monthsplit
+        this.mubiao = response.result.mubiao
+        this.shiji = response.result.shiji
         this.loading = false
       })
       this.initEcharts()
@@ -245,8 +236,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleSearch(param) {
-      this.getTest()
-      // this.getDemandanalysis()
+      this.getDemandanalysis()
     },
   },
 }

+ 5 - 55
src/views/module_ems/energyAnalyse/energyDashboard/index.vue

@@ -90,7 +90,7 @@
 import * as echarts from 'echarts'
 import commonSearch from '../components/commonSearch'
 import { httpAction, getAction } from '@/api/manage'
-import { emsdata } from '../emsdata';
+// import { emsdata } from '../emsdata';
 export default {
   name: 'energyDashboard',
   components: {
@@ -130,73 +130,24 @@ export default {
       },
       zongbiao: [],
       url: {
-        list: '/ems/statistics/energyoverview',
+        list: '/emsStatistics/energyOverview',
       },
     }
   },
   created() {},
   mounted() {
     this.$nextTick(() => {
-      this.getTest()
-      // this.getEnergyoverview()
+      this.getEnergyoverview()
     })
   },
   methods: {
-    // 后端好了需要删掉
-    getTest() {
-      var listData = emsdata.dashboarddata
-      console.log(listData)
-      // 用电需量
-      this.demandStatistics.jishi = listData.demandStatistics.find((item) => item.type === '即时需量').howManyValue
-      this.demandStatistics.fengzhi = listData.demandStatistics.find((item) => item.type === '需量峰值').howManyValue
-      this.demandStatistics.mubiao = listData.demandStatistics.find((item) => item.type === '目标需量').howManyValue
-
-      // co2+气象
-      this.demandStatistics.co2 = listData.environmentStatistics.find((item) => item.type === 'CO2排放').howManyValue
-      this.demandStatistics.shidu = listData.environmentStatistics.find((item) => item.type === '室外湿度')
-        ? listData.environmentStatistics.find((item) => item.type === '室外湿度').howManyValue
-        : ''
-      this.demandStatistics.wendu = listData.environmentStatistics.find((item) => item.type === '室外温度')
-        ? listData.environmentStatistics.find((item) => item.type === '室外温度').howManyValue
-        : ''
-
-      // top5
-      this.sortTop5Name = []
-      this.nowMonthData = []
-      this.lastMonthData = []
-      listData.top5Statistics.forEach((res) => {
-        this.sortTop5Name.push(res.equipmentname)
-        this.nowMonthData.push(res.howManyValue)
-        this.lastMonthData.push(res.howManyValue2)
-      })
-
-      // 总标煤
-      this.zongbiao = listData.kgceStatistics.map((res) => {
-        var item = {
-          name: res.type,
-          value: res.howManyValue,
-        }
-        return item
-      })
-
-      this.totalEleTrend.daysplit = listData.daysplit
-      this.totalEleTrend.kongtiao = listData.kongtiao
-      this.totalEleTrend.dongli = listData.dongli
-      this.totalEleTrend.zhaoming = listData.zhaoming
-      this.totalEleTrend.qita = listData.qita
-      this.energySpace = listData.energySpace
-      this.loading = false
-      this.initSortTop5()
-      this.initPieDianliang()
-      this.initTotalEleTrend()
-    },
     async getEnergyoverview() {
       // {spaceId: 277797283102721}
       this.loading = true
       var data = this.$refs.commonSearch.queryParams
       getAction(this.url.list, data).then((res) => {
         console.log(res)
-        var listData = res.data
+        var listData = res.result
         // 用电需量
         this.demandStatistics.jishi = listData.demandStatistics.find((item) => item.type === '即时需量').howManyValue
         this.demandStatistics.fengzhi = listData.demandStatistics.find((item) => item.type === '需量峰值').howManyValue
@@ -245,8 +196,7 @@ export default {
       })
     },
     handleSearch(param) {
-      this.getTest()
-      // this.getEnergyoverview()
+      this.getEnergyoverview()
     },
     // 当月用电量TOP5 柱状图
     initSortTop5() {

+ 10 - 75
src/views/module_ems/energyAnalyse/energyItem/index.vue

@@ -75,7 +75,6 @@
   import * as echarts from 'echarts';
   import commonSearch from '../components/commonSearch.vue'
   import { httpAction, getAction } from '@/api/manage'
-  import { emsdata } from '../emsdata';
   export default {
     name: 'energyItem',
     components: {
@@ -96,21 +95,16 @@
           lastMonth: null,
           huanbiMonth: null,
         },
-        dayPieData: [
-          { value: 2750.10, name: '照明插座' },
-          { value: 2368.90, name: '空调用电' },
-          { value: 2007.80, name: '其他用电' },
-          { value: 639.90, name: '动力用电' }
-        ],
+        dayPieData: [],
         weekPieData: [],
         monthPieData: [],
-        hours: ['11/29 00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00'],
-        kongtiao: [120, 132, 101, 134, 90, 230, 210],
-        dongli: [150, 212, 201, 154, 190, 330, 410],
-        zhaoming: [220, 182, 191, 234, 290, 330, 310],
-        qita: [320, 302, 301, 334, 390, 330, 320],
+        hours: [],
+        kongtiao: [],
+        dongli: [],
+        zhaoming: [],
+        qita: [],
         url: {
-          list: "/ems/statistics/itemizedenergy",
+          list: "/emsStatistics/itemizedenergy",
         },
       }
     },
@@ -118,74 +112,16 @@
     },
     mounted() {
       this.$nextTick(() => {
-        this.getTest()
-        // this.getItemizedenergy()
+        this.getItemizedenergy()
       })
     },
     methods: {
-      // 后端好了需要删掉
-      getTest() {
-        var listData = emsdata.itemdata
-        // 日
-        this.itemizedStatistics.nowDay = (listData.dayStatistics.find(item=>item.type === '当日用能')).howManyValue
-        this.itemizedStatistics.lastDay = (listData.dayStatistics.find(item=>item.type === '昨日用能')).howManyValue
-        this.itemizedStatistics.huanbiDay = (listData.dayStatistics.find(item=>item.type === '环比')).howManyValue
-        // 月
-        this.itemizedStatistics.nowMonth = (listData.monthStatistics.find(item=>item.type === '当月用能')).howManyValue
-        this.itemizedStatistics.lastMonth = (listData.monthStatistics.find(item=>item.type === '上月用能')).howManyValue
-        this.itemizedStatistics.huanbiMonth = (listData.monthStatistics.find(item=>item.type === '环比')).howManyValue
-        // listData.monthStatistics.find(item=>if (item.type === '环比') {return item.howManyValue})
-        // 周
-        this.itemizedStatistics.nowWeek = (listData.weekStatistics.find(item=>item.type === '当周用能')).howManyValue
-        this.itemizedStatistics.lastWeek = (listData.weekStatistics.find(item=>item.type === '上周用能')).howManyValue
-        this.itemizedStatistics.huanbiWeek = (listData.weekStatistics.find(item=>item.type === '环比')).howManyValue
-
-        this.dayPieData = listData.dayStatistics.map(res => {
-          if(res.type === '能耗分项'){
-            var item ={
-              name: res.equipmentname,
-              value: res.howManyValue,
-            }
-            return item
-          } 
-          
-        })
-        this.weekPieData = listData.weekStatistics.map(res => {
-          if(res.type === '能耗分项'){
-            var item ={
-              name: res.equipmentname,
-              value: res.howManyValue,
-            }
-            return item
-          }
-        })
-        this.monthPieData = listData.monthStatistics.map(res => {
-          if(res.type === '能耗分项'){
-            var item ={
-              name: res.equipmentname,
-              value: res.howManyValue,
-            }
-            return item
-          }
-        })
-        
-        this.hours = listData.hours
-        this.kongtiao = listData.kongtiao
-        this.dongli = listData.dongli
-        this.zhaoming = listData.zhaoming
-        this.qita = listData.qita
-      
-        this.initDayPieCharts()
-        this.initWeekPieCharts()
-        this.initMonthPieCharts()
-        this.initEcharts()
-      },
       async getItemizedenergy(){
         this.loading = true
         var data = this.$refs.commonSearch.queryParams
         getAction(this.url.list, data).then(response => {
           console.log(response)
-          var listData = response.data
+          var listData = response.result
           // 日
           this.itemizedStatistics.nowDay = (listData.dayStatistics.find(item=>item.type === '当日用能')).howManyValue
           this.itemizedStatistics.lastDay = (listData.dayStatistics.find(item=>item.type === '昨日用能')).howManyValue
@@ -496,8 +432,7 @@
       },
       /** 搜索按钮操作 */
       handleSearch(param) {
-        this.getTest()
-        // this.getItemizedenergy()
+        this.getItemizedenergy()
       }
     },
   }

+ 19 - 93
src/views/module_ems/energyAnalyse/energyRank/index.vue

@@ -36,7 +36,6 @@ import * as echarts from 'echarts'
 import commonSearch from '../components/commonSearch.vue'
 import { httpAction, getAction } from '@/api/manage'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
-import { emsdata } from '../emsdata';
 export default {
   name: 'energyRank',
   components: {
@@ -74,110 +73,38 @@ export default {
           dataIndex: 'otherValue2',
         },
       ],
-      tableData: [
-        {
-          equipmentname: '园区A栋3FAXA_P电',
-          howManyValue: '301672',
-          zhanbi: '21.73',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋2FAXA_L3电',
-          howManyValue: '230412',
-          zhanbi: '16.60',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋4FAXA_L3电',
-          howManyValue: '226125',
-          zhanbi: '16.29',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋2FAXA_LR电',
-          howManyValue: '212633',
-          zhanbi: '15.32',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋3FAXA_AC电',
-          howManyValue: '185498',
-          zhanbi: '13.36',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋2FAXA_P电',
-          howManyValue: '181028',
-          zhanbi: '13.23',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-        {
-          equipmentname: '园区A栋1FAXA_L3电',
-          howManyValue: '176050',
-          zhanbi: '12.31',
-          otherValue: '--',
-          otherValue2: '--',
-        },
-      ],
-      yuanquName: [
-        '园区A栋1FAXA_L3电',
-        '园区A栋2FAXA_P电',
-        '园区A栋3FAXA_AC电',
-        '园区A栋2FAXA_LR电',
-        '园区A栋4FAXA_L3电',
-        '园区A栋2FAXA_L3电',
-        '园区A栋3FAXA_P电',
-      ],
-      numbers: [176050, 181028, 185498, 212633, 226125, 230412, 301672],
+      tableData: [],
+      yuanquName: [],
+      numbers: [],
       url: {
-        list: '/ems/statistics/ranking',
+        list: '/emsStatistics/ranking',
       },
     }
   },
   created() {},
   mounted() {
     this.$nextTick(() => {
-      this.getTest()
-      // this.getRanking()
+      this.getRanking()
     })
   },
   methods: {
-    // 后端好了需要删掉
-    getTest() {
-      this.tableData = emsdata.rankdata
-      var yuanquName, numbers
-      yuanquName = this.tableData.map((obj) => {
-        return obj.equipmentname
-      })
-      numbers = this.tableData.map((obj) => {
-        return obj.howManyValue
-      })
-      this.yuanquName = yuanquName.filter((item, index) => index < 10)
-      this.numbers = numbers.filter((item, index) => index < 10)
-      this.yuanquName.reverse()
-      this.numbers.reverse()
-      this.initEcharts()
-    },
     async getRanking() {
       this.loading = true
       var data = this.$refs.commonSearch.queryParams
       getAction(this.url.list, data).then((response) => {
-        this.tableData = response.data
-        var yuanquName, numbers
-        yuanquName = this.tableData.map((obj) => {
-          return obj.equipmentname
-        })
-        numbers = this.tableData.map((obj) => {
-          return obj.howManyValue
-        })
-        this.yuanquName = yuanquName.filter((item, index) => index < 10)
-        this.numbers = numbers.filter((item, index) => index < 10)
+        this.tableData = response.result.tableData
+        this.yuanquName = response.result.yuanquName
+        this.numbers = response.result.numbers
+        // var yuanquName, numbers
+        // yuanquName = this.tableData.map((obj) => {
+        //   return obj.equipmentname
+        // })
+        // numbers = this.tableData.map((obj) => {
+        //   return obj.howManyValue
+        // })
+        // this.yuanquName = yuanquName.filter((item, index) => index < 10)
+        // this.numbers = numbers.filter((item, index) => index < 10)
+
         this.yuanquName.reverse()
         this.numbers.reverse()
         this.loading = false
@@ -248,8 +175,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleSearch(param) {
-      this.getTest()
-      // this.getRanking()
+      this.getRanking()
     },
   },
 }

+ 5 - 14
src/views/module_ems/energyAnalyse/flowAnalysis/index.vue

@@ -9,7 +9,6 @@
   import * as echarts from 'echarts';
   import commonSearch from '../components/commonSearch.vue'
   import { httpAction, getAction } from '@/api/manage'
-  import { emsdata } from '../emsdata';
   export default {
     name: 'flowAnalysis',
     components: {
@@ -24,7 +23,7 @@
         sourceData: [],
         linksData: [],
         url: {
-          list: "/ems/statistics/energyflowAnalysis",
+          list: "/emsStatistics/energyflowAnalysis",
         },
       }
     },
@@ -32,25 +31,18 @@
     },
     mounted() {
       this.$nextTick(() => {
-        // this.getEnergyflowAnalysis()
-        this.getTest()
+        this.getEnergyflowAnalysis()
       })
     },
     methods: {
-    // 后端好了需要删掉
-    getTest() {
-      this.sourceData = emsdata.flowdata.sourceData
-      this.linksData = emsdata.flowdata.linksData
-      this.initEcharts()
-    },
       async getEnergyflowAnalysis(){
         var _this = this
         _this.loading = true
         var data = _this.$refs.commonSearch.queryParams
         getAction(this.url.list, data).then(response => {
           console.log(response)
-          _this.sourceData = response.data.sourceData
-          _this.linksData = response.data.linksData
+          _this.sourceData = response.result.sourceData
+          _this.linksData = response.result.linksData
           _this.loading = false
         })
         _this.initEcharts()
@@ -130,8 +122,7 @@
       },
       /** 搜索按钮操作 */
       handleSearch(param) {
-        this.getTest()
-        // this.getEnergyflowAnalysis()
+        this.getEnergyflowAnalysis()
       }
     },
   }

+ 22 - 33
src/views/module_ems/energyAnalyse/savingAnalysis/index.vue

@@ -27,7 +27,6 @@
 import * as echarts from 'echarts'
 import commonSearch from '../components/commonSearch.vue'
 import { httpAction, getAction } from '@/api/manage'
-import { emsdata } from '../emsdata';
 export default {
   name: 'savingAnalysis',
   components: {
@@ -41,52 +40,43 @@ export default {
       shijiAll: null,
       jihuaAll: null,
       leijiAll: null,
-      monthDate: ['08/01', '08/02','08/03', '04', '05', '06', '07','08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29' ,'30', '31'],
-      jienengData: [ 6256,13954,14856,14236,14368,14000,0,0,14056,14265,5999,0,14666,5258,6489,14888,0,14257,13999,14879,8899,8159,14148,14942,14025,14356,14943,0,0,14678,14977 ],
-      chaobiaoData: [ 0,0,0,0,0,0,9204,9015,0,0,0,18999,0,0,0,0,15111,0,0,0,0,0,0,0,0,0,0,10056,9752,0,0 ],
-      jihuaData: [ 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000],
-      leijiData: [2743,4100,4828,5768,6670,7929,7424,7315,8338,9193,18252,14124,14547.7,18245,20942.6,22420,22314.5,23049.2,24237.6,24572.8,24638.3,25072.3,25846.9,26014.3,26956.7,27639.2,27859.5,27213.1,26854,27254,27440.8],
+      monthDate: [],
+      // monthDate: ['08/01', '08/02','08/03', '04', '05', '06', '07','08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29' ,'30', '31'],
+      jienengData: [],
+      // jienengData: [ 6256,13954,14856,14236,14368,14000,0,0,14056,14265,5999,0,14666,5258,6489,14888,0,14257,13999,14879,8899,8159,14148,14942,14025,14356,14943,0,0,14678,14977 ],
+      chaobiaoData: [],
+      // chaobiaoData: [ 0,0,0,0,0,0,9204,9015,0,0,0,18999,0,0,0,0,15111,0,0,0,0,0,0,0,0,0,0,10056,9752,0,0 ],
+      jihuaData: [],
+      // jihuaData: [ 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000, 15000, 15000, 15000, 9000, 9000, 15000, 15000],
+      leijiData: [],
+      // leijiData: [2743,4100,4828,5768,6670,7929,7424,7315,8338,9193,18252,14124,14547.7,18245,20942.6,22420,22314.5,23049.2,24237.6,24572.8,24638.3,25072.3,25846.9,26014.3,26956.7,27639.2,27859.5,27213.1,26854,27254,27440.8],
       url: {
-        list: "/ems/statistics/savinganalysis",
+        list: "/emsStatistics/savinganalysis",
       },
     }
   },
   created() {},
   mounted() {
     this.$nextTick(() => {
-      this.getTest()
-      // this.getSavinganalysis()
+      this.getSavinganalysis()
     })
   },
   methods: {
-    // 后端好了需要删掉
-    getTest() {
-        this.jienengData = emsdata.savedata.jienengData
-        this.chaobiaoData = emsdata.savedata.chaobiaoData
-        this.jihuaData = emsdata.savedata.jihuaData
-        this.leijiData = emsdata.savedata.leijiData
-        this.monthDate = emsdata.savedata.monthDate
-        this.anlysis = emsdata.savedata.anlysis
-        this.jihuaAll = emsdata.savedata.jihuaAll
-        this.shijiAll = emsdata.savedata.shijiAll
-        this.leijiAll = emsdata.savedata.leijiAll
-      this.initEcharts()
-    },
     async getSavinganalysis() {
       this.loading = true
       var data = this.$refs.commonSearch.queryParams
       console.log(data)
       getAction(this.url.list, data).then((response) => {
         console.log(response)
-        this.jienengData = response.data.jienengData
-        this.chaobiaoData = response.data.chaobiaoData
-        this.jihuaData = response.data.jihuaData
-        this.leijiData = response.data.leijiData
-        this.monthDate = response.data.monthDate
-        this.anlysis = response.data.anlysis
-        this.jihuaAll = response.data.jihuaAll
-        this.shijiAll = response.data.shijiAll
-        this.leijiAll = response.data.leijiAll
+        this.jienengData = response.result.jienengData
+        this.chaobiaoData = response.result.chaobiaoData
+        this.jihuaData = response.result.jihuaData
+        this.leijiData = response.result.leijiData
+        this.monthDate = response.result.monthDate
+        this.anlysis = response.result.anlysis
+        this.jihuaAll = response.result.jihuaAll
+        this.shijiAll = response.result.shijiAll
+        this.leijiAll = response.result.leijiAll
         this.loading = false
       })
       this.initEcharts()
@@ -319,8 +309,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleSearch(param) {
-      this.getTest()
-      // this.getSavinganalysis()
+      this.getSavinganalysis()
     },
   },
 }