11
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -60,5 +60,18 @@ export function findTreeLabelById(
|
||||
return '';
|
||||
}
|
||||
|
||||
/** 所属行业:数字 id 走行业树,已是文案则直接展示 */
|
||||
export function resolveIndustryLabel(
|
||||
tree: any[] | undefined,
|
||||
value?: string | number | null,
|
||||
): string {
|
||||
const str = value == null ? '' : String(value).trim();
|
||||
if (!str) return '';
|
||||
if (/^\d+$/.test(str)) {
|
||||
return findTreeLabelById(tree, str) || str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/** @deprecated 使用 findTreeLabelById */
|
||||
export const findIndustryLabelInTree = findTreeLabelById;
|
||||
|
||||
Reference in New Issue
Block a user