修改验证方式

This commit is contained in:
RenCheng 2025-04-26 13:49:37 +08:00
parent 62fa53b067
commit b7e23f1210

View File

@ -26,9 +26,14 @@
:wrapperCol="wrapperCol" label="端口号" > :wrapperCol="wrapperCol" label="端口号" >
<a-input v-decorator="['port',{ <a-input v-decorator="['port',{
rules: [ rules: [
{ required: true, message: '端口号不能为空' }, {
{ min: 1, max: 5, message: '长度1-5位' }, required: true,
{ type: 'number', message: '端口号必须为数字'} message: '端口号不能为空'
},
{
pattern: /^\d{1,5}$/,
message: '请输入1-5位的数字'
}
], ],
validateTrigger: 'change' validateTrigger: 'change'
}]" :disabled="testConnBool"></a-input> }]" :disabled="testConnBool"></a-input>
@ -208,7 +213,7 @@ import { datasyncqueryPage,
this.getselect(); this.getselect();
let model = {}; let model = {};
model.ip = ""; model.ip = "";
model.port = ""; model.port = 0;
model.username = ''; model.username = '';
model.password = ''; model.password = '';
model.database = ''; model.database = '';