perf: 我的工作汇报列表显示汇报对象

This commit is contained in:
kuaifan 2023-01-31 14:07:42 +08:00
parent b7ac923d36
commit d96e9f4daa
2 changed files with 51 additions and 3 deletions

View File

@ -79,20 +79,51 @@ export default {
columns: [{
title: this.$L("名称"),
key: 'title',
sortable: true,
minWidth: 120,
}, {
title: this.$L("类型"),
key: 'type',
align: 'center',
sortable: true,
width: 90,
}, {
title: this.$L("汇报时间"),
key: 'created_at',
align: 'center',
sortable: true,
width: 180,
}, {
title: this.$L("汇报对象"),
key: 'receives',
align: 'center',
width: 90,
render: (h, {row}) => {
if (row.receives.length === 0) {
return h('div', '-')
}
const array = [];
if (row.receives.length <= 2) {
row.receives.some(userid => {
array.push(h('UserAvatar', {
props: {
size: 22,
userid: userid,
}
}))
})
} else {
array.push(h('UserAvatar', {
props: {
size: 22,
userid: row.receives[0],
}
}))
array.push(h('div', {
class: "more-avatar"
}, `+${row.receives.length - 1}`))
}
return h('div', {
class: "report-table-avatar"
}, array)
}
}, {
title: this.$L("操作"),
align: 'center',

View File

@ -42,6 +42,21 @@
}
}
.report-table-avatar {
display: flex;
align-items: center;
justify-content: center;
.common-avatar {
margin: 0 1px;
}
.more-avatar {
padding-left: 3px;
font-size: 12px;
}
}
.report-detail {
display: flex;
flex-direction: column;
@ -152,6 +167,8 @@
.report-user-link {
flex-shrink: 0;
display: flex;
align-items: center;
> i {
font-size: 16px;