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-stripe": "^0.1.52",
"vue-ueditor-wrap": "^2.5.6", "vue-ueditor-wrap": "^2.5.6",
"vuedraggable": "^2.17.0", "vuedraggable": "^2.17.0",
"vuex": "^3.6.2",
"vxe-table": "^3.8.19" "vxe-table": "^3.8.19"
}, },
"devDependencies": { "devDependencies": {

View File

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

View File

@@ -2814,7 +2814,6 @@ export default {
// } // }
this.tableData[i].reportList = [...this.tableData[i].reports]; 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 i = 0; i < res.data.count_num.length; i++) {
for (let j = 0; j < this.statList.length; j++) { for (let j = 0; j < this.statList.length; j++) {
@@ -2887,7 +2886,6 @@ export default {
} }
this.tableData[i].reportList = [...this.tableData[i].reports]; 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++) { // for (let j = 0; j < this.tableData[i].reports.length; j++) {
// if ( // if (

View File

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

View File

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

View File

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

View File

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