Commit 9b604371 authored by 涂伟's avatar 涂伟
parents 54b0a96b c9420624
Pipeline #70179 waiting for manual action with stages
...@@ -320,15 +320,15 @@ const AddModal = props => { ...@@ -320,15 +320,15 @@ const AddModal = props => {
}, },
{ {
validator: (rule, value) => { validator: (rule, value) => {
let aa = form.getFieldValue().Key; let val = form.getFieldValue().Key;
if (!/^[^\u4e00-\u9fa5]{1,10}$/g.test(aa)) { if (/[\u4E00-\u9FA5]/.test(val)) {
return Promise.reject('不允许输入中文'); return Promise.reject('不允许输入中文');
} }
if (type === 'edit') { if (type === 'edit') {
if (keepData.indexOf(aa) !== -1 && pickItem.key !== aa) { if (keepData.indexOf(val) !== -1 && pickItem.key !== val) {
return Promise.reject('关键字已存在'); return Promise.reject('关键字已存在');
} }
} else if (keepData.indexOf(aa) !== -1) { } else if (keepData.indexOf(val) !== -1) {
return Promise.reject('关键字已存在'); return Promise.reject('关键字已存在');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment