@beisen-phoenix/field-user

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

Usage no npm install needed!

<script type="module">
  import beisenPhoenixFieldUser from 'https://cdn.skypack.dev/@beisen-phoenix/field-user';
</script>

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
tenantId 租户 id string Yes
userId 用户 id string Yes
host api 接口 string //www.italent.cn No
isAdvance 是否开启高级搜索(在单选场景下无效) boolean false No
onChange 选择人员的回调 (data:Staff Staff[]) => void
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 字段说明--默认翻译字段

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
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