From e4486885e4735254602f03bfb74454f4d1c463a1 Mon Sep 17 00:00:00 2001 From: smail Date: Wed, 30 Sep 2026 23:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E4=BB=B6=E7=AE=B1?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8A=95=E9=80=92=E7=8A=B6=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/List/List.js | 6 ++++++ frontend/src/views/List/List.vue | 6 ++++++ test/review/frontend-findings.test.mjs | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/frontend/src/views/List/List.js b/frontend/src/views/List/List.js index 989a8e2..62f6eef 100644 --- a/frontend/src/views/List/List.js +++ b/frontend/src/views/List/List.js @@ -298,6 +298,11 @@ export function usePage() { errorDialogVisible.value = true } + const isPartialDelivery = function (row) { + if (row?.status !== 2) return false + return /^投递未全部完成;已接收\s*[1-9]\d*,失败\s*[1-9]\d*/.test(String(row.error || '')) + } + return { EpArrowDownBold, Delete, @@ -341,6 +346,7 @@ export function usePage() { isOutbox, trustSender, showError, + isPartialDelivery, errorDialogVisible, currentErrorMsg, isRefreshing, diff --git a/frontend/src/views/List/List.vue b/frontend/src/views/List/List.vue index 8cda742..492405e 100644 --- a/frontend/src/views/List/List.vue +++ b/frontend/src/views/List/List.vue @@ -92,6 +92,11 @@ 投递结果待核对 + + + 部分成功 (查看详情) + + 发送成功 @@ -164,6 +169,7 @@ const { isOutbox, trustSender, showError, + isPartialDelivery, errorDialogVisible, currentErrorMsg, isRefreshing, diff --git a/test/review/frontend-findings.test.mjs b/test/review/frontend-findings.test.mjs index d83d08c..b202277 100644 --- a/test/review/frontend-findings.test.mjs +++ b/test/review/frontend-findings.test.mjs @@ -11,6 +11,20 @@ const Vue = require('vue') const { parse, compileScript } = require('@vue/compiler-sfc') const read = name => readFileSync(new URL(`../../frontend/${name}`, import.meta.url), 'utf8') +test('发件箱必须区分部分成功与全部失败', () => { + const source = read('src/views/List/List.js') + .replace(/^import .*$/gm, '') + .replace('export function usePage', 'function usePage') + .replace(/export \{[^}]+\}\s*$/, '') + const { isPartialDelivery } = compileFunction(source + '\nreturn { isPartialDelivery }')() + assert.equal(isPartialDelivery({ + status: 2, + error: '投递未全部完成;已接收 1,失败 1。已接收的收件人不会自动重投' + }), true) + assert.equal(isPartialDelivery({ status: 2, error: '投递失败;已接收 0,失败 2' }), false) + assert.equal(isPartialDelivery({ status: 1, error: '' }), false) +}) + test('邮件列表挂载后,表格选中项必须用于全选和批量操作', async () => { const source = read('src/views/List/List.js').replace(/^import .*$/gm, '') .replace('export function usePage', 'function usePage').replace(/export \{[^}]+\}\s*$/, '')