{ "phase": { "id": "phase-4", "name": "组件改造 — 10 个组件", "description": "改造 10 个组件,替换硬编码中文为 $t()/t() 调用。领域术语(如 suitableActivities/avoidActivities 数组)保留中文不翻译", "dependencies": ["phase-1", "phase-2"], "tasks": [ { "id": "4.1", "name": "改造 BottomNavigation", "status": "pending", "description": "将 tabs 数组中的 label 改为 computed,使用 t() 调用", "files": { "modify": ["src/components/BottomNavigation/BottomNavigation.vue"] }, "replacements": [ { "from": "黄历", "to": "t('nav.almanac')" }, { "from": "紫微", "to": "t('nav.ziwei')" }, { "from": "运势", "to": "t('nav.fortune')" } ], "steps": [ { "id": "4.1.1", "action": "write_implementation", "description": "添加 i18n 导入 + 将 tabs 改为 computed" }, { "id": "4.1.2", "action": "commit", "message": "feat(i18n): 改造 BottomNavigation 组件" } ] }, { "id": "4.2", "name": "改造 EmptyState", "status": "pending", "description": "移除 withDefaults 中的中文默认值,由调用方通过 $t() 传入", "files": { "modify": ["src/components/EmptyState/index.vue"] }, "steps": [ { "id": "4.2.1", "action": "write_implementation", "description": "移除 title/description/actionText 的中文默认值" }, { "id": "4.2.2", "action": "commit", "message": "feat(i18n): 改造 EmptyState 组件,移除中文默认值" } ] }, { "id": "4.3", "name": "改造 SearchConditionPanel", "status": "pending", "description": "替换搜索条件面板中的硬编码中文", "files": { "modify": ["src/components/SearchConditionPanel/index.vue"] }, "replacements": [ { "from": "搜索条件", "to": "$t('search.conditions')" }, { "from": "添加条件", "to": "$t('search.addCondition')" }, { "from": "请添加搜索条件", "to": "$t('search.addConditionEmpty')" }, { "from": "搜索天数", "to": "$t('search.days')" }, { "from": "天", "to": "$t('search.dayUnit')" }, { "from": "搜索", "to": "$t('common.search')" } ], "steps": [ { "id": "4.3.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换 6 处硬编码中文" }, { "id": "4.3.2", "action": "commit", "message": "feat(i18n): 改造 SearchConditionPanel 组件" } ] }, { "id": "4.4", "name": "改造 SearchConditionItem", "status": "pending", "description": "替换硬编码中文,将 typeOptions/operatorOptions 改为 computed。领域术语保留中文", "files": { "modify": ["src/components/SearchConditionItem/index.vue"] }, "replacements": [ { "from": "事项", "to": "$t('search.items')" }, { "from": "逻辑运算符", "to": "$t('search.operator')" }, { "from": "排除条件", "to": "$t('search.excludeCondition')" }, { "from": "宜", "to": "t('search.typeSuitable')" }, { "from": "忌", "to": "t('search.typeUnsuitable')" }, { "from": "与(AND)", "to": "t('search.operatorAnd')" }, { "from": "或(OR)", "to": "t('search.operatorOr')" } ], "note": "suitableActivities 和 avoidActivities 数组保持中文硬编码(领域术语策略)", "steps": [ { "id": "4.4.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换模板中文 + 将 typeOptions/operatorOptions 改为 computed" }, { "id": "4.4.2", "action": "commit", "message": "feat(i18n): 改造 SearchConditionItem 组件(领域术语保留中文)" } ] }, { "id": "4.5", "name": "改造 SearchResultList", "status": "pending", "description": "替换搜索结果列表中的硬编码中文", "files": { "modify": ["src/components/SearchResultList/index.vue"] }, "replacements": [ { "from": "搜索结果", "to": "$t('search.searchResult')" }, { "from": "共{results.length}条结果", "to": "$t('search.resultCount', { count: results.length })" }, { "from": "加载中...", "to": "$t('common.loading')" } ], "steps": [ { "id": "4.5.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换 3 处硬编码中文" }, { "id": "4.5.2", "action": "commit", "message": "feat(i18n): 改造 SearchResultList 组件" } ] }, { "id": "4.6", "name": "改造 SearchResultCard", "status": "pending", "description": "替换搜索结果卡片中的硬编码中文", "files": { "modify": ["src/components/SearchResultCard/index.vue"] }, "replacements": [ { "from": "宜", "to": "$t('search.typeSuitable')" }, { "from": "忌", "to": "$t('search.typeUnsuitable')" }, { "from": "匹配度:", "to": "$t('search.matchCount', { count: result.matchCount })" } ], "steps": [ { "id": "4.6.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换 3 处硬编码中文" }, { "id": "4.6.2", "action": "commit", "message": "feat(i18n): 改造 SearchResultCard 组件" } ] }, { "id": "4.7", "name": "改造 SortSwitcher", "status": "pending", "description": "替换排序切换器中的硬编码中文", "files": { "modify": ["src/components/SortSwitcher/index.vue"] }, "replacements": [ { "from": "排序", "to": "$t('search.sort')" }, { "from": "日期", "to": "$t('search.sortByDate')" }, { "from": "匹配度", "to": "$t('search.sortByMatch')" } ], "steps": [ { "id": "4.7.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换 3 处硬编码中文" }, { "id": "4.7.2", "action": "commit", "message": "feat(i18n): 改造 SortSwitcher 组件" } ] }, { "id": "4.8", "name": "改造 ExportPanel", "status": "pending", "description": "替换导出面板中的硬编码中文,将 contentOptions 改为 computed", "files": { "modify": ["src/components/ExportPanel/index.vue"] }, "replacements": [ { "from": "导出搜索结果", "to": "$t('export.title')" }, { "from": "选择导出格式", "to": "$t('export.selectFormat')" }, { "from": "选择导出内容", "to": "$t('export.selectContent')" }, { "from": "取消", "to": "$t('common.cancel')" }, { "from": "导出", "to": "$t('common.confirm')" } ], "steps": [ { "id": "4.8.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换模板中文 + 将 contentOptions 改为 computed" }, { "id": "4.8.2", "action": "commit", "message": "feat(i18n): 改造 ExportPanel 组件" } ] }, { "id": "4.9", "name": "改造 SearchHistoryPanel", "status": "pending", "description": "替换搜索历史面板中的硬编码中文,将 formatTime 中的中文改为 t() 调用", "files": { "modify": ["src/components/SearchHistoryPanel/index.vue"] }, "replacements": [ { "from": "搜索历史", "to": "$t('history.title')" }, { "from": "清除历史", "to": "$t('history.clear')" }, { "from": "确认清除", "to": "$t('history.clearConfirm')" }, { "from": "确定要清除所有搜索历史吗?", "to": "$t('history.clearConfirmMsg')" }, { "from": "暂无搜索历史", "to": "$t('history.empty')" }, { "from": "执行搜索后,搜索条件将显示在这里", "to": "$t('history.emptyDesc')" }, { "from": "刚刚", "to": "t('history.justNow')" }, { "from": "小时前", "to": "t('history.hoursAgo', { count })" }, { "from": "天前", "to": "t('history.daysAgo', { count })" } ], "steps": [ { "id": "4.9.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换模板中文 + 改造 formatTime 函数" }, { "id": "4.9.2", "action": "commit", "message": "feat(i18n): 改造 SearchHistoryPanel 组件" } ] }, { "id": "4.10", "name": "改造 TemplatePanel", "status": "pending", "description": "替换搜索模板面板中的硬编码中文", "files": { "modify": ["src/components/TemplatePanel/index.vue"] }, "replacements": [ { "from": "搜索模板", "to": "$t('template.title')" }, { "from": "搜索模板(占位符)", "to": "$t('template.searchPlaceholder')" }, { "from": "暂无模板", "to": "$t('template.empty')" }, { "from": "没有找到符合条件的模板", "to": "$t('template.emptyDesc')" }, { "from": "全部", "to": "$t('template.all')" } ], "steps": [ { "id": "4.10.1", "action": "write_implementation", "description": "添加 i18n 导入 + 替换 5 处硬编码中文" }, { "id": "4.10.2", "action": "commit", "message": "feat(i18n): 改造 TemplatePanel 组件" } ] } ] } }