zhaobao 2 anni fa
parent
commit
eca428d239

+ 1 - 1
src/config/index.js

@@ -3,7 +3,7 @@ module.exports = {
     /**
     * 服务API地址
     */
-    serverUrl: 'http://192.168.1.214:8080/', // 正式环境
+    serverUrl: 'http://113.141.93.143:1688', // 正式环境
     // devServerUrl: 'http://1.15.92.205:8080/', // 开发环境
     devServerUrl: 'http://192.168.3.5:8080/', // 开发环境 qu
     // devServerUrl: 'http://192.168.3.201:8080/', // 开发环境  test

+ 9 - 4
src/utils/request.js

@@ -12,7 +12,7 @@ const service = axios.create({
 })
 
 let loadingInstance = null
-
+let ElMessageBoxFlag =false
 // request interceptor
 service.interceptors.request.use(
   config => {
@@ -41,14 +41,19 @@ service.interceptors.response.use(
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
       if (res.code === 401) {
         // to re-login
+        if(ElMessageBoxFlag){
+          ElMessageBoxFlag =false
+        }else{
+          return
+        }
         ElMessageBox.confirm('登录失效,请重新登录!', '温馨提示!', {
           confirmButtonText: '确认',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          store.dispatch('user/resetToken').then(() => {
-            location.reload()
-          })
+            setTimeout(()=>{
+              window.location.href="http://113.141.93.143:9528/"
+            },1000)
         })
       } else {
         ElMessage({

+ 56 - 6
src/views/home/components/SensorInfoStatistics.vue

@@ -11,6 +11,7 @@
 </template>
     <script>
      import * as echarts from 'echarts';
+     import { goafdevstatis} from '@/api/goaf/sensor'
       export default {
         name:"SensorInfoStatistics",
         data(){
@@ -84,8 +85,8 @@
                                 show: false
                             },
                             data: [
-                                { value: 735, name: '异常',itemStyle:{color:'#D4603C'} },
-                                { value: 1048, name: '正常' ,itemStyle:{color:'#3CD495'}}
+                                { value: 0, name: '异常',itemStyle:{color:'#D4603C'} },
+                                { value: 0, name: '正常' ,itemStyle:{color:'#3CD495'}}
                             ]
                         },
                         {
@@ -115,8 +116,8 @@
                                 show: false
                             },
                             data: [
-                                { value: 735, name: '异常',itemStyle:{color:'#D4603C'} },
-                                { value: 1048, name: '正常' ,itemStyle:{color:'#3CD495'}}
+                                { value: 0, name: '异常',itemStyle:{color:'#D4603C'} },
+                                { value: 0, name: '正常' ,itemStyle:{color:'#3CD495'}}
                             ]
                         },
                         {
@@ -146,14 +147,19 @@
                                 show: false
                             },
                             data: [
-                                { value: 735, name: '异常',itemStyle:{color:'#D4603C'} },
-                                { value: 1048, name: '正常' ,itemStyle:{color:'#3CD495'}}
+                                { value: 0, name: '异常',itemStyle:{color:'#D4603C'} },
+                                { value: 0, name: '正常' ,itemStyle:{color:'#3CD495'}}
                             ]
                         }                                                 
                     ]
                 }
             }
         },
+        // created(){
+        //     this.$nextTick(()=>{
+        //         this.reload()
+        //     })
+        // },        
         methods:{
             init(){
                 var chartDom = document.getElementById('sensor-info-chart');
@@ -169,6 +175,50 @@
                     })
                 });                   
             }
+            ,reload(){      
+                this.$nextTick(()=>{
+                    this.goafdevstatis()
+                })                 
+            },            
+            goafdevstatis(){
+                let   option  =JSON.parse(JSON.stringify(this.option))
+                goafdevstatis().then((res)=>{
+                    this.total=res.data.goafDevTotalNum
+                    let pressureSensorNum=res.data.pressureSensorNum
+                    let displacementSensorNum=res.data.displacementSensorNum
+                    let harmfulGasSensorNum=res.data.harmfulGasSensorNum
+
+                    let pressureSensorOnlineNum=res.data.pressureSensorOnlineNum
+                    let displacementSensorOnlineNum=res.data.displacementSensorOnlineNum
+                    let harmfulGasSensorOnlineNum=res.data.harmfulGasSensorOnlineNum               
+
+                    option.series[0].data[0].value=pressureSensorNum-pressureSensorOnlineNum
+                    option.series[0].data[1].value=pressureSensorOnlineNum
+   
+                    option.series[1].data[0].value=displacementSensorNum-displacementSensorOnlineNum
+                    option.series[1].data[1].value=displacementSensorOnlineNum
+                    
+                    option.series[2].data[0].value=harmfulGasSensorNum-harmfulGasSensorOnlineNum
+                    option.series[2].data[1].value=displacementSensorNum-displacementSensorOnlineNu
+                    
+                    if(!this.myChart){
+                        var chartDom = document.getElementById('sensor-status-chart');
+                        var myChart = echarts.init(chartDom);
+                        this.myChart=myChart 
+                    }        
+                    this.myChart.setOption(option);  
+                    this.myChart.on('click', (params)=> {
+                        this.$router.push({
+                            path: '/particulars/sensor',
+                            query: {
+                                id: '0'
+                            }
+                        })
+                    }); 
+                                    
+                })
+            }
+            
         },
         destroyed() {
             this.status=false

+ 3 - 0
vue.config.js

@@ -2,6 +2,9 @@ const { defineConfig } = require('@vue/cli-service')
 const path = require('path')
 
 module.exports = defineConfig({
+  publicPath: './',
+  outputDir: 'dist',
+  assetsDir: 'static',
   transpileDependencies: true,
   configureWebpack: {
     resolve: {