| | |
| | | // @ts-expect-error: tree ref instance type is provided by the UI library at runtime |
| | | const treeRef = ref<any>(); |
| | | |
| | | /** |
| | | * 用户下拉的搜索过滤:按昵称模糊匹配(忽略大小写)。 |
| | | */ |
| | | function filterUserOption(input: string, option: any) { |
| | | const keyword = (input || '').trim().toLowerCase(); |
| | | if (!keyword) { |
| | | return true; |
| | | } |
| | | const label = String(option?.label ?? option?.nickname ?? ''); |
| | | return label.toLowerCase().includes(keyword); |
| | | } |
| | | |
| | | const { formFieldOptions } = useFormFieldsPermission(FieldPermissionType.READ); |
| | | |
| | | // 定义 TreeSelect 的默认属性映射 |
| | |
| | | v-model:value="userTaskForm.candidateParam" |
| | | allow-clear |
| | | mode="multiple" |
| | | show-search |
| | | option-filter-prop="label" |
| | | :filter-option="filterUserOption" |
| | | placeholder="请输入用户名称搜索" |
| | | style="width: 100%" |
| | | @change="updateElementTask" |
| | | > |
| | | <SelectOption |
| | | v-for="item in userOptions" |
| | | :key="item.id" |
| | | :label="item.nickname" |
| | | :value="item.id" |
| | | > |
| | | {{ item.nickname }} |