>[warning] 使用前请务必在js页面引入**selector.js**
#### 岗位选择组件
>[info] selectPost: function (callback, options) {}
* callback:确认选择后的回调函数
* options:初始化参数
* checked:已选择的岗位信息
* selectMode:选择模式 radio-单选 checkbox-多选
* startOrgId:选择的起始组织机构节点编码
* checkLevel:可以选择的组织机构节点类型(此处配置可选择单位及科室)
* title:弹出选择框标题
```php
{
"checked":"1,b,c",
"selectMode":"radio",
"startOrgId":'HBDBKJ',
"checkLevel":"2,3"
}
```
>[success]回调函数
选择后的回调函数为二维数组,其格式如下:
```php
[{"id":"22C45E6D-2E30-89E8-D3BA-03A385A07FB3","name":"科员","state":1,"text":"科员"}]
```
>[success]示例代码
表单页面代码
```html
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">选择岗位:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group" style="width:60%;">
<input type="text" name="PostName" id="PostName" value="" class="form-control" placeholder="选择岗位" readonly="readonly"/>
<input type="hidden" name="row[PostId]" id="PostId" value=""/>
<div class="input-group-btn">
<button type="button" name="btnPostSelector" id="btnPostSelector" class="btn btn-success"><i class="fa fa-search"></i> 选择</button>
</div>
</div>
</div>
</div>
```
js页面代码
```js
$('#btnPostSelector').on('click',function(){
var options={
selectModel :'radio',
checked :$('#PostId').val()
};
Selector.api.selectPost(function(data){
if(data && data.length>0){
var post =data[0];
$('#PostId').val(post.id);
$('#PostName').val(post.name);
}else{
$('#PostId').val('');
$('#PostName').val('');
}
},options);
});
```
- 空白目录
- 简介
- 前端
- 组件
- 文件上传
- 用户选择
- 组织机构选择
- 角色岗位选择
- 岗位选择
- 用户组选择
- 高拍仪上传
- 公共类库
- 组织机构
- bindToOrg
- bindusertoremote
- getAncestors
- getAllChildIds
- getByOrgId
- getByThirdAppPkId
- getChilds
- getChildsCount
- getMasterOrg
- getOrgUserById
- getOrgUser
- getOrgRoleData
- getOrgRoleQuota
- getOrgRoleUserCount
- getParents
- getPosteritys
- getTreeArray
- getUserOrgs
- getUserOrgCount
- getUserOrgRoleInfo
- hasChild
- hasMasterOrg
- hasBind
- isOrgUser
- updateOrg
- 用户管理
- getAuthorInfo
- getByDuty
- getByGroup
- getByMobile
- getByOrg
- getByUserId
- getByUserName
- getByRole
- getByToken
- getByThirdUserId
- getUserOrgs
- getUserRoles
- getUserList
- 统一待办
- createTodo
- createHandle
- createRead
- removeTodo
- getTodoList
- setReaded