459242451@qq.com 3 年之前
父節點
當前提交
26894d739a
共有 3 個文件被更改,包括 62 次插入63 次删除
  1. 12 12
      ruoyi-ui/src/components/map/index.vue
  2. 11 12
      ruoyi-ui/src/utils/request.js
  3. 39 39
      ruoyi-ui/src/views/components/table/homeTable.vue

+ 12 - 12
ruoyi-ui/src/components/map/index.vue

@@ -238,30 +238,30 @@
                 :label="'SO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.so2Concentration!=null && scope.row.so2Concentration > normalPer" style="color:red">
-                    {{ scope.row.so2Concentration }}% ↑
-                  </div>
-                  <div v-if="scope.row.so2Concentration!=null && scope.row.so2Concentration <= normalPer">{{ scope.row.so2Concentration }}%</div>
+                  <!--                  <div v-if="scope.row.so2Concentration!=null && scope.row.so2Concentration > normalPer" style="color:red">-->
+                  <!--                    {{ scope.row.so2Concentration }}% ↑-->
+                  <!--                  </div>-->
+                  <div v-if="scope.row.so2Concentration!=null">{{ scope.row.so2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'NO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.no2Concentration!=null && scope.row.no2Concentration > normalPer" style="color:red">
-                    {{ scope.row.no2Concentration }}% ↑
-                  </div>
-                  <div v-if="scope.row.no2Concentration!=null && scope.row.no2Concentration <= normalPer">{{ scope.row.no2Concentration }}%</div>
+                  <!--                  <div v-if="scope.row.no2Concentration!=null && scope.row.no2Concentration > normalPer" style="color:red">-->
+                  <!--                    {{ scope.row.no2Concentration }}% ↑-->
+                  <!--                  </div>-->
+                  <div v-if="scope.row.no2Concentration!=null">{{ scope.row.no2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column
                 :label="'CO2浓度'"
               >
                 <template slot-scope="scope">
-                  <div v-if="scope.row.co2Concentration!=null &&  scope.row.co2Concentration > normalPer" style="color:red">
-                    {{ scope.row.co2Concentration }}% ↑
-                  </div>
-                  <div v-if=" scope.row.co2Concentration!=null && scope.row.co2Concentration <= normalPer">{{ scope.row.co2Concentration }}%</div>
+                  <!--                  <div v-if="scope.row.co2Concentration!=null &&  scope.row.co2Concentration > normalPer" style="color:red">-->
+                  <!--                    {{ scope.row.co2Concentration }}% ↑-->
+                  <!--                  </div>-->
+                  <div v-if=" scope.row.co2Concentration!=null">{{ scope.row.co2Concentration }}%</div>
                 </template>
               </el-table-column>
               <el-table-column

+ 11 - 12
ruoyi-ui/src/utils/request.js

@@ -1,7 +1,7 @@
 import axios from 'axios'
-import { Notification, MessageBox, Message } from 'element-ui'
+import {Message, MessageBox, Notification} from 'element-ui'
 import store from '@/store'
-import { getToken } from '@/utils/auth'
+import {getToken} from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
@@ -10,7 +10,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 10000
+  timeout: 20000
 })
 // request拦截器
 service.interceptors.request.use(config => {
@@ -25,7 +25,7 @@ service.interceptors.request.use(config => {
     for (const propName of Object.keys(config.params)) {
       const value = config.params[propName];
       var part = encodeURIComponent(propName) + "=";
-      if (value !== null && typeof(value) !== "undefined") {
+      if (value !== null && typeof (value) !== "undefined") {
         if (typeof value === 'object') {
           for (const key of Object.keys(value)) {
             let params = propName + '[' + key + ']';
@@ -43,8 +43,8 @@ service.interceptors.request.use(config => {
   }
   return config
 }, error => {
-    console.log(error)
-    Promise.reject(error)
+  console.log(error)
+  Promise.reject(error)
 })
 
 // 响应拦截器
@@ -63,7 +63,8 @@ service.interceptors.response.use(res => {
         store.dispatch('LogOut').then(() => {
           location.href = '/index';
         })
-      }).catch(() => {});
+      }).catch(() => {
+      });
     } else if (code === 500) {
       Message({
         message: msg,
@@ -81,14 +82,12 @@ service.interceptors.response.use(res => {
   },
   error => {
     console.log('err' + error)
-    let { message } = error;
+    let {message} = error;
     if (message == "Network Error") {
       message = "后端接口连接异常";
-    }
-    else if (message.includes("timeout")) {
+    } else if (message.includes("timeout")) {
       message = "系统接口请求超时";
-    }
-    else if (message.includes("Request failed with status code")) {
+    } else if (message.includes("Request failed with status code")) {
       message = "系统接口" + message.substr(message.length - 3) + "异常";
     }
     Message({

+ 39 - 39
ruoyi-ui/src/views/components/table/homeTable.vue

@@ -257,46 +257,46 @@ export default {
     //  this.getChart();
   },
   methods: {
-    clickship(shipdata){
-
-       if (shipdata!=null && shipdata!=undefined) {
-          var ship = shipdata;
-          ship["shipName"] = ship.shipname_cn;
-          ship["locations"] = [[ship.lng, ship.lat]];
-          ship["type"] = 1;
-          ship["speed"] = ship.speed == null ? '-' : ship.speed;
-          ship["head"] = ship.head == null ? '-' : ship.head;
-          ship["course"] = ship.course == null ? '-' : ship.course;
-          ship["monitorPointName"] = '-';
-
-          var tt=[];
-          var obj = ship;
-          var img = 'zc.png'
-          if (obj.type == 2) {
-            img = 'xy.png'
-          } else if (obj.type == 3) {
-            img = 'wg.png'
-          }
-          var isin = false;
-          for(var i in this.ship){
-             if(this.ship[i]["mmsi"] == obj["mmsi"]){
-               this.ship[i] = obj;
-               isin = true;
-               break;
-             }
-          }
-          if(!isin){
-            this.ship.push(obj);
+    clickship(shipdata) {
+
+      if (shipdata != null && shipdata != undefined) {
+        var ship = shipdata;
+        // ship["shipName"] = ship.shipname_cn;
+        ship["locations"] = [[ship.lng, ship.lat]];
+        ship["type"] = 1;
+        ship["speed"] = ship.speed == null ? '-' : ship.speed + '节';
+        ship["head"] = ship.head == null ? '-' : ship.head;
+        ship["course"] = ship.course == null ? '-' : ship.course;
+        // ship["monitorPointName"] = '-';
+
+        var tt = [];
+        var obj = ship;
+        var img = 'zc.png'
+        if (obj.type == 2) {
+          img = 'xy.png'
+        } else if (obj.type == 3) {
+          img = 'wg.png'
+        }
+        var isin = false;
+        for (var i in this.ship) {
+          if (this.ship[i]["mmsi"] == obj["mmsi"]) {
+            this.ship[i] = obj;
+            isin = true;
+            break;
           }
-          this.addshipPoint();
-          this.$refs.mapv.map.getView().setCenter(this.$refs.mapv.transpoints(obj["locations"], 0)[0]);
-          this.$refs.mapv.map.getView().setZoom(18);
-          this.$refs.mapv.shipShow = true;
-          this.$refs.mapv.deviceShow = false;
-          this.$refs.mapv.deviceTableShow = false
-          this.$refs.mapv.shipName = obj;
-          this.$refs.mapv.activeName = "first";
-       }
+        }
+        if (!isin) {
+          this.ship.push(obj);
+        }
+        this.addshipPoint();
+        this.$refs.mapv.map.getView().setCenter(this.$refs.mapv.transpoints(obj["locations"], 0)[0]);
+        this.$refs.mapv.map.getView().setZoom(18);
+        this.$refs.mapv.shipShow = true;
+        this.$refs.mapv.deviceShow = false;
+        this.$refs.mapv.deviceTableShow = false
+        this.$refs.mapv.shipName = obj;
+        this.$refs.mapv.activeName = "first";
+      }
 
 
     },