组件使用、扩展文档
提交
- 修改package.json中的devDependencies里依赖版本, @beisen/gulp-lib -> 0.1.1; @beisen/storybook-lib -> 0.3.0
- npm install
- 修改代码后执行 npm run lib进行编译
- 更新package.json中的 version版本号
- push代码
- 在cmp.beisen.io站点,头部导航的《服务》中查看编译是否通过
人员组件 接口自定义配置
{
//获取常用联系人接口
"getUserUrl" : {
"url": ""
,"method": "GET"
},
//获取下属接口
"getStaffUrl" : {
"url": ""
,"method": "GET"
},
//获取部门详细信息
"getDeptUrl" : {
"url": ""
,"method": "GET"
},
//获取部门下人员列表
"getDeptUserUrl" : {
"url": ""
,"method": "GET"
},
//搜索人员接口
"getSearchUserUrl" : {
"url": ""
,"method": "GET"
}
}
可以配置部分参数,如果参数为空则请求系统默认接口
const config = {
titaHost: getBSGlobal('apiPath'),
tenantId: getBSGlobal('tenantInfo').Id,
userId: getBSGlobal('loginUserInfo').Id,
application: getBSGlobal('application'),
cloudHost: getBSGlobal('cloudHost') || '',// || '//cloud.italent.link',
}
表单组件请求url添加 formState参数
使用参数
{
text: this.props.text || '',
value: this.props.value || '',
"avatars":{
"222":{ //头像,key要和value里对应
"hasAvatar":false,
"color":"#f0c75a"
}
},
"cmp_id": "c569ca1e-e58b-4a54-8a82-274ebc654162",
"cmp_name": "Onwer",
"cmp_type": "BC_UserSelect",
"cmp_label": "所有者",
"cmp_data": {
"AllowSearchNull": "1",
"title": "所有者",
"field_name": "BeisenCloudDemo.searchshengji.Onwer",
"metaObjectName":"BeisenCloudDemo.searchshengji",
"required": false,
"cmp_state": "create",
"cmp_status": "editable",
"editdisplaystate": "editable",
"createdisplaystate": "editable",
"showdisplaystate": "readonly",
"datasourcename": "BCStaffDataSource",
"IsShowHeadPic": true,
"dataType": "Text",
"singleSelect": false, //单选or多选
"datasourceurl":{
//获取常用联系人接口
"getUserUrl" : {
"url": ""
,"method": "GET"
},
//获取下属接口
"getStaffUrl" : {
"url": ""
,"method": "GET"
},
//获取部门详细信息
"getDeptUrl" : {
"url": ""
,"method": "GET"
},
//获取部门下人员列表
"getDeptUserUrl" : {
"url": ""
,"method": "GET"
},
//搜索人员接口
"getSearchUserUrl" : {
"url": ""
,"method": "GET"
}
}
},
"search_data": {
metaFieldRelationIDPath: null,
metaobjectname: "BeisenCloudDemo.searchshengji",
opeartor: "eq",
seperator: "-"
},
"biz_data": { "text": "" },
"validators": {},
"singleSelect": false //单选or多选
"usersDataFromProps": true // true or false,审批参数
styleTitle: 'rightFlush', // "upAndDown" , "rightFlush", "leftFlush", label的位置上下还是左右
onChange: (value) => {} //回调事件
}
组件使用
- npm install @beisen-cmps/platform-user-selector
- 该组件有两种使用方式, 第一种会走组件内部的获取数据方式,数据会存在state里,第二种会走外部传入的action
- import XXX from '@beisen-cmps/platform-user-selector'
- import {UserSelector} from '@beisen-cmps/platform-user-selector'
render() {
return <UserSelector {...this.props}/>;
}