个人资料和岗位列表联调,简历优化部分页面

This commit is contained in:
2026-04-01 11:41:51 +08:00
parent 0468339d23
commit 821a950df2
42 changed files with 5935 additions and 748 deletions
+20
View File
@@ -0,0 +1,20 @@
import store from '@/stores/index'
import type { IndustryItem } from '@/api/common'
/**
* 根据行业 ID 从 store 行业树中查找对应的行业名称
* 遍历一级→二级,匹配到即返回名称,未匹配返回 ID 本身
* @param id 行业 ID(如 12
* @returns 匹配到的行业名称,未匹配则返回 ID 字符串
*/
export function resolveIndustryName(id: number): string {
if (!id && id !== 0) return ''
const industries: IndustryItem[] = store.state.industries
for (const parent of industries) {
if (String(parent.id) === String(id)) return parent.name
for (const child of parent.children) {
if (String(child.id) === String(id)) return child.name
}
}
return String(id)
}