feat(broadcast): finish multi-role insight experience

This commit is contained in:
2026-07-25 15:18:58 +08:00
parent 7990db6883
commit 230dfb4dfc
20 changed files with 552 additions and 81 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ import test from 'node:test';
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8');
test('M1 员工端可筛选与我有关和必读未读消息,并保留公开频道', async () => {
test('M1 员工端可筛选定向提醒和必读未读消息,并保留公开频道', async () => {
const [service, list, detail] = await Promise.all([
read('../src/services/broadcast.ts'),
read('../src/pages/user/broadcast/index.vue'),
@@ -19,6 +19,7 @@ test('M1 员工端可筛选与我有关和必读未读消息,并保留公开
assert.match(list, /listBroadcastMessages\(1, pageSize, scope\.value\)/);
assert.match(list, /item\.requiredRead/);
assert.match(list, /item\.targeted/);
assert.match(list, /定向提醒/);
assert.match(detail, /item\.requiredRead/);
assert.match(detail, /item\.targeted/);
});
@@ -0,0 +1,41 @@
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8');
test('公司文件按岗位展示可切换的解读、生成状态和可折叠原文依据', async () => {
const [service, list, detail] = await Promise.all([
read('../src/services/broadcast.ts'),
read('../src/pages/user/broadcast/index.vue'),
read('../src/pages/user/broadcast/detail.vue')
]);
assert.match(service, /export type BroadcastInsightStatus/);
assert.match(service, /interface BroadcastPerspective/);
assert.match(service, /defaultPerspectiveCode\?: string/);
assert.match(service, /perspectives: BroadcastPerspective\[\]/);
assert.match(service, /normalizeBroadcastAttachment/);
assert.match(service, /perspectives: Array\.isArray\(attachment\.perspectives\) \? attachment\.perspectives : \[\]/);
assert.match(service, /insightStatus: attachment\.insightStatus \|\| 'NOT_PROCESSED'/);
assert.match(detail, /多岗位解读/);
assert.match(detail, /defaultPerspectiveCode/);
assert.match(detail, /selectedPerspective/);
assert.match(detail, /selectPerspective/);
assert.match(detail, /原文依据/);
assert.match(detail, /insightStatus === 'PENDING'/);
assert.match(detail, /刷新解读/);
assert.match(detail, /insightStatus === 'PARTIAL'/);
assert.match(detail, /insightStatus === 'FAILED'/);
assert.match(detail, /scroll-x/);
assert.match(detail, /role="group"/);
assert.match(detail, /aria-pressed/);
assert.ok(detail.indexOf('attachment-summary') < detail.indexOf('perspective-panel'));
assert.ok(detail.indexOf('download-button') < detail.indexOf('perspective-panel'));
assert.ok(detail.indexOf('detail-actions') < detail.indexOf('perspective-panel'));
assert.match(list, /定向提醒/);
assert.doesNotMatch(list, />与我有关</);
assert.doesNotMatch(detail, />与我有关/);
});