mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): mock manage list data with pagination
This commit is contained in:
@ -13,11 +13,17 @@ import RoleSearch from './modules/role-search.vue';
|
||||
const appStore = useAppStore();
|
||||
const { bool: drawerVisible, setTrue: openDrawer } = useBoolean();
|
||||
|
||||
const { columns, filteredColumns, data, loading, pagination, getData, searchParams, resetSearchParams } = useTable<
|
||||
Api.SystemManage.Role,
|
||||
typeof fetchGetRoleList,
|
||||
'index' | 'operate'
|
||||
>({
|
||||
const {
|
||||
columns,
|
||||
filteredColumns,
|
||||
data,
|
||||
loading,
|
||||
pagination,
|
||||
getData,
|
||||
searchParams,
|
||||
updateSearchParams,
|
||||
resetSearchParams
|
||||
} = useTable<Api.SystemManage.Role, typeof fetchGetRoleList, 'index' | 'operate'>({
|
||||
apiFn: fetchGetRoleList,
|
||||
apiParams: {
|
||||
current: 1,
|
||||
@ -38,6 +44,16 @@ const { columns, filteredColumns, data, loading, pagination, getData, searchPara
|
||||
total
|
||||
};
|
||||
},
|
||||
onPaginationChanged(pg) {
|
||||
const { page, pageSize } = pg;
|
||||
|
||||
updateSearchParams({
|
||||
current: page,
|
||||
size: pageSize
|
||||
});
|
||||
|
||||
getData();
|
||||
},
|
||||
columns: () => [
|
||||
{
|
||||
type: 'selection',
|
||||
@ -179,6 +195,7 @@ function getIndex(index: number) {
|
||||
:flex-height="!appStore.isMobile"
|
||||
:scroll-x="702"
|
||||
:loading="loading"
|
||||
remote
|
||||
:pagination="pagination"
|
||||
:row-key="item => item.id"
|
||||
class="sm:h-full"
|
||||
|
@ -13,11 +13,17 @@ import UserSearch from './modules/user-search.vue';
|
||||
const appStore = useAppStore();
|
||||
const { bool: drawerVisible, setTrue: openDrawer } = useBoolean();
|
||||
|
||||
const { columns, filteredColumns, data, loading, pagination, getData, searchParams, resetSearchParams } = useTable<
|
||||
Api.SystemManage.User,
|
||||
typeof fetchGetUserList,
|
||||
'index' | 'operate'
|
||||
>({
|
||||
const {
|
||||
columns,
|
||||
filteredColumns,
|
||||
data,
|
||||
loading,
|
||||
pagination,
|
||||
getData,
|
||||
searchParams,
|
||||
updateSearchParams,
|
||||
resetSearchParams
|
||||
} = useTable<Api.SystemManage.User, typeof fetchGetUserList, 'index' | 'operate'>({
|
||||
apiFn: fetchGetUserList,
|
||||
apiParams: {
|
||||
current: 1,
|
||||
@ -41,6 +47,16 @@ const { columns, filteredColumns, data, loading, pagination, getData, searchPara
|
||||
total
|
||||
};
|
||||
},
|
||||
onPaginationChanged(pg) {
|
||||
const { page, pageSize } = pg;
|
||||
|
||||
updateSearchParams({
|
||||
current: page,
|
||||
size: pageSize
|
||||
});
|
||||
|
||||
getData();
|
||||
},
|
||||
columns: () => [
|
||||
{
|
||||
type: 'selection',
|
||||
@ -209,6 +225,7 @@ function getIndex(index: number) {
|
||||
:flex-height="!appStore.isMobile"
|
||||
:scroll-x="962"
|
||||
:loading="loading"
|
||||
remote
|
||||
:pagination="pagination"
|
||||
:row-key="item => item.id"
|
||||
class="sm:h-full"
|
||||
|
Reference in New Issue
Block a user