Sfoglia il codice sorgente

feat(组件): 修改

tangning 2 anni fa
parent
commit
0b7d176f82
1 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 10 1
      src/views/corporation/SubaccountModal.vue

+ 10 - 1
src/views/corporation/SubaccountModal.vue

@@ -159,7 +159,16 @@
         {
           title: t('common.mobile'),
           edit: true,
-          editRule: true,
+          editRule: async (text) => {
+            var reg_tel =
+              /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
+            if (text && text.length > 11) {
+              return t('routes.corporation.maxlength');
+            } else if (!reg_tel.test(text)) {
+              return t('common.phoneError');
+            }
+            return '';
+          },
           width: 160,
           dataIndex: 'userName',
         },