Skip to content

Commit

Permalink
Merge pull request #416 from yiqingfeng/master
Browse files Browse the repository at this point in the history
feat: 选人组件支持自定义 apiOptions
  • Loading branch information
eternalsky authored Dec 3, 2021
2 parents 6758457 + b8083cf commit 22431af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/EmployeeField/EmployeeField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class EmployeeField extends React.Component {
enableNW: PropTypes.bool,
onPick: PropTypes.func,
enableAutoJumpDepart: PropTypes.bool,
apiOptions: PropTypes.object,
};

static defaultProps = {
Expand All @@ -58,6 +59,7 @@ class EmployeeField extends React.Component {
corpId: undefined,
onPick: undefined,
enableAutoJumpDepart: true,
apiOptions: {},
};


Expand All @@ -77,6 +79,7 @@ class EmployeeField extends React.Component {
const {
onPick, multiple, max, isNeedSearch, startWithDepartmentId,
value, disabledUsers, enableAutoJumpDepart, corpId, enableNW, onChange,
apiOptions,
} = this.props;
if (typeof onPick === 'function') {
onPick();
Expand All @@ -92,6 +95,7 @@ class EmployeeField extends React.Component {
users: value.map(v => v.key),
disabledUsers,
enableAutoJumpDepart,
...apiOptions,
};
const Ali = window.Ali || {};
if (window.Ali) {
Expand Down Expand Up @@ -127,6 +131,7 @@ class EmployeeField extends React.Component {
startWithDepartmentId: 0,
showRootOrg: true,
corpId,
...apiOptions,
onSuccess(result) {
onChange(transToValue(result.users));
},
Expand Down

0 comments on commit 22431af

Please sign in to comment.