提交 b0513c4a authored 作者: lidongxu's avatar lidongxu

refactor(all): 所有页面在 app-container 下加一层 div

用于限制内容在一个白色背景区域中
上级 a8a46e49
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true"> <div>
<el-form-item label="登录地址" prop="ipaddr"> <el-form :model="queryParams"
<el-input ref="queryRef"
v-model="queryParams.ipaddr" :inline="true">
placeholder="请输入登录地址" <el-form-item label="登录地址"
clearable prop="ipaddr">
style="width: 200px" <el-input v-model="queryParams.ipaddr"
@keyup.enter="handleQuery" placeholder="请输入登录地址"
/> clearable
</el-form-item> style="width: 200px"
<el-form-item label="用户名称" prop="userName"> @keyup.enter="handleQuery" />
<el-input </el-form-item>
v-model="queryParams.userName" <el-form-item label="用户名称"
placeholder="请输入用户名称" prop="userName">
clearable <el-input v-model="queryParams.userName"
style="width: 200px" placeholder="请输入用户名称"
@keyup.enter="handleQuery" clearable
/> style="width: 200px"
</el-form-item> @keyup.enter="handleQuery" />
<el-form-item> </el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-form-item>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button type="primary"
</el-form-item> icon="Search"
@click="handleQuery">搜索</el-button>
<el-button icon="Refresh"
@click="resetQuery">重置</el-button>
</el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="loading"
v-loading="loading" :data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
:data="onlineList.slice((pageNum - 1) * pageSize, pageNum * pageSize)" style="width: 100%;">
style="width: 100%;" <el-table-column label="序号"
> width="50"
<el-table-column label="序号" width="50" type="index" align="center"> type="index"
<template #default="scope"> align="center">
<span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span> <template #default="scope">
</template> <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
</el-table-column> </template>
<el-table-column label="会话编号" align="center" prop="tokenId" :show-overflow-tooltip="true" /> </el-table-column>
<el-table-column label="登录名称" align="center" prop="userName" :show-overflow-tooltip="true" /> <el-table-column label="会话编号"
<el-table-column label="所属部门" align="center" prop="deptName" :show-overflow-tooltip="true" /> align="center"
<el-table-column label="主机" align="center" prop="ipaddr" :show-overflow-tooltip="true" /> prop="tokenId"
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="操作系统" align="center" prop="os" :show-overflow-tooltip="true" /> <el-table-column label="登录名称"
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> align="center"
<el-table-column label="登录时间" align="center" prop="loginTime" width="180"> prop="userName"
<template #default="scope"> :show-overflow-tooltip="true" />
<span>{{ parseTime(scope.row.loginTime) }}</span> <el-table-column label="所属部门"
</template> align="center"
</el-table-column> prop="deptName"
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> :show-overflow-tooltip="true" />
<template #default="scope"> <el-table-column label="主机"
<el-button link type="primary" icon="Delete" @click="handleForceLogout(scope.row)" v-hasPermi="['monitor:online:forceLogout']">强退</el-button> align="center"
</template> prop="ipaddr"
</el-table-column> :show-overflow-tooltip="true" />
<el-table-column label="登录地点"
align="center"
prop="loginLocation"
:show-overflow-tooltip="true" />
<el-table-column label="操作系统"
align="center"
prop="os"
:show-overflow-tooltip="true" />
<el-table-column label="浏览器"
align="center"
prop="browser"
:show-overflow-tooltip="true" />
<el-table-column label="登录时间"
align="center"
prop="loginTime"
width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
class-name="small-padding fixed-width">
<template #default="scope">
<el-button link
type="primary"
icon="Delete"
@click="handleForceLogout(scope.row)"
v-hasPermi="['monitor:online:forceLogout']">强退</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="pageNum" v-model:limit="pageSize" /> <pagination v-show="total > 0"
</div> :total="total"
v-model:page="pageNum"
v-model:limit="pageSize" />
</div>
</div>
</template> </template>
<script setup name="Online"> <script setup
import { forceLogout, list as initData } from "@/api"; name="Online">
import { forceLogout, list as initData } from "@/api";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const onlineList = ref([]); const onlineList = ref([]);
const loading = ref(true); const loading = ref(true);
const total = ref(0); const total = ref(0);
const pageNum = ref(1); const pageNum = ref(1);
const pageSize = ref(10); const pageSize = ref(10);
const queryParams = ref({ const queryParams = ref({
ipaddr: undefined, ipaddr: undefined,
userName: undefined userName: undefined
});
/** 查询登录日志列表 */
function getList() {
loading.value = true;
initData(queryParams.value).then(response => {
onlineList.value = response.data;
total.value = response.data.total;
loading.value = false;
}); });
}
/** 搜索按钮操作 */ /** 查询登录日志列表 */
function handleQuery() { function getList() {
pageNum.value = 1; loading.value = true;
getList(); initData(queryParams.value).then(response => {
} onlineList.value = response.data;
total.value = response.data.total;
loading.value = false;
});
}
/** 搜索按钮操作 */
function handleQuery() {
pageNum.value = 1;
getList();
}
/** 重置按钮操作 */ /** 重置按钮操作 */
function resetQuery() { function resetQuery() {
proxy.resetForm("queryRef"); proxy.resetForm("queryRef");
handleQuery(); handleQuery();
} }
/** 强退按钮操作 */ /** 强退按钮操作 */
function handleForceLogout(row) { function handleForceLogout(row) {
proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () { proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () {
return forceLogout(row.tokenId); return forceLogout(row.tokenId);
}).then(() => { }).then(() => {
getList(); getList();
proxy.$modal.msgSuccess("删除成功"); proxy.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => { });
} }
getList(); getList();
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<div>
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="字典名称" prop="dictName"> <el-form-item label="字典名称" prop="dictName">
<el-input <el-input
...@@ -168,6 +169,7 @@ ...@@ -168,6 +169,7 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
</div>
</div> </div>
</template> </template>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论