Skip to content

Commit

Permalink
Merge pull request #243 from sj-distributor/Fixed-tree-already-select…
Browse files Browse the repository at this point in the history
…-bug

Fixed tree already select bug
  • Loading branch information
koki812 authored Mar 5, 2024
2 parents 3ca86a8 + 030ba36 commit e380675
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"moment": "^2.29.4",
"node-sass": "^8.0.0",
"notistack": "^3.0.1",
"query-string": "^8.0.0",
"ramda": "^0.28.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
12 changes: 4 additions & 8 deletions web/src/api/role-user-permissions/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import queryString from "query-string";
import {
IAddRoleUsersDto,
IDeleteRole,
Expand All @@ -19,10 +20,10 @@ export const GetCurrentRolesByPermissions = async () => {

// 获取用户list
export const GetRoleUser = async (data: IRoleUserPageDto) => {
const newQueryString = queryString.stringify(data);

return await Get<IRoleUserResponse>(
`/api/Security/role/users?PageIndex=${data.PageIndex + 1}&PageSize=${
data.PageSize
}&RoleId=${data.RoleId}&Keyword=${data.Keyword}`
`/api/Security/role/users?${newQueryString}`
);
};

Expand All @@ -43,11 +44,6 @@ export const GetTreeList = async () => {
);
};

//获取全部角色用户列表
export const GetRoleUserList = async () => {
return await Get<IRoleUserResponse>(`/api/Security/role/users`);
};

// 获取功能权限
export const GetPermissions = async () => {
return await Get<IPermissionsDto>("/api/Security/permissions");
Expand Down
6 changes: 3 additions & 3 deletions web/src/dtos/role-user-permissions/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export interface IRoleUserPageDto {
PageIndex: number;
PageSize: number;
PageIndex?: number;
PageSize?: number;
RoleId: string;
Keyword: string;
Keyword?: string;
}

export interface IRoleUserResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSnackbar } from "notistack";
import { ModalBoxRef } from "../../../../dtos/modal";
import {
AddRoleUser,
GetRoleUserList,
GetRoleUser,
GetTreeList,
} from "../../../../api/role-user-permissions";
import {
Expand Down Expand Up @@ -90,7 +90,9 @@ export const useAction = (props: {
};

const handleTotalRoleUserList = () => {
GetRoleUserList()
GetRoleUser({
RoleId: roleId,
})
.then((res) => {
setTotalRoleUserList(res?.roleUsers ?? []);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const useAction = () => {
setLoading(true);

GetRoleUser({
PageIndex: pageDto.PageIndex,
PageIndex: (pageDto.PageIndex ?? 0) + 1,
PageSize: pageDto.PageSize,
RoleId: pageDto.RoleId,
Keyword: inputVal,
Expand Down

0 comments on commit e380675

Please sign in to comment.