修复小组权限bug:文件名称显示过程处理,添加成员角色重复;小组权限全选按钮相关内容调整
This commit is contained in:
parent
d0220d9c2b
commit
30ab7ac739
@ -133,7 +133,7 @@
|
|||||||
label=""
|
label=""
|
||||||
align="center">
|
align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="width: 30px;display: inline-block;">
|
<div style="/*width: 30px;display: inline-block;*/">
|
||||||
<div class="operate-icon-display">
|
<div class="operate-icon-display">
|
||||||
<el-tooltip v-if="!scope.row.isOlderVersion && scope.row.hasUserPerm" content="权限复制" placement="bottom" :hide-after=2000>
|
<el-tooltip v-if="!scope.row.isOlderVersion && scope.row.hasUserPerm" content="权限复制" placement="bottom" :hide-after=2000>
|
||||||
<i class="awsui-iconfont" style="cursor: pointer;padding-right: 10px;" @click="copyUser(scope.row.userId)"></i>
|
<i class="awsui-iconfont" style="cursor: pointer;padding-right: 10px;" @click="copyUser(scope.row.userId)"></i>
|
||||||
|
|||||||
@ -173,7 +173,9 @@
|
|||||||
if (!that.isOlderVersion){
|
if (!that.isOlderVersion){
|
||||||
let nodes = this.$refs.tree.getCheckedNodes();
|
let nodes = this.$refs.tree.getCheckedNodes();
|
||||||
nodes.forEach((item)=>{
|
nodes.forEach((item)=>{
|
||||||
that.form.userArr.push(item.id);
|
if (!that.form.userArr.includes(item.id)){
|
||||||
|
that.form.userArr.push(item.id);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (that.form.userArr.length == 0) {
|
if (that.form.userArr.length == 0) {
|
||||||
|
|||||||
@ -44,8 +44,7 @@
|
|||||||
<el-checkbox v-model="checkAllProcess" @change="checkAllProcessChange">全选</el-checkbox>
|
<el-checkbox v-model="checkAllProcess" @change="checkAllProcessChange">全选</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="actionGroup">
|
<div class="actionGroup">
|
||||||
<el-checkbox v-model="checkAllUpdate" @change="checkAllUpdateChange"
|
<el-checkbox v-model="checkAllUpdate" @change="checkAllUpdateChange">编辑</el-checkbox>
|
||||||
:disabled="checkAllDelete || checkAllVersion ">编辑</el-checkbox>
|
|
||||||
<el-checkbox v-model="checkAllDelete" @change="checkAllDeleteChange">删除</el-checkbox>
|
<el-checkbox v-model="checkAllDelete" @change="checkAllDeleteChange">删除</el-checkbox>
|
||||||
<el-checkbox v-model="checkAllVersion" @change="checkAllVersionChange">版本管理</el-checkbox>
|
<el-checkbox v-model="checkAllVersion" @change="checkAllVersionChange">版本管理</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@ -70,11 +69,11 @@
|
|||||||
:load="loadNode">
|
:load="loadNode">
|
||||||
<span slot-scope="{node, data}" style="display: flex;width: 100%">
|
<span slot-scope="{node, data}" style="display: flex;width: 100%">
|
||||||
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
<i class="awsui-iconfont tree-content-icon tree-content-icon-padding" :style="{'color': node.data.icon.color}" v-html="node.data.icon.icon"></i>
|
||||||
<span>{{node.label}}</span>
|
<span style="max-width:150px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">{{node.label}}</span>
|
||||||
<span v-if="node.level > 1" class="action-checkBox" style="flex: 1;text-align: right" @click="handleCheckedActionChange(node)">
|
<span v-if="node.level > 1" class="action-checkBox" style="flex: 1;text-align: right" @click="handleCheckedActionChange(node)">
|
||||||
<el-checkbox-group v-model="node.data.dataActionPerm">
|
<el-checkbox-group v-model="node.data.dataActionPerm">
|
||||||
<el-checkbox v-for="dataAction in node.data.dataActionPermOpts" :label="dataAction.label" :key="dataAction.label"
|
<el-checkbox v-for="dataAction in node.data.dataActionPermOpts" :label="dataAction.label" :key="dataAction.label"
|
||||||
:disabled="!node.checked || dataAction.disabled" @change="checkBoxDisabledHandle(node.data,dataAction)" >{{dataAction.value}}</el-checkbox>
|
@change="checkBoxChangeHandle(node.data,dataAction)" >{{dataAction.value}}</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@ -576,13 +575,6 @@
|
|||||||
Object.assign(item,{dataActionPermOpts: that.dataActionPermOpts})
|
Object.assign(item,{dataActionPermOpts: that.dataActionPermOpts})
|
||||||
if (that.dataActionPerm[item.versionId] != undefined){
|
if (that.dataActionPerm[item.versionId] != undefined){
|
||||||
Object.assign(item,{dataActionPerm:that.dataActionPerm[item.versionId]})
|
Object.assign(item,{dataActionPerm:that.dataActionPerm[item.versionId]})
|
||||||
if (that.dataActionPerm[item.versionId].includes('d') || that.dataActionPerm[item.versionId].includes('v')){
|
|
||||||
item.dataActionPermOpts.forEach(item=>{
|
|
||||||
if (item.label == 'w'){
|
|
||||||
item.disabled = true;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else {
|
}else {
|
||||||
Object.assign(item,{dataActionPerm:[]})
|
Object.assign(item,{dataActionPerm:[]})
|
||||||
}
|
}
|
||||||
@ -621,26 +613,26 @@
|
|||||||
},100)
|
},100)
|
||||||
|
|
||||||
},
|
},
|
||||||
checkBoxDisabledHandle(data,dataAction){
|
checkBoxChangeHandle(data,dataAction){
|
||||||
let dataActionPerm = data.dataActionPerm;
|
let dataActionPerm = data.dataActionPerm;
|
||||||
let actionOpts = data.dataActionPermOpts;
|
|
||||||
|
|
||||||
|
//选中删除与版本控制
|
||||||
let flag = dataActionPerm.includes('d') || dataActionPerm.includes('v')
|
let flag = dataActionPerm.includes('d') || dataActionPerm.includes('v')
|
||||||
if ((dataAction.label == 'd' || dataAction.label == 'v') && flag){
|
if ((dataAction.label == 'd' || dataAction.label == 'v') && flag){
|
||||||
if (!dataActionPerm.includes('w')){
|
if (!dataActionPerm.includes('w')){
|
||||||
dataActionPerm.push('w');
|
dataActionPerm.push('w');
|
||||||
}
|
}
|
||||||
actionOpts.forEach(item=>{
|
}
|
||||||
if (item.label == 'w'){
|
|
||||||
item.disabled = true;
|
//将w勾选掉后处理
|
||||||
}
|
flag = dataActionPerm.includes('w');
|
||||||
})
|
if(dataAction.label == 'w' && !flag){
|
||||||
}else {
|
if (dataActionPerm.includes('d')){
|
||||||
actionOpts.forEach(item=>{
|
this.removeArr(dataActionPerm,'d')
|
||||||
if (item.label == 'w'){
|
}
|
||||||
item.disabled = false;
|
if (dataActionPerm.includes('v')){
|
||||||
}
|
this.removeArr(dataActionPerm,'v')
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkAllProcessChange(value){
|
checkAllProcessChange(value){
|
||||||
@ -690,33 +682,41 @@
|
|||||||
let checkedNodes = this.$refs.tree.getCheckedNodes();
|
let checkedNodes = this.$refs.tree.getCheckedNodes();
|
||||||
|
|
||||||
if (flag){
|
if (flag){
|
||||||
|
//选中
|
||||||
Object.keys(actionPerm).forEach(key=>{
|
Object.keys(actionPerm).forEach(key=>{
|
||||||
this.pushArr(actionPerm[key],str);
|
this.pushArr(actionPerm[key],str);
|
||||||
if (str == 'd' || str == 'v'){
|
if (str == 'd' || str == 'v'){
|
||||||
this.pushArr(actionPerm[key],'w');
|
this.pushArr(actionPerm[key],'w');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//el 节点处理
|
||||||
checkedNodes.forEach(node=>{
|
checkedNodes.forEach(node=>{
|
||||||
this.pushArr(node.dataActionPerm,str);
|
this.pushArr(node.dataActionPerm,str);
|
||||||
if (str == 'd' || str == 'v'){
|
if (str == 'd' || str == 'v'){
|
||||||
this.pushArr(node.dataActionPerm,'w');
|
this.checkBoxChangeHandle(node,{label:str})
|
||||||
this.checkBoxDisabledHandle(node,{label:str})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else {
|
}else {
|
||||||
|
//去掉勾选
|
||||||
Object.keys(actionPerm).forEach(key=>{
|
Object.keys(actionPerm).forEach(key=>{
|
||||||
this.removeArr(actionPerm[key],str);
|
this.removeArr(actionPerm[key],str);
|
||||||
|
if (str == 'w'){
|
||||||
|
this.removeArr(actionPerm[key],'d');
|
||||||
|
this.removeArr(actionPerm[key],'v');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
checkedNodes.forEach(node=>{
|
checkedNodes.forEach(node=>{
|
||||||
|
this.checkBoxChangeHandle(node,{label:str})
|
||||||
this.removeArr(node.dataActionPerm,str)
|
this.removeArr(node.dataActionPerm,str)
|
||||||
if (str == 'd' || str == 'v'){
|
|
||||||
this.checkBoxDisabledHandle(node,{label:str})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//重新计算全选编辑
|
//重新计算全选编辑
|
||||||
let wPermNum = this.getActionPermNum("w");
|
let wPermNum = this.getActionPermNum("w");
|
||||||
this.checkAllUpdate = wPermNum == this.teamPermFileSize;
|
this.checkAllUpdate = wPermNum == this.teamPermFileSize;
|
||||||
|
let dPermNum = this.getActionPermNum("d");
|
||||||
|
this.checkAllDelete = dPermNum == this.teamPermFileSize;
|
||||||
|
let vPermNum = this.getActionPermNum("v");
|
||||||
|
this.checkAllVersion = vPermNum == this.teamPermFileSize;
|
||||||
},
|
},
|
||||||
pushArr(arr,str){
|
pushArr(arr,str){
|
||||||
if (!arr.includes(str)){
|
if (!arr.includes(str)){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user