Add page control to user management page
This commit is contained in:
5
src/global.d.ts
vendored
5
src/global.d.ts
vendored
@@ -175,6 +175,11 @@ interface TableParam {
|
||||
filters?: Record<string, _FilterValue | null>
|
||||
}
|
||||
|
||||
interface UserGetParam extends PageParam {
|
||||
searchValue?: string
|
||||
searchRegex?: boolean
|
||||
}
|
||||
|
||||
interface UserAddEditParam {
|
||||
id?: string
|
||||
username: string
|
||||
|
||||
@@ -348,6 +348,7 @@ const User: React.FC = () => {
|
||||
>
|
||||
<AntdInput.Password />
|
||||
</AntdForm.Item>
|
||||
{value.id !== '0' ? (
|
||||
<AntdForm.Item
|
||||
name={'needChangePassword'}
|
||||
label={'需改密'}
|
||||
@@ -356,6 +357,7 @@ const User: React.FC = () => {
|
||||
>
|
||||
<AntdSwitch />
|
||||
</AntdForm.Item>
|
||||
) : undefined}
|
||||
</AntdForm>
|
||||
),
|
||||
onOk: () =>
|
||||
@@ -583,7 +585,19 @@ const User: React.FC = () => {
|
||||
|
||||
setIsLoadingUserData(true)
|
||||
|
||||
void r_sys_user_get()
|
||||
void r_sys_user_get({
|
||||
currentPage: tableParams.pagination?.current,
|
||||
pageSize: tableParams.pagination?.pageSize,
|
||||
sortField:
|
||||
tableParams.sortField && tableParams.sortOrder
|
||||
? (tableParams.sortField as string)
|
||||
: undefined,
|
||||
sortOrder:
|
||||
tableParams.sortField && tableParams.sortOrder ? tableParams.sortOrder : undefined,
|
||||
searchValue: searchValue.trim().length ? searchValue : undefined,
|
||||
searchRegex: isUseRegex ? isUseRegex : undefined,
|
||||
...tableParams.filters
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data
|
||||
if (data.code === DATABASE_SELECT_SUCCESS) {
|
||||
|
||||
@@ -13,7 +13,8 @@ import request from '@/services/index'
|
||||
|
||||
export const r_sys_user_info = () => request.get<UserWithPowerInfoVo>(URL_SYS_USER_INFO)
|
||||
|
||||
export const r_sys_user_get = () => request.get<PageVo<UserWithRoleInfoVo>>(URL_SYS_USER)
|
||||
export const r_sys_user_get = (param: UserGetParam) =>
|
||||
request.get<PageVo<UserWithRoleInfoVo>>(URL_SYS_USER, param)
|
||||
|
||||
export const r_sys_user_add = (param: UserAddEditParam) => request.post(URL_SYS_USER, param)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user