fix(search): 用户搜索支持名称或昵称合并检索
- 用户管理列表:搜索框改为「用户名称/昵称」,提示词统一为「搜索名称或昵称」
- 用户选择弹窗:合并名称与昵称两个输入框为单一 keyword 检索
- 用户穿梭框:本地过滤同时匹配 username 与 nickname,搜索提示同步调整
- 条码列表:移除重复的 content 列定义,消除 vxe-table 字段重复告警
Co-Authored-By: Claude <noreply@anthropic.com>
| | |
| | | function useUserSelectGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'username', |
| | | label: '用户名称', |
| | | fieldName: 'keyword', |
| | | label: '用户名称/昵称', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请输入用户名称', |
| | | }, |
| | | }, |
| | | { |
| | | fieldName: 'nickname', |
| | | label: '用户昵称', |
| | | component: 'Input', |
| | | componentProps: { |
| | | allowClear: true, |
| | | placeholder: '请输入用户昵称', |
| | | placeholder: '搜索名称或昵称', |
| | | }, |
| | | }, |
| | | { |
| | |
| | | pageNo, |
| | | pageSize, |
| | | deptId: selectedDeptId.value, |
| | | username: leftListState.value.searchValue || undefined, |
| | | keyword: leftListState.value.searchValue || undefined, |
| | | }); |
| | | |
| | | leftListState.value.dataSource = list; |
| | |
| | | }; |
| | | } |
| | | |
| | | // TODO 后端接口目前仅支持 username 检索, 筛选条件需要跟后端请求参数保持一致。 |
| | | function filterOption(inputValue: string, option: any) { |
| | | return option.username.toLowerCase().includes(inputValue.toLowerCase()); |
| | | const keyword = inputValue.toLowerCase(); |
| | | return ( |
| | | option.username?.toLowerCase().includes(keyword) || |
| | | option.nickname?.toLowerCase().includes(keyword) |
| | | ); |
| | | } |
| | | |
| | | /** 处理部门树展开/折叠 */ |
| | |
| | | v-model:target-keys="selectedUserIds" |
| | | :titles="['未选', '已选']" |
| | | :show-search="true" |
| | | search-placeholder="搜索名称或昵称" |
| | | :show-select-all="true" |
| | | :filter-option="filterOption" |
| | | @change="handleUserChange" |
| | |
| | | export function useGridFormSchema(): VbenFormSchema[] { |
| | | return [ |
| | | { |
| | | fieldName: 'username', |
| | | label: '用户名称', |
| | | fieldName: 'keyword', |
| | | label: '用户名称/昵称', |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请输入用户名称', |
| | | placeholder: '搜索名称或昵称', |
| | | allowClear: true, |
| | | }, |
| | | }, |
| | |
| | | cellRender: { |
| | | name: 'CellSwitch', |
| | | attrs: { beforeChange: onAutoGenerateChange }, |
| | | props: { checkedValue: true, unCheckedValue: false }, |
| | | }, |
| | | }, |
| | | { |