批量上传

This commit is contained in:
2026-05-15 10:54:06 +08:00
parent be8ea4e486
commit d765628bb3
4 changed files with 1590 additions and 240 deletions

View File

@@ -510,7 +510,7 @@ const en = {
languagePlaceholder: 'Language',
searchBtn: 'Search',
createTemplate: 'Create Template',
colTitle: 'Template title',
colTitle: 'Template title',
colSubject: 'Email subject',
colScene: 'Scene',
colLanguage: 'Language',
@@ -526,6 +526,23 @@ colTitle: 'Template title',
deleteFail: 'Delete failed',
previewTitle: 'Template preview',
previewClose: 'Close',
batchImportBtn: 'Batch import',
batchImportTitle: 'Batch import templates (JSON)',
batchImportHint:
'Paste a JSON array. Each item is saved via the same API as the editor (omit template_id to create; include template_id to update). Fields: title, subject, scene, language (or lang), version, body_html (or body), variables_json (or variables), is_active.',
batchImportCommonTip: 'Journal ID is set in the field below; when non-empty it overrides journal_id / journalId on every row.',
batchImportJournalId: 'Journal ID',
batchImportJournalPlaceholder: 'Match list filter or type manually',
batchImportRun: 'Run import',
batchImportBadJson: 'Invalid JSON',
batchImportEmpty: 'Array must contain at least one object',
batchImportMissingJournal: 'Row {index}: missing journal_id (use the input above or put journal_id in JSON)',
batchImportMissingField: 'Row {index}: missing {field}',
batchImportRowFail: 'Row {index} failed: {msg}',
batchImportRowNetwork: 'Row {index}: request error',
batchImportDone: 'Done: {ok} succeeded, {fail} failed',
batchImportErrorsTitle: 'Errors (first 8)',
batchImportSaveFail: 'Save failed',
},
mailboxStyle: {
title: 'Email Styles',
@@ -1244,6 +1261,55 @@ colTitle: 'Template title',
onlySaveConfig: 'Save configuration only',
enableNowNextDay: 'Enable auto promotion now (starts next day)',
factoryCreateBtn: 'Create automated promotion task',
factoryBatchImportBtn: 'Batch import (JSON)',
factoryBatchImportTitle: 'Batch create tasks (JSON)',
factoryBatchImportHintShort: 'Submit a JSON array; non-empty fields merge into each row. You can still edit JSON.',
factoryBatchImportHint:
'Paste a JSON array… Pick journal (getAllJournal) or type ID; template/style/fetch_ids below override JSON when non-empty. Load promotion fields to tick IDs or type comma-separated fetch_ids; load accounts for j_email_id. expert_type "5" needs partitions/countries. Shorthand: zones, countries, email_id_list.',
factoryBatchImportCommonTip: 'Journal from cover or ID field; non-empty template ID, style ID, or fetch_ids override JSON on every row.',
factoryBatchImportJournalId: 'Journal ID',
factoryBatchImportJournalPick: 'Journal',
factoryBatchImportJournalEmpty: 'No journals returned. Check api/Journal/getAllJournal.',
factoryBatchImportJournalManualPlaceholder: 'Filled when you pick a cover, or type manually',
factoryBatchImportTemplateId: 'Template ID',
factoryBatchImportStyleId: 'Style ID',
factoryBatchImportJournalPlaceholder: 'Merged into payload',
factoryBatchImportTemplatePlaceholder: 'Merged into payload',
factoryBatchImportStylePlaceholder: 'Merged into payload',
factoryBatchImportFetchIdsLabel: 'Promotion fields (fetch_ids)',
factoryBatchImportLoadFields: 'Load available fields',
factoryBatchImportFetchTip: 'Uses current journal: pick journal, then load. Search by name or ID (multiple tokens: space or comma). “Select all” selects the filtered list when search is set, otherwise all fields. Checkboxes sync with the comma text; when non-empty, overrides fetch_ids on every row.',
factoryBatchImportFetchIdsManual: 'Merged IDs (comma-separated, editable)',
factoryBatchImportFetchIdsPlaceholder: 'e.g. 1,2,3 or use checkboxes',
factoryBatchImportNeedJournalForFields: 'Select or enter journal ID first',
factoryBatchImportLoadAccounts: 'Load accounts for journal',
factoryBatchImportAccountsApiTip: 'POST api/email_client/getAccounts with journal_id',
factoryBatchImportColEmailId: 'j_email_id',
factoryBatchImportColAddress: 'Sender address',
factoryBatchImportColQuota: 'Remaining / daily limit',
factoryBatchImportCopyEmailIds: 'Copy email_ids (comma)',
factoryBatchImportNeedJournalForAccounts: 'Enter journal ID first',
factoryBatchImportNoAccounts: 'No mailbox accounts for this journal',
factoryBatchImportAccountsFail: 'Failed to load accounts',
factoryBatchImportCopyEmailIdsEmpty: 'Load the account list first',
factoryBatchImportIdsCopied: 'Copied j_email_id list to clipboard',
factoryBatchImportCopyFail: 'Copy failed; select and copy manually',
factoryBatchImportSyncToJson: 'Apply top form to JSON',
factoryBatchImportSyncFromJson: 'Load first row into form',
factoryBatchImportSyncIncludeEmails: 'When applying, set each row email_ids from loaded accounts',
factoryBatchImportSyncTip: 'You can still edit JSON manually; non-empty top fields are merged again on submit.',
factoryBatchImportJsonFromUiOk: 'JSON updated from the form',
factoryBatchImportUiFromJsonOk: 'Form updated from the first JSON row',
factoryBatchImportRun: 'Run batch create',
factoryBatchImportBadJson: 'Invalid JSON; check brackets and quotes',
factoryBatchImportEmpty: 'Array must contain at least one object',
factoryBatchImportMissing: 'Row {index}: missing field {field}',
factoryBatchImportNeedFetch: 'Row {index}: expert database requires fetch_ids',
factoryBatchImportNeedZone: 'Row {index}: expert database requires target_partitions or target_country_ids',
factoryBatchImportRowFail: 'Row {index} failed: {msg}',
factoryBatchImportRowNetwork: 'Row {index}: request error',
factoryBatchImportDone: 'Done: {ok} succeeded, {fail} failed',
factoryBatchImportErrorsTitle: 'Errors (first 8)',
factoryDialogTitle: 'Create task',
factoryJournal: 'Journal',
factoryJournalPlaceholder: 'Select a journal',

View File

@@ -515,6 +515,23 @@ const zh = {
deleteFail: '删除失败',
previewTitle: '模板预览',
previewClose: '关闭',
batchImportBtn: '批量导入',
batchImportTitle: '批量导入邮件模板JSON',
batchImportHint:
'粘贴 JSON 数组,每条对应一次保存接口(新建不传 template_id更新可带 template_id。字段与编辑页一致title、subject、scene、language可用 lang、version、body_html可用 body、variables_json可用 variables、is_active。',
batchImportCommonTip: '期刊 ID 在下方单独填写;若填写非空,会覆盖每条 JSON 中的 journal_id / journalId。',
batchImportJournalId: '期刊 ID',
batchImportJournalPlaceholder: '可与列表筛选一致,或手填',
batchImportRun: '开始导入',
batchImportBadJson: 'JSON 解析失败',
batchImportEmpty: '请至少包含一条对象',
batchImportMissingJournal: '第 {index} 条:缺少期刊 ID请填写上方输入框或在 JSON 中提供 journal_id',
batchImportMissingField: '第 {index} 条:缺少字段 {field}',
batchImportRowFail: '第 {index} 条保存失败:{msg}',
batchImportRowNetwork: '第 {index} 条请求异常',
batchImportDone: '完成:成功 {ok},失败 {fail}',
batchImportErrorsTitle: '失败明细(最多 8 条)',
batchImportSaveFail: '保存失败',
},
mailboxStyle: {
title: '邮件风格',
@@ -1225,6 +1242,55 @@ const zh = {
onlySaveConfig: '仅保存配置',
enableNowNextDay: '立即激活自动推广(次日开始自动推广)',
factoryCreateBtn: '创建自动化推广任务',
factoryBatchImportBtn: '临时批量导入',
factoryBatchImportTitle: '批量创建推广任务JSON',
factoryBatchImportHintShort: '数组提交;上方非空项会合并进每条请求,仍可直接改 JSON。',
factoryBatchImportHint:
'粘贴 JSON 数组…期刊用封面getAllJournal或手填 ID模板/样式/推广领域 fetch_ids 在下方非空则覆盖 JSON。推广领域可「加载可选领域」勾选或手改逗号 ID填期刊后可查邮箱 j_email_idgetAccounts。expert_type 为 5 时须分区或国家。简写zones、countries、email_id_list。',
factoryBatchImportCommonTip: '期刊以封面或下方 ID 为准;模板 ID、样式 ID、推广领域 fetch_ids 任一非空则覆盖每条 JSON 中对应字段后再请求接口。',
factoryBatchImportJournalId: '期刊 ID',
factoryBatchImportJournalPick: '选择期刊',
factoryBatchImportJournalEmpty: '未获取到期刊列表,请检查接口或稍后重试',
factoryBatchImportJournalManualPlaceholder: '点击上方封面自动填入,也可手改',
factoryBatchImportTemplateId: '模板 ID',
factoryBatchImportStyleId: '样式 ID',
factoryBatchImportJournalPlaceholder: '与 JSON 合并',
factoryBatchImportTemplatePlaceholder: '与 JSON 合并',
factoryBatchImportStylePlaceholder: '与 JSON 合并',
factoryBatchImportFetchIdsLabel: '推广领域 fetch_ids',
factoryBatchImportLoadFields: '加载可选领域',
factoryBatchImportFetchTip: '依赖当前期刊:先选期刊再加载。上方可搜索名称或 ID多关键词用空格或逗号有搜索时「全选」勾选当前筛选结果无搜索时「全选」为全部。勾选与下方逗号文本同步非空则覆盖每条 JSON 的 fetch_ids。',
factoryBatchImportFetchIdsManual: '合并用 ID逗号分隔可手改',
factoryBatchImportFetchIdsPlaceholder: '例1,2,3或与勾选联动',
factoryBatchImportNeedJournalForFields: '请先选择或填写期刊 ID',
factoryBatchImportLoadAccounts: '查询该期刊邮箱',
factoryBatchImportAccountsApiTip: 'POST api/email_client/getAccounts参数 journal_id',
factoryBatchImportColEmailId: 'j_email_id',
factoryBatchImportColAddress: '发件地址',
factoryBatchImportColQuota: '今日剩余 / 日上限',
factoryBatchImportCopyEmailIds: '复制 email_ids逗号',
factoryBatchImportNeedJournalForAccounts: '请先填写期刊 ID',
factoryBatchImportNoAccounts: '该期刊下暂无邮箱账号',
factoryBatchImportAccountsFail: '拉取邮箱列表失败',
factoryBatchImportCopyEmailIdsEmpty: '请先查询出账号列表',
factoryBatchImportIdsCopied: '已复制 j_email_id 列表到剪贴板',
factoryBatchImportCopyFail: '复制失败,请手动选中复制',
factoryBatchImportSyncToJson: '上方选项写入 JSON',
factoryBatchImportSyncFromJson: '首条 JSON 回显到上方',
factoryBatchImportSyncIncludeEmails: '写入时用当前邮箱列表覆盖每条 email_ids',
factoryBatchImportSyncTip: '写入后仍可单独改 JSON提交时若上方输入框非空仍会再合并覆盖。',
factoryBatchImportJsonFromUiOk: '已根据上方选项更新 JSON',
factoryBatchImportUiFromJsonOk: '已用首条 JSON 更新上方表单',
factoryBatchImportRun: '开始批量创建',
factoryBatchImportBadJson: 'JSON 解析失败,请检查括号与引号',
factoryBatchImportEmpty: '请至少包含一条对象',
factoryBatchImportMissing: '第 {index} 条缺少字段:{field}',
factoryBatchImportNeedFetch: '第 {index} 条:专家库需填写 fetch_ids推广领域',
factoryBatchImportNeedZone: '第 {index} 条专家库需至少填写分区或国家target_partitions / target_country_ids',
factoryBatchImportRowFail: '第 {index} 条创建失败:{msg}',
factoryBatchImportRowNetwork: '第 {index} 条请求异常',
factoryBatchImportDone: '完成:成功 {ok},失败 {fail}',
factoryBatchImportErrorsTitle: '失败明细(最多显示 8 条)',
factoryDialogTitle: '创建任务',
factoryJournal: '期刊',
factoryJournalPlaceholder: '请选择期刊',