From f81b18d2d094212cddc70549110f74f8092b8c50 Mon Sep 17 00:00:00 2001 From: jingrow Date: Thu, 14 May 2026 02:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96communication=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E5=B7=A5=E5=85=B7=E6=A0=8F=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communication/communication_toolbar.vue | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/frontend/src/views/pagetype/communication/communication_toolbar.vue b/frontend/src/views/pagetype/communication/communication_toolbar.vue index 33d8723f4..b2e336b1e 100644 --- a/frontend/src/views/pagetype/communication/communication_toolbar.vue +++ b/frontend/src/views/pagetype/communication/communication_toolbar.vue @@ -103,20 +103,20 @@ {{ t('Reply') }} - - + - - - - + + {{ t('Forward') }} + h(Icon, { icon: iconName }) }) } -// ===== Dropdown options ===== -const actionsOptions = computed(() => { - const opts: DropdownOption[] = [] - - const replyAll = makeOption('reply_all', t('Reply All'), 'tabler:arrow-back-up-right') - if (replyAll) opts.push(replyAll) - - const forward = makeOption('forward', t('Forward'), 'tabler:send') - if (forward) opts.push(forward) - - opts.push({ type: 'divider', key: 'd1' }) - - const readLabel = isSeen.value ? t('Mark as Unread') : t('Mark as Read') - const readIcon = isSeen.value ? 'tabler:mail-opened' : 'tabler:mail-check' - const toggleRead = makeOption('toggle_read', readLabel, readIcon) - if (toggleRead) opts.push(toggleRead) - - const move = makeOption('move', t('Move'), 'tabler:folder-arrow-right') - if (move) opts.push(move) - - opts.push({ type: 'divider', key: 'd2' }) - - if (!isSpam.value) { - const spam = makeOption('spam', t('Mark as Spam'), 'tabler:alert-triangle') - if (spam) opts.push(spam) - } - - if (!isTrash.value) { - const trash = makeOption('trash', t('Move To Trash'), 'tabler:trash') - if (trash) opts.push(trash) - } - - return opts -}) - const createOptions = computed(() => { const contact = makeOption('contact', t('Contact'), 'tabler:user-plus') return contact ? [contact] : [] @@ -783,6 +748,33 @@ const createOptions = computed(() => { const moreOptions = computed(() => { const opts: DropdownOption[] = [] + // Email action items (from former Actions dropdown) + if (canReply.value) { + const replyAll = makeOption('reply_all', t('Reply All'), 'tabler:arrow-back-up-right') + if (replyAll) opts.push(replyAll) + + const readLabel = isSeen.value ? t('Mark as Unread') : t('Mark as Read') + const readIcon = isSeen.value ? 'tabler:mail-opened' : 'tabler:mail-check' + const toggleRead = makeOption('toggle_read', readLabel, readIcon) + if (toggleRead) opts.push(toggleRead) + + const move = makeOption('move', t('Move'), 'tabler:folder-arrow-right') + if (move) opts.push(move) + + if (!isSpam.value) { + const spam = makeOption('spam', t('Mark as Spam'), 'tabler:alert-triangle') + if (spam) opts.push(spam) + } + + if (!isTrash.value) { + const trash = makeOption('trash', t('Move To Trash'), 'tabler:trash') + if (trash) opts.push(trash) + } + + opts.push({ type: 'divider', key: 'd-email-actions' }) + } + + // General more items if (!isNew.value && props.canEdit && !props.pageMeta?.allow_copy) { const dup = makeOption('duplicate', t('Duplicate'), 'tabler:copy') if (dup) opts.push(dup) @@ -802,17 +794,6 @@ const moreOptions = computed(() => { return opts }) -function handleActionsSelect(key: string) { - switch (key) { - case 'reply_all': replyAll(); break - case 'forward': forward(); break - case 'toggle_read': markAsReadUnread(); break - case 'move': openMoveDialog(); break - case 'spam': markAsSpam(); break - case 'trash': moveToTrash(); break - } -} - function handleCreateSelect(key: string) { switch (key) { case 'contact': addToContact(); break @@ -821,6 +802,11 @@ function handleCreateSelect(key: string) { function handleMoreSelect(key: string) { switch (key) { + case 'reply_all': replyAll(); break + case 'toggle_read': markAsReadUnread(); break + case 'move': openMoveDialog(); break + case 'spam': markAsSpam(); break + case 'trash': moveToTrash(); break case 'rename': emit('rename', '') break case 'duplicate': emit('duplicate', '')