Browse Source

perf: 唯一key 校验调整

lanceJiang 1 year ago
parent
commit
b585ea07c5
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/views/flow/create/components/BasicInfo.vue

+ 6 - 1
src/views/flow/create/components/BasicInfo.vue

@@ -21,7 +21,12 @@ const rules = {
 	processKey: [
 		{
 			required: true,
-			message: '请输入唯一标识',
+			// message: '请输入唯一标识',
+			validator(rule, value, callback) {
+				if (!value) callback('请输入唯一标识')
+				if (!/^[a-zA-Z0-9]+$/g.test(value)) callback('仅支持字母和数字')
+				callback()
+			},
 			trigger: 'blur'
 		}
 	],