DG9 统一全站 UI 布局样板迁移
关联 Issue: DG9-0..DG9-12
这个提交包含在:
@@ -339,6 +339,38 @@ function scanMobilePcShell(file, source) {
|
||||
}
|
||||
}
|
||||
|
||||
function scanMobileDesktopContainers(file, source) {
|
||||
if (!isMobileSourceFile(file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const patterns = [
|
||||
{
|
||||
regex: /\bcard-std\b[^"'`]{0,80}\bp-[45]\b/g,
|
||||
evidence: "card-std p-4/p-5",
|
||||
},
|
||||
{
|
||||
regex: /\bcard-std\b[^"'`]{0,80}\bp-6\b/g,
|
||||
evidence: "card-std p-6",
|
||||
},
|
||||
];
|
||||
|
||||
for (const pattern of patterns) {
|
||||
let match = pattern.regex.exec(source);
|
||||
while (match) {
|
||||
addFinding({
|
||||
rule: "mobile.no_desktop_card_container",
|
||||
severity: "error",
|
||||
file,
|
||||
line: lineNumber(source, match.index),
|
||||
message: "专用 /mobile 页面不应把桌面 card-std 大容器作为主内容,应使用 mobile-card、mobile-list-card 或移动表单分组。",
|
||||
evidence: match[0],
|
||||
});
|
||||
match = pattern.regex.exec(source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function scanRawBusinessIdentifiers(file, source) {
|
||||
const normalized = toPosix(file);
|
||||
if (!/Reimbursement|Invoice|Leave|Purchase|Travel/.test(path.basename(normalized))) {
|
||||
@@ -542,6 +574,7 @@ function scanFileSource(file, source) {
|
||||
scanMobileCapturePdfInputs(file, source);
|
||||
scanMobileDesktopTables(file, source);
|
||||
scanMobilePcShell(file, source);
|
||||
scanMobileDesktopContainers(file, source);
|
||||
scanUuidPrimaryDisplay(file, source);
|
||||
scanRawBusinessIdentifiers(file, source);
|
||||
scanReimbursementRawCodeDisplay(file, source);
|
||||
@@ -575,6 +608,16 @@ function runSelfTest() {
|
||||
],
|
||||
expectedSuppressedRules: [],
|
||||
},
|
||||
{
|
||||
file: "client/src/pages/MobileDesktopCardFixture.tsx",
|
||||
source: `
|
||||
export function MobileDesktopCardFixture() {
|
||||
return <main className="card-std space-y-4 p-6">内容</main>;
|
||||
}
|
||||
`,
|
||||
expectedRules: ["mobile.no_desktop_card_container"],
|
||||
expectedSuppressedRules: [],
|
||||
},
|
||||
{
|
||||
file: "client/src/pages/AuditLogsPage.tsx",
|
||||
source: `
|
||||
|
||||
在新工单中引用
屏蔽一个用户