Browse Source

权限管理调整

dev
jiangyy 5 years ago
parent
commit
e693a7a14a
  1. 113
      epmet-oper-web/src/views/modules/customer/customize/roleList.vue

113
epmet-oper-web/src/views/modules/customer/customize/roleList.vue

@ -3,69 +3,96 @@
<el-card class="flex1"> <el-card class="flex1">
<div class="now-name"> <div class="now-name">
当前客户: {{customerName}} 当前客户: {{customerName}}
<el-button type="primary" size="small" @click="handleSaveSort">保存顺序</el-button> <el-button type="primary"
size="small"
@click="handleSaveSort">保存顺序</el-button>
</div> </div>
<el-table ref="roleTable" v-loading="loading1" :data="roleList" row-key="roleId" border style="width: 100%"> <el-table ref="roleTable"
<el-table-column type="index" width="50"></el-table-column> v-loading="loading1"
:data="roleList"
row-key="roleId"
border
style="width: 100%">
<el-table-column type="index"
width="50"></el-table-column>
<!-- <el-table-column prop="roleId" label="角色ID"></el-table-column> --> <!-- <el-table-column prop="roleId" label="角色ID"></el-table-column> -->
<el-table-column prop="roleName" label="角色名称" width="160"> <el-table-column prop="roleName"
label="角色名称"
width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="scope.row.isEdit" v-model="scope.row.roleName" clearable> <el-input v-if="scope.row.isEdit"
</el-input> v-model="scope.row.roleName"
clearable>
</el-input>
<span v-else>{{scope.row.constName}}</span> <span v-else>{{scope.row.constName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!funcShow" prop="roleKey" label="角色Key"></el-table-column> <el-table-column v-if="!funcShow"
prop="roleKey"
label="角色Key"></el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="mini" @click="toOperationConfig(scope.row.roleId, scope.row.roleName)">功能权限</el-button> <el-button type="primary"
<span v-if="scope.row.isEdit" style="display: inline-block; margin-left: 10px;"> size="mini"
<el-button type="primary" size="small" @click="handleSaveChange(scope.row)">保存</el-button> @click="toOperationConfig(scope.row.roleId, scope.row.roleName)">功能权限</el-button>
<el-button size="small" @click="scope.row.isEdit=false">取消</el-button> <span v-if="scope.row.isEdit"
style="display: inline-block; margin-left: 10px;">
<el-button type="primary"
size="small"
@click="handleSaveChange(scope.row)">保存</el-button>
<el-button size="small"
@click="scope.row.isEdit=false">取消</el-button>
</span> </span>
<el-button v-else type="primary" size="mini" @click="handleChangeName(scope.row)">修改名称</el-button> <el-button v-else
type="primary"
size="mini"
@click="handleChangeName(scope.row)">修改名称</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-card v-show="funcShow" style="flex: 1; margin: 0 10px;"> <el-card v-show="funcShow"
style="flex: 1; margin: 0 10px;">
<div class="now-name">当前角色: {{roleName}}</div> <div class="now-name">当前角色: {{roleName}}</div>
<el-table <el-table v-loading="loading2"
v-loading="loading2" max-height="580"
max-height="580" ref="opeTable"
ref="opeTable" :data="opeList"
:data="opeList" border
border style="width: 100%"
style="width: 100%" @select="handleSelectionChange">
@select="handleSelectionChange" <el-table-column type="selection"
> width="55"></el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<!-- <el-table-column prop="operationKey" label="操作Key"></el-table-column> --> <!-- <el-table-column prop="operationKey" label="操作Key"></el-table-column> -->
<el-table-column prop="operationName" label="操作名称"></el-table-column> <el-table-column prop="operationName"
label="操作名称"></el-table-column>
<!-- <el-table-column prop="brief" label="简介"></el-table-column> --> <!-- <el-table-column prop="brief" label="简介"></el-table-column> -->
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" size="small" @click="toScopeConfig(scope.row.operationKey, scope.row.operationName)">权限配置</el-button> <el-button type="primary"
size="small"
@click="toScopeConfig(scope.row.operationKey, scope.row.operationName)">权限配置</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-card v-show="roleShow" style="width: 250px;"> <el-card v-show="roleShow"
style="width: 250px;">
<div class="now-name">当前功能: {{funcName}}</div> <div class="now-name">当前功能: {{funcName}}</div>
<div> <div>
<el-row :gutter="12"> <el-row :gutter="12">
<el-col v-loading="loading3"> <el-col v-loading="loading3">
<el-card shadow="hover"> <el-card shadow="hover">
<el-checkbox-group class="t" v-model="checkedScopes" @change="roleChange"> <el-checkbox-group class="t"
<el-checkbox v-model="checkedScopes"
v-for="scope in scopeOptions" @change="roleChange">
:label="scope.scopeKey" <el-checkbox v-for="scope in scopeOptions"
:key="scope.scopeKey" :label="scope.scopeKey"
>{{scope.scopeName}}</el-checkbox> :key="scope.scopeKey">{{scope.scopeName}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-card> </el-card>
</el-col> </el-col>
<!-- <el-col :span="8"> <!-- <el-col :span="8">
<el-card shadow="hover"> <el-card shadow="hover">
<el-checkbox-group class="t" v-model="checkedSettings"> <el-checkbox-group class="t" v-model="checkedSettings">
<el-checkbox <el-checkbox
@ -77,7 +104,7 @@
</el-checkbox-group> </el-checkbox-group>
</el-card> </el-card>
</el-col> --> </el-col> -->
</el-row> </el-row>
</div> </div>
</el-card> </el-card>
</div> </div>
@ -157,7 +184,7 @@ export default {
this.loading2 = true this.loading2 = true
this.$http.post('/gov/access/config/roleopes/' + roleId).then((resp) => { this.$http.post('/gov/access/config/roleopes/' + roleId).then((resp) => {
this.opeList = resp.data.data this.opeList = resp.data.data
this.$nextTick(function () { this.$nextTick(function() {
this.defaultCheck() // this.defaultCheck() //
}) })
setTimeout(() => { setTimeout(() => {
@ -211,7 +238,8 @@ export default {
saveOperations4Role (val) { saveOperations4Role (val) {
let param = { let param = {
roleId: this.roleId, roleId: this.roleId,
opes: val opes: val,
customerId: this.customerId
} }
this.$http.post('/gov/access/config/saveroleopes', param).then( this.$http.post('/gov/access/config/saveroleopes', param).then(
resp => { resp => {
@ -228,7 +256,8 @@ export default {
roleId: this.roleId, roleId: this.roleId,
operationKey: this.operationKey, operationKey: this.operationKey,
scopeKeys: val, scopeKeys: val,
settingKeys: this.checkedSettings settingKeys: this.checkedSettings,
customerId: this.customerId
} }
this.$http.post('/gov/access/config/saveconfig', param).then( this.$http.post('/gov/access/config/saveconfig', param).then(

Loading…
Cancel
Save