|
@@ -8,7 +8,7 @@
|
|
|
<div class="tag" :style="isActive(2)" @click="toTab2">数据权限</div>
|
|
|
</div>
|
|
|
<div class="actions">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 1" @click="addRole" v-hasPermi="['system:levelPosition:addLevel']">添加</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini " v-show="tabIndex == 1" @click="addRole" v-hasPermi="['system:dataPermissions:addRole']">添加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 数据角色表格 -->
|
|
@@ -22,12 +22,18 @@
|
|
|
<el-table-column label="创建时间" prop="createTime" width="200" align="center" />
|
|
|
<el-table-column label="操作" class-name="small-padding fixed-width" width="300" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click.stop="updRole(scope.row)" v-hasPermi="['system:levelPosition:updLevel']">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delRole(scope.row)" v-hasPermi="['system:levelPosition:delLevel']">删除</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-remove" @click.stop="setRole(scope.row)" v-hasPermi="['system:levelPosition:upLevel']" v-if="scope.row.status == 0"
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click.stop="updRole(scope.row)" v-hasPermi="[' system:dataPermissions:updRole']">修改</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click.stop="delRole(scope.row)" v-hasPermi="['system:dataPermissions:delRole']">删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-remove" @click.stop="setRole(scope.row)" v-hasPermi="['system:dataPermissions:disabledRole']" v-if="scope.row.status == 0"
|
|
|
>禁用</el-button
|
|
|
>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-circle-plus" @click.stop="setRole(scope.row)" v-hasPermi="['system:levelPosition:upLevel']" v-if="scope.row.status == 1"
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
+ @click.stop="setRole(scope.row)"
|
|
|
+ v-hasPermi="['system:dataPermissions:disabledRole']"
|
|
|
+ v-if="scope.row.status == 1"
|
|
|
>启用</el-button
|
|
|
>
|
|
|
</template>
|
|
@@ -49,12 +55,12 @@
|
|
|
<el-table-column label="机构名称" prop="label" />
|
|
|
<el-table-column label="数据权限" class-name="small-padding fixed-width" width="300" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <input type="checkbox" :checked="authIds.includes(scope.row.id)" @change="checkboxClick(scope.row, $event)" />
|
|
|
+ <input type="checkbox" :checked="authIds.includes(scope.row.id)" @change="checkboxClick(scope.row, $event)" :disabled="!checkPermi(['system:dataPermissions:updAuth'])" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 编辑数据角色 -->
|
|
|
- <el-dialog title="编辑角色" :visible.sync="roleShow" width="30%" :close-on-press-escape="false" :close-on-click-modal="false">
|
|
|
+ <el-dialog :title="roleTitle" :visible.sync="roleShow" width="30%">
|
|
|
<el-form ref="roleForm" :model="roleForm" :rules="roleRules" label-width="100px">
|
|
|
<el-form-item label="名称" prop="dataRoleName">
|
|
|
<div style="width: 200px"><el-input v-model="roleForm.dataRoleName" placeholder="请输入名称" /></div>
|
|
@@ -75,6 +81,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { roleAdd, roleList, roleUpd, roleDel, roleStatus, authUpd, deptList } from '@/api/system/dataPermissions.js'
|
|
|
+ import { checkPermi } from '@/utils/permission'
|
|
|
export default {
|
|
|
name: 'dataPermissions',
|
|
|
data() {
|
|
@@ -109,7 +116,9 @@
|
|
|
//部门数据
|
|
|
deptList: [],
|
|
|
//选中的角色id
|
|
|
- dataRoleId: 0
|
|
|
+ dataRoleId: 0,
|
|
|
+ //弹窗标题
|
|
|
+ roleTitle: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -129,6 +138,7 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ checkPermi,
|
|
|
//动态选中样式
|
|
|
isActive(index) {
|
|
|
if (this.tabIndex != index) return {}
|
|
@@ -146,6 +156,9 @@
|
|
|
},
|
|
|
//获取角色数据
|
|
|
getRoleList() {
|
|
|
+ if (!checkPermi(['system:dataPermissions:listRole'])) {
|
|
|
+ return
|
|
|
+ }
|
|
|
roleList(this.roleParams).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.roleList = res.rows
|
|
@@ -156,6 +169,7 @@
|
|
|
//添加角色
|
|
|
addRole() {
|
|
|
this.roleShow = true
|
|
|
+ this.roleTitle = '角色添加'
|
|
|
},
|
|
|
//数据角色行选中
|
|
|
rowHandler(e) {
|
|
@@ -211,6 +225,7 @@
|
|
|
this.roleForm.dataRoleName = row.dataRoleName
|
|
|
this.roleForm.remark = row.remark
|
|
|
this.roleForm.dataRoleId = row.dataRoleId
|
|
|
+ this.roleTitle = '角色修改'
|
|
|
this.roleShow = true
|
|
|
},
|
|
|
//删除角色
|