This commit is contained in:
2025-03-26 15:05:27 +08:00
parent 3ce099e454
commit 9fb503757a
10 changed files with 401 additions and 181 deletions

View File

@@ -2630,10 +2630,14 @@ export default {
// 点击进行下一步
onStep(e) {
console.log('this.majorValueList at line 2604:', this.majorValueList);
console.log('this.form at line 2622:', this.form);
console.log('this.form at line 2622:', this.form.abstrart);
this.$refs.articleform.validate((valid) => {
if (valid) {
if (this.isAbstractTooShort(this.form.abstrart)) {
this.$message.error('The abstract should not be less than 200 Chinese characters or English words!');
return false;
}
if (e == 1) {
if (this.form.journal == 0 || !this.form.journal) {
this.$message.error('Please select the Journal');
@@ -2752,13 +2756,17 @@ export default {
fstr += flist[fu].ke.trim() + ',';
}
}
console.log('this.form at line 2707:', this.form);
console.log('this.form at line 2707:', this.form.abstrart);
this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1);
this.form.major = this.majorValueList.map((item) => item.selectedValue[item.selectedValue.length - 1]).toString(',');
if (this.form.major == '') {
this.$message.error('Please select the Research areas');
return false;
}
if (this.isAbstractTooShort(this.form.abstrart)) {
this.$message.error('The abstract should not be less than 200 Chinese characters or English words!');
return false;
}
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) {
this.stagingID = res.data.article_id;
@@ -2875,7 +2883,14 @@ export default {
});
}
},
isAbstractTooShort(text) {
let chineseCount = (text.match(/[\u4e00-\u9fa5]/g) || []).length;
let englishCount = (text.match(/[A-Za-z0-9]/g) || []).length;
const total = chineseCount + englishCount;
return total < 200; // 不足 200说明太短
},
// 读取
Temporary() {
this.$api