fix 编辑角色 不显示权限设置项

This commit is contained in:
oldHome 2025-06-27 19:57:32 +08:00
parent 3a239ba326
commit 9b59058724
2 changed files with 7 additions and 6 deletions

View File

@ -336,7 +336,7 @@ const routes = [
meta: {
title: '单位管理',
icon: 'iconfont icon-a-shanghu_choose2x1',
roles: ['master', 'admin'],
roles: ['master', 'admin', 'editor'],
tapName: 'admin'
},
children: [
@ -346,7 +346,7 @@ const routes = [
meta: {
title: '单位设置',
icon: 'iconfont icon-dianpuguanli',
roles: ['master', 'admin'],
roles: ['master', 'admin', 'editor'],
tapName: 'admin'
}
},
@ -400,7 +400,7 @@ const routes = [
meta: {
title: '账户编辑',
icon: 'iconfont icon-huizhi',
roles: ['master', 'admin'],
roles: ['master', 'admin', 'editor'],
tapName: 'admin',
hidden: true
}

View File

@ -34,7 +34,7 @@
</template>
</el-upload>
</el-form-item>
<el-form-item label="权限设置">
<el-form-item v-if="$store.state.user.power !== 'editor'" label="权限设置">
<el-radio-group v-model="form.role">
<el-radio label="admin">管理员</el-radio>
<el-radio label="editor">编辑</el-radio>
@ -77,7 +77,7 @@ export default {
upFile: '',
oldFile: '',
pwd: '',
role: 'admin'
role: ''
},
adminId: this.$route.params.id, // get id
pageState: 'add', //
@ -121,6 +121,7 @@ export default {
this.form.name = data.name
this.form.uname = data.uname
this.form.oldFile = data.oldFile
this.form.role = data.role
if (Object.keys(data).length === 0) {
this.$message.warning('清空表单')
}
@ -136,7 +137,7 @@ export default {
const data = {
name: this.admin.name,
uname: this.admin.uname,
role: this.admin.role === 5 ? 'admin' : 'editor',
role: (Number(this.admin.role) === 5 || Number(this.admin.role) === 4) ? 'admin' : 'editor',
oldFile: this.admin.photo,
shop_id: this.admin.shop_id
}