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