|
@@ -4,8 +4,8 @@
|
|
|
<div class="grid-content treeDom roleLeft">
|
|
|
<div style="" class="mb-20 addBox">
|
|
|
<b>角色类型</b>
|
|
|
- <el-button type="success" @click="addRole()">新增</el-button>
|
|
|
- <el-button type="primary" @click="editRole()">修改</el-button>
|
|
|
+ <el-button type="success" @click="addRole()" :disabled="store.state.authorities.indexOf('新增')==-1">新增</el-button>
|
|
|
+ <el-button type="primary" @click="editRole()" :disabled="store.state.authorities.indexOf('修改')==-1">修改</el-button>
|
|
|
</div>
|
|
|
<el-radio-group v-model="radio1">
|
|
|
<el-radio-button
|
|
@@ -16,7 +16,7 @@
|
|
|
>
|
|
|
<img src="@/assets/images/userIcon.svg" />
|
|
|
{{ item.roleName }}
|
|
|
- <i class="el-icon-delete" @click="deleteRoleItem(item)"></i>
|
|
|
+ <i v-if="store.state.authorities.indexOf('删除')!=-1" class="el-icon-delete" @click="deleteRoleItem(item)"></i>
|
|
|
</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
@@ -55,10 +55,12 @@ import { ElMessage } from 'element-plus'
|
|
|
|
|
|
import roleInfoCom from './roleInfoCom'
|
|
|
import addRoleCom from './addRoleCom'
|
|
|
+import { useStore } from 'vuex'
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: { roleInfoCom, addRoleCom },
|
|
|
setup() {
|
|
|
+ const store = useStore()
|
|
|
const radio1 = ref('1')
|
|
|
const showDialog = ref(false)
|
|
|
const roleData = ref([])
|
|
@@ -128,13 +130,11 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const listTabsChange = (value, item) => {
|
|
|
- // console.log(value)
|
|
|
radio1.value = value
|
|
|
objItem.value = item
|
|
|
roleMenuTreeselect()
|
|
|
getAuthorityTable()
|
|
|
|
|
|
- // console.log(radio1.value)
|
|
|
}
|
|
|
|
|
|
// 表格树结构渲染
|
|
@@ -184,9 +184,6 @@ export default defineComponent({
|
|
|
api.getAuthorityTable({roleId:radio1.value}).then((requset) => {
|
|
|
if (requset.code == 200) {
|
|
|
menuData2.value = requset.data
|
|
|
- console.log( '父组件中menuData2.value')
|
|
|
- console.log( menuData2.value)
|
|
|
-
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
@@ -226,10 +223,18 @@ export default defineComponent({
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
+
|
|
|
roleList()
|
|
|
roleMenuTreeselect()
|
|
|
getAuthorityTable()
|
|
|
+
|
|
|
+ console.log('store.state.authorities')
|
|
|
+ console.log(store.state.authorities)
|
|
|
+ console.log(111)
|
|
|
+ console.log(store.state.authorities.indexOf('删除1'))
|
|
|
})
|
|
|
|
|
|
return {
|
|
@@ -251,6 +256,7 @@ export default defineComponent({
|
|
|
closeDialog,
|
|
|
objItem,
|
|
|
getTreeData2,
|
|
|
+ store
|
|
|
}
|
|
|
},
|
|
|
})
|