// 检查角色数组是否包含传入的角色 export function hasRole(roles, target) { if (typeof target === 'string') { return roles.includes(target); } else if (Array.isArray(target)) { return target.some(role => roles.includes(role)); } return false; } //根据id等回显 export function findLabelByValue(arr,value,orgVal,name) { const found = arr.find(item => item[value] == orgVal); return found ? found[name] : undefined; }