mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-12-24 08:12:55 +08:00
序号
This commit is contained in:
@@ -65,10 +65,16 @@ export function usePaging<T>(options: Options) {
|
||||
|
||||
resetPage()
|
||||
}
|
||||
// 计算真实序号的函数
|
||||
const handleIndex = (index: number) => {
|
||||
// index 是当前页的索引(从 0 开始)
|
||||
return (pager.page - 1) * pager.size + index + 1
|
||||
}
|
||||
return {
|
||||
pager,
|
||||
getLists,
|
||||
resetParams,
|
||||
resetPage
|
||||
resetPage,
|
||||
handleIndex
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
size="large"
|
||||
v-loading="pager.loading"
|
||||
:data="pager.lists"
|
||||
max-height="calc(100vh - 200px)"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="序号" type="index" :index="handleIndex" min-width="60" />
|
||||
<el-table-column label="项目" prop="ProjectKey" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<dict-value
|
||||
@@ -153,7 +153,7 @@ const queryParams = reactive<type_monitor_error_query>({
|
||||
CreateTimeEnd: null
|
||||
})
|
||||
|
||||
const { pager, getLists, resetPage, resetParams } = usePaging<type_monitor_error>({
|
||||
const { pager, getLists, resetPage, resetParams, handleIndex } = usePaging<type_monitor_error>({
|
||||
fetchFun: monitor_error_list,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
@@ -68,7 +68,12 @@
|
||||
<el-card class="!border-none mt-4" shadow="never" v-loading="pager.loading">
|
||||
<div>
|
||||
<el-table :data="pager.lists" size="large" max-height="calc(100vh - 200px)">
|
||||
<el-table-column label="ID" prop="id" />
|
||||
<el-table-column
|
||||
label="序号"
|
||||
type="index"
|
||||
:index="handleIndex"
|
||||
min-width="60"
|
||||
/>
|
||||
<el-table-column label="操作" prop="title" min-width="120" />
|
||||
<el-table-column label="管理员" prop="username" min-width="120" />
|
||||
<el-table-column label="访问链接" prop="url" min-width="240">
|
||||
@@ -121,7 +126,7 @@ const visitType = ref<Array<any>>([
|
||||
}
|
||||
])
|
||||
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging<SystemLogResp>({
|
||||
const { pager, getLists, resetParams, resetPage, handleIndex } = usePaging<SystemLogResp>({
|
||||
fetchFun: systemLogLists,
|
||||
params: formData.value
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user