Browse Source

feat:仪表盘在线用户列表相关

luoy 7 hours ago
parent
commit
a5191259df
4 changed files with 121 additions and 11 deletions
  1. 1 1
      .env
  2. 7 0
      src/api/marketing/data.ts
  3. 101 9
      src/views/home/user-info.vue
  4. 12 1
      src/views/marketing/data/index.vue

+ 1 - 1
.env

@@ -7,7 +7,7 @@ VITE_PUBLIC_PATH = /
 # 后端请求前缀
 # VITE_API_URL = http://192.168.10.101:9999
 # VITE_API_URL = http://192.168.3.118:9999
-VITE_API_URL = http://192.168.3.17:9999
+ VITE_API_URL = http://192.168.3.17:9999
 
 # OAUTH2 密码模式客户端信息
 VITE_OAUTH2_PASSWORD_CLIENT='pig:pig'

+ 7 - 0
src/api/marketing/data.ts

@@ -23,4 +23,11 @@ export const getUserNum = () => {
 		method: 'get',
 	});
 };
+//查询最近10分钟内有活动的用户列表,仪表盘用
+export const getOnlineUsers = () => {
+	return request({
+		url: 'marketing/tcp/online/users',
+		method: 'get',
+	});
+};
 

File diff suppressed because it is too large
+ 101 - 9
src/views/home/user-info.vue


+ 12 - 1
src/views/marketing/data/index.vue

@@ -49,8 +49,11 @@
         <el-table-column label="请求头" prop="headInfo" show-overflow-tooltip>
           <template #default="{ row }">{{ row.headInfo }}</template>
         </el-table-column>
-        <el-table-column label="创建时间" prop="createTime" show-overflow-tooltip>
+        <!-- <el-table-column label="创建时间" prop="createTime" show-overflow-tooltip>
           <template #default="{ row }">{{ row.createTime }}</template>
+        </el-table-column> -->
+        <el-table-column label="最后推送时间" prop="latestPushTime" show-overflow-tooltip>
+          <template #default="{ row }">{{ row.latestPushTime }}</template>
         </el-table-column>
         <el-table-column label="更新时间" prop="updateTime" show-overflow-tooltip>
           <template #default="{ row }">{{ row.updateTime }}</template>
@@ -78,6 +81,7 @@ import { formatDate } from '/@/utils/formatTime';
 
 const dataListModal = defineAsyncComponent(() => import('./dataListModal.vue'));
 const dataListRef = ref();
+const route = useRoute();
 const handleDetail = (clientID: string) => {
   dataListRef.value.openDialog(clientID);
 }
@@ -182,6 +186,13 @@ const statusFormatter = (row: any, column: any, cellValue: any, index: any) => {
 
 onMounted(() => {
   query();
+  if(route.query.clientID) {
+    setTimeout(() => {
+      dataListRef.value.openDialog(route.query.clientID);
+    }, 500);
+    // dataListRef.value.openDialog(route.query.clientID);
+  }
+  // console.log(route.query.clientID);
 })
 
 </script>

Some files were not shown because too many files changed in this diff