This commit is contained in:
2025-10-28 11:44:05 +08:00
parent 5d4339905e
commit 4dd5fa6a42
9 changed files with 158 additions and 63 deletions

View File

@@ -46,6 +46,7 @@
"vue-stripe": "^0.1.52",
"vue-ueditor-wrap": "^2.5.6",
"vuedraggable": "^2.17.0",
"vuex": "^3.6.2",
"vxe-table": "^3.8.19"
},
"devDependencies": {

View File

@@ -2,6 +2,7 @@
<div style="">
<div style="display: flex; justify-content: space-between">
<div style="width: 100%; min-width: 1020px; position: relative">
<div class="step_list_new" >
<el-steps align-center >
<!-- 状态 已完成 未完成 正在填写 -->
@@ -19,7 +20,7 @@
<template #icon v-if="stepStatus && stepStatus.length > 0" @click.stop="StepCode(item)">
<span v-if="stepStatus[i].status == 0"> </span>
<span class="step_icon" v-if="stepStatus[i].status == 1">
<i class="el-icon-check" style="font-size: 22px"></i>
<i class="el-icon-check" style="font-size: 21px"></i>
</span>
<span class="step_icon" v-if="stepStatus[i].status == 2">
<i class="el-icon-edit-outline" style="font-size: 22px"></i>
@@ -46,12 +47,14 @@
<div class="bag_color" v-if="show_step == 1">
<div>
<h3>Manuscript Information</h3>
<el-form-item label="Journal :" prop="journal">
<JournalSelector
<JournalSelector v-if="show_step == 1"
ref="journalSelector"
@selected="handleJournalSelected"
:list="items"
:check_item="check_item"
:journal_id="form.journal"
/>
</el-form-item>
@@ -475,8 +478,8 @@
If your manuscript is not deemed suitable for the first journal, it can be automatically transferred
along with reviews and reviewers' identities (cascading peer-review) to another journal of your choice.
Please note that you can choose up to two journals only.
<br /><br />
<el-switch
<br />
<el-switch style="margin-top: 20px;"
@change="changeSwitch($event)"
v-model="form.istransfer"
active-text="Yes"
@@ -504,8 +507,8 @@
</el-form-item>
<p style="line-height: 25px; margin: 30px 10px 0 55px; font-size: 14px" v-if="checkReviewerof == 0">
Would you be interested in serving as a reviewer for this journal?
<br /><br />
<el-switch
<br />
<el-switch style="margin-top: 20px;"
@change="changeBecome($event)"
v-model="form.becomeRev"
active-text="Yes"
@@ -1429,8 +1432,7 @@ export default {
},
async created() {
this.journal_type = await this.$commonJS.journalTypeList();
console.log('this.journal_type at line 1340:', this.journal_type);
this.initSelect();
this.initSelect();
this.getAutData();
if (this.stagingID != undefined) {
this.form.article_id = this.stagingID;
@@ -1745,20 +1747,22 @@ export default {
//初始化期刊选项
initSelect() {
this.$api
.post('api/Article/getJournal')
.then((res) => {
this.items = res;
// this.$api
// .post('api/Article/getJournal')
// .then((res) => {
this.items = this.$store.state.journalList;
for (let i in this.items) {
if (this.items[i].journal_id == this.form.journal) {
this.check_item = this.items[i];
this.jour_form.journal = this.items[i].journal_id;
}
}
})
.catch((err) => {
console.log(err);
});
// })
// .catch((err) => {
// console.log(err);
// });
this.$api
.post('api/Reviewer/getAllMajor')
.then((res) => {
@@ -2740,7 +2744,8 @@ export default {
this.fileL_articleApproval = [{}];
this.fileL_articleApproval[0].name = 'Ethical approval file';
this.fileL_articleApproval[0].url = this.form.approval_file;
}
} console.log('this.fileL_articleApproval at line 2746:', this.fileL_articleApproval)
this.fileL_coverLetter = [];
if (this.form.coverLetter != '') {
this.fileL_coverLetter = [{}];
@@ -3069,10 +3074,17 @@ export default {
if (res.code == 0) {
// 基本信息
this.form.journal = res.data.base.journal_id;
console.log('this.form.journal at line 3075:', this.form.journal)
this.$forceUpdate()
this.$nextTick(()=>{
this.$refs.journalSelector.init(this.form.journal)
})
this.form.type = res.data.base.type;
this.form.title = res.data.base.title;
this.form.approval = res.data.base.approval;
this.form.approval_file = res.data.base.approval_file;
this.form.approval_content = res.data.base.approval_content;
this.form.abstrart = res.data.base.abstrart;
this.form.fund = res.data.base.fund;

View File

@@ -2814,8 +2814,7 @@ export default {
// }
this.tableData[i].reportList = [...this.tableData[i].reports];
console.log('.reportList at line 1265:', this.tableData[i].reportList);
}
}
for (let i = 0; i < res.data.count_num.length; i++) {
for (let j = 0; j < this.statList.length; j++) {
if (i == this.statList[j].state) {
@@ -2887,8 +2886,7 @@ export default {
}
this.tableData[i].reportList = [...this.tableData[i].reports];
console.log('.reportList at line 1265:', this.tableData[i].reportList);
// if (this.tableData[i].reports.length == 1) {
// if (this.tableData[i].reports.length == 1) {
// for (let j = 0; j < this.tableData[i].reports.length; j++) {
// if (
// this.tableData[i].reports[j].author_account != '' &&

View File

@@ -9,6 +9,7 @@ var stepFields = {
{ field: 'approval', required: true },
// ✅ 这里改:用 (f)=> f.approval === 0
{ field: 'approval_content', required: false, condition: (f) => f.approval === 0 },
{ field: 'approval_file', required: false, condition: (f) => f.approval === 1 },
{ field: 'abstrart', required: true },
{ field: 'majorValueList', required: false, check: (f) => Array.isArray(f.majorValueList) && f.majorValueList.length > 0 }
],

View File

@@ -1,6 +1,7 @@
<template>
<div class="journal-selector relative w-full max-w-md" ref="journalSelector">
<!-- 使用el-input作为输入框 -->
<div v-if="!selectedJournal">
<el-input
clearable
@@ -27,10 +28,10 @@
<div class="journal-item" v-for="journal in filteredJournals" :key="journal.id" @click="selectJournal(journal)">
<div class="flexBox alignCenter justBetween">
<img
src="https://www.tmrjournals.com/public/journalicon/20251010/28267562ad187206ca77d64bcd7a138f.jpg"
:src="journalUrl+journal.journal_icon"
:alt="journal.title"
class=""
style="width: 40px; height: 50px"
style="width: 35px; height: 45px"
/>
<div class="journal-title">{{ journal.title }}</div>
</div>
@@ -49,7 +50,7 @@
<div class="journal-selected" v-if="selectedJournal && !showDropdown">
<div class="flexBox alignCenter">
<img
src="https://www.tmrjournals.com/public/journalicon/20251010/28267562ad187206ca77d64bcd7a138f.jpg"
:src="journalUrl+selectedJournal.journal_icon"
:alt="selectedJournal.name"
class="object-cover"
style="width: 30px; height: 40px"
@@ -81,6 +82,7 @@ export default {
},
data() {
return {
journalUrl: 'https://www.tmrjournals.com/public/journalicon/',
searchTerm: '',
showDropdown: false,
selectedJournal: null,
@@ -108,6 +110,17 @@ export default {
// }
},
deep: true
},
journal_id: {
handler(newVal) {
if (this.journal_id) {
this.selectedJournal = this.journals.find((journal) => journal.id === newVal);
} else {
this.selectedJournal = null;
}
console.log('this.selectedJournal at line 142:', this.selectedJournal);
},
deep: true
}
},
computed: {
@@ -117,7 +130,6 @@ export default {
return this.journals;
}
const term = this.searchTerm.toLowerCase();
return this.journals.filter(
(journal) =>
@@ -130,14 +142,9 @@ export default {
},
methods: {
getJournalList() {
this.$api
.post('api/Article/getJournal')
.then((res) => {
this.journals = res;
})
.catch((err) => {
console.log(err);
});
this.journals = this.$store.state.journalList;
console.log('this.journals at line 145:', this.journals);
this.$forceUpdate();
},
closeSelection() {
this.selectedJournal = null;
@@ -167,17 +174,36 @@ export default {
if (this.showDropdown && !this.$refs.journalSelector.contains(event.target)) {
this.showDropdown = false;
}
},
init(id) {
this.getJournalList();
if (id) {
this.journal_id = id;
for (let i in this.journals) {
if (this.journals[i].journal_id == this.journal_id) {
this.selectedJournal = this.journals[i];
}
}
} else {
this.selectedJournal = null;
}
}
},
mounted() {
if (JSON.stringify(this.check_item) !== '{}') {
this.selectedJournal = this.check_item;
} else {
this.selectedJournal = null;
}
this.getJournalList();
console.log('at line 194:初始化' )
this.$nextTick(() => {
this.getJournalList();
});
document.addEventListener('click', this.handleClickOutside);
},
activated() {
this.$nextTick(() => {
this.getJournalList();
});
},
beforeDestroy() {
document.removeEventListener('click', this.handleClickOutside);
}

View File

@@ -850,6 +850,13 @@ export default {
this.$emit('loaded', this.images);
});
},
isHeaderRow(rowIndex, table) {
var table =table;
var head = table[0];
return rowIndex < head[0].rowspan; // 假设前两行是表头
},
async getWordTablesList(callback) {
this.$api
.post(this.urlList ? this.urlList.table : 'api/Article/getArticleTable', {
@@ -894,8 +901,8 @@ export default {
>`;
if (table.table && table.table.length > 0) {
table.table.forEach((row) => {
modalContent += `<tr>`;
table.table.forEach((row,i) => {
modalContent += `<tr class="${this.isHeaderRow(i, table.table)? 'table-header-row':'' }">`;
row.forEach((cell) => {
modalContent += `
<td

View File

@@ -12,6 +12,11 @@ import './components/common/directives';
import 'babel-polyfill';
import api from './api/index.js';
import Common from './components/common/common'
import store from './store' // 引入 store
Vue.prototype.$validateString = function (str) {
return /^[a-zA-Z\s\u00C0-\u00FF\u0100-\u017F-]+$/.test(str);
}
@@ -63,7 +68,6 @@ async function loadJournalType() {
localStorage.setItem('journalTypeData', JSON.stringify(res.data.base)); // 将数据存储到 localStorage
localStorage.setItem('journalTypeDataAll', JSON.stringify([...res.data.base, ...res.data.supplement])); // 将数据存储到 localStorage
}
})
await api
@@ -84,6 +88,20 @@ async function loadJournalType() {
} else {
console.log('Journal types loaded from localStorage:', JSON.parse(localData));
}
}
async function loadJournalList() {
return await api
.post('api/Article/getJournal', {})
.then((res) => {
store.commit('setJournalList', res); // 提交 mutation 更新 journalList
console.log('journalList at line 100:, 提交 mutation 更新 journalList')
})
}
// 启动应用时调用一次函数来加载 journalType 数据
@@ -182,29 +200,26 @@ const i18n = new VueI18n({
messages
});
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
loadJournalType();
router.beforeEach(async(to, from, next) => {
try {
// 尝试请求接口(即使失败也继续后续逻辑)
await Promise.all([
loadJournalList(),
loadJournalType()
]);
} catch (err) {
// 仅打印错误,不阻断路由
console.error('接口请求失败,但继续路由跳转', err);
}
// 无论接口成功/失败,都执行原有跳转逻辑
document.title = `${to.meta.title} | Traditional Medicine Research`;
const role = localStorage.getItem('U_name');
const userrole = localStorage.getItem('U_status');
if (!role && to.path != '/register' && to.path !== '/submission' && to.path !== '/verification' && to.path !== '/orcidLink' && to.path !== '/img' && to.path !== '/reviewer' && to.path !== '/thanks' && to.path !== '/login' && to.path !== '/refuse' && to.path !== '/managing' && to.path.search(/retrieve/i) < 0) {
next('/login');
// } else if (to.meta.permission) {
// // 如果是管理员权限则可进入,这里只是简单的模拟管理员权限而已
// // role === 'admin' ? next() : next('/403');
// if(userrole == to.meta.permission){
// next();
// }else{
// next('/403');
// }
} else {
//审稿人导航
// if(to.path=='/reviewerArticleList'&&userrole!='reviewer'){
// next('/authorApplyReviewer');
// }
// 简单的判断IE10及以下不进入富文本编辑器该组件不兼容
if (navigator.userAgent.indexOf('MSIE') > -1 && to.path === '/editor') {
Vue.prototype.$alert('vue-quill-editor组件不兼容IE10及以下浏览器请使用更高版本的浏览器查看', '浏览器不兼容通知', {
confirmButtonText: '确定'
@@ -212,14 +227,16 @@ router.beforeEach((to, from, next) => {
} else {
next();
}
}
});
new Vue({
router,
i18n,
store,
render: h => h(App),
mounted() {
this.$renderMath(); // 页面加载后自动渲染
}

34
src/store/index.js Normal file
View File

@@ -0,0 +1,34 @@
import Vue from 'vue'
import Vuex from 'vuex'
// 必须先通过 Vue.use() 安装 Vuex
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
journalList: []
},
mutations: {
setJournalList(state, journalList) {
state.journalList = journalList
}
},
actions: {
incrementAsync(context) {
setTimeout(() => {
context.commit('increment')
}, 1000)
}
},
getters: {
getJournalList(state) {
return state.journalList
},
doubleCount(state) {
return state.count * 2
}
}
})
export default store

View File

@@ -74,10 +74,9 @@ module.exports = {
// target: 'http://www.tougao.com/',
// target: 'http://192.168.110.110/tougao/public/index.php/',
// target: 'http://api.tmrjournals.com/public/index.php/',//正式
// target: 'http://192.168.110.90:80/',//晓玲
// target: 'http://zmzm.tougao.dev.com/',//晓玲
target: 'https://submission.tmrjournals.com/',//正式
// target: 'https://submission.tmrjournals.com/',//正式
target: 'http://tougaotest.tmrjournals.com/public/index.php/',//测试环境
changeOrigin: true,
pathRewrite: {
'^/api': ''