diff --git a/src/utils/validate.ts b/src/utils/validate.ts index 4eba7d5f..6db4bbce 100644 --- a/src/utils/validate.ts +++ b/src/utils/validate.ts @@ -34,10 +34,10 @@ export const rule = { } }, /** - * 校验 请输入中文、英文、数字包括下划线 + * 校验 请输入大写英文、下划线 * 名称校验 */ - validatorKey(rule: any, value: any, callback: any) { + validatorCapital(rule: any, value: any, callback: any) { const acount = /^[A-Z_]+$/; if (value && !acount.test(value)) { callback(new Error('请输入大写英文、下划线')); @@ -46,6 +46,19 @@ export const rule = { } }, + /** + * 校验 请输入小写英文、下划线 + * 名称校验 + */ + validatorLowercase(rule: any, value: any, callback: any) { + const acount = /^[a-z_]+$/; + if (value && !acount.test(value)) { + callback(new Error('请输入小写英文、下划线')); + } else { + callback(); + } + }, + /** * 校验首尾空白字符的正则表达式 * diff --git a/src/views/admin/client/form.vue b/src/views/admin/client/form.vue index 04005241..34609e9f 100644 --- a/src/views/admin/client/form.vue +++ b/src/views/admin/client/form.vue @@ -20,39 +20,27 @@ - + - - {{ item.label }} - - - - - - - - - - - - - + + + - + - + - + {{ item.label }} @@ -60,9 +48,15 @@ - - - + + + + + + + + + @@ -118,13 +112,13 @@