From d96e9f4daa0b4f4c032f36d93ffbc2b2000c9ed0 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 31 Jan 2023 14:07:42 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=88=91=E7=9A=84=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B1=87=E6=8A=A5=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=B1=87?= =?UTF-8?q?=E6=8A=A5=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/pages/manage/components/ReportMy.vue | 37 +++++++++++++++++-- resources/assets/sass/components/report.scss | 17 +++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ReportMy.vue b/resources/assets/js/pages/manage/components/ReportMy.vue index 517b3258d..5118b3a42 100644 --- a/resources/assets/js/pages/manage/components/ReportMy.vue +++ b/resources/assets/js/pages/manage/components/ReportMy.vue @@ -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', diff --git a/resources/assets/sass/components/report.scss b/resources/assets/sass/components/report.scss index ea6313a8a..b36242863 100644 --- a/resources/assets/sass/components/report.scss +++ b/resources/assets/sass/components/report.scss @@ -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;