# @beisen-phoenix/field-user

> | 参数 | 说明 | 类型 | 默认值 | 是否必传 | | ---------------------------- | ----------------------------------------------------------

Latest version **3.3.55** (published 2019-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-phoenix/field-user
pnpm add @beisen-phoenix/field-user
yarn add @beisen-phoenix/field-user
bun add @beisen-phoenix/field-user
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.55 |
| Published | 2019-11-25 |
| First published | 2019-04-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 27.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-phoenix/field-user
- npm.io page: https://npm.io/package/@beisen-phoenix/field-user

## Dependencies (4)

- [@beisen-phoenix/select](https://npm.io/package/@beisen-phoenix/select.md) ^3.3.55
- [@beisen-phoenix/person-selector](https://npm.io/package/@beisen-phoenix/person-selector.md) ^3.3.55
- [@beisen-phoenix/unmodeled-layer](https://npm.io/package/@beisen-phoenix/unmodeled-layer.md) ^3.3.55
- [@beisen-phoenix/form-control-preview](https://npm.io/package/@beisen-phoenix/form-control-preview.md) ^3.3.55

## Recent versions

- 3.3.55 (latest) — 2019-11-25
- 3.2.44-rc.1 (rc) — 2019-10-24
- 3.3.54 — 2019-11-25
- 3.3.53 — 2019-11-25
- 3.3.52 — 2019-11-24
- 3.3.51 — 2019-11-23
- 3.3.50 — 2019-11-22
- 3.3.48 — 2019-11-22
- 3.3.47 — 2019-11-22
- 3.3.46 — 2019-11-22
- 3.3.45 — 2019-11-21
- 3.3.43 — 2019-11-21
- 3.3.42 — 2019-11-21
- 3.3.41-beta.1 — 2019-11-21
- 3.3.41 — 2019-11-21
- … 419 more at https://npm.io/package/@beisen-phoenix/field-user/versions

## README

| 参数                         | 说明                                                                  | 类型                 | 默认值                              | 是否必传 |
| ---------------------------- | --------------------------------------------------------------------- | -------------------- | ----------------------------------- | -------- |
| disabled                     | 该输入项是否禁用                                                      | boolean              | false                               | No       |
| userTranslation              | 选人组件多语言翻译文字                                                | object               | No                                  | No       |
| placeholder                  | 输入框的占位符                                                        | string               |                                     | No       |
| multiple                     | 是否可以多选                                                          | boolean              | false                               | No       |
| hasError                     | 是否显示错误                                                          | boolean              | false                               | No       |
| isPreview                    | 是否用于表单展示态                                                     | boolean              | false                               | No       |
| value                        | 已选的值                                                              | Staff                | Staff[](单选时是object，多选是数组) |          | No |
| tenantId                     | 租户 id                                                               | string               |                                     | Yes      |
| userId                       | 用户 id                                                               | string               |                                     | Yes      |
| host                         | api 接口                                                              | string               | //www.italent.cn                    | No       |
| isAdvance                    | 是否开启高级搜索（在单选场景下无效）                                  | boolean              | false                               | No       |
| onChange                     | 选择人员的回调                                                        | (data:Staff          | Staff[]) => void                    |          | No |
| onError                      | ajax 请求出错的回调函数                                               | (e) => void          |                                     | No       |
| hideTabs                     | 隐藏一个或者多个 tab（暂不支持隐藏所有）                              | array                |                                     | No       |
| dataProvideByExternalPromise | 组件是否使用外部数据                                                  | boolean              |                                     | No       |
| contactPromise               | 外部数据-常用联系人函数（返回 promise）                               | () => promise        |                                     | No       |
| staffPromise                 | 外部数据-我的下属函数（返回 promise）                                 | () => promise        |                                     | No       |
| departmentPromise            | 外部数据-所有部门函数（返回 promise）                                 | () => promise        |                                     | No       |
| departmentStaffPromise       | 外部数据-部门下面的员工函数（返回 promise）                           | (staffId) => promise |                                     | No       |
| searchPromise                | 外部数据-search 函数（返回 promise）                                  | (string) => promise  |                                     | No       |
| getPopupContainer            | 弹层挂载的容器(默认是挂载到 body 下,通过此函数可以改变弹层挂载的节点) | Funtion              |                                     | No       |

#### translate 字段说明--默认翻译字段

```angular2
export interface Staff {
	Id: number;
	Name: string;
	Email: string;
	Avatar: string;
	AvatarColor: string;
	DepartmentId: number;
}
export const defaultTranslation: DefaultTranslationType = {
	search: '搜索',
	advancedMode: '高级模式',
	noDataTip: '这里什么都没有...',
	emptyText: '空 (未填写)',
	commonContact: '常用',
	subordinate: '下属',
	department: '部门',
	searchResult: '搜索结果',
	frequentContacts: '常用联系人',
	person: '人',
	my: '我的',
	aleradySelect: '已选人员',
	group: '组',
	clearSelect: '清空已选',
	cancel: '取消',
	sure: '确认',
	pleaseSelectTip: '请在左侧选择人员',
	one: '个',
	empty: '空(未填写)',
	directSubordinate: '直接下属'
}

```

##### 默认值 examples

```javascript
const value = [
	{
		Avatar:
			'//cache.tita.gift/Image/100013/3bbe4b2a5e5f4fcb976812bc0f77d404_s.jpg',
		AvatarColor: '#f79c6f',
		DepartmentId: null,
		Email: 'xian_yangqianqian@beisen.com',
		Id: 111469971,
		Name: 'yangqianqian'
	}
];
```

##### 使用外部数据的 examples 请参考 http://gitlab.beisencorp.com/ux-phoenix/person-selector/tree/master

---
_Source: https://npm.io/package/@beisen-phoenix/field-user · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
