From d9b192cea16ec6d031c4c0830b8de206d36851c5 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Mon, 19 Feb 2024 17:25:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E5=AF=B9Country=20Cod?= =?UTF-8?q?e=E7=9A=84=E9=9D=9E=E7=A9=BA=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/stationList.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/system/stationList.vue b/src/views/system/stationList.vue index 2a0ecfa..55e4d1b 100644 --- a/src/views/system/stationList.vue +++ b/src/views/system/stationList.vue @@ -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',