|
|
@@ -4396,9 +4396,7 @@ export default {
|
|
|
let maxValue = item.collectionOptionList[0].maxValue;
|
|
|
if (maxValue && maxValue != '') {
|
|
|
if (value.length > Number(maxValue)) {
|
|
|
- // this.$set(itemData, 'answerValue', '');
|
|
|
this.$set(itemData, 'ruleMessage', '最大字数为:' + maxValue);
|
|
|
- // this.$toast('输入内容不合法');
|
|
|
this.validatorFlag = false;
|
|
|
return;
|
|
|
}
|
|
|
@@ -4407,9 +4405,7 @@ export default {
|
|
|
let minValue = item.collectionOptionList[0].minValue;
|
|
|
if (minValue && minValue != '') {
|
|
|
if (value.length < Number(minValue)) {
|
|
|
- // this.$set(itemData, 'answerValue', '');
|
|
|
this.$set(itemData, 'ruleMessage', '最小字数为:' + minValue);
|
|
|
- // this.$toast('输入内容不合法');
|
|
|
this.validatorFlag = false;
|
|
|
return;
|
|
|
}
|
|
|
@@ -4418,21 +4414,23 @@ export default {
|
|
|
let leastOneChinese = item.collectionOptionList[0].leastOneChinese;
|
|
|
if (leastOneChinese == '1') {
|
|
|
if (!/[\u4e00-\u9fa5]/.test(value)) {
|
|
|
- // this.$set(itemData, 'answerValue', '');
|
|
|
this.$set(itemData, 'ruleMessage', '至少有一个汉字');
|
|
|
- // this.$toast('输入内容不合法,至少有一个汉字');
|
|
|
this.validatorFlag = false;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+ if (!/^[\u4e00-\u9fa5]+(·[\u4e00-\u9fa5]+)*$/.test(value)) {
|
|
|
+ this.$set(itemData, 'ruleMessage', '只能输入中文');
|
|
|
+ this.validatorFlag = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$set(itemData, 'ruleMessage', '');
|
|
|
} else {
|
|
|
- // this.$set(itemData, 'ruleMessage', '请输入至少有一个汉字');
|
|
|
}
|
|
|
},
|
|
|
xmFormatter(value) {
|
|
|
return value.replace(
|
|
|
- /[0-9]|[a-zA-Z]|[`~!@#$%^&*()_\-+×÷=<>?:"{}|<>,.\/;'\\[\]~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030|\s*/gi,
|
|
|
+ /[0-9]|[a-zA-Z]|[`~~!@#$%^&*()_\-+×÷=<>?:"{}|<>,.\/;'\\[\]~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030|\s*/gi,
|
|
|
''
|
|
|
);
|
|
|
},
|