fix: 增加对Country Code的非空校验

This commit is contained in:
Xu Zhimeng 2024-02-19 17:25:27 +08:00
parent 183bc52071
commit d9b192cea1

View File

@ -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',