teams-selecter
v0.1.5
Published
teams-selecter
Downloads
192
Readme
Irene Awesome Greeter
使用
import DepartmentSelect from 'teams-selecter/dist/src'
import 'teams-selecter/dist/index.css'
<div style={{ width: '100%', height: 600 }}>
<DepartmentSelect
// 初始化用户id
initUids={uidsList}
// 实时监听返回的users
onChange={(users) => {
console.log(users, "uidsuids")
}}
// 限制选人数量
restrictUser={1}
// 图片云地址
publicOrigin={'url'}
// 接口在咱们项目里固定的
apiMethod={{
departmentList: () => {
return get('/api/userData/addr_book/dept/list').then((res: any) => {
console.log(res, "resresresres")
return res.data
})
},
userSearch: (keyWord, depart_id) => {
return post('/api/userData/addr_book/user/list', { key: keyWord, depts: depart_id, page: 1, num: 10000 }).then((res: any) => {
console.log(res, "resresresres")
return res.data.res
})
}
}}
/>
</div>