Commit d41e7649b383dc7abe7c53899eaab542e6301499

Authored by xp.Huang
2 parents 69bee73d 94ea931e

Merge branch 'fix/DEFECT-19641' into 'main_dev'

fix: 组织支持下拉选择和搜索选择

See merge request yunteng/thingskit-front!1279
  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 import { BasicColumn } from '/@/components/Table'; 1 import { BasicColumn } from '/@/components/Table';
2 import { FormSchema } from '/@/components/Table'; 2 import { FormSchema } from '/@/components/Table';
3 import { useI18n } from '/@/hooks/web/useI18n'; 3 import { useI18n } from '/@/hooks/web/useI18n';
  4 +import { createOrganizationSearch } from '/@/utils/organizationSearch';
4 const { t } = useI18n(); 5 const { t } = useI18n();
5 6
6 export const columns: BasicColumn[] = [ 7 export const columns: BasicColumn[] = [
@@ -38,6 +39,7 @@ export const formSchema: FormSchema[] = [ @@ -38,6 +39,7 @@ export const formSchema: FormSchema[] = [
38 value: 'id', 39 value: 'id',
39 }, 40 },
40 maxTagCount: 10, 41 maxTagCount: 10,
  42 + ...createOrganizationSearch(),
41 getPopupContainer: () => document.body, 43 getPopupContainer: () => document.body,
42 }, 44 },
43 }, 45 },