<template>
|
<div class="role-peimission">
|
<div class="btn-pager">
|
<el-button @click="addBtnClick" type="primary" size="small">新增权限</el-button>
|
</div>
|
<TableCommonView ref="tableListRef" :select-box="false" :table-list="tableList">
|
<template slot="tableButton">
|
<el-table-column label="操作" width="320">
|
<template slot-scope="scope">
|
<el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">复制</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">设置成员</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">字段权限</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">上移</el-button>
|
<el-button @click="handleClick(scope.row)" type="text" size="small">下移</el-button>
|
</template>
|
</el-table-column>
|
</template>
|
</TableCommonView>
|
<!-- 新建/编辑 -->
|
<AddRolePermssionDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
|
</div>
|
</template>
|
|
<script>
|
import AddRolePermssionDialog from "@/views/backgroundConfig/rolePermssion/AddRolePermssionDialog"
|
|
export default {
|
name: "RoleOeimission",
|
props: {},
|
components: {
|
AddRolePermssionDialog
|
},
|
computed: {
|
searchCommonHeight() {
|
return this.$refs.searchCommonView.offsetHeight
|
}
|
},
|
data() {
|
return {
|
tableList: {},
|
editConfig: {
|
visible: false,
|
title: "新增权限",
|
infomation: {}
|
}
|
}
|
},
|
created() {
|
this.setTable()
|
},
|
methods: {
|
setTable() {
|
this.tableList = {
|
tableInfomation: [
|
{
|
number: "1",
|
authorityName: "总经理",
|
notes: ""
|
}
|
],
|
tableColumn: [
|
{ label: "#", prop: "number", width: 80 },
|
{ label: "权限名称", prop: "authorityName", width: 160 },
|
{ label: "备注", prop: "notes" }
|
]
|
}
|
this.searchOptions = []
|
for (let i = 0; i < this.tableList.tableColumn.length; i++) {
|
const label = this.tableList.tableColumn[i].label
|
this.searchOptions.push({ value: (i + 1).toString(), label: label })
|
}
|
},
|
// 新建
|
addBtnClick() {
|
this.editConfig.visible = true
|
this.editConfig.title = "新建"
|
this.editConfig.infomation = {}
|
},
|
// 编辑
|
handleClick(row) {
|
console.log(row)
|
this.editConfig.visible = true
|
this.editConfig.title = "编辑"
|
this.editConfig.infomation = { ...row }
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.role-peimission {
|
.btn-pager {
|
margin: 0px 20px 20px;
|
float: right;
|
}
|
}
|
</style>
|