日志添加关键词搜索

This commit is contained in:
浅念
2025-10-24 16:28:37 +08:00
parent 37e75014d0
commit 926823df32
2 changed files with 44 additions and 24 deletions
+2 -1
View File
@@ -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
+20 -1
View File
@@ -1,5 +1,13 @@
<template> <template>
<div class="page-content"> <div class="page-content">
<div class="customer-toolbar boxshadow">
<div class="customer-search-group">
<el-form-item label="关键字:" label-width="70px">
<el-input style="min-width: 120px" v-model="keyword" placeholder="请输入关键字" />
</el-form-item>
</div>
</div>
<div class="boxshadow">
<ArtTable <ArtTable
ref="tableRef" ref="tableRef"
row-key="id" row-key="id"
@@ -23,6 +31,7 @@
</template> </template>
</ArtTable> </ArtTable>
</div> </div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -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>