V2.4.1 FE

This commit is contained in:
孙超
2021-04-25 20:43:20 +08:00
parent 2672502c07
commit 47b8fe5022
63 changed files with 1558 additions and 329 deletions

View File

@@ -28,7 +28,8 @@ export class StaffSelect extends React.Component<IStaffSelectProps> {
public getStaffList = () => {
const { value } = this.props;
const current = users.currentUser.username || getCookie('username');
const principals = value || (current ? [current] : []);
const principals = [''];
// const principals = value || (current ? [current] : []);
const promises: any[] = [];
for (const item of principals) {
@@ -64,7 +65,6 @@ export class StaffSelect extends React.Component<IStaffSelectProps> {
const { value, isDisabled } = this.props;
const current = users.currentUser.username || getCookie('username');
const principals = value || (current ? [current] : []);
return (
<Select
mode="multiple"
@@ -72,6 +72,7 @@ export class StaffSelect extends React.Component<IStaffSelectProps> {
defaultValue={principals}
onChange={(e: string[]) => this.handleChange(e)}
onSearch={(e: string) => this.handleSearch(e)}
onFocus={() => this.getFocus()}
disabled={isDisabled}
{...searchProps}
>
@@ -83,6 +84,10 @@ export class StaffSelect extends React.Component<IStaffSelectProps> {
);
}
public getFocus() {
this.getStaffList();
}
public handleSearch(params: string) {
debounce(() => {
getStaff(params).then((data: IStaff[]) => {
@@ -98,9 +103,9 @@ export class StaffSelect extends React.Component<IStaffSelectProps> {
});
}, 300)();
}
public handleChange(params: string[]) {
const { onChange } = this.props;
// tslint:disable-next-line:no-unused-expression
onChange && onChange(params);
}