@beisen/ocean-person-selector-input
TypeScript icon, indicating that this package has built-in type declarations

2.4.7 • Public • Published
属性 说明 类型 必须配置 默认值
status 状态描述(可选值包括 'normal' 'disabled' 'error') string normal
value 已选值 {Name:string,Id:number,Email:string,AvatarColor:string,DepartmentId:number}[] no []
trigger 自定义dom(用来触发弹层) JSX.Element @beisen-phoenix/input
apiPath 接口请求前缀,形如(http://www.italent-inc.cn) string yes(仅在使用内置APi模式下需要)
tenantId BSGlobal.tenantInfo中的Id string、number yes(仅在使用内置APi模式下需要)
userId BSGlobal.loginUserInfo中的Id string、number yes(仅在使用内置APi模式下需要)
onSure 点击确定按钮后的回调 (val: array): void no
onError fetch数据发生error后的回调 (er: error): void no
onCancel 点击取消按钮后的回调 Function no
onChange 高级模式下数据变动回调 Function no
advanceMode 高级/普通模式开关 bool yes
translation 多语言翻译文字 object no 请参考下面的translate说明
hideTabs 隐藏一个或者多个tab(暂不支持隐藏所有) array no 请参考下面的hideTabs说明
hideAdvanceModeText 普通模式下隐藏'高级模式'文字 bool no false
dataProvideByExternalPromise 组件是否使用外部数据 bool no false
contactPromise 外部数据-常用联系人函数(返回promise) ()=>Promise no
staffPromise 外部数据-我的下属函数(返回promise) ()=>Promise no
departmentPromise 外部数据-所有部门函数(返回promise) ()=>Promise no
departmentStaffPromise 外部数据-部门下面的员工函数(返回promise) (staffId)=>Promise no
searchPromise 外部数据-search函数(返回promise) (string)=>Promise no
zIndex 控制层级 number no 1050

注意

  • 若使用内置接口,依据平台现有选人组件的数据请求方式,所有数据方式为 get,请求url已经内置,为了更好的兼容性,请必须配置apiPath、tenantId、userId。
  • 选人没有内置弹层,需要依赖非模态组件,请参考:http://cmp.italent-inc.cn/details?id=1064
  • apiPath 的前缀必须要有 // 或者http:// 或者https://
  • value 仅支持高级模式
  • value 的数据格式为
interface Staff {
    Id: number,
    Name: string,
    Email: string,
    Avatar: string,
    AvatarColor: string,
    DepartmentId: number
}
  • 使用外部数据,搜索结果、常用联系人、我的下属、部门下面的员工接口,请提供Staff[], Staff的结构如下
export interface Staff {
    Id: number,
    Name: string,
    Email: string,
    Avatar: string,
    AvatarColor: string,
    DepartmentId: number
}

部门数据,请提供Department[],Department的结构如下

export interface Department {
    Id: number,
    PId: number,
    DepartmentName: string,
    TotalUserCount: number
}

####hideTabs字段说明 hideTabs array可以使用的字段有

export enum TabType {
    'commonContact'="commonContact",
    'subordinate'='subordinate',
    'department'='department'
};

比如我要取消常用联系人+我的下属的显示,就传递 ['commonContact','subordinate'], 暂不支持隐藏所有tabName,如果传递了所有的tabName,将会忽略该字段

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


export const defaultTranslation: DefaultTranslationType = {
	search: '搜索',
	advancedMode: '高级模式',
	noDataTip: '这里什么都没有...',
	emptyText: '空 (未填写)',
	common: '常用',
	subordinate: '下属',
	department: '部门',
	searchResult: '搜索结果',
	contacts: '联系人',
	person: '人',
	my: '我的',
	aleradySelect: '已选人员',
	group: '组',
	clearSelect: '清空已选',
	cancel: '取消',
	sure: '确认',
	pleaseSelectTip: '请在左侧选择人员',
	one: '个',
	empty: "空(未填写)"
}

Readme

Keywords

none

Package Sidebar

Install

npm i @beisen/ocean-person-selector-input

Weekly Downloads

71

Version

2.4.7

License

ISC

Unpacked Size

11.6 kB

Total Files

5

Last publish

Collaborators

  • albert-zhang
  • liugenpeng
  • beisencorp
  • lgm
  • neozw