From fe631515b71782a10a750874f6d4582fe027cd22 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 09:32:49 +0800
Subject: [PATCH] 公司-所有的表格添加斑马纹
---
src/views/monitor/online/index.vue | 90 ++++++++++++++++++++++-----------------------
1 files changed, 44 insertions(+), 46 deletions(-)
diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue
index 8950dbc..7a56ad5 100644
--- a/src/views/monitor/online/index.vue
+++ b/src/views/monitor/online/index.vue
@@ -1,12 +1,12 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
+ <el-form :model="queryParams" ref="queryRef" :inline="true">
<el-form-item label="鐧诲綍鍦板潃" prop="ipaddr">
<el-input
v-model="queryParams.ipaddr"
placeholder="璇疯緭鍏ョ櫥褰曞湴鍧�"
clearable
- size="small"
+ style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -15,20 +15,22 @@
v-model="queryParams.userName"
placeholder="璇疯緭鍏ョ敤鎴峰悕绉�"
clearable
+ style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="Search" size="mini" @click="handleQuery">鎼滅储</el-button>
- <el-button icon="Refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
style="width: 100%;"
+ stripe
>
- <el-table-column label="搴忓彿" type="index" align="center">
+ <el-table-column label="搴忓彿" width="50" type="index" align="center">
<template #default="scope">
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
</template>
@@ -47,13 +49,7 @@
</el-table-column>
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template #default="scope">
- <el-button
- size="mini"
- type="text"
- icon="Delete"
- @click="handleForceLogout(scope.row)"
- v-hasPermi="['monitor:online:forceLogout']"
- >寮洪��</el-button>
+ <el-button link type="primary" icon="Delete" @click="handleForceLogout(scope.row)" v-hasPermi="['monitor:online:forceLogout']">寮洪��</el-button>
</template>
</el-table-column>
</el-table>
@@ -63,50 +59,52 @@
</template>
<script setup name="Online">
-import { forceLogout, list as initData } from "@/api/monitor/online";
+import { forceLogout, list as initData } from "@/api/monitor/online"
-const { proxy } = getCurrentInstance();
+const { proxy } = getCurrentInstance()
-const onlineList = ref([]);
-const loading = ref(true);
-const total = ref(0);
-const pageNum = ref(1);
-const pageSize = ref(10);
+const onlineList = ref([])
+const loading = ref(true)
+const total = ref(0)
+const pageNum = ref(1)
+const pageSize = ref(10)
const queryParams = ref({
ipaddr: undefined,
userName: undefined
-});
+})
/** 鏌ヨ鐧诲綍鏃ュ織鍒楄〃 */
function getList() {
- loading.value = true;
+ loading.value = true
initData(queryParams.value).then(response => {
- onlineList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
-}
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-function handleQuery() {
- pageNum.value = 1;
- getList();
-}
-/** 閲嶇疆鎸夐挳鎿嶄綔 */
-function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
-}
-/** 寮洪��鎸夐挳鎿嶄綔 */
-function handleForceLogout(row) {
- const operIds = row.operId || ids.value;
- proxy.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?').then(function () {
- return forceLogout(row.tokenId);
- }).then(() => {
- getList();
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ onlineList.value = response.rows
+ total.value = response.total
+ loading.value = false
+ })
}
-getList();
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+function handleQuery() {
+ pageNum.value = 1
+ getList()
+}
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+function resetQuery() {
+ proxy.resetForm("queryRef")
+ handleQuery()
+}
+
+/** 寮洪��鎸夐挳鎿嶄綔 */
+function handleForceLogout(row) {
+ proxy.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?').then(function () {
+ return forceLogout(row.tokenId)
+ }).then(() => {
+ getList()
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+ }).catch(() => {})
+}
+
+getList()
</script>
--
Gitblit v1.9.3