DG7/MRF7 移动信息架构与展示去重治理
这个提交包含在:
@@ -410,6 +410,43 @@ function scanReimbursementRawCodeDisplay(file, source) {
|
||||
}
|
||||
}
|
||||
|
||||
function scanDuplicateBusinessIdentifierDisplay(file, source) {
|
||||
const normalized = normalizeFindingFile(file);
|
||||
if (!/^client\/src\/(?:pages|components)\//.test(normalized)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const patterns = [
|
||||
{
|
||||
regex: /业务单号[::][\s\S]{0,160}\{task\.reference\}/g,
|
||||
message: "审批卡片标题已有业务对象时,不应在同一卡片再次展示业务单号。",
|
||||
},
|
||||
{
|
||||
regex: /业务:\$\{entityLabel\([^}]+\)\}\s*·\s*\$\{reference/g,
|
||||
message: "审批卡片副标题不应重复拼接业务类型和业务编号,应使用固定主标题槽位。",
|
||||
},
|
||||
{
|
||||
regex: /业务单号[::][\s\S]{0,220}(?:报销单号|采购单号|差旅单号)[::]/g,
|
||||
message: "同一详情摘要不应同时展示通用业务单号和具体业务单号。",
|
||||
},
|
||||
];
|
||||
|
||||
for (const pattern of patterns) {
|
||||
let match = pattern.regex.exec(source);
|
||||
while (match) {
|
||||
addFinding({
|
||||
rule: "display.no_duplicate_business_identifier",
|
||||
severity: "error",
|
||||
file,
|
||||
line: lineNumber(source, match.index),
|
||||
message: pattern.message,
|
||||
evidence: match[0].replace(/\s+/g, " ").slice(0, 180),
|
||||
});
|
||||
match = pattern.regex.exec(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function extractStringList(source, name) {
|
||||
const assignment = new RegExp(`const\\s+${name}\\s*=\\s*\\[([\\s\\S]*?)\\];`, "m").exec(source);
|
||||
if (!assignment) {
|
||||
@@ -460,6 +497,7 @@ function scanFileSource(file, source) {
|
||||
scanUuidPrimaryDisplay(file, source);
|
||||
scanRawBusinessIdentifiers(file, source);
|
||||
scanReimbursementRawCodeDisplay(file, source);
|
||||
scanDuplicateBusinessIdentifierDisplay(file, source);
|
||||
scanNavigationTitleCoverage(file, source);
|
||||
}
|
||||
|
||||
@@ -475,7 +513,7 @@ function runSelfTest() {
|
||||
file: "client/src/pages/MobileBadFixture.tsx",
|
||||
source: `
|
||||
export function MobileBadFixture() {
|
||||
return <div><table><tbody /></table><aside>备用模块</aside><button>Upload</button><div>任务ID:{task.id}</div></div>;
|
||||
return <div><table><tbody /></table><aside>备用模块</aside><button>Upload</button><div>任务ID:{task.id}</div><div>业务单号:{task.reference}</div></div>;
|
||||
}
|
||||
`,
|
||||
expectedRules: [
|
||||
@@ -483,6 +521,7 @@ function runSelfTest() {
|
||||
"mobile.no_pc_shell",
|
||||
"copy.no_english_upload_labels",
|
||||
"data.no_uuid_primary_display",
|
||||
"display.no_duplicate_business_identifier",
|
||||
],
|
||||
expectedSuppressedRules: [],
|
||||
},
|
||||
|
||||
在新工单中引用
屏蔽一个用户