mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-06 05:22:16 +08:00
V2.4.1 FE
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user