From 031d83828a20b7bc56c1723fe4eaa67fd9d8cd07 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期四, 14 十二月 2023 00:44:12 +0800 Subject: [PATCH] update 代码规范化 --- src/views/monitor/online/index.vue | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue index d105cd7..6bde45c 100644 --- a/src/views/monitor/online/index.vue +++ b/src/views/monitor/online/index.vue @@ -2,7 +2,7 @@ <div class="p-2"> <div class="mb-[10px]"> <el-card shadow="hover"> - <el-form :model="queryParams" ref="queryFormRef" :inline="true"> + <el-form ref="queryFormRef" :model="queryParams" :inline="true"> <el-form-item label="鐧诲綍鍦板潃" prop="ipaddr"> <el-input v-model="queryParams.ipaddr" placeholder="璇疯緭鍏ョ櫥褰曞湴鍧�" clearable style="width: 200px" @keyup.enter="handleQuery" /> </el-form-item> @@ -20,7 +20,7 @@ <el-table v-loading="loading" :data="onlineList.slice((queryParams.pageNum - 1) * queryParams.pageSize, queryParams.pageNum * queryParams.pageSize)" - style="width: 100%;" + style="width: 100%" > <el-table-column label="搴忓彿" width="50" type="index" align="center"> <template #default="scope"> @@ -48,26 +48,25 @@ <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template #default="scope"> <el-tooltip content="寮洪��" placement="top"> - <el-button link type="primary" icon="Delete" @click="handleForceLogout(scope.row)" v-hasPermi="['monitor:online:forceLogout']"> + <el-button v-hasPermi="['monitor:online:forceLogout']" link type="primary" icon="Delete" @click="handleForceLogout(scope.row)"> </el-button> </el-tooltip> </template> </el-table-column> </el-table> - <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" /> + <pagination v-show="total > 0" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" :total="total" /> </el-card> </div> </template> <script setup name="Online" lang="ts"> -import { forceLogout, list as initData } from "@/api/monitor/online"; -import { OnlineQuery, OnlineVO } from "@/api/monitor/online/types"; -import api from "@/api/system/user"; -import {to} from "await-to-js"; +import { forceLogout, list as initData } from '@/api/monitor/online'; +import { OnlineQuery, OnlineVO } from '@/api/monitor/online/types'; +import { to } from 'await-to-js'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { sys_device_type } = toRefs<any>(proxy?.useDict("sys_device_type")); +const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type')); const onlineList = ref<OnlineVO[]>([]); const loading = ref(true); @@ -89,28 +88,28 @@ onlineList.value = res.rows; total.value = res.total; loading.value = false; -} +}; /** 鎼滅储鎸夐挳鎿嶄綔 */ const handleQuery = () => { queryParams.value.pageNum = 1; getList(); -} +}; /** 閲嶇疆鎸夐挳鎿嶄綔 */ const resetQuery = () => { queryFormRef.value?.resetFields(); handleQuery(); -} +}; /** 寮洪��鎸夐挳鎿嶄綔 */ const handleForceLogout = async (row: OnlineVO) => { const [err] = await to(proxy?.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?') as any); if (!err) { await forceLogout(row.tokenId); await getList(); - proxy?.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛'); } -} +}; onMounted(() => { getList(); -}) +}); </script> -- Gitblit v1.9.3