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) => {
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',