**JSelectPosition岗位选择框** ***** [TOC] ## 参数定义 | 参数 | 类型 | 是否可选 | 默认值 | 说明 | | --- | --- | --- | --- | --- | | value | \[String,Array\] | 否 | 无 | 回显值 | | showButton | Boolean | 否 | true | 是否显示选择按钮 | | disabled | Boolean | 否 | false | 是否禁用 | | placeholder | String | 否 | 请选择 | 选择提示语 | | rowKey | String | 否 | code | 取值字段配置,一般为主键字段 | | labelKey | String | 否 | name | 显示字段配置 | | params | String | 否 | \- | 自定义查询参数,需要传递字符串,如:params:**'{"code":"001"}'** | | showSelected | Boolean | 否 | false | 是否右侧显示选中列表 | | maxSelectCount | Number | 否 | null | 最大选择数量 | | modalTitle| String| 否 | 职务选择| 选择框标题| | isRadioSelection | boolean| 否 | false| 是否单选 | ## 事件定义 | 事件名 | 参数 | 说明 | | --- | --- | --- | | getSelectResult | options, values | 确认选择回调,单独使用选择框中使用该事件获取选中值 | ## 使用示例 ### BaseForm中使用示例 ![](https://img.kancloud.cn/a6/8b/a68b417faf41341a07f53443d23e3d67_1051x52.png) ![](https://img.kancloud.cn/78/73/78731e96edcd61e1ff8ed524499a7ee9_1724x749.png) ~~~ { field: 'user2', component: 'JSelectPosition', label: '选择示例', helpMessage: ['component模式'], componentProps:{ labelKey:'name', rowKey:'code' } } ~~~ ### 插槽中使用示例 ~~~ <template #jSelectPosition="{model, field }"> <JSelectPosition v-model:value="model[field]"/> </template> ~~~ ### 单独使用示例 ~~~ <template> <a-button type="primary" preIcon="ant-design:plus-outlined" @click="openHandle">选择</a-button> <PositionSelectModal rowKey="id" @register="registerSelModal" @getSelectResult="onSelectOk"/> </template> <script lang="ts" setup> import PositionSelectModal from '/@/components/Form/src/jeecg/components/modal/PositionSelectModal .vue' // 注册选择框 const [registerSelModal, {openModal}] = useModal() // 打开选择框 function openHandle() { openModal(); } // 选择确认事件 function onSelectOk(selectRows, selectKeys) { //处理业务逻辑 } </script> ~~~ ### showSelected属性配置效果 ![](https://img.kancloud.cn/0b/35/0b357bd1cfbcca0a2eba56a5d0aa2ced_896x598.png)