fix: 增加对Country Code的非空校验
This commit is contained in:
parent
183bc52071
commit
d9b192cea1
|
@ -188,7 +188,10 @@ export default {
|
|||
}
|
||||
|
||||
const validateCountryCode = (_, value, callback) => {
|
||||
if (value && value.length > 2) {
|
||||
if(!value) {
|
||||
callback(new Error('Please Enter Country Code'))
|
||||
}
|
||||
else if (value.length > 2) {
|
||||
callback(new Error('Country Code Limit 2 Char'))
|
||||
} else {
|
||||
callback()
|
||||
|
@ -199,7 +202,7 @@ export default {
|
|||
rules: {
|
||||
stationId: [{ required: true, message: 'Please Enter Station Id' }],
|
||||
stationCode: [{ required: true, validator: validateStationCode }],
|
||||
countryCode: [{ validator: validateCountryCode }]
|
||||
countryCode: [{ required: true, validator: validateCountryCode }]
|
||||
},
|
||||
url: {
|
||||
list: '/gardsStations/findPage',
|
||||
|
|
Loading…
Reference in New Issue
Block a user