角色弹框

This commit is contained in:
zhoutianchi
2026-02-24 16:24:27 +08:00
parent 2408996109
commit cdd84bea31
6 changed files with 66 additions and 11 deletions

View File

@@ -21,18 +21,23 @@ import {useMessage} from "/@/hooks/message";
const visible=ref(false)
const radio=ref('')
const allRole=reactive([])
const allRole = reactive<any[]>([])
const schoolName=ref('')
const open=()=>{
// handleQuerySchoolName()
listAllRole().then(res=>{
Object.assign(allRole,res.data)
radio.value=Local.get("roleCode")
visible.value=true
const open = () => {
listAllRole().then(res => {
Object.assign(allRole, res.data)
radio.value = Local.get('roleCode')
visible.value = true
})
}
const handleChangeRole=(label:any)=>{
// 必须选择角色后才能关闭,禁止点击遮罩/ESC 关闭(不调用 done 即不关闭)
const handleBeforeClose = (_done: () => void) => {
useMessage().warning('请先选择登录角色')
}
const handleChangeRole = (label: any) => {
let obj:any=allRole.find((v:any) => v.roleCode == label)
Local.set("roleCode",obj.roleCode)
Local.set("roleName",obj.roleName)