feat(shipping-notice): 完成货代发货通知全门禁恢复MVP收口

完成全门禁恢复MVP版本交付:调整自动上传与重试配置,重构正式执行链路;修复多处代码bug,新增测试与审计工具;更新全流程文档与契约规范。
This commit is contained in:
hugo committed 2026-08-11 14:04:39 +08:00
1 parent 8e0bbf7a81
commit c94d173f92
181 files changed
+12947 -1724

No files matched your search

@@ -0,0 +1,62 @@
/**
* features/chat/components/shipping-review/ReviewProfileMatchPanel.spec.ts
* 用途:锁定模板匹配侧栏的候选披露规则,避免候选数量增长撑长工作台。
* 依赖:vitest、@vue/test-utils、vue-i18n、ReviewProfileMatchPanel。
* 逻辑:所有状态默认收起;用户可手动展开/收起候选列表。
*/
import { describe, expect, it } from 'vitest';
import { mount } from '@vue/test-utils';
import { createI18n } from 'vue-i18n';
import ReviewProfileMatchPanel from './ReviewProfileMatchPanel.vue';
const i18n = createI18n({
legacy: false,
locale: 'zh-CN',
messages: {
'zh-CN': {
chat: { shippingOrderReview: { profileMatch: {
title: '文档模板匹配', subtitle: '摘要', selected: '命中模板', noSelected: '未选定模板',
expandCandidates: '查看候选模板({count})', collapseCandidates: '收起候选模板',
routeType: '路由类型', executionMode: '执行模式',
status: { matched: '已匹配', ambiguous: '多个候选' },
} } },
},
},
});
function mountPanel(needsReview = false) {
return mount(ReviewProfileMatchPanel, {
props: {
profileMatch: {
available: true,
visibility: 'admin',
status: needsReview ? 'ambiguous' : 'matched',
needs_review: needsReview,
selected_profile: { profile_code: 'ODP-A', display_name: '客户订单模板', version: 1 },
candidates: [
{ profile_code: 'ODP-A', score: 0.99 },
{ profile_code: 'ODP-B', score: 0.98 },
],
fallback_reason_codes: [],
},
},
global: { plugins: [i18n] },
});
}
describe('ReviewProfileMatchPanel', () => {
it('默认收起无需关注的候选列表', () => {
const wrapper = mountPanel(false);
expect(wrapper.find('[data-testid="review-profile-match-candidates"]').exists()).toBe(false);
expect(wrapper.get('[data-testid="review-profile-match-candidates-toggle"]').text()).toContain('查看候选模板(2)');
});
it('多个候选且需要人工处理时也默认收起,并允许展开后收起', async () => {
const wrapper = mountPanel(true);
expect(wrapper.find('[data-testid="review-profile-match-candidates"]').exists()).toBe(false);
await wrapper.get('[data-testid="review-profile-match-candidates-toggle"]').trigger('click');
expect(wrapper.find('[data-testid="review-profile-match-candidates"]').exists()).toBe(true);
await wrapper.get('[data-testid="review-profile-match-candidates-toggle"]').trigger('click');
expect(wrapper.find('[data-testid="review-profile-match-candidates"]').exists()).toBe(false);
});
});