Skip to content

Commit

Permalink
✨ add role permission
Browse files Browse the repository at this point in the history
  • Loading branch information
tookbra committed Jun 9, 2019
1 parent 16bc349 commit 24f0a35
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/components/tableMenu/index.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<template>
<div class="table-menu">
<div class="table-menu-permission">
<a-button type="primary" icon="plus" @click="showAdd">新增</a-button>
<a-button type="danger" class="danger" icon="delete" @click="remove"
<a-button type="primary" class="btn" icon="plus" @click="showAdd"
>新增</a-button
>
<a-button type="danger" class="btn anger" icon="delete" @click="remove"
>删除</a-button
>
<a-button class="btn" icon="delete" @click="showPermission"
>权限设置</a-button
>
</div>
<div class="table-menu-nav">
<a-button shape="circle" icon="sync" @click="refresh" />
Expand Down Expand Up @@ -34,6 +39,9 @@ export default {
},
showAdd() {
this.$emit("showAdd");
},
showPermission() {
this.$emit("showPermission");
}
}
};
Expand All @@ -52,8 +60,10 @@ export default {
overflow: hidden;
margin-bottom: 5px;
.ant-btn-primary {
margin-right: 8px;
.table-menu-permission {
.btn {
margin-right: 8px;
}
}
.table-menu-nav {
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions src/mock/services/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const getResource = () => {
{
title: "数据字典",
key: "dict"
},
{
title: "系统配置",
key: "setting"
}
]
}
Expand Down
11 changes: 11 additions & 0 deletions src/views/system/role.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
@refresh="refresh"
@remove="batchRemove"
@showAdd="showAdd"
@showPermission="showPermission"
/>
<s-table
ref="table"
Expand Down Expand Up @@ -348,6 +349,16 @@ export default {
onCancel() {}
});
},
showPermission() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请选择需授权的数据");
return;
}
if (this.selectedRowKeys.length > 1) {
this.$message.warning("只能选择一条需授权的数据");
return;
}
},
showAdd() {
this.visible = true;
this.title = "新增";
Expand Down

0 comments on commit 24f0a35

Please sign in to comment.