refactor(i18n): 全工程面向国际用户与全球现代商务重构,彻底清理出海跨境等单向视角表达并对齐自动化测试
这个提交包含在:
@@ -49,7 +49,7 @@ test('2. ai/concierge 必须遵循设计 Token,禁止 emoji 与硬编码颜色
|
||||
assert.ok(!emojiRegex.test(content), '页面中严禁使用 emoji 图标或字符');
|
||||
|
||||
// 人设切换支持
|
||||
assert.ok(content.includes('trade_expert'), '必须支持外贸专家预设 trade_expert');
|
||||
assert.ok(content.includes('trade_expert'), '必须支持国际贸易顾问预设 trade_expert');
|
||||
assert.ok(content.includes('business_rep'), '必须支持商务代表预设 business_rep');
|
||||
assert.ok(content.includes('tech_advisor'), '必须支持技术顾问预设 tech_advisor');
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ test('1. routes.ts 已注册 card/cases,对应 pages/card/cases', () => {
|
||||
|
||||
test('2. locale 必须包含 menu.card.cases 中英文案', () => {
|
||||
assert.equal(defaultI18n['en-US']['menu.card.cases'], 'Portfolio');
|
||||
assert.equal(defaultI18n['zh-CN']['menu.card.cases'], '出海案例作品集');
|
||||
assert.equal(defaultI18n['zh-CN']['menu.card.cases'], '案例作品集');
|
||||
});
|
||||
|
||||
test('3. cases 页面必须请求 CRUD 接口并遵守 Cool-Admin 协议', () => {
|
||||
|
||||
@@ -82,7 +82,7 @@ test('5. 工作台 i18n 必须覆盖 KPI、雷达动态与快捷入口,且含
|
||||
assert.ok(!EMOJI_RE.test(localeContent), '语言包严禁 emoji');
|
||||
});
|
||||
|
||||
test('6. 专业出海运营官视角:包含全球雷达监控、渠道漏斗与效率工具,全屏仅 1 个主 CTA', () => {
|
||||
test('6. 专业运营官视角:包含全球雷达监控、渠道漏斗与效率工具,全屏仅 1 个主 CTA', () => {
|
||||
const content = fs.readFileSync(pagePath, 'utf-8');
|
||||
const localeContent = fs.readFileSync(localePath, 'utf-8');
|
||||
|
||||
@@ -118,7 +118,7 @@ test('6. 专业出海运营官视角:包含全球雷达监控、渠道漏斗
|
||||
assert.ok(!EMOJI_RE.test(content), '页面代码严禁 emoji');
|
||||
});
|
||||
|
||||
test('7. 出海运营快捷中枢:覆盖8大核心业务快捷入口与运营预警,全屏仅1个主CTA', () => {
|
||||
test('7. 全球运营快捷中枢:覆盖8大核心业务快捷入口与运营预警,全屏仅1个主CTA', () => {
|
||||
const content = fs.readFileSync(pagePath, 'utf-8');
|
||||
const localeContent = fs.readFileSync(localePath, 'utf-8');
|
||||
|
||||
@@ -152,4 +152,37 @@ test('7. 出海运营快捷中枢:覆盖8大核心业务快捷入口与运营
|
||||
assert.ok(!EMOJI_RE.test(content), '页面代码严禁 emoji');
|
||||
});
|
||||
|
||||
test('8. 实时雷达数据专家重构:相对时间、本地环境优雅降级、名片归属与科学意向分分级', () => {
|
||||
const content = fs.readFileSync(pagePath, 'utf-8');
|
||||
const localeContent = fs.readFileSync(localePath, 'utf-8');
|
||||
|
||||
// 1. 相对时间与本地化支持
|
||||
const radarKeys = [
|
||||
'workplace.radar.localEnv',
|
||||
'workplace.radar.justNow',
|
||||
'workplace.radar.minsAgo',
|
||||
'workplace.radar.hoursAgo',
|
||||
'workplace.radar.bounce',
|
||||
'workplace.radar.cardFallback',
|
||||
];
|
||||
for (const key of radarKeys) {
|
||||
assert.ok(
|
||||
localeContent.includes(key),
|
||||
`语言包必须包含雷达数据语义化词条: ${key}`
|
||||
);
|
||||
}
|
||||
|
||||
// 2. 页面中实现相对时间格式化与本地环境优雅降级
|
||||
assert.ok(content.includes('formatRelativeTime'), '必须包含相对时间计算逻辑');
|
||||
assert.ok(content.includes('formatLocation'), '必须包含本地环境优雅降级逻辑');
|
||||
assert.ok(content.includes('formatStayText'), '必须包含跳出/停留文案格式化');
|
||||
assert.ok(content.includes('getIntentTagColor'), '必须包含科学意向分语义色彩分级');
|
||||
|
||||
// 3. 规范约束
|
||||
assert.ok(!EMOJI_RE.test(localeContent), '语言包严禁 emoji');
|
||||
assert.ok(!EMOJI_RE.test(content), '页面代码严禁 emoji');
|
||||
assert.ok(!/\bany\b/.test(content), '严禁使用 any');
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ const REMOVED_DEMO_MODULES = [
|
||||
'user',
|
||||
];
|
||||
|
||||
test('1. 核心出海业务菜单必须保留在侧边栏正常展示', () => {
|
||||
test('1. 核心业务菜单必须保留在侧边栏正常展示', () => {
|
||||
const content = fs.readFileSync(routesPath, 'utf-8');
|
||||
for (const key of CORE_BIZ_MODULES) {
|
||||
assert.ok(
|
||||
|
||||
@@ -126,14 +126,12 @@ test('5. mpuniapp/common/tokens.uts - uni-app x 跨端 Token 校验', () => {
|
||||
assert.ok(content.includes('export const utsRadius: UtsRadius ='));
|
||||
assert.ok(content.includes('export const utsTypography: UtsTypography ='));
|
||||
|
||||
// 校验关键值
|
||||
assert.ok(content.includes("'#0B5CFF'"));
|
||||
assert.ok(content.includes("'#4D8DFF'"));
|
||||
assert.ok(content.includes("'#7C5CFF'"));
|
||||
assert.ok(content.includes("'#9B8CFF'"));
|
||||
assert.ok(content.includes("button: '12px'"));
|
||||
assert.ok(content.includes("card: '16px'"));
|
||||
assert.ok(content.includes("modal: '20px'"));
|
||||
// 校验关键值 (严格遵守 AGENTS.md 权威 Design Token)
|
||||
assert.ok(content.includes("'#0088FF'"));
|
||||
assert.ok(content.includes("'#3894FF'"));
|
||||
assert.ok(content.includes("button: '14px'"));
|
||||
assert.ok(content.includes("card: '20px'"));
|
||||
assert.ok(content.includes("modal: '24px'"));
|
||||
assert.ok(content.includes("space16: '16px'"));
|
||||
});
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ test('3. 快捷导航卡片副标题必须具备单行文本防截断样式', ()
|
||||
);
|
||||
});
|
||||
|
||||
test('4. 零 any,零 emoji,符合出海国际化商务规范', () => {
|
||||
test('4. 零 any,零 emoji,符合国际化现代商务规范', () => {
|
||||
const tsx = read('src/pages/dashboard/workplace/index.tsx');
|
||||
const styles = read('src/pages/dashboard/workplace/style/index.module.less');
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户