perf: 远程应用名称不能包含()

This commit is contained in:
“huailei000”
2023-10-24 19:28:20 +08:00
committed by huailei
parent 27ce5a3785
commit 67e99702c1
5 changed files with 22 additions and 1 deletions

View File

@@ -53,13 +53,27 @@ export const matchAlphanumericUnderscore = {
trigger: ['blur', 'change']
}
// 不能包含()
export const MatchExcludeParenthesis = {
validator: (rule, value, callback) => {
value = value?.trim()
if (!/^[^()]*$/.test(value)) {
callback(new Error(i18n.t('common.notParenthesis')))
} else {
callback()
}
},
trigger: ['blur', 'change']
}
export default {
IpCheck,
Required,
RequiredChange,
EmailCheck,
specialEmojiCheck,
matchAlphanumericUnderscore
matchAlphanumericUnderscore,
MatchExcludeParenthesis
}
export const JsonRequired = {

View File

@@ -867,6 +867,7 @@
"SecretKey": "Secret Key",
"NotSpecialEmoji": "No special emoji allowed",
"notAlphanumericUnderscore": "Only numbers, letters and underscores can be entered",
"notParenthesis": "Not contain ( )",
"Task": "Task",
"Cas": "CAS",
"Invalid": "Invalid",

View File

@@ -804,6 +804,7 @@
"FormatError": "フォーマットエラー",
"NotSpecialEmoji": "特殊な表情記号の入力は許可されていません",
"notAlphanumericUnderscore": "数字、文字、アンダースコアのみ入力可能",
"notParenthesis": "含まない ( )",
"WeekCronSelect": {
"Monday": "月曜日",
"Tuesday": "火曜日",

View File

@@ -838,6 +838,7 @@
"FormatError": "格式错误",
"NotSpecialEmoji": "不允许输入特殊表情符号",
"notAlphanumericUnderscore": "只能输入字母、数字、下划线",
"notParenthesis": "不能包含 ( )",
"WeekCronSelect": {
"Monday": "星期一",
"Tuesday": "星期二",

View File

@@ -4,6 +4,7 @@
<script>
import BaseAssetCreateUpdate from '@/views/assets/Asset/AssetCreateUpdate/BaseAssetCreateUpdate'
import { Required, MatchExcludeParenthesis } from '@/components/Form/DataForm/rules'
export default {
components: {
@@ -19,6 +20,9 @@ export default {
[this.$t('assets.Account'), ['auto_create_accounts', 'accounts_create_amount']]
],
addFieldsMeta: {
name: {
rules: [Required, MatchExcludeParenthesis]
},
accounts_create_amount: {
hidden: (formValue) => !formValue['auto_create_accounts']
},