This commit is contained in:
2025-08-01 15:37:41 +08:00
parent 3b7c76de47
commit a5bb5b45e7
2 changed files with 25 additions and 21 deletions

BIN
dist.zip

Binary file not shown.

View File

@@ -1102,22 +1102,22 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
major: [ // major: [
{ // {
required: true, // required: true,
validator: (rule, value, callback) => { // validator: (rule, value, callback) => {
console.log('value at line 1202:', this.form); // console.log('value at line 1202:', this.form);
var major = this.majorValueList.map((item) => item.selectedValue[item.selectedValue.length - 1]).toString(','); // var major = this.majorValueList.map((item) => item.selectedValue[item.selectedValue.length - 1]).toString(',');
if (major == '') { // if (major == '') {
callback(new Error('Please select the Research areas')); // callback(new Error('Please select the Research areas'));
} else { // } else {
callback(); // callback();
} // }
// 如果你需要在此处使用 this 访问 Vue 实例的数据,使用箭头函数保持上下文 // // 如果你需要在此处使用 this 访问 Vue 实例的数据,使用箭头函数保持上下文
// 其他逻辑 // // 其他逻辑
} // }
} // }
], // ],
abstrart: [ abstrart: [
{ {
required: true, required: true,
@@ -2590,13 +2590,17 @@ export default {
} }
} }
this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1); this.form.keyWords = fstr == '' ? '' : fstr.substring(0, fstr.length - 1);
this.form.major = this.majorValueList
.map((item) => item.selectedValue[item.selectedValue.length - 1]) if(this.majorValueList.length>0){
this.form.major = this.majorValueList
.map((item) => item.selectedValue.length>0?item.selectedValue[item.selectedValue.length - 1]:[])
.toString(','); .toString(',');
if (this.form.major == '') { // if (this.form.major == '') {
this.$message.error('Please select the Research areas'); // this.$message.error('Please select the Research areas');
return false; // return false;
// }
} }
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => { this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) { if (res.code == 0) {