zy před 1 rokem
rodič
revize
ab53150714

+ 7 - 0
wps-biz/src/main/java/com/jiayue/biz/controller/TunnelInfoController.java

@@ -55,4 +55,11 @@ public class TunnelInfoController extends BaseController {
         return toAjax(tunnelInfoService.removeById(ids) ? 1 : 0);
     }
 
+    /**
+     * 首页通道信息表格
+     */
+    @GetMapping("/homepage")
+    public AjaxResult homepageTunnelInfo() {
+        return AjaxResult.success(tunnelInfoService.homepageTunnelInfo());
+    }
 }

+ 5 - 0
wps-biz/src/main/java/com/jiayue/biz/service/TunnelInfoService.java

@@ -3,5 +3,10 @@ package com.jiayue.biz.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jiayue.biz.domain.TunnelInfo;
 
+import java.util.List;
+import java.util.Map;
+
 public interface TunnelInfoService extends IService<TunnelInfo> {
+    /*首页通道信息*/
+    List<Map<String,Object>> homepageTunnelInfo();
 }

+ 10 - 1
wps-biz/src/main/java/com/jiayue/biz/service/impl/EnvironmentalDataServiceImpl.java

@@ -142,17 +142,26 @@ public class EnvironmentalDataServiceImpl extends ServiceImpl<EnvironmentalDataM
      * @return 首页温湿压
      */
     public ArrayList<HashMap<String, Object>> getTAndPaAndRh() {
-        List<WeatherLook> weatherLookList = weatherLookService.list();
+        List<WeatherLook> weatherLookList = weatherLookService.list().stream().sorted(Comparator.comparing(WeatherLook::getWeatherLookNo)).collect(Collectors.toList());
         ArrayList<HashMap<String, Object>> list = new ArrayList<>();
         for (WeatherLook weatherLook : weatherLookList) {
             HashMap<String, Object> weatherMap = new HashMap<>();
             //获取最后一条的时间
             EnvironmentalData environmentalData = baseMapper.selectLastTimeData(weatherLook.getWeatherLookNo());
+            weatherMap.put("weatherLookNo", weatherLook.getWeatherLookNo());
+            weatherMap.put("weatherLookName", weatherLook.getWeatherLookName());
+            weatherMap.put("modelNumber", weatherLook.getModelNumber());
+            weatherMap.put("latitude", weatherLook.getLatitude());
+            weatherMap.put("longitude", weatherLook.getLongitude());
             if (environmentalData != null) {
                 weatherMap.put("t", environmentalData.getT());
                 weatherMap.put("rh", environmentalData.getRh());
                 weatherMap.put("pa", environmentalData.getPa());
                 weatherMap.put("weatherLook", weatherLook.getWeatherLookNo());
+            }else{
+                weatherMap.put("t", null);
+                weatherMap.put("rh", null);
+                weatherMap.put("pa", null);
             }
             list.add(weatherMap);
 

+ 22 - 0
wps-biz/src/main/java/com/jiayue/biz/service/impl/TunnelInfoServiceImpl.java

@@ -6,9 +6,31 @@ import com.jiayue.biz.mapper.TunnelInfoMapper;
 import com.jiayue.biz.service.TunnelInfoService;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * 通道信息
  */
 @Service
 public class TunnelInfoServiceImpl extends ServiceImpl<TunnelInfoMapper, TunnelInfo> implements TunnelInfoService {
+    /*首页通道信息*/
+    public List<Map<String,Object>> homepageTunnelInfo(){
+        List<Map<String,Object>> list = new ArrayList<>();
+        try {
+            List<TunnelInfo> tunnelInfoList = this.list();
+            for(TunnelInfo tunnelInfo : tunnelInfoList){
+                Map<String,Object> map = new HashMap<>();
+                map.put("tunnelName",tunnelInfo.getTunnelName());
+                map.put("address",tunnelInfo.getIp()+":"+tunnelInfo.getPort());
+                map.put("status",tunnelInfo.getStatus());
+                list.add(map);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return list;
+    }
 }

+ 8 - 1
wps-ui/src/api/biz/dataQuery/environmentalData.js

@@ -25,7 +25,7 @@ export function selectWeatherData(query) {
     params: query
   })
 }
-// 查询首页数据(5个属性)
+// 查询首页数据
 export function selectHomePage(query) {
   return request({
     url: '/environmentalData/selectHomePage',
@@ -33,3 +33,10 @@ export function selectHomePage(query) {
     params: query
   })
 }
+// 查询首页 温 湿 压 数据
+export function selectHomePageByPTR() {
+  return request({
+    url: '/environmentalData/selectHomePageByPTR',
+    method: 'get'
+  })
+}

+ 7 - 0
wps-ui/src/api/biz/dataQuery/tunnelInfo.js

@@ -36,3 +36,10 @@ export function delTunnelInfo(id) {
   })
 }
 
+// 首页通道信息表格
+export function homepageTunnelInfo() {
+  return request({
+    url: '/tunnelInfo/homepage',
+    method: 'get'
+  })
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
wps-ui/src/assets/icons/iconfont.js


+ 1 - 1
wps-ui/src/views/dataQuery/weatherStationInfo/index.vue

@@ -235,7 +235,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id;
-      this.$modal.confirm('是否确认删除环境监测仪信息名称为"' + row.name + '"信息及所有数据?').then(function () {
+      this.$modal.confirm('是否确认删除环境监测仪信息名称为"' + row.weatherLookName + '"信息及所有数据?').then(function () {
         return delWeatherLook(ids);
       }).then(() => {
         this.getList();

+ 92 - 18
wps-ui/src/views/largeScreenPage/index.vue

@@ -44,19 +44,19 @@
                   <svg class="icon" aria-hidden="true">
                     <use xlink:href="#icon-wendu"></use>
                   </svg>
-                  <span class="header-title">温度:</span> °
+                  <span class="header-title">温度:</span> {{item.t}} °
                 </div>
                 <div>
                   <svg class="icon" aria-hidden="true">
-                    <use xlink:href="#icon-shidu"></use>
+                    <use xlink:href="#icon-shidu-copy"></use>
                   </svg>
-                  <span class="header-title">湿度:</span> %rh
+                  <span class="header-title">湿度:</span>  {{item.rh}} %rh
                 </div>
                 <div>
                   <svg class="icon" aria-hidden="true">
                     <use xlink:href="#icon-YaQiang"></use>
                   </svg>
-                  <span class="header-title">压强:</span> Pa
+                  <span class="header-title">压强:</span> {{item.pa}} Pa
                 </div>
               </div>
             </div>
@@ -79,14 +79,40 @@
             <!--       右侧主体     -->
             <div class="right-main-container">
               <!--      主体上方        -->
-              <div style="height: 30%">
+              <div style="height: 40%">
                 <div class="rightSubtitle">通道信息</div>
-                <div>
-
+                <div class="tableDiv">
+                  <el-table
+                    :header-cell-style="{'background-color':'transparent',color:'#fff'}"
+                    :data="tableData"
+                    style="width: 100%">
+                    <el-table-column
+                      prop="tunnelName" align="center"
+                      label="通道名称"
+                    >
+                    </el-table-column>
+                    <el-table-column
+                      prop="address" align="center"
+                      label="地址"
+                      >
+                    </el-table-column>
+                    <el-table-column
+                      prop="status" align="center"
+                      label="通道状态">
+                      <template slot-scope="scope">
+                        <svg class="icon" aria-hidden="true" v-if="scope.row.status === '1'">
+                          <use xlink:href="#icon-zhengchang"></use>
+                        </svg>
+                        <svg class="icon" aria-hidden="true" v-else>
+                          <use xlink:href="#icon-lianjieduankai"></use>
+                        </svg>
+                      </template>
+                    </el-table-column>
+                  </el-table>
                 </div>
               </div>
               <!--主体下方-->
-              <div style="height: 65%">
+              <div style="height: 60%">
                 <div class="rightSubtitle">实时风速风向折线图</div>
                 <div id="wswdChart"/>
               </div>
@@ -105,7 +131,8 @@
 <script>
 import {list} from "@/api/biz/dataQuery/weatherLook";
 import '../../assets/icons/iconfont'
-import {selectHomePage} from "@/api/biz/dataQuery/environmentalData";
+import {selectHomePage,selectHomePageByPTR} from "@/api/biz/dataQuery/environmentalData";
+import {homepageTunnelInfo} from "@/api/biz/dataQuery/tunnelInfo";
 import {dateFormat} from "@/utils/dateTimeFormat";
 
 export default {
@@ -114,34 +141,53 @@ export default {
     return {
       time: null,
       wsTime: null,
+      tunnelTime:null,
       eqData: [],
       eqNo: '',
       eqName: '',
       //时间控件 当天的零点到23:59:59
       dataTime: [new Date(new Date().toLocaleDateString()).getTime(), new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 -1000],
-      timeList:[]
+      timeList:[],
+      // ptrData:{1001:{pa: 0, t: 28, rh: 66.5}}
+      ptrData:[],
+      tableData:[
+        {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
+        {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
+        {tunnelName:'通道1',address:'192.168.10.226:505',status:'1'},
+        {tunnelName:'通道1',address:'192.168.10.226:505',status:'0'},
+      ],
+      charts:null
     }
   },
   destroyed() {
+    this.charts = null
     clearInterval(this.timer)
     this.timer = null
     clearInterval(this.wsTime)
     this.wsTime = null
+    clearInterval(this.tunnelTime)
+    this.tunnelTime = null
   },
   mounted() {
     this.getTimeArray()
     this.formatTime()
     this.timer = setInterval(this.formatTime, 1000 * 60)
-    this.getWeatherLookInfo()
+    this.init()
   },
   methods: {
+    init(){
+      this.getWeatherLookInfo()
+      this.wsTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
+      this.getTunnelInfo()
+      this.tunnelTime = setInterval(this.getWeatherLookInfo, 1000 * 60 * 10)
+    },
     getWeatherLookInfo() {
-      list().then(res => {
-        this.eqData = res.rows
+      selectHomePageByPTR().then(res => {
+        // this.eqData = res.rows
+        this.eqData = res.data
         this.eqNo = this.eqData[0].weatherLookNo
         this.eqName = this.eqData[0].weatherLookName
         this.getWindData()
-        this.wsTime = setInterval(this.getWindData, 1000 * 60 * 10)
       }).catch(err => {
         console.log('首页获取环境监测仪信息异常:' + err)
       })
@@ -155,6 +201,13 @@ export default {
         console.log('首页获取风数据异常:' + err)
       })
     },
+    getTunnelInfo(){
+      homepageTunnelInfo().then(res=>{
+        this.tableData= res.data
+      }).catch(err=>{
+        console.log('获取通道信息异常:'+err)
+      })
+    },
     clickWeatherLook(value) {
       this.eqNo = value.weatherLookNo
       this.eqName = value.weatherLookName
@@ -163,7 +216,10 @@ export default {
       this.wsTime = setInterval(this.getWindData, 1000 * 60 * 10)
     },
     draw(time, ws, wd, name) {
-      let myChart = this.$echarts.init(document.getElementById('wswdChart'));
+      if(this.charts == null){
+        this.charts = this.$echarts.init(document.getElementById('wswdChart'));
+      }
+
       let option = {
         title: {
           text: name + '数据',
@@ -172,8 +228,8 @@ export default {
           }
         },
         grid: {
-          top: 80,
-          bottom: 50
+          top: 70,
+          bottom: 70
         },
         tooltip: {
           trigger: 'axis'
@@ -237,7 +293,7 @@ export default {
           }
         ]
       };
-      option && myChart.setOption(option);
+      option && this.charts.setOption(option,true);
     },
     push() {
       this.$router.push({path: "/dataQuery/weatherStationInfo"})
@@ -492,4 +548,22 @@ export default {
   width: 100%;
   height: calc(50vh);
 }
+
+.tableDiv /deep/  .el-table, .el-table__expanded-cell {
+  background-color: transparent;
+}
+
+.tableDiv /deep/ .el-table tr {
+  background-color: transparent!important;
+}
+.tableDiv /deep/  .el-table--enable-row-transition .el-table__body td, .el-table .cell{
+  color: #fff;
+  background-color: transparent;
+}
+.tableDiv /deep/ .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
+  background-color: transparent;
+}
+.tableDiv /deep/.el-table--medium .el-table__cell {
+  padding: 9px 0;
+}
 </style>

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů