Merge branch 'dev-new' into runny827

This commit is contained in:
runny committed 2026-09-10 22:01:56 +08:00
commit f1beb6fefb
112 files changed
+6300 -586

No files matched your search

@@ -18,7 +18,9 @@ const i18n = createI18n({
title: '文档模板匹配', subtitle: '摘要', selected: '命中模板', noSelected: '未选定模板',
expandCandidates: '查看候选模板({count})', collapseCandidates: '收起候选模板',
routeType: '路由类型', executionMode: '执行模式',
extractionBlocked: '模板已命中,但字段提取仍被安全门禁阻断', extractionBlockedReason: '阻断原因:{reasons}',
extractionBlocked: '模板已命中,但字段提取仍被安全门禁阻断',
extractionBlockedNoMatch: '模板未唯一命中,字段提取被阻断',
extractionBlockedReason: '阻断原因:{reasons}',
coordinateModel: {
anchorFrame: '锚点坐标框架', status: '变换状态', translateX: '横向平移',
translateY: '纵向平移', reasonCodes: '原因码',
@@ -122,6 +124,30 @@ describe('ReviewProfileMatchPanel', () => {
// 关键断言:唯一模板命中不等于字段已提取,必须明确暴露下游阻断原因。
expect(wrapper.get('[data-testid="review-profile-match-extraction-blocked"]').text())
.toContain('PARSE_STRATEGY_ROW_MODE_AMBIGUOUS');
expect(wrapper.get('[data-testid="review-profile-match-extraction-blocked"]').text())
.toContain('模板已命中');
});
it('未选定模板时阻断文案不得再写模板已命中', () => {
const wrapper = mount(ReviewProfileMatchPanel, {
props: {
profileMatch: {
available: true,
visibility: 'admin',
status: 'evidence_insufficient',
needs_review: true,
selected_profile: null,
candidates: [],
fallback_reason_codes: ['coordinate_evidence_unavailable'],
},
},
global: { plugins: [i18n] },
});
const blocked = wrapper.get('[data-testid="review-profile-match-extraction-blocked"]').text();
expect(blocked).toContain('模板未唯一命中');
expect(blocked).not.toContain('模板已命中');
expect(blocked).toContain('coordinate_evidence_unavailable');
});
it('管理员技术详情展示锚点框架平移和稳定原因码,不展示原始正文或完整坐标', async () => {
@@ -43,10 +43,20 @@ const selectedCoordinateTransform = computed(() => {
const coordinateTransformReasonCodes = computed(() => (
selectedCoordinateTransform.value?.reason_codes || []
));
/** 唯一命中仅证明版式身份;下游字段/明细恢复若受门禁阻断,必须在同卡明确说明。 */
/** 唯一命中仅证明版式身份;下游字段/明细恢复若受门禁阻断,必须在同卡明确说明。
* 未选定模板时不得再写「模板已命中」,避免与上方「未选定模板」矛盾。 */
const extractionBlockReasons = computed(() => (
(props.profileMatch?.fallback_reason_codes || []).filter((code) => String(code).trim())
));
const hasSelectedProfile = computed(() => Boolean(
String(props.profileMatch?.selected_profile?.profile_code || '').trim()
|| String(props.profileMatch?.selected_profile?.display_name || '').trim(),
));
const extractionBlockedTitle = computed(() => (
hasSelectedProfile.value
? t('chat.shippingOrderReview.profileMatch.extractionBlocked')
: t('chat.shippingOrderReview.profileMatch.extractionBlockedNoMatch')
));
watch(
() => `${props.profileMatch?.status || ''}:${props.profileMatch?.selected_profile?.profile_code || ''}:${candidateCount.value}`,
@@ -117,7 +127,7 @@ const selectedLabel = computed(() => {
class="mt-3 rounded-lg border border-amber-200 bg-amber-50 px-2.5 py-2 text-xs text-amber-900 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-100"
data-testid="review-profile-match-extraction-blocked"
>
<p class="font-medium">{{ t('chat.shippingOrderReview.profileMatch.extractionBlocked') }}</p>
<p class="font-medium">{{ extractionBlockedTitle }}</p>
<p class="mt-1 text-amber-800 dark:text-amber-200">
{{ t('chat.shippingOrderReview.profileMatch.extractionBlockedReason', { reasons: extractionBlockReasons.join(', ') }) }}
</p>