From b829ba4aa0617d1d7c0559f859e1357f3ae6f0b3 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期五, 03 十一月 2023 18:36:11 +0800 Subject: [PATCH] fix 修复 websocket 初始化无法连接进程死掉问题(vue代理问题) --- src/views/monitor/online/index.vue | 46 ++++++++++++++++++++++++++-------------------- 1 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue index 72cd46e..1a25dc5 100644 --- a/src/views/monitor/online/index.vue +++ b/src/views/monitor/online/index.vue @@ -29,6 +29,12 @@ </el-table-column> <el-table-column label="浼氳瘽缂栧彿" align="center" prop="tokenId" :show-overflow-tooltip="true" /> <el-table-column label="鐧诲綍鍚嶇О" align="center" prop="userName" :show-overflow-tooltip="true" /> + <el-table-column label="瀹㈡埛绔�" align="center" prop="clientKey" :show-overflow-tooltip="true" /> + <el-table-column label="璁惧绫诲瀷" align="center"> + <template #default="scope"> + <dict-tag :options="sys_device_type" :value="scope.row.deviceType" /> + </template> + </el-table-column> <el-table-column label="鎵�灞為儴闂�" align="center" prop="deptName" :show-overflow-tooltip="true" /> <el-table-column label="涓绘満" align="center" prop="ipaddr" :show-overflow-tooltip="true" /> <el-table-column label="鐧诲綍鍦扮偣" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> @@ -56,51 +62,51 @@ <script setup name="Online" lang="ts"> import { forceLogout, list as initData } from "@/api/monitor/online"; -import { ComponentInternalInstance } from "vue"; import { OnlineQuery, OnlineVO } from "@/api/monitor/online/types"; const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const { sys_device_type } = toRefs<any>(proxy?.useDict("sys_device_type")); const onlineList = ref<OnlineVO[]>([]); const loading = ref(true); const total = ref(0); -const queryFormRef = ref(ElForm); +const queryFormRef = ref<ElFormInstance>(); const queryParams = ref<OnlineQuery>({ - pageNum: 1, - pageSize: 10, - ipaddr: '', - userName: '' + pageNum: 1, + pageSize: 10, + ipaddr: '', + userName: '' }); /** 鏌ヨ鐧诲綍鏃ュ織鍒楄〃 */ const getList = async () => { - loading.value = true; - const res = await initData(queryParams.value); - onlineList.value = res.rows; - total.value = res.total; - loading.value = false; + loading.value = true; + const res = await initData(queryParams.value); + onlineList.value = res.rows; + total.value = res.total; + loading.value = false; } /** 鎼滅储鎸夐挳鎿嶄綔 */ const handleQuery = () => { - queryParams.value.pageNum = 1; - getList(); + queryParams.value.pageNum = 1; + getList(); } /** 閲嶇疆鎸夐挳鎿嶄綔 */ const resetQuery = () => { - queryFormRef.value.resetFields(); - handleQuery(); + queryFormRef.value?.resetFields(); + handleQuery(); } /** 寮洪��鎸夐挳鎿嶄綔 */ const handleForceLogout = async (row: OnlineVO) => { - await proxy?.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?'); - await forceLogout(row.tokenId); - getList(); - proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + await proxy?.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?'); + await forceLogout(row.tokenId); + await getList(); + proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); } onMounted(() => { - getList(); + getList(); }) </script> -- Gitblit v1.9.3