日志添加关键词搜索
This commit is contained in:
@@ -147,7 +147,8 @@
|
|||||||
|
|
||||||
const { records, current, size, total } = await logService.getChangelogList({
|
const { records, current, size, total } = await logService.getChangelogList({
|
||||||
current: currentPage,
|
current: currentPage,
|
||||||
size: pageSize
|
size: pageSize,
|
||||||
|
keyword: keyword.value
|
||||||
})
|
})
|
||||||
tableData.value = records.map((item: any) => ({
|
tableData.value = records.map((item: any) => ({
|
||||||
...item
|
...item
|
||||||
|
|||||||
@@ -1,27 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<ArtTable
|
<div class="customer-toolbar boxshadow">
|
||||||
ref="tableRef"
|
<div class="customer-search-group">
|
||||||
row-key="id"
|
<el-form-item label="关键字:" label-width="70px">
|
||||||
:loading="loading"
|
<el-input style="min-width: 120px" v-model="keyword" placeholder="请输入关键字" />
|
||||||
:data="tableData"
|
</el-form-item>
|
||||||
:currentPage="pagination.currentPage"
|
</div>
|
||||||
:pageSize="pagination.pageSize"
|
</div>
|
||||||
:total="pagination.total"
|
<div class="boxshadow">
|
||||||
@size-change="handleSizeChange"
|
<ArtTable
|
||||||
@current-change="handleCurrentChange"
|
ref="tableRef"
|
||||||
>
|
row-key="id"
|
||||||
<template #default>
|
:loading="loading"
|
||||||
<ElTableColumn label="ID" prop="id" />
|
:data="tableData"
|
||||||
<ElTableColumn label="操作人" prop="user_name" />
|
:currentPage="pagination.currentPage"
|
||||||
<ElTableColumn label="请求路由" prop="route" />
|
:pageSize="pagination.pageSize"
|
||||||
<ElTableColumn label="用户ip" prop="ip" />
|
:total="pagination.total"
|
||||||
<ElTableColumn label="用户ua" prop="ua" />
|
@size-change="handleSizeChange"
|
||||||
<ElTableColumn label="入参摘要" prop="params_brief" />
|
@current-change="handleCurrentChange"
|
||||||
<ElTableColumn label="异常" prop="message" />
|
>
|
||||||
<ElTableColumn label="创建时间" prop="created_at" />
|
<template #default>
|
||||||
</template>
|
<ElTableColumn label="ID" prop="id" />
|
||||||
</ArtTable>
|
<ElTableColumn label="操作人" prop="user_name" />
|
||||||
|
<ElTableColumn label="请求路由" prop="route" />
|
||||||
|
<ElTableColumn label="用户ip" prop="ip" />
|
||||||
|
<ElTableColumn label="用户ua" prop="ua" />
|
||||||
|
<ElTableColumn label="入参摘要" prop="params_brief" />
|
||||||
|
<ElTableColumn label="异常" prop="message" />
|
||||||
|
<ElTableColumn label="创建时间" prop="created_at" />
|
||||||
|
</template>
|
||||||
|
</ArtTable>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -31,6 +40,7 @@
|
|||||||
import { useAuth } from '@/composables/useAuth'
|
import { useAuth } from '@/composables/useAuth'
|
||||||
const { hasAuth } = useAuth()
|
const { hasAuth } = useAuth()
|
||||||
defineOptions({ name: 'Operationlog' })
|
defineOptions({ name: 'Operationlog' })
|
||||||
|
const keyword = ref('')
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
@@ -46,6 +56,10 @@
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getWorkList()
|
getWorkList()
|
||||||
})
|
})
|
||||||
|
watch([keyword], () => {
|
||||||
|
pagination.currentPage = 1
|
||||||
|
getWorkList()
|
||||||
|
})
|
||||||
// 处理表格分页变化
|
// 处理表格分页变化
|
||||||
const handleSizeChange = (newPageSize: number) => {
|
const handleSizeChange = (newPageSize: number) => {
|
||||||
pagination.pageSize = newPageSize
|
pagination.pageSize = newPageSize
|
||||||
@@ -63,7 +77,8 @@
|
|||||||
|
|
||||||
const { records, current, size, total } = await logService.getOperationLogList({
|
const { records, current, size, total } = await logService.getOperationLogList({
|
||||||
current: currentPage,
|
current: currentPage,
|
||||||
size: pageSize
|
size: pageSize,
|
||||||
|
keyword: keyword.value
|
||||||
})
|
})
|
||||||
tableData.value = records.map((item: any) => ({
|
tableData.value = records.map((item: any) => ({
|
||||||
...item
|
...item
|
||||||
@@ -94,4 +109,8 @@
|
|||||||
fill: currentcolor;
|
fill: currentcolor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.customer-search-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user