测评platform动态权限

This commit is contained in:
zhangsir
2024-04-17 17:26:54 +08:00
parent 1973d3ed05
commit 8f38d7b9b2

View File

@@ -878,6 +878,7 @@ import {downLoadZip} from "@/utils/zipdownload";
bg_remarks: false, bg_remarks: false,
checkclick: [], checkclick: [],
permissionId:'', permissionId:'',
perWorkNum: '',
filesList:[], filesList:[],
tableData:[], tableData:[],
tableData1:[], tableData1:[],
@@ -1289,6 +1290,7 @@ import {downLoadZip} from "@/utils/zipdownload";
listData() listData()
} }
}) })
getByUserIds(record.workNum)
} }
const textDelete = (record) => { const textDelete = (record) => {
dialog({ dialog({
@@ -1301,12 +1303,14 @@ import {downLoadZip} from "@/utils/zipdownload";
listData() listData()
} }
}) })
getByUserIds(record.workNum)
} }
}) })
} }
const updateAuthority = (record) => { const updateAuthority = (record) => {
state.bg_power = true state.bg_power = true
state.permissionId = record.id state.permissionId = record.id
state.perWorkNum = record.workNum
if(record.permission){ if(record.permission){
state.checkclick = record.permission.split(',') state.checkclick = record.permission.split(',')
} }
@@ -1725,21 +1729,22 @@ import {downLoadZip} from "@/utils/zipdownload";
state.bg_power2 = false state.bg_power2 = false
state.powerStatus = {} state.powerStatus = {}
state.permissionId = '' state.permissionId = ''
state.perWorkNum = ''
state.checkclick = [] state.checkclick = []
} }
const getByUserIds = async () => { const getByUserIds = async (workNum) => {
// const roleCode = userInfo.value await getByUserId({workNum,}).then(res=>{
// const roleId = roleCode.roleList.find(item=>item.roleCode=='quiz-admin') || null // if(res.code == 200){
// const isQuizAdmin = roleId ? 1 : 0 // console.log(res.data,'workUnum')
// await getByUserId({loginId:roleCode.userId,roleId,isQuizAdmin}).then(res=>{ // }
})
// })
} }
const powerTrue = async () => { const powerTrue = async () => {
state.powerStatus.permission = state.checkclick.join(",") state.powerStatus.permission = state.checkclick.join(",")
if(state.permissionId){ if(state.permissionId){
await updateStatus({id:state.permissionId,permission:state.checkclick.join(",")}).then((res)=>{ await updateStatus({id:state.permissionId,permission:state.checkclick.join(",")}).then((res)=>{
saveListItem() saveListItem()
getByUserIds(state.perWorkNum)
}) })
} }
listData() listData()
@@ -1751,9 +1756,9 @@ import {downLoadZip} from "@/utils/zipdownload";
message.success('启用成功') message.success('启用成功')
listData() listData()
saveListItem() saveListItem()
getByUserIds()
} }
}) })
getByUserIds(record.workNum)
} }
const textEnableAdd = async (record) => { const textEnableAdd = async (record) => {
record.statusList = 0 record.statusList = 0