Complete main UI #37
5
src/global.d.ts
vendored
5
src/global.d.ts
vendored
@@ -175,6 +175,11 @@ interface TableParam {
|
|||||||
filters?: Record<string, _FilterValue | null>
|
filters?: Record<string, _FilterValue | null>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface UserGetParam extends PageParam {
|
||||||
|
searchValue?: string
|
||||||
|
searchRegex?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
interface UserAddEditParam {
|
interface UserAddEditParam {
|
||||||
id?: string
|
id?: string
|
||||||
username: string
|
username: string
|
||||||
|
|||||||
@@ -348,14 +348,16 @@ const User: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<AntdInput.Password />
|
<AntdInput.Password />
|
||||||
</AntdForm.Item>
|
</AntdForm.Item>
|
||||||
<AntdForm.Item
|
{value.id !== '0' ? (
|
||||||
name={'needChangePassword'}
|
<AntdForm.Item
|
||||||
label={'需改密'}
|
name={'needChangePassword'}
|
||||||
valuePropName={'checked'}
|
label={'需改密'}
|
||||||
rules={[{ type: 'boolean' }]}
|
valuePropName={'checked'}
|
||||||
>
|
rules={[{ type: 'boolean' }]}
|
||||||
<AntdSwitch />
|
>
|
||||||
</AntdForm.Item>
|
<AntdSwitch />
|
||||||
|
</AntdForm.Item>
|
||||||
|
) : undefined}
|
||||||
</AntdForm>
|
</AntdForm>
|
||||||
),
|
),
|
||||||
onOk: () =>
|
onOk: () =>
|
||||||
@@ -583,7 +585,19 @@ const User: React.FC = () => {
|
|||||||
|
|
||||||
setIsLoadingUserData(true)
|
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) => {
|
.then((res) => {
|
||||||
const data = res.data
|
const data = res.data
|
||||||
if (data.code === DATABASE_SELECT_SUCCESS) {
|
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_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)
|
export const r_sys_user_add = (param: UserAddEditParam) => request.post(URL_SYS_USER, param)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user