mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-19 04:44:19 +08:00
[improvement][semantic-fe] Optimized the frontend display and code logic of visual modeling, and updated the relevant interface of the permission management module.
This commit is contained in:
@@ -30,15 +30,7 @@ const SelectTMEPerson: FC<Props> = ({ placeholder, value, isMultiple = true, onC
|
||||
}
|
||||
},
|
||||
updater: (list) => {
|
||||
const users = list.map((item: UserItem) => {
|
||||
const { enName, chName, name } = item;
|
||||
return {
|
||||
...item,
|
||||
enName: enName || name,
|
||||
chName: chName || name,
|
||||
};
|
||||
});
|
||||
setUserList(users);
|
||||
setUserList(list);
|
||||
},
|
||||
cleanup: () => {
|
||||
setUserList([]);
|
||||
@@ -58,8 +50,8 @@ const SelectTMEPerson: FC<Props> = ({ placeholder, value, isMultiple = true, onC
|
||||
>
|
||||
{userList.map((item) => {
|
||||
return (
|
||||
<Select.Option key={item.enName} value={item.enName}>
|
||||
<TMEAvatar size="small" staffName={item.enName} />
|
||||
<Select.Option key={item.name} value={item.name}>
|
||||
<TMEAvatar size="small" staffName={item.name} />
|
||||
<span className={styles.userText}>{item.displayName}</span>
|
||||
</Select.Option>
|
||||
);
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
import request from 'umi-request';
|
||||
|
||||
export type UserItem = {
|
||||
enName?: string;
|
||||
export interface UserItem {
|
||||
id: number;
|
||||
name: string;
|
||||
displayName: string;
|
||||
chName?: string;
|
||||
name?: string;
|
||||
email: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type GetAllUserRes = Result<UserItem[]>;
|
||||
|
||||
// 获取所有用户
|
||||
export async function getAllUser(): Promise<GetAllUserRes> {
|
||||
const { APP_TARGET } = process.env;
|
||||
if (APP_TARGET === 'inner') {
|
||||
return request.get('/api/oa/user/all');
|
||||
}
|
||||
return request.get(`${process.env.AUTH_API_BASE_URL}user/getUserList`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user