温红权 3 роки тому
батько
коміт
a39bc418b8
2 змінених файлів з 50 додано та 24 видалено
  1. 10 0
      ruoyi-ui/src/api/data/deviceData.js
  2. 40 24
      ruoyi-ui/src/components/map/index.vue

+ 10 - 0
ruoyi-ui/src/api/data/deviceData.js

@@ -17,6 +17,16 @@ export function queryShipByDeviceId(query) {
     });
 }
 
+export function queryDatabymmsi(query) {
+    return request({
+        url: "gas/common/queryShipMonitorInfo",
+        method: "get",
+        params: query,
+    });
+}
+
+
+
 export function queryShipData(query) {
     return request({
         url: "gas/common/queryShipList",

+ 40 - 24
ruoyi-ui/src/components/map/index.vue

@@ -231,7 +231,7 @@
             <el-table
               :header-cell-style="{ background: '#e4eafc'}"
               ref="singleTable"
-              :data="tableData"
+              :data="tableData.minor"
               highlight-current-row
               style="width: 100%"
               class="tableSc">
@@ -241,7 +241,7 @@
                 width="50">
               </el-table-column>
               <el-table-column
-                property="name"
+                property="monitorPointName"
                 label="监测点"
                 width="100">
               </el-table-column>
@@ -249,19 +249,19 @@
                 :label="'硫含量'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.value > normalPer" style="color:red">{{ scope.row.value }}% ↑ {{ ((scope.row.value - normalPer) / normalPer * 100).toFixed(0) }}%</div>
-                  <div v-if=" scope.row.value <= normalPer">{{ scope.row.value }}%</div>
+                  <div v-if="scope.row.so2Percent > normalPer" style="color:red">{{ scope.row.so2Percent }}% ↑ {{ ((scope.row.so2Percent - normalPer) / normalPer * 100).toFixed(0) }}%</div>
+                  <div v-if=" scope.row.so2Percent <= normalPer">{{ scope.row.so2Percent }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'黑度'">
                 <template slot-scope="scope">
-                  <div v-if="scope.row.count > normalCount" style="color:red">{{ scope.row.count }}度 ↑ {{ ((scope.row.count - normalCount) / normalCount * 100).toFixed(0) }}%</div>
-                  <div v-if=" scope.row.count <= normalCount">{{ scope.row.count }}度</div>
+                  <div v-if="scope.row.rcgSoot > normalCount" style="color:red">{{ scope.row.rcgSoot }}度 ↑ {{ ((scope.row.rcgSoot - normalCount) / normalCount * 100).toFixed(0) }}%</div>
+                  <div v-if=" scope.row.rcgSoot <= normalCount">{{ scope.row.rcgSoot }}度</div>
                 </template>
               </el-table-column>
               <el-table-column
-                property="date"
+                property="createTime"
                 label="监测时间">
               </el-table-column>
             </el-table>
@@ -272,7 +272,7 @@
             <el-table
               :header-cell-style="{ background: '#e4eafc'}"
               ref="singleTable"
-              :data="tableData"
+              :data="tableData.main"
               highlight-current-row
               style="width: 100%"
               class="tableSc"
@@ -283,7 +283,7 @@
                 width="50">
               </el-table-column>
               <el-table-column
-                property="name"
+                property="monitorPointName"
                 label="监测点"
               >
               </el-table-column>
@@ -291,35 +291,35 @@
                 :label="'SO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.value > normalPer" style="color:red">{{ scope.row.value }}% ↑</div>
-                  <div v-if=" scope.row.value <= normalPer">{{ scope.row.value }}%</div>
+                  <div v-if="scope.row.so2Concentration > normalPer" style="color:red">{{ scope.row.so2Concentration }}% ↑</div>
+                  <div v-if=" scope.row.so2Concentration <= normalPer">{{ scope.row.so2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'NO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.value > normalPer" style="color:red">{{ scope.row.value }}% ↑</div>
-                  <div v-if=" scope.row.value <= normalPer">{{ scope.row.value }}%</div>
+                  <div v-if="scope.row.no2Concentration > normalPer" style="color:red">{{ scope.row.no2Concentration }}% ↑</div>
+                  <div v-if=" scope.row.no2Concentration <= normalPer">{{ scope.row.no2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'CO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.value > normalPer" style="color:red">{{ scope.row.value }}% ↑</div>
-                  <div v-if=" scope.row.value <= normalPer">{{ scope.row.value }}%</div>
+                  <div v-if="scope.row.co2Concentration > normalPer" style="color:red">{{ scope.row.co2Concentration }}% ↑</div>
+                  <div v-if=" scope.row.co2Concentration <= normalPer">{{ scope.row.co2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'硫碳比'">
                 <template slot-scope="scope">
-                  <div v-if="scope.row.count > normalCount" style="color:red">{{ scope.row.count }}度 ↑</div>
-                  <div v-if=" scope.row.count <= normalCount">{{ scope.row.count }}度</div>
+                  <div v-if="scope.row.so2Percent > normalCount" style="color:red">{{ scope.row.so2Percent }}度 ↑</div>
+                  <div v-if=" scope.row.so2Percent <= normalCount">{{ scope.row.so2Percent }}度</div>
                 </template>
               </el-table-column>
               <el-table-column
-                property="date"
+                property="createTime"
                 label="监测时间">
               </el-table-column>
             </el-table>
@@ -387,7 +387,7 @@ import {Feature} from "ol";
 import {LineString, Point} from "ol/geom";
 import {Icon, Stroke, Style} from "ol/style";
 import {Vector as LayerVec} from "ol/layer";
-import {queryShipByDeviceId} from "@/api/data/deviceData";
+import {queryShipByDeviceId,queryDatabymmsi} from "@/api/data/deviceData";
 
 let ispro = process.env.NODE_ENV === "production";
 let that = null;
@@ -415,7 +415,7 @@ export default {
       tabledatas: [],
 
       d_activeName: 'd_first',
-      tableData: [],
+      tableData: {minor:[],main:[]},
       addrlist: [{name: "南京四桥", location: [1, 1]}],
       caddr: "南京四桥",
       shipShow: false,
@@ -483,14 +483,10 @@ export default {
       this.tabledatas = [];
       queryShipByDeviceId(q).then(data => {
         console.log(data);
-
         data.data.forEach(element => {
           element["values"] = element.illegalType == "heiyan" ? element.rcgSoot : (element.illegalType == "guangpu" ? element.so2Percent : (element.illegalType == "xiutan" ? element.so2Percent : 0));
           this.tabledatas.push(element);
         });
-
-
-        //  console.log(deviceList);
       });
       //dd
 
@@ -520,6 +516,26 @@ export default {
     },
     handleClick(tab, event) {
       console.log(tab, event);
+      var sect = tab.name;
+      if (sect == "first") {
+        return;
+      }
+      var q = {
+        mmsi: this.shipName.mmsi
+      }
+
+      this.tableData = {minor:[],main:[]};
+      queryDatabymmsi(q).then(data => {
+        console.log(data);
+        this.tableData = data.data;
+        //  console.log(deviceList);
+      });
+
+
+
+
+
+
     },
     transpoints: function (points, type) {
       if (false) {