Commit d41e7649b383dc7abe7c53899eaab542e6301499
Merge branch 'fix/DEFECT-19641' into 'main_dev'
fix: 组织支持下拉选择和搜索选择 See merge request yunteng/thingskit-front!1279
Showing
2 changed files
with
18 additions
and
0 deletions
src/utils/organizationSearch.ts
0 → 100644
| 1 | +export const createOrganizationSearch = () => { | |
| 2 | + return { | |
| 3 | + showSearch: true, | |
| 4 | + filterTreeNode: (value, options) => { | |
| 5 | + const { props } = options || {}; | |
| 6 | + | |
| 7 | + if (!value) { | |
| 8 | + return true; | |
| 9 | + } | |
| 10 | + let { name } = props || {}; | |
| 11 | + value = value?.toLowerCase(); | |
| 12 | + name = name?.toLowerCase(); | |
| 13 | + return name.includes(value); | |
| 14 | + }, | |
| 15 | + }; | |
| 16 | +}; | ... | ... |
| 1 | 1 | import { BasicColumn } from '/@/components/Table'; |
| 2 | 2 | import { FormSchema } from '/@/components/Table'; |
| 3 | 3 | import { useI18n } from '/@/hooks/web/useI18n'; |
| 4 | +import { createOrganizationSearch } from '/@/utils/organizationSearch'; | |
| 4 | 5 | const { t } = useI18n(); |
| 5 | 6 | |
| 6 | 7 | export const columns: BasicColumn[] = [ |
| ... | ... | @@ -38,6 +39,7 @@ export const formSchema: FormSchema[] = [ |
| 38 | 39 | value: 'id', |
| 39 | 40 | }, |
| 40 | 41 | maxTagCount: 10, |
| 42 | + ...createOrganizationSearch(), | |
| 41 | 43 | getPopupContainer: () => document.body, |
| 42 | 44 | }, |
| 43 | 45 | }, | ... | ... |