feat(aihr): complete company message R1-R3

This commit is contained in:
2026-07-24 23:25:15 +08:00
parent 5d864a1444
commit 342f84a9de
37 changed files with 2479 additions and 42 deletions
@@ -0,0 +1,19 @@
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('公司文件在员工端展示摘要、受控原文件入口并继续复用消息ID追问', async () => {
const [service, detail] = await Promise.all([
read('../src/services/broadcast.ts'),
read('../src/pages/user/broadcast/detail.vue')
]);
assert.match(service, /interface BroadcastAttachment/);
assert.match(service, /downloadUrl: string/);
assert.match(detail, /公司文件/);
assert.match(detail, /attachment\.summary/);
assert.match(detail, /authenticatedFileUrl/);
assert.match(detail, /saveBroadcastQuestionContext\(item\.value\.id/);
});
+24
View File
@@ -0,0 +1,24 @@
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, page, broadcast, pages] = await Promise.all([
read('../src/services/direct.ts'),
read('../src/pages/user/direct/index.vue'),
read('../src/pages/user/broadcast/index.vue'),
read('../src/pages.json')
]);
assert.match(service, /'PRESIDENT' \| 'FINANCE' \| 'HR' \| 'AUDIT' \| 'OPERATIONS'/);
assert.ok(service.includes('/api/aihr/direct/feedback'));
assert.ok(service.includes('/api/aihr/direct/mine'));
assert.match(page, /选择直达对象/);
assert.match(page, /匿名提交/);
assert.match(page, /正式回复/);
assert.match(page, /requestId/);
assert.match(broadcast, /openDirect/);
assert.ok(pages.includes('pages/user/direct/index'));
});