fix: 限制最长新闻标签最多为4个字符
This commit is contained in:
parent
6fc064fbc8
commit
0a4bb5426e
@ -140,6 +140,11 @@ export default function ArticleEditModal(props: Props) {
|
|||||||
// setState({msgTitle: '请输入标题内容'});
|
// setState({msgTitle: '请输入标题内容'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(i18n.language == 'zh-CN' && tag.length > 4 ){
|
||||||
|
// 获取图文设置不正确的数据
|
||||||
|
setState({ msgGroup: t('news.edit.tag_length_error') });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) {
|
if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) {
|
||||||
setState({ msgGroup: t('news.edit_empty_human_content') });
|
setState({ msgGroup: t('news.edit_empty_human_content') });
|
||||||
return;
|
return;
|
||||||
@ -180,6 +185,11 @@ export default function ArticleEditModal(props: Props) {
|
|||||||
// setState({msgTitle: '请输入标题内容'});
|
// setState({msgTitle: '请输入标题内容'});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(i18n.language == 'zh-CN' && tag.length > 4 ){
|
||||||
|
// 获取图文设置不正确的数据
|
||||||
|
setState({ msgGroup: t('news.edit.tag_length_error') });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) {
|
if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) {
|
||||||
setState({ msgGroup: t('news.edit_empty_human_content') });
|
setState({ msgGroup: t('news.edit_empty_human_content') });
|
||||||
return;
|
return;
|
||||||
@ -307,7 +317,7 @@ export default function ArticleEditModal(props: Props) {
|
|||||||
key={idx} placement="bottomLeft" arrow={false}
|
key={idx} placement="bottomLeft" arrow={false}
|
||||||
content={<img className="w-[150px] rounded" src={opt.background} />}
|
content={<img className="w-[150px] rounded" src={opt.background} />}
|
||||||
>
|
>
|
||||||
<Radio value={opt.template_id}>背景{idx + 1}</Radio></Popover>
|
<Radio value={opt.template_id}>{t('news.edit.bg')}{idx + 1}</Radio></Popover>
|
||||||
))}
|
))}
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
"edit": {
|
"edit": {
|
||||||
"bg": "Background",
|
"bg": "Background",
|
||||||
"tag": "Tag",
|
"tag": "Tag",
|
||||||
|
"tag_length_error": "Video tag only limit 4 words ",
|
||||||
"tag_placeholder": "Example: Enterprise dynamics"
|
"tag_placeholder": "Example: Enterprise dynamics"
|
||||||
},
|
},
|
||||||
"edit_add_group": "Add Group",
|
"edit_add_group": "Add Group",
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
"edit": {
|
"edit": {
|
||||||
"bg": "背景",
|
"bg": "背景",
|
||||||
"tag": "标签",
|
"tag": "标签",
|
||||||
|
"tag_length_error": "标签长度不能超过4个字",
|
||||||
"tag_placeholder": "例:企业动态"
|
"tag_placeholder": "例:企业动态"
|
||||||
},
|
},
|
||||||
"edit_add_group": "新增分组",
|
"edit_add_group": "新增分组",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user