feat: ️ 优化数字人面板高度及布局,调整热点新闻编辑模式切换逻辑及国际化文案

This commit is contained in:
LittleBoy 2025-04-08 23:00:32 +08:00
parent 4dee84a459
commit 0520cb8e1d
3 changed files with 12 additions and 12 deletions

View File

@ -39,21 +39,21 @@ function HotNews({news, mode, onValueChange}: HotNewsProps) {
</div> </div>
<div className="mode"> <div className="mode">
<span className="mr-2">{mode == 'auto' ? t("modal.hot_news.edit_auto") : t("modal.hot_news.edit_manual")}</span> <span className="mr-2">{mode == 'auto' ? t("modal.hot_news.edit_auto") : t("modal.hot_news.edit_manual")}</span>
<Switch size="small" checked={mode == 'auto'} onChange={checked => { <Switch size="small" checked={mode != 'auto'} onChange={checked => {
onValueChange({news, mode: checked ? 'auto' : 'manual'}) onValueChange({news, mode: checked ? 'manual' : 'auto'})
}}/> }}/>
</div> </div>
</div> </div>
<div className="hot-news-list panel-body p-3 "> {mode != 'auto' && <div className="hot-news-list panel-body p-3 ">
{news.map((item, index) => <div key={index} className={`hot-news-item bg-gray-50 ${index == 0?'':'mt-3'} rounded-xl`}> {news.map((item, index) => <div key={index} className={`hot-news-item bg-gray-50 ${index == 0?'':'mt-3'} rounded-xl`}>
<Input <Input
variant={"borderless"} variant={"borderless"}
readOnly={mode == 'auto'} readOnly={mode == 'auto'}
placeholder={mode != 'auto' ? demoPlaceholderList[index] : ''} placeholder={mode != 'auto' ? demoPlaceholderList[index] : ''}
value={item} value={item}
onChange={e => handleValueChange(e.target.value, index)}/> onChange={e => handleValueChange(e.target.value, index)}/>
</div>)} </div>)}
</div> </div>}
</div> </div>
) )
} }

View File

@ -56,20 +56,20 @@ export default function ArticleGroup({groups, editable, onChange, errorMessage,
} }
return <div className={styles.group}> return <div className={styles.group}>
<div className={'panel digital-person'}> <div className={'panel digital-person h-[544px]'}>
<div className="area-title"> <div className="area-title">
<span className="">{t('news.edit_digital_text')}</span> <span className="">{t('news.edit_digital_text')}</span>
{i18n.language == 'zh-CN' && <span className="text-gray-400"></span>} {i18n.language == 'zh-CN' && <span className="text-gray-400"></span>}
</div> </div>
<div className="panel-body p-3"> <div className="panel-body p-3 flex-1">
{/* value={groups || groups[0][0].content}*/} {/* value={groups || groups[0][0].content}*/}
<div className="h-[306px] pt-2 rounded-xl overflow-hidden bg-gray-50"> <div className={`pt-2 h-full rounded-xl overflow-hidden bg-gray-50`}>
<div className="human-tts"> <div className="human-tts">
{editable ? <div className="relative"> {editable ? <div className="relative">
<Input.TextArea <Input.TextArea
placeholder={t('news.edit_notice_enter_text')} placeholder={t('news.edit_notice_enter_text')}
value={groups && groups.length > 0 ? groups[0][0].content : ''} value={groups && groups.length > 0 ? groups[0][0].content : ''}
autoSize={{minRows: 20, maxRows: 21}} autoSize={{maxRows: hotNews.mode == 'auto'?20:13}}
variant={"borderless"} variant={"borderless"}
onChange={e => { onChange={e => {
handleDigitalPersonContentChange(e.target.value) handleDigitalPersonContentChange(e.target.value)

View File

@ -55,10 +55,10 @@
"modal": { "modal": {
"hot_news": { "hot_news": {
"edit_auto": "智能填充", "edit_auto": "智能填充",
"edit_manual": "手动编辑", "edit_manual": "自定义",
"empty_notice_message": "手动编辑的“新闻热点”尚未填写完毕,<br/>请填写全部热点,或开启智能填充", "empty_notice_message": "自定义的“新闻热点”尚未填写完毕,<br/>请填写全部热点,或开启智能填充",
"empty_notice_title": "操作提示", "empty_notice_title": "操作提示",
"title": "新闻热点" "title": "视频下方热点(跑马灯)"
}, },
"push_article": { "push_article": {
"action_all": "全部生成", "action_all": "全部生成",