feat(web): ontology extract add form rules

This commit is contained in:
zhaoying
2026-03-04 17:04:25 +08:00
parent 4ee198813a
commit f5eda38dc9
3 changed files with 3 additions and 0 deletions

View File

@@ -456,6 +456,7 @@ export const en = {
logoTip: `Supported image formats: JPG, PNG \n Suggested size: square ratio \n Maximum size: ≤ 2MB`, logoTip: `Supported image formats: JPG, PNG \n Suggested size: square ratio \n Maximum size: ≤ 2MB`,
imageSquareRequired: 'Please upload a square image', imageSquareRequired: 'Please upload a square image',
nameInvalid: 'Name cannot start or end with a space', nameInvalid: 'Name cannot start or end with a space',
notAllSpaces: 'Cannot be all spaces',
}, },
model: { model: {
searchPlaceholder: 'search model…', searchPlaceholder: 'search model…',

View File

@@ -1032,6 +1032,7 @@ export const zh = {
logoTip: `支持图片格式JPG、PNG\n 尺寸:正方形比例 \n 文件大小限制:≤ 2MB`, logoTip: `支持图片格式JPG、PNG\n 尺寸:正方形比例 \n 文件大小限制:≤ 2MB`,
imageSquareRequired: '请上传正方形比例图片', imageSquareRequired: '请上传正方形比例图片',
nameInvalid: '不能是空格开头或结尾', nameInvalid: '不能是空格开头或结尾',
notAllSpaces: '不能是纯空格',
}, },
model: { model: {
searchPlaceholder: '搜索模型…', searchPlaceholder: '搜索模型…',

View File

@@ -185,6 +185,7 @@ const OntologyClassExtractModal = forwardRef<OntologyClassExtractModalRef, Ontol
rules={[ rules={[
{ required: true, message: t('common.pleaseEnter') }, { required: true, message: t('common.pleaseEnter') },
{ max: 2000 }, { max: 2000 },
{ pattern: /^(?!\s*$).+$/, message: t('common.notAllSpaces') },
]} ]}
> >
<Input.TextArea placeholder={t('ontology.scenarioPlaceholder')} /> <Input.TextArea placeholder={t('ontology.scenarioPlaceholder')} />