Browse Source

websocket修改

a1140836302 2 years ago
parent
commit
84c92d10a7

+ 1 - 1
.env.development

@@ -2,4 +2,4 @@
 ENV = 'development'
 
 # base api
-VUE_APP_BASE_API = 'http://192.168.3.177:8080/api'
+VUE_APP_BASE_API = 'http://192.168.3.154:8080/api'

+ 2 - 2
src/layout/components/Navbar.vue

@@ -111,8 +111,8 @@ export default {
     //菜单路由
     menuList(){
       //console.log(this.permission_routes);
-       this.PermissionList = this.permission_routes.slice(5, 11);
-      //this.PermissionList = this.permission_routes.slice(5, 9);
+      // this.PermissionList = this.permission_routes.slice(5, 11);
+      this.PermissionList = this.permission_routes.slice(5,10);
     },
     //当前时间
     timer() {

+ 15 - 15
src/router/index.js

@@ -195,21 +195,21 @@ export const asyncRoutes = [
       },
     ]
   },
-  {
-    path: '/control-config',
-    component: Layout,
-    redirect: '/control-config/setFile',
-    name: 'ControlConfig',
-    meta: {title: '站控配置',icon: 'kzpz'},
-    children: [
-      {
-        path: 'setfile',
-        component: () => import('@/views/control-config/setFile'),
-        name: 'SetFile',
-        meta: { title: '消防配置'}
-      }
-    ]
-  },
+  // {
+  //   path: '/control-config',
+  //   component: Layout,
+  //   redirect: '/control-config/setFile',
+  //   name: 'ControlConfig',
+  //   meta: {title: '站控配置',icon: 'kzpz'},
+  //   children: [
+  //     {
+  //       path: 'setfile',
+  //       component: () => import('@/views/control-config/setFile'),
+  //       name: 'SetFile',
+  //       meta: { title: '消防配置'}
+  //     }
+  //   ]
+  // },
   // 404 page must be placed at the end !!!
   { path: '*', redirect: '/404', hidden: true }
 ]

+ 0 - 1
src/utils/request.js

@@ -11,7 +11,6 @@ const service = axios.create({
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 service.interceptors.request.use(
   config => {
-    console.log('url',config)
     // do something before request is sent
     if (config.method === 'get' && config.params) {
       let url = config.url + '?' + tansParams(config.params)

+ 5 - 0
src/views/equipment-monitoring/index.vue

@@ -264,6 +264,11 @@ export default {
     },
     websocketOnOpen() {
       console.log('socket连接成功')
+      const wsMessage={
+        type: 'page',
+        payload: 'equipment-monitoring'
+      }
+      this.ws.send(JSON.stringify(wsMessage))
     },
     websocketOnMessage(m) {
       const d = JSON.parse(m.data)

+ 5 - 0
src/views/manage-log/control.vue

@@ -97,6 +97,11 @@ export default {
     // },
     websocketOnOpen() {
       console.log("socket连接成功");
+      const wsMessage={
+        type: 'page',
+        payload: 'control'
+      }
+      this.ws.send(JSON.stringify(wsMessage))
     },
     websocketOnMessage(m) {
       const d = JSON.parse(m.data)

+ 7 - 2
src/views/power-change-monitoring/index.vue

@@ -704,10 +704,15 @@ export default {
     },
     websocketOnOpen() {
       console.log('socket连接成功')
+      const wsMessage={
+        type: 'page',
+        payload: 'power-change-monitoring'
+      }
+      this.ws.send(JSON.stringify(wsMessage))
     },
     websocketOnMessage(m) {
       const d = JSON.parse(m.data)
-      console.log(d)
+      // console.log(d)
       //云端连接状态
       if(d.cloundState){
         this.cloundState=d.cloundState
@@ -802,7 +807,7 @@ export default {
       this.ws.onerror = this.websocketOnError
       this.ws.onmessage = this.websocketOnMessage
       this.ws.onclose = this.websocketOnClose
-    }
+    },
   }
 }
 </script>