修复小组权限bug:文件名称显示过程处理,添加成员角色重复;小组权限全选按钮相关内容调整
This commit is contained in:
parent
d0220d9c2b
commit
30ab7ac739
@ -133,7 +133,7 @@
|
||||
label=""
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<div style="width: 30px;display: inline-block;">
|
||||
<div style="/*width: 30px;display: inline-block;*/">
|
||||
<div class="operate-icon-display">
|
||||
<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>
|
||||
|
||||
@ -173,7 +173,9 @@
|
||||
if (!that.isOlderVersion){
|
||||
let nodes = this.$refs.tree.getCheckedNodes();
|
||||
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) {
|
||||
|
||||
@ -44,8 +44,7 @@
|
||||
<el-checkbox v-model="checkAllProcess" @change="checkAllProcessChange">全选</el-checkbox>
|
||||
</div>
|
||||
<div class="actionGroup">
|
||||
<el-checkbox v-model="checkAllUpdate" @change="checkAllUpdateChange"
|
||||
:disabled="checkAllDelete || checkAllVersion ">编辑</el-checkbox>
|
||||
<el-checkbox v-model="checkAllUpdate" @change="checkAllUpdateChange">编辑</el-checkbox>
|
||||
<el-checkbox v-model="checkAllDelete" @change="checkAllDeleteChange">删除</el-checkbox>
|
||||
<el-checkbox v-model="checkAllVersion" @change="checkAllVersionChange">版本管理</el-checkbox>
|
||||
</div>
|
||||
@ -70,11 +69,11 @@
|
||||
:load="loadNode">
|
||||
<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>
|
||||
<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)">
|
||||
<el-checkbox-group v-model="node.data.dataActionPerm">
|
||||
<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>
|
||||
</span>
|
||||
</span>
|
||||
@ -576,13 +575,6 @@
|
||||
Object.assign(item,{dataActionPermOpts: that.dataActionPermOpts})
|
||||
if (that.dataActionPerm[item.versionId] != undefined){
|
||||
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 {
|
||||
Object.assign(item,{dataActionPerm:[]})
|
||||
}
|
||||
@ -621,26 +613,26 @@
|
||||
},100)
|
||||
|
||||
},
|
||||
checkBoxDisabledHandle(data,dataAction){
|
||||
checkBoxChangeHandle(data,dataAction){
|
||||
let dataActionPerm = data.dataActionPerm;
|
||||
let actionOpts = data.dataActionPermOpts;
|
||||
|
||||
//选中删除与版本控制
|
||||
let flag = dataActionPerm.includes('d') || dataActionPerm.includes('v')
|
||||
if ((dataAction.label == 'd' || dataAction.label == 'v') && flag){
|
||||
if (!dataActionPerm.includes('w')){
|
||||
dataActionPerm.push('w');
|
||||
}
|
||||
actionOpts.forEach(item=>{
|
||||
if (item.label == 'w'){
|
||||
item.disabled = true;
|
||||
}
|
||||
})
|
||||
}else {
|
||||
actionOpts.forEach(item=>{
|
||||
if (item.label == 'w'){
|
||||
item.disabled = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//将w勾选掉后处理
|
||||
flag = dataActionPerm.includes('w');
|
||||
if(dataAction.label == 'w' && !flag){
|
||||
if (dataActionPerm.includes('d')){
|
||||
this.removeArr(dataActionPerm,'d')
|
||||
}
|
||||
if (dataActionPerm.includes('v')){
|
||||
this.removeArr(dataActionPerm,'v')
|
||||
}
|
||||
}
|
||||
},
|
||||
checkAllProcessChange(value){
|
||||
@ -690,33 +682,41 @@
|
||||
let checkedNodes = this.$refs.tree.getCheckedNodes();
|
||||
|
||||
if (flag){
|
||||
//选中
|
||||
Object.keys(actionPerm).forEach(key=>{
|
||||
this.pushArr(actionPerm[key],str);
|
||||
if (str == 'd' || str == 'v'){
|
||||
this.pushArr(actionPerm[key],'w');
|
||||
}
|
||||
})
|
||||
//el 节点处理
|
||||
checkedNodes.forEach(node=>{
|
||||
this.pushArr(node.dataActionPerm,str);
|
||||
if (str == 'd' || str == 'v'){
|
||||
this.pushArr(node.dataActionPerm,'w');
|
||||
this.checkBoxDisabledHandle(node,{label:str})
|
||||
this.checkBoxChangeHandle(node,{label:str})
|
||||
}
|
||||
})
|
||||
}else {
|
||||
//去掉勾选
|
||||
Object.keys(actionPerm).forEach(key=>{
|
||||
this.removeArr(actionPerm[key],str);
|
||||
if (str == 'w'){
|
||||
this.removeArr(actionPerm[key],'d');
|
||||
this.removeArr(actionPerm[key],'v');
|
||||
}
|
||||
})
|
||||
checkedNodes.forEach(node=>{
|
||||
this.checkBoxChangeHandle(node,{label:str})
|
||||
this.removeArr(node.dataActionPerm,str)
|
||||
if (str == 'd' || str == 'v'){
|
||||
this.checkBoxDisabledHandle(node,{label:str})
|
||||
}
|
||||
})
|
||||
}
|
||||
//重新计算全选编辑
|
||||
let wPermNum = this.getActionPermNum("w");
|
||||
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){
|
||||
if (!arr.includes(str)){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user