增加按钮权限

This commit is contained in:
smallchill 2019-02-15 16:24:50 +08:00
parent 6d5bbcaf9c
commit 792ff748c7
3 changed files with 36 additions and 0 deletions

View File

@ -4,6 +4,7 @@
:data="data" :data="data"
ref="crud" ref="crud"
v-model="form" v-model="form"
:permission="permissionList"
:before-open="beforeOpen" :before-open="beforeOpen"
:page="page" :page="page"
@row-del="rowDel" @row-del="rowDel"
@ -17,6 +18,7 @@
<el-button type="danger" <el-button type="danger"
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.dept_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete"> </el-button>
</template> </template>
@ -41,6 +43,7 @@ import {
getDept, getDept,
getDeptTree getDeptTree
} from "@/api/system/dept"; } from "@/api/system/dept";
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return { return {
@ -89,6 +92,15 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.dept_add,
viewBtn: this.permission.dept_view,
delBtn: this.permission.dept_delete,
editBtn: this.permission.dept_edit
};
},
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach(ele => { this.selectionList.forEach(ele => {

View File

@ -4,6 +4,7 @@
:data="data" :data="data"
ref="crud" ref="crud"
v-model="form" v-model="form"
:permission="permissionList"
:before-open="beforeOpen" :before-open="beforeOpen"
:page="page" :page="page"
@row-del="rowDel" @row-del="rowDel"
@ -17,6 +18,7 @@
<el-button type="danger" <el-button type="danger"
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.dict_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete"> </el-button>
</template> </template>
@ -41,6 +43,7 @@ import {
getDict, getDict,
getDictTree getDictTree
} from "@/api/system/dict"; } from "@/api/system/dict";
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return { return {
@ -92,6 +95,15 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.dict_add,
viewBtn: this.permission.dict_view,
delBtn: this.permission.dict_delete,
editBtn: this.permission.dict_edit
};
},
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach(ele => { this.selectionList.forEach(ele => {

View File

@ -4,6 +4,7 @@
:data="data" :data="data"
ref="crud" ref="crud"
v-model="form" v-model="form"
:permission="permissionList"
:before-open="beforeOpen" :before-open="beforeOpen"
:page="page" :page="page"
@row-del="rowDel" @row-del="rowDel"
@ -17,6 +18,7 @@
<el-button type="danger" <el-button type="danger"
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.menu_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete"> </el-button>
</template> </template>
@ -34,6 +36,7 @@
<script> <script>
import { getList, remove, update, add, getMenu } from "@/api/system/menu"; import { getList, remove, update, add, getMenu } from "@/api/system/menu";
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return { return {
@ -137,6 +140,15 @@ export default {
}, },
computed: { computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.menu_add,
viewBtn: this.permission.menu_view,
delBtn: this.permission.menu_delete,
editBtn: this.permission.menu_edit
};
},
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach(ele => { this.selectionList.forEach(ele => {