zy 1 vuosi sitten
vanhempi
commit
453d83e40b

+ 24 - 0
wps-ui/src/api/biz/dataQuery/environmentalData.js

@@ -9,3 +9,27 @@ export function list(query) {
     params: query
   })
 }
+// 实时风速风向查询
+export function selectWindData(query) {
+  return request({
+    url: '/environmentalData/selectWindData',
+    method: 'get',
+    params: query
+  })
+}
+// 查询环境数据(温度压强)
+export function selectWeatherData(query) {
+  return request({
+    url: '/environmentalData/selectWeatherData',
+    method: 'get',
+    params: query
+  })
+}
+// 查询首页数据(5个属性)
+export function selectHomePage(query) {
+  return request({
+    url: '/environmentalData/selectHomePage',
+    method: 'get',
+    params: query
+  })
+}

+ 2 - 3
wps-ui/src/plugins/download.js

@@ -9,8 +9,8 @@ import Cookies from "js-cookie";
 const baseURL = process.env.VUE_APP_BASE_API
 
 export default {
-  windTowerStatus(urls, startTime, endTime, equipmentId) {
-    var url = baseURL + urls + "?startTime=" + encodeURI(startTime) + "&endTime=" + encodeURI(endTime) + "&equipmentId=" + encodeURI(equipmentId);
+  weatherStationData(urls, startTime, endTime, weatherLookNo) {
+    var url = baseURL + urls + "?startTime=" + encodeURI(startTime) + "&endTime=" + encodeURI(endTime) + "&weatherLookNo=" + encodeURI(weatherLookNo);
     axios({
       method: 'get',
       url: url,
@@ -25,7 +25,6 @@ export default {
         this.printErrMsg(res.data);
       }
     })
-    Cookies.set("exportDataLoading", true, {expires: 60});
   },
   exportAllData(urls, eqId) {
     var url = baseURL + urls + "?equipmentId=" + encodeURI(eqId);

+ 3 - 2
wps-ui/src/utils/request.js

@@ -122,11 +122,12 @@ service.interceptors.response.use(res => {
       }
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
     } else if (code === 500) {
+      console.log(msg)
       Message({
-        message: msg,
+        message: '数据异常或缺失,请联系管理员',
         type: 'warning'
       })
-      return Promise.reject('数据异常或缺失,请联系管理员')
+      return Promise.reject(msg)
     } else if (code !== 200) {
       Notification.error({
         title: msg

+ 43 - 6
wps-ui/src/views/dataQuery/WeatherStationStatusData/index.vue

@@ -24,13 +24,14 @@
             </el-option>
           </el-select>
         </div>
-        <el-button :loading="btuLoading" class="myButton" type="primary" icon="el-icon-search" @change="getData">搜索</el-button>
+        <el-button :loading="btuLoading" class="myButton" type="primary" icon="el-icon-search" @click="getData">搜索</el-button>
+        <el-button :loading="dbtuLoading" class="myButton" type="primary" icon="el-icon-download" @click="download">导出</el-button>
       </div>
       <div class="tableBox">
         <el-table v-loading="loading" border
                   :data="tableAllData.slice((page.currentPage-1)*page.pageSize,page.currentPage*page.pageSize)">
           <el-table-column type="index" label="序号" width="55" align="center"/>
-          <el-table-column label="时间" align="center" prop="ts"/>
+          <el-table-column label="时间" align="center" prop="ts" :formatter="formatDate"/>
           <el-table-column label="风速" align="center" prop="ws"/>
           <el-table-column label="风向" align="center" prop="wd"/>
           <el-table-column label="温度" align="center" prop="t"/>
@@ -57,16 +58,17 @@
 <script>
 import {infoList} from "@/api/biz/dataQuery/weatherLook";
 import {list} from "@/api/biz/dataQuery/environmentalData";
-
+import download from '@/plugins/download'
 export default {
   name: "index",
   data() {
     return {
       loading: false,
       btuLoading: true,
+      dbtuLoading: false,
       tableAllData: [],
-      //时间控件
-      dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 24 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
+      //时间控件 当天的零点到23:59:59
+      dataTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 -1000],
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
@@ -83,7 +85,7 @@ export default {
     getWeatherLook() {
       infoList().then(res => {
         this.equipmentAllInfo = res.data
-        this.eqNo = this.equipmentAllInfo[0].weatherLookNo
+        this.eqNo = this.equipmentAllInfo[0].no
         this.getData()
       }).catch(err => {
         console.log('获取环境检测仪异常' + err)
@@ -99,6 +101,7 @@ export default {
       }
       list(param).then(res=>{
         this.tableAllData = res.data
+        this.page.total = this.tableAllData.length
         this.btuLoading = false
         this.loading = false
       }).catch(err=>{
@@ -107,6 +110,39 @@ export default {
         console.log('获取环境监测仪数据异常:'+err)
       })
     },
+    download(){
+      this.dbtuLoading = true
+      download.weatherStationData("/environmentalData/exportAll",new Date(this.dataTime[0]).getTime(), new Date(this.dataTime[1]).getTime(), this.eqNo)
+      const _self =this
+      setTimeout(function (){
+        _self.dbtuLoading = false
+      },5000)
+    },
+    formatDate(row){
+      var date = new Date(row.ts)
+      let format = 'yyyy-MM-dd hh:mm:ss';
+      if (date != 'Invalid Date') {
+        var o = {
+          "M+": date.getMonth() + 1, //month
+          "d+": date.getDate(), //day
+          "h+": date.getHours(), //hour
+          "m+": date.getMinutes(), //minute
+          "s+": date.getSeconds(), //second
+          "q+": Math.floor((date.getMonth() + 3) / 3), //quarter
+          "S": date.getMilliseconds() //millisecond
+        }
+        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
+          (date.getFullYear() + "").substr(4 - RegExp.$1.length));
+        for (var k in o)
+          if (new RegExp("(" + k + ")").test(format))
+            format = format.replace(RegExp.$1,
+              RegExp.$1.length == 1 ? o[k] :
+                ("00" + o[k]).substr(("" + o[k]).length));
+        return format;
+      }
+      return date;
+    },
+
     /*pageSize改变*/
     handleSizeChange(val) {
       this.page.pageSize = val
@@ -116,6 +152,7 @@ export default {
     handleCurrentChange(val) {
       this.page.currentPage = val
     },
+
   }
 }
 </script>

+ 34 - 8
wps-ui/src/views/dataQuery/realTimeQuery/realTP/index.vue

@@ -24,7 +24,7 @@
             </el-option>
           </el-select>
         </div>
-        <el-button :loading="btuLoading" class="myButton" type="primary" icon="el-icon-search">搜索
+        <el-button :loading="btuLoading" class="myButton" type="primary" icon="el-icon-search" @click="getData">搜索
         </el-button>
       </div>
       <div id="tpCharts"/>
@@ -34,15 +34,15 @@
 
 <script>
 import {infoList} from "@/api/biz/dataQuery/weatherLook";
-
+import {selectWeatherData} from "@/api/biz/dataQuery/environmentalData";
 export default {
   name: "index",
   data() {
     return {
       loading: false,
-      btuLoading: false,
-      //时间控件
-      dataTime: [new Date(new Date().toLocaleDateString()).getTime() - 24 * 60 * 60 * 1000, new Date(new Date().toLocaleDateString()).getTime()],
+      btuLoading: true,
+      //时间控件 当天的零点到23:59:59
+      dataTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 -1000],
       eqNo: '',
       equipmentAllInfo: []
     }
@@ -54,15 +54,40 @@ export default {
     getWeatherLook() {
       infoList().then(res => {
         this.equipmentAllInfo = res.data
-        this.eqNo = this.equipmentAllInfo[0].weatherLookNo
-        let time = ['0:00', '1:00', '2:00', '3:00', '4:00', '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']
-        this.draw(time,[],[])
+        this.eqNo = this.equipmentAllInfo[0].no
+
+        this.getData()
       }).catch(err => {
         console.log('获取环境检测仪异常' + err)
       })
     },
+    getData(){
+      this.btuLoading = true
+      let param = {
+        startTime: new Date(this.dataTime[0]).getTime(),
+        endTime: new Date(this.dataTime[1]).getTime(),
+        weatherLookNo: this.eqNo,
+      }
+      selectWeatherData(param).then(res=>{
+        let time = res.data.timeList
+        let pa= res.data.paList
+        let t = res.data.tList
+        this.draw(time,t,pa)
+        this.btuLoading = false
+      }).catch(err=>{
+        this.btuLoading = false
+        console.log('获取温度压强失败:'+err)
+      })
+    },
     draw(time,t,pa) {
       let myChart = this.$echarts.init(document.getElementById('tpCharts'));
+      myChart.showLoading({
+        text: 'loading',
+        color: '#c23531',
+        textColor: '#000',
+        maskColor: 'rgba(255, 255, 255, 0.2)',
+        zlevel: 0,
+      });
       let option = {
         title: {
           text: '温度和气压时间折线图',
@@ -157,6 +182,7 @@ export default {
         ]
       }
       option && myChart.setOption(option);
+      myChart.hideLoading();
     },
   }
 }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 34 - 17
wps-ui/src/views/dataQuery/realTimeQuery/realWsWd/index.vue


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä