@@ -57,20 +63,31 @@ export default function ArticleGroup({groups, editable, onChange, errorMessage}:
@@ -81,9 +98,12 @@ export default function ArticleGroup({groups, editable, onChange, errorMessage}:
- {editable && groups.length == 1 &&
- handleAddGroup?.(1,1)} className="article-action-add" title={t('news.materials.add_group')}>
- }
+ {editable && groups.length == 1 &&
+
+ handleAddGroup?.(1, 1)} className="article-action-add"
+ title={t('news.materials.add_group')}>
+
+
}
{groups.map((g, index) => (
index == 0 ? null :
{
groups[index] = blocks
- onChange?.([...groups])
+ onChange?.([...groups], hotNews)
}}
errorMessage={errorMessage}
index={index}
- onAdd={(_index,checkIndex) => {
- handleAddGroup?.(_index ? _index :index + 1,checkIndex)
+ onAdd={(_index, checkIndex) => {
+ handleAddGroup?.(_index ? _index : index + 1, checkIndex)
}}
- disableRemoveMessage={groups.length <= 1?t('news.edit_notice_keep_1'):''}
+ disableRemoveMessage={groups.length <= 1 ? t('news.edit_notice_keep_1') : ''}
onRemove={async () => {
if (groups.length <= 1) {
message.warning(t('news.edit_notice_keep_1'))
return;
}
- onChange?.(groups.filter((_, idx) => index !== idx))
+ onChange?.(groups.filter((_, idx) => index !== idx), hotNews)
}}
/>
))}
@@ -113,7 +133,7 @@ export default function ArticleGroup({groups, editable, onChange, errorMessage}:
{groups.length == 0 && editable &&
-
onChange?.([blocks])} index={0}
- blocks={[{type: 'text', content: ''}]}/>}
+ onChange?.([blocks],hotNews)} index={0}
+ blocks={[{type: 'text', content: ''}]}/>}
}
\ No newline at end of file
diff --git a/src/i18n/translations/en-US.json b/src/i18n/translations/en-US.json
index 9024c99..297cdc5 100644
--- a/src/i18n/translations/en-US.json
+++ b/src/i18n/translations/en-US.json
@@ -1,14 +1,8 @@
{
"AppTitle": "AI Livesteam",
- "go_to_home": "Go to Homepage" ,
"Hello": "Hello",
"cancel": "Cancel",
"close": "Close",
- "service_error": "Service exception, please contact customer support.",
- "error_401": "You do not have permission to access this page",
- "error_403": "You do not have permission to access this page",
- "error_404": "Page not found",
- "error_500": "Service exception, please contact customer support.",
"confirm": {
"push_title": "Push Notice",
"push_video": "Are you sure editing selected news?",
@@ -20,9 +14,14 @@
"delete_failed": "Delete failed",
"delete_success": "Delete success",
"download": "Download",
+ "error_401": "You do not have permission to access this page",
+ "error_403": "You do not have permission to access this page",
+ "error_404": "Page not found",
+ "error_500": "Service exception, please contact customer support.",
"generating": {
"title": "Preview - Click the video to play"
},
+ "go_to_home": "Go to Homepage",
"history": {
"delete_confirm": "Are you sure you want to delete this video?",
"push_success": "Streaming success",
@@ -49,6 +48,26 @@
"username": "Please enter your phone number",
"welcome": "Welcome"
},
+ "modal": {
+ "hot_news": {
+ "edit_auto": "Smart",
+ "edit_manual": "Manual",
+ "empty_notice_message": "\"Hot News\" has not been filled in yet. Should it be filled in automatically by the system?",
+ "empty_notice_title": "Notice",
+ "title": "Hot news"
+ },
+ "push_article": {
+ "action_all": "Still generating",
+ "action_cancel": "Cancel",
+ "action_skip": "Skip the news",
+ "content_error": "
{{count}} news are selected, and
{{error_count}} metahuman contents are too short in these news below. Do you want to transfer them to videos?",
+ "content_error_single": "
{{count}} news is selected, and the metahuman content is too short in this news. Do you want to transfer it to a video?",
+ "content_normal": "
{{count}} news are selected, Do you want to transfer them into videos?",
+ "content_normal_single": "
{{count}} news is selected. Do you want to transfer it to a video?",
+ "error_title": "Abnormal news"
+ },
+ "warning": "Warning"
+ },
"nav": {
"editing": "Editing",
"generating": "Generating",
@@ -89,8 +108,8 @@
"get_detail_error": "Get new details failed",
"image_count": "Images",
"materials": {
- "title": "News Materials",
- "add_group": "Add Group"
+ "add_group": "Add Group",
+ "title": "News Materials"
},
"news_all_source": "All",
"push_empty": "please select the news to edit",
@@ -118,6 +137,7 @@
"text": "Select",
"total": "Total: {{count}}"
},
+ "service_error": "Service exception, please contact customer support.",
"time_filter": {
"all": "All",
"last_week": "Last week",
@@ -142,8 +162,8 @@
"delete_description_count": "Are you sure you want to delete these {{count}} videos?",
"delete_empty": "Select the video you want to delete",
"download": "Download",
- "generating": "Generating",
"generate_failed": "Generate Failed",
+ "generating": "Generating",
"playing": "Playing",
"push_confirm": "Are you sure you want to streaming these video?",
"push_empty": "Select the video you want to streaming",
@@ -159,18 +179,5 @@
"title_generated_time": "Time stamp",
"title_operation": "",
"title_thumb": "Cover"
- },
- "modal": {
- "warning": "Warning",
- "push_article": {
- "content_normal": "
{{count}} news are selected, Do you want to transfer them into videos?",
- "content_normal_single": "
{{count}} news is selected. Do you want to transfer it to a video?",
- "content_error": "
{{count}} news are selected, and
{{error_count}} metahuman contents are too short in these news below. Do you want to transfer them to videos?",
- "content_error_single": "
{{count}} news is selected, and the metahuman content is too short in this news. Do you want to transfer it to a video?",
- "error_title": "Abnormal news",
- "action_cancel": "Cancel",
- "action_skip": "Skip the news",
- "action_all": "Still generating"
- }
}
}
\ No newline at end of file
diff --git a/src/i18n/translations/zh-CN.json b/src/i18n/translations/zh-CN.json
index 11bf1f4..4c1f6cf 100644
--- a/src/i18n/translations/zh-CN.json
+++ b/src/i18n/translations/zh-CN.json
@@ -1,14 +1,8 @@
{
"AppTitle": "数字人直播",
- "go_to_home": "返回首页" ,
"Hello": "你好",
"cancel": "取消",
"close": "关闭",
- "service_error": "新闻异常,无法生成,请咨询客服",
- "error_401": "您没有权限访问本页面",
- "error_403": "您没有权限访问本页面",
- "error_404": "访问的页面不存在",
- "error_500": "服务异常,请咨询客服.",
"confirm": {
"push_title": "推流提示",
"push_video": "是否确定一键推流选中新闻视频?",
@@ -20,9 +14,14 @@
"delete_failed": "删除失败",
"delete_success": "删除成功",
"download": "下载",
+ "error_401": "您没有权限访问本页面",
+ "error_403": "您没有权限访问本页面",
+ "error_404": "访问的页面不存在",
+ "error_500": "服务异常,请咨询客服.",
"generating": {
"title": "预览视频 - 点击视频列表播放"
},
+ "go_to_home": "返回首页",
"history": {
"delete_confirm": "是否要删除该视频",
"push_success": "一键推流成功,已推流至数字人直播间,请查看!",
@@ -49,6 +48,26 @@
"username": "请输入账号",
"welcome": "欢迎登录"
},
+ "modal": {
+ "hot_news": {
+ "edit_auto": "智能填充",
+ "edit_manual": "手动编辑",
+ "empty_notice_message": "“新闻热点”尚未填写,是否由系统自动填充?",
+ "empty_notice_title": "操作提示",
+ "title": "新闻热点"
+ },
+ "push_article": {
+ "action_all": "全部生成",
+ "action_cancel": "全部取消",
+ "action_skip": "跳过异常新闻",
+ "content_error": "已选中
{{count}}条新闻,
{{error_count}}条新闻数字人播报字数过少,是否生成全部
{{count}}条视频?",
+ "content_error_single": "已选中
{{count}}条新闻,
{{error_count}}条新闻数字人播报字数过少,是否生成全部
{{count}}条视频?",
+ "content_normal": "已选中
{{count}}条新闻,是否全部生成?",
+ "content_normal_single": "已选中
{{count}}条新闻,是否生成?",
+ "error_title": "异常新闻"
+ },
+ "warning": "操作提示"
+ },
"nav": {
"editing": "新闻编辑",
"generating": "视频生成",
@@ -89,8 +108,8 @@
"get_detail_error": "获取新闻详情失败",
"image_count": "图片数",
"materials": {
- "title": "新闻素材",
- "add_group": "新增分组"
+ "add_group": "新增分组",
+ "title": "新闻素材"
},
"news_all_source": "全部来源",
"push_empty": "请选择要推入编辑的新闻",
@@ -118,6 +137,7 @@
"text": "选择",
"total": "总共 {{count}} 条"
},
+ "service_error": "新闻异常,无法生成,请咨询客服",
"time_filter": {
"all": "所有时间",
"last_week": "近一周",
@@ -142,8 +162,8 @@
"delete_description_count": "已选择{{count}}条,确定要全部删除吗?",
"delete_empty": "请选择要删除的视频",
"download": "下载视频",
- "generating": "生成中",
"generate_failed": "生成失败",
+ "generating": "生成中",
"playing": "播放中",
"push_confirm": "是否确定一键推流选中新闻视频?",
"push_empty": "请选择要推流的新闻视频",
@@ -159,18 +179,5 @@
"title_generated_time": "生成时间",
"title_operation": "操作",
"title_thumb": "缩略图"
- },
- "modal": {
- "warning": "操作提示",
- "push_article": {
- "content_normal": "已选中
{{count}}条新闻,是否全部生成?",
- "content_normal_single": "已选中
{{count}}条新闻,是否生成?",
- "content_error": "已选中
{{count}}条新闻,
{{error_count}}条新闻数字人播报字数过少,是否生成全部
{{count}}条视频?",
- "content_error_single": "已选中
{{count}}条新闻,
{{error_count}}条新闻数字人播报字数过少,是否生成全部
{{count}}条视频?",
- "error_title": "异常新闻",
- "action_cancel": "全部取消",
- "action_skip": "跳过异常新闻",
- "action_all": "全部生成"
- }
}
}
\ No newline at end of file
diff --git a/src/service/api/article.ts b/src/service/api/article.ts
index 1e3118f..70f0662 100644
--- a/src/service/api/article.ts
+++ b/src/service/api/article.ts
@@ -20,13 +20,8 @@ export function getById(id: Id) {
return post
({url: '/article/detail/' + id})
}
-export function save(title: string, metahuman_text: string, content_group: BlockContent[][], id?: number) {
- return post<{ content: string }>(id && id > 0 ? '/article/modify' : '/article/create/new', {
- title,
- metahuman_text,
- content_group,
- id
- })
+export function save(params:{title: string, metahuman_text: string, content_group: BlockContent[][],hot_news: string[], id?: number}) {
+ return post<{ content: string }>(params.id && params.id > 0 ? '/article/modify' : '/article/create/new',params)
}
export function push2video(article_ids: Id[]) {
diff --git a/src/service/api/video.ts b/src/service/api/video.ts
index 5cffff9..4827bac 100644
--- a/src/service/api/video.ts
+++ b/src/service/api/video.ts
@@ -17,21 +17,24 @@ export function deleteHistories(ids: Id[]) {
* @param content_group
* @param article_id
*/
-export function regenerate(title: string, metahuman_text: string, content_group: BlockContent[][], article_id?: Id) {
+export function regenerate(params:{title: string, metahuman_text: string, content_group: BlockContent[][], id?: Id}) {
return post<{ content: string }>({
url: '/video/regenerate',
data: {
- title,
- metahuman_text,
- content_group,
- article_id
+ ...params,
+ article_id:params.id
}
})
}
// 重新生成视频
export async function regenerateById(article_id: Id) {
const article = await getArticle(article_id);
- return await regenerate(article.title, article.metahuman_text, article.content_group, article_id)
+ return await regenerate({
+ title:article.title,
+ metahuman_text:article.metahuman_text,
+ content_group:article.content_group,
+ id:article_id
+ })
}
export function getById(id: Id) {
diff --git a/src/types/core.d.ts b/src/types/core.d.ts
index 0545cd2..8a227f7 100644
--- a/src/types/core.d.ts
+++ b/src/types/core.d.ts
@@ -32,6 +32,8 @@ declare interface ArticleDetail {
id: number;
title: string;
metahuman_text: string;
+ hot_news_mode?: string;
+ hot_news: string[]; // 4月 6 日新增
content_group: BlockContent[][]
}