5 changed files with 29 additions and 8 deletions
@ -0,0 +1,15 @@ |
|||
import useUserStore from '@/store/modules/user'; |
|||
|
|||
export function getNameById(id) { |
|||
const userStore = useUserStore(); |
|||
const list = userStore.dsSysList || []; |
|||
const item = list.find(x => x.id === id); |
|||
return item ? item.name : ''; |
|||
} |
|||
|
|||
export function getIdByName(name) { |
|||
const userStore = useUserStore(); |
|||
const list = userStore.dsSysList || []; |
|||
const item = list.find(x => x.name === name); |
|||
return item ? item.id : null; |
|||
} |
Loading…
Reference in new issue