This commit is contained in:
2025-02-12 17:58:57 +08:00
parent d11b02b06b
commit a178d5ffbe
5 changed files with 712 additions and 588 deletions

View File

@@ -56,8 +56,9 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="Major :" :required="true" prop="major_a">
<el-select
<el-form-item label="Research areas :" prop="major">
<common-major-list :list="majorValueList" @load="(e)=>this.majorValueList=e"></common-major-list>
<!-- <el-select
v-model="form.major_a"
placeholder="Please select major"
@change="majorChange(1)"
@@ -99,7 +100,7 @@
:label="item.major_title"
:value="item.major_id"
></el-option>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item label="Manuscript Title :" prop="title">
<el-input v-model="form.title" placeholder="Please enter title"></el-input>
@@ -966,6 +967,7 @@
export default {
data() {
return {
majorValueList:[],
baseUrl: this.Common.baseUrl,
usercap: localStorage.getItem('U_role'),
ms_alias: localStorage.getItem('ms_journal_alias'),
@@ -1194,11 +1196,21 @@ export default {
}
],
major: [
{
required: true,
message: 'Please select major',
trigger: 'blur'
}
{
required: true,
validator: (rule, value, callback) => {
console.log('value at line 1202:', this.form);
var major=this.majorValueList.map(item => item.selectedValue[item.selectedValue.length - 1]).toString(',')
if (major=='') {
callback(new Error('Please select the Research areas'));
} else {
callback();
}
// 如果你需要在此处使用 this 访问 Vue 实例的数据,使用箭头函数保持上下文
// 其他逻辑
}
}
],
abstrart: [
{
@@ -2598,7 +2610,11 @@ export default {
},
// 点击进行下一步
onStep(e) {
onStep(e) {
console.log('this.majorValueList at line 2604:', this.majorValueList)
console.log('this.form at line 2622:', this.form)
this.$refs.articleform.validate((valid) => {
if (valid) {
if (e == 1) {
@@ -2617,7 +2633,13 @@ export default {
}
}
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
}
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) {
this.stagingID = res.data.article_id;
this.form.article_id = res.data.article_id;
@@ -2702,8 +2724,15 @@ export default {
fstr += flist[fu].ke.trim() + ',';
}
}
console.log('this.form at line 2707:', this.form)
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
}
this.$api.post('api/Article/addArticlePart1', this.form).then((res) => {
if (res.code == 0) {
this.stagingID = res.data.article_id;
this.form.article_id = res.data.article_id;
@@ -2840,44 +2869,48 @@ export default {
console.log(res.data.base);
// this.form.topics = res.data.base.topics
// 领域
this.$api
.post('api/Major/getMajorForAddArticle', {
journal_id: this.form.journal,
major_id: 1
})
.then((res) => {
this.majors_a = res.data.majors;
});
this.form.major_a = res.data.major.major_id;
this.$api
.post('api/Major/getMajorForAddArticle', {
journal_id: this.form.journal,
major_id: this.form.major_a
})
.then((ref) => {
this.majors_b = ref.data.majors;
this.majors_c = [];
this.form.major_b = '';
this.form.major_c = '';
this.majorChange_panduan();
if (res.data.major.child != undefined) {
this.form.major_b = res.data.major.child.major_id;
this.$api
.post('api/Major/getMajorForAddArticle', {
journal_id: this.form.journal,
major_id: this.form.major_b
})
.then((ref) => {
this.majors_c = ref.data.majors;
this.form.major_c = '';
this.majorChange_panduan();
if (res.data.major.child.child != undefined) {
this.form.major_c = res.data.major.child.child.major_id;
this.majorChange_panduan();
}
});
}
});
this.majorValueList = res.data.majors.map(item => ({
selectedValue: Array.isArray(item.major) ? item.major : (typeof item.major === 'string' ? item.major.split(',').map(Number) : [item.major])
})); console.log('this.majorValueList at line 2853:', this.majorValueList)
// this.$api
// .post('api/Major/getMajorForAddArticle', {
// journal_id: this.form.journal,
// major_id: 1
// })
// .then((res) => {
// this.majors_a = res.data.majors;
// });
// this.form.major_a = res.data.major.major_id;
// this.$api
// .post('api/Major/getMajorForAddArticle', {
// journal_id: this.form.journal,
// major_id: this.form.major_a
// })
// .then((ref) => {
// this.majors_b = ref.data.majors;
// this.majors_c = [];
// this.form.major_b = '';
// this.form.major_c = '';
// this.majorChange_panduan();
// if (res.data.major.child != undefined) {
// this.form.major_b = res.data.major.child.major_id;
// this.$api
// .post('api/Major/getMajorForAddArticle', {
// journal_id: this.form.journal,
// major_id: this.form.major_b
// })
// .then((ref) => {
// this.majors_c = ref.data.majors;
// this.form.major_c = '';
// this.majorChange_panduan();
// if (res.data.major.child.child != undefined) {
// this.form.major_c = res.data.major.child.child.major_id;
// this.majorChange_panduan();
// }
// });
// }
// });
// 关键词
let keyList = res.data.base.keywords.split(',');
this.keywordsList = [];