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 = [];

View File

@@ -57,7 +57,42 @@
<p v-if="form.special_num > 0">
<font>Special Issues :</font><b>{{ form.special_title }}</b>
</p>
<el-collapse class="auth_colla auth_collna_ew" style="margin-bottom: 0;">
<el-collapse-item title="Research areas" name="1" >
<div style="position: relative;height: 30px;">
<common-major
:articleId="editform.articleId"
@load="initMajor()"
style="position: absolute; top: 10px; right: 10px"
></common-major>
</div>
<div style="margin: 12px 20px 30px 0px; line-height: 24px; font-size: 14px; position: relative">
<div>
<!-- 统计数据 -->
<div class="join_link">
<!-- 如果你想投稿 请点击 -->
<p style="" v-for="(v, i) in majorsList">
<span style="color: #006699; font-weight: bold; margin-right: 10px"
>Field {{ i + 1 }}:</span
>{{ v.str
}}<i
class="el-icon-delete-solid"
style="color: #f56c6c !important; margin-left: 10px"
@click="handleDeleteMajor(v)"
></i>
</p>
<!-- 查看已投稿件列表 -->
</div>
</div>
</div>
</el-collapse-item>
</el-collapse>
<el-collapse class="auth_colla auth_collna_ew">
<el-collapse-item :title="authorList_name" name="1">
<div v-for="(item, index) in form.authorList" class="auth_mess">
@@ -108,6 +143,7 @@
</div>
</el-collapse-item>
</el-collapse>
<el-collapse class="auth_colla auth_collna_ew" style="margin-top: -15px">
<el-collapse-item name="2">
<template slot="title">
@@ -126,6 +162,7 @@
</p>
</el-collapse-item>
</el-collapse>
</div>
<div class="art_file_">
@@ -178,7 +215,7 @@
<h4>Manuscirpt :</h4>
<p class="fi_new">
<!-- <template v-for="item in manuscirptFileList"> -->
<!-- <a href="#">
<!-- <a href="#">
<img
src="../../assets/img/icon_0.png"
@click="openDrawer(item, mediaUrl + item.file_url)"
@@ -193,14 +230,14 @@
<i class="el-icon-download download"></i>
</a>
</a> -->
<a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url" >
<a v-for="item in manuscirptFileList" :href="mediaUrl + item.file_url">
<img src="../../assets/img/icon_0.png" />
<span>
<font>Uploader : </font>{{ form.username }}
<i><i class="el-icon-time"></i>{{ formatDate(item.ctime) }}</i>
</span>
<i class="el-icon-download download"></i>
</a>
</a>
<!-- </template> -->
</p>
<br clear="both" />
@@ -241,12 +278,8 @@
</el-col>
</el-row>
</div>
<common-word-html
:articleId="$route.query.id"
style=" box-sizing: border-box"
></common-word-html>
<common-word-html :articleId="$route.query.id" style="box-sizing: border-box"></common-word-html>
</div>
<!-- 被拒稿件操作 --->
<div class="art_caozuo_" v-if="opname == 'rejectArticles'">
@@ -626,6 +659,7 @@ export default {
ad_content: ''
},
talkMsgs: [],
majorsList: [],
opname: '', // 稿件详细类型
editorJournalList: [], // 编辑期刊列表
resubmitJournal: {
@@ -805,7 +839,7 @@ export default {
});
},
openDrawer(data, url) {
console.log('url at line 799:',data, url)
console.log('url at line 799:', data, url);
this.previewData = {
...data,
previewUrl: url,
@@ -899,7 +933,29 @@ export default {
return { status: status, msg: msg };
},
handleDeleteMajor(v) {
console.log('v at line 925:', v);
this.$confirm('Are you sure you want to delete this Field ?', 'Tip', {
type: 'warning'
})
.then(() => {
this.$api
.post('api/Major/delMajorByArticleIdForEditor', {
mta_id: v.mta_id
})
.then((res) => {
if (res.code == 0) {
this.initMajor();
} else {
this.$message.error(res.msg);
}
})
.catch((err) => {
this.$message.error(err);
});
})
.catch(() => {});
},
//修改文章状态
async saveEdit() {
if (this.form.state == 0) {
@@ -948,7 +1004,16 @@ export default {
this.$router.go(0);
});
},
initMajor() {
this.$api
.post('api/Major/getMajorByArticleId', {
article_id: this.editform.articleId
})
.then((res) => {
console.log('res at line 978:', res);
this.majorsList = res.data.majors;
});
},
//初始化期刊信息
initarticle() {
this.now_year = new Date().getFullYear();
@@ -957,7 +1022,9 @@ export default {
articleId: this.editform.articleId,
human: 'editor'
})
.then((res) => {
this.initMajor();
this.form.username = res.article.account;
this.form.title = res.article.title;
this.form.journal = res.article.journal_id;

File diff suppressed because it is too large Load Diff

View File

@@ -49,6 +49,10 @@ export default {
userId: {
type: String,
default: ''
},
articleId: {
type: String,
default: ''
}
},
data() {
@@ -87,10 +91,17 @@ this.coreForm1.majorList = this.fields[i].selectedValue;
}
this.$refs.core_Form1.validate((valid) => {
if (valid) {
var data={
major_id: this.coreForm1.majorList[this.coreForm1.majorList.length - 1]
}
if(this.userId){
data.user_id = this.userId;
}else{
data.article_id = this.articleId;
}
this.$api
.post('api/User/addUserMajor', {
user_id: this.userId,
major_id: this.coreForm1.majorList[this.coreForm1.majorList.length - 1]
.post(this.userId?'api/User/addUserMajor':'api/Major/addMajorByArticleIdForEditor', {
...data
})
.then((res) => {

View File

@@ -49,8 +49,21 @@ export default {
userId: {
type: String,
default: ''
},
list: {
type: Array,
default: []
}
},
watch: {
list: {
handler(e) {
this.fields=[...this.list]
},
immediate: true
},
},
data() {
return {
rules1:{},
@@ -58,7 +71,7 @@ export default {
coreForm1: {
majorList: []
},
fields: [{}], // 用于存储多个领域的选项数据
fields: [], // 用于存储多个领域的选项数据
options: [] // 用于存储级联选择的选项数据
};
},
@@ -74,7 +87,7 @@ export default {
this.$refs[`cascader${i}`][0].dropDownVisible = false;
this.coreForm1.majorList = this.fields[i].selectedValue;
this.$emit('load',this.fields.map(item => item.selectedValue[item.selectedValue.length - 1]))
this.$emit('load',this.fields)
this.$forceUpdate();
});
@@ -117,6 +130,7 @@ this.coreForm1.majorList = this.fields[i].selectedValue;
this.$nextTick(() => {
// this.fields=[]
this.fields.push({ selectedValue: [] }); // 添加一个新的字段
this.$emit('load',this.fields)
// this.coreVisible1 = true;
});
},
@@ -124,6 +138,7 @@ this.coreForm1.majorList = this.fields[i].selectedValue;
// 删除指定的 Cascader
handleDelete(index) {
this.fields.splice(index, 1); // 删除指定索引的字段
this.$emit('load',this.fields)
},
// 获取 Cascader 配置