This commit is contained in:
徐哼唧L
2022-12-09 16:18:12 +08:00
parent dc4d87a990
commit 5ed3073b6e
130 changed files with 41608 additions and 2013 deletions

View File

@@ -302,44 +302,15 @@
},
add_apply: 1,
rules: {
recommend: [{
required: true,
message: 'please select',
trigger: 'blur'
}],
comment: [{
required: true,
message: "please input content",
trigger: "blur"
}, {
validator: function(rule, value, callback) {
if (new RegExp("[\\u4E00-\\u9FFF]+", "g").test(value)) {
//中文
let blankCount = 0;
for (let i in value.match(/ /g)) {
blankCount++
}
let wenziCount = 0;
for (let j = 0; j < value.length; j++) {
if ((value.charCodeAt(j) < 0) || (value.charCodeAt(j) > 255)) {
wenziCount++
}
}
if (blankCount + wenziCount <= 60) {
return callback(new Error(
"Dear reviewer, we recommend the available comment should be more than 60 Chinese words."));
} else {
return callback();
}
} else {
//英文
let blankCount = 0;
for (let i in value.match(/ /g)) {
blankCount++
}
if (blankCount <= 40) {
return callback(new Error("Dear reviewer, we recommend the available comment should be more than 40 words."));
} else {
return callback();
}
}
},
trigger: "blur"
}],
}
}
@@ -477,7 +448,8 @@
this.loading = true
this.$refs.question.validate((valid) => {
if (valid) {
this.$api.post('api/Reviewer/questionSubmit', this.questionform)
this.$api
.post('api/Reviewer/questionSubmit', this.questionform)
.then((res) => {
if (res.code == 0) {
this.loading = false;