fix : 修复角色修改权限

This commit is contained in:
dj
2025-07-11 10:12:48 +08:00
parent 8974282b44
commit 1d5e8a23ed
2 changed files with 14 additions and 11 deletions

View File

@@ -50,6 +50,8 @@ const openChangeRoleDialog = (selectRoleId, data) => {
} }
}) })
} }
console.log("🚀 ~ file: ", authStore.roles.includes('superAdmin'))
const schame = computed(() => { const schame = computed(() => {
let arr = [ let arr = [
{ {
@@ -62,7 +64,7 @@ const schame = computed(() => {
filterable: true, filterable: true,
checkStrictly: true, checkStrictly: true,
data: localData.subCompanyIdOpt, data: localData.subCompanyIdOpt,
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
}, },
on: { on: {
change: async (val) => { change: async (val) => {
@@ -81,7 +83,7 @@ const schame = computed(() => {
data: localData.departmentIdOpt, data: localData.departmentIdOpt,
filterable: true, filterable: true,
checkStrictly: true, checkStrictly: true,
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -90,7 +92,7 @@ const schame = computed(() => {
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入', placeholder: '请输入',
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -99,7 +101,7 @@ const schame = computed(() => {
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入', placeholder: '请输入',
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -120,7 +122,7 @@ const schame = computed(() => {
filterable: true, filterable: true,
checkStrictly: true, checkStrictly: true,
data: localData.jobOpt, data: localData.jobOpt,
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -130,7 +132,8 @@ const schame = computed(() => {
props: { props: {
placeholder: '请选择', placeholder: '请选择',
multiple: true, multiple: true,
data: localData.roleOpt data: localData.roleOpt,
disabled:!authStore.roles.includes('superAdmin') ? true : false
}, },
on: { on: {
change: async (val) => { change: async (val) => {
@@ -173,7 +176,7 @@ const schame = computed(() => {
props: { props: {
placeholder: '请选择', placeholder: '请选择',
data: cacheStore.getDict('user_sex'), data: cacheStore.getDict('user_sex'),
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -183,7 +186,7 @@ const schame = computed(() => {
props: { props: {
placeholder: '请选择', placeholder: '请选择',
data: cacheStore.getDict('normal_disable'), data: cacheStore.getDict('normal_disable'),
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -192,7 +195,7 @@ const schame = computed(() => {
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入', placeholder: '请输入',
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
{ {
@@ -201,7 +204,7 @@ const schame = computed(() => {
component: 'el-input', component: 'el-input',
props: { props: {
placeholder: '请输入', placeholder: '请输入',
disabled: route.query.userType == 0 ? true : false disabled: route.query.userType == 0 ? true : !authStore.roles.includes('superAdmin') ? true : false
} }
}, },
] ]

View File

@@ -43,7 +43,7 @@
<el-button type="primary" v-perm="auths.agentSetting" <el-button type="primary" v-perm="auths.agentSetting"
@click="handleAgentSetting(scope.row)" link>设置代理 @click="handleAgentSetting(scope.row)" link>设置代理
</el-button> </el-button>
<el-button type="danger" v-if="scope.row.userType != 0" v-perm="auths.del" <el-button type="danger" v-if="scope.row.userType != 0&&!authStore.roles.includes('superAdmin')" v-perm="auths.del"
@click="handleDel(scope.row)" link>删除 @click="handleDel(scope.row)" link>删除
</el-button> </el-button>
<el-button type="primary" v-if="scope.row.accountType == 0" v-perm="auths.bindUser" <el-button type="primary" v-if="scope.row.accountType == 0" v-perm="auths.bindUser"