diff --git a/src/utils/comm.ts b/src/utils/comm.ts index 9d47b987..310b4d72 100644 --- a/src/utils/comm.ts +++ b/src/utils/comm.ts @@ -35,4 +35,24 @@ export const LocalStore = { export const getToken = () => { return LocalStore.get(TOKEN_KEY) -} \ No newline at end of file +} + +/** + * TreeSelect过滤 + * @param value 过滤值 + * @param treeNode + * @param key + */ +export const filterTreeSelectNode = (value: string, treeNode: any, key: string = 'name'): boolean => { + return treeNode[key]?.includes(value) +} + +/** + * Select过滤 + * @param value 过滤值 + * @param option + * @param key + */ +export const filterSelectNode = (value: string, option: any, key: string = 'label'): boolean => { + return option[key]?.includes(value) +}