diff --git a/src/components/article/edit-modal.tsx b/src/components/article/edit-modal.tsx
index 7d46000..6b24778 100644
--- a/src/components/article/edit-modal.tsx
+++ b/src/components/article/edit-modal.tsx
@@ -100,9 +100,21 @@ export default function ArticleEditModal(props: Props) {
return;
}
if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) {
- // setState({msgGroup: '请输入正文文本内容'});
+ setState({msgGroup: t('news.edit_empty_human_content')});
return;
}
+ // 验证图文都存在时,文图是否匹配
+ if(groups.length > 1) {
+ // 获取图文设置不正确的数据
+ const group = groups.filter((it,idx)=>{
+ return idx > 0 && (it.length < 2 || it.some(s=>s.content.trim().length == 0))
+ })
+ console.log('xxx',group)
+ if(group.length > 0){
+ setState({msgGroup: t('news.edit_empty_group_content')});
+ return;
+ }
+ }
if(!props.id || state.generating) return;
setState({generating:true})
await article.save(title, groups[0][0].content, groups.slice(1), props.id)
@@ -164,6 +176,7 @@ export default function ArticleEditModal(props: Props) {
setState({msgGroup: (list.length == 0 || list[0].length == 0 || !list[0][0].content) ? t('news.edit_notice_enter_article_content') : ''});
}}
/>
+
{state.msgGroup}
{state.error && {state.error}
}
diff --git a/src/i18n/translations/en-US.json b/src/i18n/translations/en-US.json
index 0f0f320..881c784 100644
--- a/src/i18n/translations/en-US.json
+++ b/src/i18n/translations/en-US.json
@@ -73,6 +73,8 @@
"edit_notice_keep_1": "Keep at least one content block",
"edit_other_text": "Other media Material",
"edit_save_failed": "Save failed!",
+ "edit_empty_human_content": "Please enter meta human material",
+ "edit_empty_group_content": "Please other media material",
"editing": "Editing",
"filter_all": "All",
"filter_source": "News source",
diff --git a/src/i18n/translations/zh-CN.json b/src/i18n/translations/zh-CN.json
index 4c38ffe..8417c01 100644
--- a/src/i18n/translations/zh-CN.json
+++ b/src/i18n/translations/zh-CN.json
@@ -69,10 +69,12 @@
"edit_notice_enter_article_content": "请输入正文文本内容",
"edit_notice_enter_article_title": "请输入文章标题",
"edit_notice_enter_article_title1": "请输入标题内容",
- "edit_notice_enter_text": "请先填写当前组的内容",
+ "edit_notice_enter_text": "请先填写文本内容",
"edit_notice_keep_1": "至少保留一个内容块",
"edit_other_text": "素材融合呈现编辑区",
"edit_save_failed": "保存失败,请重试!",
+ "edit_empty_human_content": "请先填写数字人播报内容",
+ "edit_empty_group_content": "正文文本和图片均不为空",
"editing": "新闻编辑",
"filter_all": "全部",
"filter_source": "新闻来源",
@@ -133,6 +135,7 @@
"delete_description_count": "已选择{{count}}条,确定要全部删除吗?",
"delete_empty": "请选择要删除的视频",
"download": "下载视频",
+ "generating": "生成中",
"playing": "播放中",
"push_confirm": "是否确定一键推流选中新闻视频?",
"push_empty": "请选择要推流的新闻视频",
diff --git a/src/pages/live/index.tsx b/src/pages/live/index.tsx
index 2b95cc2..19a3042 100644
--- a/src/pages/live/index.tsx
+++ b/src/pages/live/index.tsx
@@ -206,6 +206,11 @@ export default function LiveIndex() {
return checkedIdArray.filter(id => currentId.id != id)
}, [checkedIdArray, state.activeIndex])
+ const currentSelectedVideoIds = useMemo(()=>{
+ const activeId = videoData[state.activeIndex].id;
+ return checkedIdArray.length == 0 ? [] : checkedIdArray.filter(id => id != activeId)
+ },[checkedIdArray,state.activeIndex])
+
return (
@@ -320,14 +325,14 @@ export default function LiveIndex() {
scrollerRef.current?.scrollToPosition(0)}/>
- {checkedIdArray.length > 0 && 0 && 1?
- t('video.delete_description_count',{count:checkedIdArray.length})
+ confirmMessage={currentSelectedVideoIds.length > 1?
+ t('video.delete_description_count',{count:currentSelectedVideoIds.length})
:
- t('video.delete_description',{count:checkedIdArray.length})}
+ t('video.delete_description',{count:currentSelectedVideoIds.length})}
onSuccess={loadList}
onProcess={processDeleteVideo}
>