<el-transfer
v-model="transferList.check"
class="transfer-box"
:titles="['人员列表', '已分配列表']"
:button-texts="['取消分配', '加入右侧']"
:data="transferList.list"
:props="{
key: 'id',
label: 'orgName'
}"
@check-change="treeChange">
</el-transfer>
<script>
transferList:{
list:[],
check:[],
},
treeChange(){
this.$http({
}).then((res)=>{
if(res.result){
let check = []
res.result.forEach(function(item){
if(item.checked){
check.push(item.id)
}
})
this.transferList.list = res.result
this.transferList.check = check
}else{
this.transferList.list = []
this.transferList.check = []
}
})
},
</script>
.transfer-box .el-transfer__buttons{
width: 124px;
padding: 0 8px;
}
.transfer-box .el-transfer__buttons .el-button{
width: 108px;
}
.transfer-box .el-transfer__buttons .el-button+.el-button{
margin-left: 0;
}
.transfer-box .el-transfer-panel{
width: 268px;
}