feat: add frontend API integration for operation log

This commit is contained in:
张翔
2026-03-18 22:37:47 +08:00
parent fd1c700412
commit ce41fe7e26
2 changed files with 49 additions and 10 deletions
@@ -91,10 +91,10 @@
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { Search } from '@element-plus/icons-vue'
import request from '@/utils/request'
import { operationLogApi, OperationLog } from '@/api/operationLog'
const loading = ref(false)
const dataSource = ref([])
const dataSource = ref<OperationLog[]>([])
const searchKeyword = ref('')
const pagination = reactive({
current: 1,
@@ -110,14 +110,12 @@ const sortInfo = reactive({
const fetchData = async () => {
loading.value = true
try {
const res: any = await request.get('/logs/operation/page', {
params: {
page: pagination.current - 1,
size: pagination.pageSize,
sort: sortInfo.sort,
order: sortInfo.order,
keyword: searchKeyword.value || undefined
}
const res = await operationLogApi.getPage({
page: pagination.current - 1,
size: pagination.pageSize,
sort: sortInfo.sort,
order: sortInfo.order,
keyword: searchKeyword.value || undefined
})
dataSource.value = res.content
pagination.total = res.totalElements