diff --git a/app/(admin)/settings/agent-workflow/agent-workflow-settings-client.tsx b/app/(admin)/settings/agent-workflow/agent-workflow-settings-client.tsx index fd907f28b..85bb360cc 100644 --- a/app/(admin)/settings/agent-workflow/agent-workflow-settings-client.tsx +++ b/app/(admin)/settings/agent-workflow/agent-workflow-settings-client.tsx @@ -913,6 +913,8 @@ export function AgentWorkflowSettingsClient({ () => getAgentWorkflowCategoryLabels(config), [config] ); + const firstCategoryLabel = categoryLabels.firstCategory; + const secondCategoryLabel = categoryLabels.secondCategory; const thirdCategoryLabel = categoryLabels.thirdCategory; const fourthCategoryLabel = categoryLabels.fourthCategory; const fifthCategoryLabel = categoryLabels.fifthCategory; @@ -1013,12 +1015,12 @@ export function AgentWorkflowSettingsClient({ const handleAddBrandEntry = () => { const nextValue = normalizeInputOptionValue(brandDraft); if (!nextValue) { - toast.error("请输入品牌名称"); + toast.error(`请输入${firstCategoryLabel}名称`); return; } if (brandStoreEntries.some((item) => item.brandName.toLowerCase() === nextValue.toLowerCase())) { - toast.error("该品牌已存在"); + toast.error(`该${firstCategoryLabel}已存在`); return; } @@ -1074,7 +1076,7 @@ export function AgentWorkflowSettingsClient({ const draft = storeDrafts[brandName] || ""; const nextValue = normalizeInputOptionValue(draft); if (!nextValue) { - toast.error("请输入店铺名称"); + toast.error(`请输入${secondCategoryLabel}名称`); return; } @@ -1085,7 +1087,7 @@ export function AgentWorkflowSettingsClient({ ) || targetEntry?.stores.some((store) => store.toLowerCase() === nextValue.toLowerCase()) ) { - toast.error("该店铺已存在"); + toast.error(`该${secondCategoryLabel}已存在`); return; } @@ -2014,7 +2016,7 @@ export function AgentWorkflowSettingsClient({ const handleDownloadBrandTemplate = async () => { try { await downloadAgentWorkflowBrandImportTemplate(categoryLabels); - toast.success("品牌导入模板已开始下载"); + toast.success("层级导入模板已开始下载"); } catch (error) { toast.error(error instanceof Error ? error.message : "下载模板失败"); } @@ -2031,7 +2033,7 @@ export function AgentWorkflowSettingsClient({ setIsImportingBrandSheet(true); const { entries, rowCount } = await parseAgentWorkflowBrandImportFile(file, categoryLabels); updateInputOptions([...brandStoreEntries, ...entries]); - toast.success(`已从表格导入 ${rowCount} 行,品牌树已自动合并去重`); + toast.success(`已从表格导入 ${rowCount} 行,层级树已自动合并去重`); } catch (error) { toast.error(error instanceof Error ? error.message : "导入表格失败"); } finally { @@ -3477,7 +3479,9 @@ export function AgentWorkflowSettingsClient({
基础下拉选项 - 配置品牌、店铺与分类层级关系,以及第一页可选的价格带区间 + + 配置{firstCategoryLabel}、{secondCategoryLabel}与分类层级关系,以及第一页可选的价格带区间 +
@@ -3485,14 +3489,14 @@ export function AgentWorkflowSettingsClient({
- +

- 支持一键下载模板并导入品牌、店铺、{thirdCategoryLabel}、{fourthCategoryLabel}、{fifthCategoryLabel}表格 + 支持一键下载模板并导入{firstCategoryLabel}、{secondCategoryLabel}、{thirdCategoryLabel}、{fourthCategoryLabel}、{fifthCategoryLabel}表格

- {brandStoreEntries.length} 个品牌 + {brandStoreEntries.length} 个{firstCategoryLabel}
@@ -3587,13 +3607,13 @@ export function AgentWorkflowSettingsClient({ type="button" onClick={() => handleRemoveBrandEntry(entry.brandName)} className="rounded-full p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-destructive" - aria-label={`删除品牌 ${entry.brandName}`} + aria-label={`删除${firstCategoryLabel} ${entry.brandName}`} >
- {(entry.storeEntries || []).length} 个店铺 + {(entry.storeEntries || []).length} 个{secondCategoryLabel}
@@ -3614,7 +3634,7 @@ export function AgentWorkflowSettingsClient({ handleAddStoreToBrand(entry.brandName); } }} - placeholder={`给品牌“${entry.brandName}”添加店铺`} + placeholder={`给${firstCategoryLabel}“${entry.brandName}”添加${secondCategoryLabel}`} /> @@ -3649,7 +3669,7 @@ export function AgentWorkflowSettingsClient({ ) } className="rounded-full p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-destructive" - aria-label={`删除店铺 ${storeEntry.storeName}`} + aria-label={`删除${secondCategoryLabel} ${storeEntry.storeName}`} > @@ -3679,7 +3699,7 @@ export function AgentWorkflowSettingsClient({ ); } }} - placeholder={`给店铺“${storeEntry.storeName}”添加${thirdCategoryLabel}`} + placeholder={`给${secondCategoryLabel}“${storeEntry.storeName}”添加${thirdCategoryLabel}`} />