Ver Fonte

用户热力分布

lihongxiao há 2 anos atrás
pai
commit
47d67a7a89

+ 3 - 5
src/utils/websocket.js

@@ -3,7 +3,6 @@ import { Message } from 'element-ui'
 let websock = null
 let websock = null
 let messageCallback = null
 let messageCallback = null
 let errorCallback = null
 let errorCallback = null
-let wsUrl = process.env.SOCKET_Url
 let tryTime = 0
 let tryTime = 0
 
 
 // 接收ws后端返回的数据
 // 接收ws后端返回的数据
@@ -57,7 +56,7 @@ function websocketOpen (e) {
 }
 }
 
 
 // 初始化weosocket
 // 初始化weosocket
-function initWebSocket () {
+function initWebSocket (wsUrl) {
   if (typeof (WebSocket) === 'undefined') {
   if (typeof (WebSocket) === 'undefined') {
     Message.error('您的浏览器不支持WebSocket,无法获取数据')
     Message.error('您的浏览器不支持WebSocket,无法获取数据')
     return false
     return false
@@ -92,9 +91,8 @@ function initWebSocket () {
  * @param {function} errCallback ws连接错误的回调函数
  * @param {function} errCallback ws连接错误的回调函数
  */
  */
 export function sendWebsocket (url, agentData, successCallback, errCallback) {
 export function sendWebsocket (url, agentData, successCallback, errCallback) {
-
-  wsUrl+=url
-  initWebSocket()
+  url
+  initWebSocket(url)
   messageCallback = successCallback
   messageCallback = successCallback
   errorCallback = errCallback
   errorCallback = errCallback
   websocketSend(agentData)
   websocketSend(agentData)

+ 2 - 2
src/views/Login.vue

@@ -318,8 +318,8 @@ export default {
                     userId,
                     userId,
                     systemType:this.systemType
                     systemType:this.systemType
                   }
                   }
-                  // sendWebsocket(`ws://192.168.0.52:8080//pcWebsocket/${userId}`,data)
-                  sendWebsocket(`/pcWebsocket/${userId}`,data)
+                  sendWebsocket(`${process.env.SOCKET_Url}/pcWebsocket/${userId}`,data)
+                  // sendWebsocket(`/pcWebsocket/${userId}`,data)
                   },1000)
                   },1000)
                   
                   
 
 

+ 15 - 6
src/views/PeopleManage/PcLoginRecord.vue

@@ -50,10 +50,14 @@
         <span>历史记录</span>
         <span>历史记录</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
       </p>
       </p>
-      <el-table :data="tableData" border style="width: 100%;  overflow: auto;" :header-cell-style="{
+      <el-table :data="tableData" border style="width: 98%; max-height: 45vh;
+    overflow-y: auto; " 
+    :cell-style="{padding: '3px 8px'}"
+    :header-cell-style="{
         background: '#F2F7FC',
         background: '#F2F7FC',
         fontWeight: '700',
         fontWeight: '700',
         color: '#606266',
         color: '#606266',
+        
       }">
       }">
         <el-table-column prop="userId" label="工号" width="150">
         <el-table-column prop="userId" label="工号" width="150">
         </el-table-column>
         </el-table-column>
@@ -79,7 +83,7 @@
           <el-tab-pane label="历史在线人数" name="2"></el-tab-pane>
           <el-tab-pane label="历史在线人数" name="2"></el-tab-pane>
         </el-tabs>
         </el-tabs>
         <span style="color: #3865E9 ; cursor: pointer; font-size: 14px;position: absolute;line-height: 40px;
         <span style="color: #3865E9 ; cursor: pointer; font-size: 14px;position: absolute;line-height: 40px;
-    right: 30px;" @click="isCollapse = !isCollapse">{{
+    right: 30px;" @click="isCollapse = !isCollapse;if(isCollapse)infoWindowVisible=false">{{
       isCollapse ? '收起' : '展开' }} </span>
       isCollapse ? '收起' : '展开' }} </span>
       </p>
       </p>
       <div v-show="activeName == 1">
       <div v-show="activeName == 1">
@@ -922,7 +926,7 @@ export default {
   }
   }
 
 
   span {
   span {
-    margin-right: 5px;
+    margin-right: 15px;
   }
   }
 }
 }
 
 
@@ -944,19 +948,23 @@ export default {
   z-index: 100;
   z-index: 100;
   background-color: white;
   background-color: white;
   padding: 10px;
   padding: 10px;
-  width: 25vw;
+  width: 500px;
+  box-sizing: border-box;
   box-shadow: 0px 5px 10px #ddd;
   box-shadow: 0px 5px 10px #ddd;
+  // max-height: 57vh;
+  //   overflow-y: auto;
 }
 }
 
 
 .personnel-window {
 .personnel-window {
   position: fixed;
   position: fixed;
   bottom: 10px;
   bottom: 10px;
-  right: 10px;
+  right: 5px;
   z-index: 100;
   z-index: 100;
   background-color: white;
   background-color: white;
   padding: 10px;
   padding: 10px;
-  width: 460px;
   box-shadow: 0px 5px 10px #ddd;
   box-shadow: 0px 5px 10px #ddd;
+  box-sizing: border-box;
+    width: 500px;
 }
 }
 
 
 .bottomFixed {
 .bottomFixed {
@@ -1087,5 +1095,6 @@ export default {
       margin-right: 10px;
       margin-right: 10px;
     }
     }
   }
   }
+
 }
 }
 </style>
 </style>

+ 13 - 4
src/views/PeopleManage/UserMap.vue

@@ -51,7 +51,10 @@
         <span>历史记录</span>
         <span>历史记录</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
         <span style="color: #c3c3c3;font-size:18px" @click="infoWindowVisible = false"> ×</span>
       </p>
       </p>
-      <el-table :data="tableData" border style="width: 100%;  overflow: auto;" :header-cell-style="{
+      <el-table :data="tableData" border style="width: 98%; max-height: 45vh;
+    overflow-y: auto;"
+    :cell-style="{padding: '3px 8px'}"
+     :header-cell-style="{
         background: '#F2F7FC',
         background: '#F2F7FC',
         fontWeight: '700',
         fontWeight: '700',
         color: '#606266',
         color: '#606266',
@@ -857,7 +860,7 @@ export default {
   }
   }
 
 
   span {
   span {
-    margin-right: 5px;
+    margin-right: 15px;
   }
   }
 }
 }
 
 
@@ -879,19 +882,24 @@ export default {
   z-index: 100;
   z-index: 100;
   background-color: white;
   background-color: white;
   padding: 10px;
   padding: 10px;
-  width: 25vw;
+  width: 500px;
+  box-sizing: border-box;
   box-shadow: 0px 5px 10px #ddd;
   box-shadow: 0px 5px 10px #ddd;
+  // max-height: 57vh;
+  //   overflow-y: auto;
 }
 }
 
 
 .personnel-window {
 .personnel-window {
   position: fixed;
   position: fixed;
   bottom: 10px;
   bottom: 10px;
-  right: 10px;
+  right: 5px;
   z-index: 100;
   z-index: 100;
   background-color: white;
   background-color: white;
   padding: 10px;
   padding: 10px;
   width: 460px;
   width: 460px;
   box-shadow: 0px 5px 10px #ddd;
   box-shadow: 0px 5px 10px #ddd;
+  box-sizing: border-box;
+    width: 500px;
 }
 }
 
 
 .bottomFixed {
 .bottomFixed {
@@ -1021,4 +1029,5 @@ export default {
       margin-right: 10px;
       margin-right: 10px;
     }
     }
   }
   }
+ 
 }</style>
 }</style>