diff --git a/src/views/Receive/index.vue b/src/views/Receive/index.vue index b76a323..e3cc803 100644 --- a/src/views/Receive/index.vue +++ b/src/views/Receive/index.vue @@ -1361,19 +1361,24 @@ export default { //常错词确认 subMsg() { - this.$refs.form.validate((valid) => { - if (valid) { - this.form.correctWord = this.form.correctWord.replace(/[^\w\u4e00-\u9fa5]/g,"") - this.form.wrongWord = this.form.wrongWord.replace(/[^\w\u4e00-\u9fa5]/g,"") - this.dialogFormVisible = false; - let sas = this.textItself.replace( - this.form.wrongWord, - this.form.correctWord - ); - this.transcriptionlist[this.argtextindex].onebest = sas; - this.subWrongMsg(); - } - }); + let reg = /^[0-9]+$/ + if(reg.test(this.form.wrongWord)){ + this.$message.warning("常错词不能为纯数字!"); + }else{ + this.$refs.form.validate((valid) => { + if (valid) { + this.form.correctWord = this.form.correctWord.replace(/[^\w\u4e00-\u9fa5]/g,"") + this.form.wrongWord = this.form.wrongWord.replace(/[^\w\u4e00-\u9fa5]/g,"") + this.dialogFormVisible = false; + let sas = this.textItself.replace( + this.form.wrongWord, + this.form.correctWord + ); + this.transcriptionlist[this.argtextindex].onebest = sas; + this.subWrongMsg(); + } + }); + } }, //常错词提交 subWrongMsg() {