|
|
@ -69,7 +69,18 @@ const addRole = ref({ |
|
|
|
}) |
|
|
|
// 新增角色的权限列表 |
|
|
|
const permissionSelect = ref() |
|
|
|
|
|
|
|
//这是获取用户信息的接口 |
|
|
|
const adminData = ref({}) |
|
|
|
const getAdminData = async function () { |
|
|
|
try { |
|
|
|
const result = await API({ url: '/admin/userinfo', data: {} }) |
|
|
|
adminData.value = result |
|
|
|
// console.log('请求成功', result) |
|
|
|
console.log('管理员用户信息', adminData.value) |
|
|
|
} catch (error) { |
|
|
|
console.log('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑用户权限对象 |
|
|
|
const permissionEditObj = ref({ |
|
|
@ -606,13 +617,7 @@ const editStatus = async function (row) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 挂载 |
|
|
|
onMounted(async function () { |
|
|
|
await get() |
|
|
|
await getArea() |
|
|
|
await getStore() |
|
|
|
await getRoleList() |
|
|
|
}) |
|
|
|
|
|
|
|
const handlePageSizeChange = function (val) { |
|
|
|
getObj.value.pageSize = val |
|
|
|
get() |
|
|
@ -698,6 +703,16 @@ const resetPassword = async function (row) { |
|
|
|
ElMessage.error('请求失败', error) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 挂载 |
|
|
|
onMounted(async function () { |
|
|
|
await get() |
|
|
|
await getArea() |
|
|
|
await getStore() |
|
|
|
await getRoleList() |
|
|
|
await getAdminData() |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
@ -774,12 +789,12 @@ const resetPassword = async function (row) { |
|
|
|
重置密码 |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" text @click="permissionEditInit(scope.row)" |
|
|
|
:disabled="scope.row.adminStatus === 0"> |
|
|
|
:disabled="scope.row.adminStatus === 0 ||scope.row.account === adminData.account "> |
|
|
|
修改权限 |
|
|
|
</el-button> |
|
|
|
<el-popconfirm title="确定将此用户删除吗?" @confirm="delRoleConfirm"> |
|
|
|
<template #reference> |
|
|
|
<el-button type="danger" text @click="del(scope.row)" :disabled="scope.row.adminStatus === 0"> |
|
|
|
<el-button type="danger" text @click="del(scope.row)" :disabled="scope.row.adminStatus === 0 || scope.row.account === adminData.account"> |
|
|
|
删除 |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
@ -794,7 +809,7 @@ const resetPassword = async function (row) { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="adminStatus" label="状态"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-switch v-model="scope.row.adminStatus" :active-value="1" :inactive-value="0" size="large" |
|
|
|
<el-switch v-model="scope.row.adminStatus" :active-value="1" :inactive-value="0" size="large" :disabled="scope.row.account === adminData.account" |
|
|
|
@change="editStatus(scope.row)" style=" |
|
|
|
--el-switch-on-color: #13ce66; |
|
|
|
--el-switch-off-color: #ff4949; |
|
|
|