From 4dd5fa6a42622d6e06b574774f8510e08458454f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Tue, 28 Oct 2025 11:44:05 +0800 Subject: [PATCH] tijiao --- package.json | 1 + src/components/page/articleAdd2.vue | 48 ++++++++------ src/components/page/articleListEditor_A.vue | 6 +- .../components/article/checkStepCompletion.js | 1 + .../components/article/journal-selector.vue | 62 +++++++++++++------ .../components/table/wordHtmlTypesetting.vue | 11 +++- src/main.js | 53 ++++++++++------ src/store/index.js | 34 ++++++++++ vue.config.js | 5 +- 9 files changed, 158 insertions(+), 63 deletions(-) create mode 100644 src/store/index.js diff --git a/package.json b/package.json index 83f36aa..f5bae26 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/components/page/articleAdd2.vue b/src/components/page/articleAdd2.vue index 989828e..603622a 100644 --- a/src/components/page/articleAdd2.vue +++ b/src/components/page/articleAdd2.vue @@ -2,6 +2,7 @@
Would you be interested in serving as a reviewer for this 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);
}
diff --git a/src/components/page/components/table/wordHtmlTypesetting.vue b/src/components/page/components/table/wordHtmlTypesetting.vue
index c98261b..6952bda 100644
--- a/src/components/page/components/table/wordHtmlTypesetting.vue
+++ b/src/components/page/components/table/wordHtmlTypesetting.vue
@@ -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 += ``;
+ table.table.forEach((row,i) => {
+ modalContent += ` `;
row.forEach((cell) => {
modalContent += `
{
+ 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(); // 页面加载后自动渲染
}
diff --git a/src/store/index.js b/src/store/index.js
new file mode 100644
index 0000000..5630ece
--- /dev/null
+++ b/src/store/index.js
@@ -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
\ No newline at end of file
diff --git a/vue.config.js b/vue.config.js
index 63a64ca..3a096de 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -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': ''