clay : 任意节点退回完成 #34
|
|
@ -127,6 +127,7 @@ export default {
|
|||
},
|
||||
getList() {
|
||||
getUserTree(this.radio, this.chooseId).then(res => {
|
||||
console.log('人员', res.data)
|
||||
if (res.data) {
|
||||
if (this.selectItem.type === -1 || this.selectItem.type === -2) {
|
||||
this.dataList = this.setData(res.data)
|
||||
|
|
@ -141,7 +142,6 @@ export default {
|
|||
setData(source) {
|
||||
for (let item of source) {
|
||||
this.$set(item, "value", this.selectItem.value + "-" + item.id)
|
||||
this.$set(item, "children", [])
|
||||
}
|
||||
return source;
|
||||
},
|
||||
|
|
@ -162,20 +162,19 @@ export default {
|
|||
if (item.type !== 0) {
|
||||
this.chooseId = item.id
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
if (!item.children) {
|
||||
if (this.multiple) {
|
||||
//不添加重复的数据到右边
|
||||
for (let i = 0; i < this.selectList.length; i++) {
|
||||
if (this.selectList[i].id === item.id) {
|
||||
this.selectList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
if (this.multiple) {
|
||||
//不添加重复的数据到右边
|
||||
for (let i = 0; i < this.selectList.length; i++) {
|
||||
if (this.selectList[i].id === item.id) {
|
||||
this.selectList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
this.selectList.push(item);
|
||||
} else {
|
||||
this.selectList = [item];
|
||||
}
|
||||
this.selectList.push(item);
|
||||
} else {
|
||||
this.selectList = [item];
|
||||
}
|
||||
// this._value = this.selectList
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,18 +9,21 @@
|
|||
placement="top">
|
||||
<el-card>
|
||||
<div style="display: flex;">
|
||||
<div v-for="(user,index) in operation.userInfo" :key="index">
|
||||
<el-avatar style="margin-right: 5px;" size="large"
|
||||
:src="user.avatar"></el-avatar>
|
||||
<div v-if="!$slots.dot && operation.userInfo.length > 1"
|
||||
class="el-timeline-item__node" :style="{
|
||||
<div v-for="(user,index) in operation.userInfo" :key="index" class="avatar_name">
|
||||
<el-avatar size="large"
|
||||
:src="user.avatar"></el-avatar>
|
||||
<div v-if="!$slots.dot && operation.userInfo.length > 1"
|
||||
class="el-timeline-item__node avatar_icon" :style="{
|
||||
backgroundColor: user.color
|
||||
}">
|
||||
<i v-if="user.icon"
|
||||
class="el-timeline-item__icon"
|
||||
:class="user.icon"
|
||||
></i>
|
||||
</div>
|
||||
<i v-if="user.icon"
|
||||
class="el-timeline-item__icon"
|
||||
:class="user.icon"
|
||||
></i>
|
||||
</div>
|
||||
<el-tooltip effect="dark" :content="user.name" placement="bottom-start">
|
||||
<span class="username">{{ user.name }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div style="margin-left: 10px;">
|
||||
<div style="color: #c0bebe">{{ operation.operationName }}</div>
|
||||
|
|
@ -230,5 +233,25 @@ export default {
|
|||
/deep/ .el-card__body, .el-main {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.avatar_name{
|
||||
width: 45px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.avatar_icon{
|
||||
position: absolute;
|
||||
bottom: 16px;
|
||||
right: -2px;
|
||||
}
|
||||
.username{
|
||||
width: 45px;
|
||||
padding-top: 2px;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue