From b66b390f2c7b3c669235819b420e669df62b1258 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: Mon, 3 Nov 2025 10:14:27 +0800 Subject: [PATCH] tijiao --- src/api/index.js | 4 +- src/components/common/common.vue | 8 +- src/components/page/articleAdd.vue | 2476 ++++++++---- src/components/page/articleAdd2.vue | 835 ++-- src/components/page/articleAdd222222.vue | 3432 +++++++++++++++++ src/components/page/articleDetailEditor.vue | 1 + src/components/page/articleListEditor_B1.vue | 6 +- src/components/page/articleListEditor_E.vue | 7 +- .../components/article/checkStepCompletion.js | 206 +- .../components/article/journal-selector.vue | 24 +- src/components/page/edit_per_ewer.vue | 22 +- src/components/page/per_ewer.vue | 21 +- src/components/page/per_text.vue | 24 +- src/components/page/per_text_yq.vue | 15 +- src/router/index.js | 3 +- vue.config.js | 4 +- 16 files changed, 5902 insertions(+), 1186 deletions(-) create mode 100644 src/components/page/articleAdd222222.vue diff --git a/src/api/index.js b/src/api/index.js index fa6d863..2698668 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -19,8 +19,8 @@ const service = axios.create({ // baseURL: 'https://submission.tmrjournals.com/', //正式 记得切换 // baseURL: 'http://www.tougao.com/', //测试本地 记得切换 // baseURL: 'http://192.168.110.110/tougao/public/index.php/', - baseURL: '/api', //本地 - // baseURL: '/', //正式 + // baseURL: '/api', //本地 + baseURL: '/', //正式 }); diff --git a/src/components/common/common.vue b/src/components/common/common.vue index 54024fa..92a15a2 100644 --- a/src/components/common/common.vue +++ b/src/components/common/common.vue @@ -2,8 +2,8 @@ //记得切换 //正式 -// const mediaUrl = '/public/'; -// const baseUrl = '/'; +const mediaUrl = '/public/'; +const baseUrl = '/'; // const mediaUrl = 'https://submission.tmrjournals.com/public/'; // // const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; @@ -11,9 +11,9 @@ //本地(正式环境 ) -const mediaUrl = 'https://submission.tmrjournals.com/public/'; +// const mediaUrl = 'https://submission.tmrjournals.com/public/'; -const baseUrl = '/api'; +// const baseUrl = '/api'; //晓玲 // const mediaUrl = 'http://zmzm.tougao.dev.com/public/'; diff --git a/src/components/page/articleAdd.vue b/src/components/page/articleAdd.vue index f2f60b6..b7baf79 100644 --- a/src/components/page/articleAdd.vue +++ b/src/components/page/articleAdd.vue @@ -1,53 +1,70 @@ + + + + diff --git a/src/components/page/articleDetailEditor.vue b/src/components/page/articleDetailEditor.vue index d35d0ed..b2b867b 100644 --- a/src/components/page/articleDetailEditor.vue +++ b/src/components/page/articleDetailEditor.vue @@ -493,6 +493,7 @@ Reviewer {{ reviewerIndex + 1 }} ( {{ iken.rated }} ) + {{ iken.realname }}
-
+

{{ tabsList[2].name }}

@@ -514,7 +514,7 @@
-
+

{{ tabsList[3].name }}

-
+

{{ tabsList[4].name }}

HTML typesetting and AI proofreading

diff --git a/src/components/page/articleListEditor_E.vue b/src/components/page/articleListEditor_E.vue index 46f9a18..1f68f66 100644 --- a/src/components/page/articleListEditor_E.vue +++ b/src/components/page/articleListEditor_E.vue @@ -1267,12 +1267,7 @@ export default { }).href, '_blank' ); - // this.$router.push({ - // path: '/GenerateCharts', - // query: { - // id: this.tg_article_id - // } - // }); + } }, htmlLayout() { diff --git a/src/components/page/components/article/checkStepCompletion.js b/src/components/page/components/article/checkStepCompletion.js index 079b88a..7765e75 100644 --- a/src/components/page/components/article/checkStepCompletion.js +++ b/src/components/page/components/article/checkStepCompletion.js @@ -1,126 +1,198 @@ -// 关键:让 condition 接收当前表单 f -var stepStatus=[] +// 状态说明: +// 0: 未完成(校验未通过) +// 1: 已完成且已保存(校验通过 + 已保存) +// 2: 正在填写(部分字段填写,但未通过校验) +// 3: 已通过校验但未保存(校验通过 + 未保存) + +import { t } from "vxe-table"; + +var stepStatus = []; var stepFields = { + // 保持原有字段配置不变... 1: [ { field: 'journal', required: true }, { field: 'type', required: true }, { field: 'manuscirpt', required: true }, { field: 'title', required: true }, { 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 } ], 2: [ { field: 'authorList', required: true, check: (f) => Array.isArray(f.authorList) && f.authorList.length > 0 }, + { field: 'authorEmail', required: true, check: (f) => f.authorList.every(a => a.email) }, { field: 'authorFirstname', required: true, check: (f) => f.authorList.every(a => a.firstname) }, { field: 'authorLastname', required: true, check: (f) => f.authorList.every(a => a.lastname) }, - { field: 'authorEmail', required: true, check: (f) => f.authorList.every(a => a.email && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email)) }, + { field: 'authorTitle', required: true, check: (f) => f.authorList.every(a => a.title) }, + { field: 'authorAffiliation', required: true, check: (f) => f.authorList.every(a => a.company) }, + { field: 'authorCountry', required: true, check: (f) => f.authorList.every(a => a.country) }, { field: 'isSuper', required: true, check: (f) => f.authorList.some(a => a.isSuper) }, - { field: 'isReport', required: true, check: (f) => f.authorList.some(a => a.isReport) } + { field: 'isReport', required: true, check: (f) => f.authorList.some(a => a.isReport) }, + { field: 'authorAddress', required: false, condition: (f) => f.isReport == 1 }, ], 3: [ - { field: 'coverLetter', required: true }, - { field: 'picturesAndTables', required: true }, - { field: 'supplementary', required: false } + { field: 'manuscirpt', required: true }, + { field: 'is_figure_copyright', required: true }, + { field: 'figurecopyright_file', required: true, condition: (f) => f.is_figure_copyright == 1 }, + { field: 'is_use_ai', required: true }, + { field: 'use_ai_explain', required: false, condition: (f) => f.is_use_ai == '1' }, ], 4: [ - { field: 'istransfer', required: true }, - { field: 'checkedjours', required: false, condition: (f) => !!f.istransfer }, - { field: 'becomeRev', required: true }, - // 注意:this.usercap 在这里可能没有 this 环境,建议改成从 form 里取,如 f.usercap - { field: 'reviewerInfo', required: false, condition: (f) => f.becomeRev && !(Array.isArray(f.usercap) && f.usercap.includes('reviewer')) }, - { field: 'qualification', required: true }, - { field: 'qualificationFile', required: false, condition: (f) => f.qualification === '2' }, - { field: 'isUseAi', required: true }, - { field: 'useAiExplain', required: false, condition: (f) => f.isUseAi === '1' }, - { field: 'agreechecked', required: true } + { field: 'majorValueList', required: false, check: (f) => Array.isArray(f.majorValueList) && f.majorValueList.length > 0 }, + { + field: 'majorValueListSelectValue', + required: true, + check: (f) => f.majorValueList.every(a => a.selectedValue !== null && Array.isArray(a.selectedValue) && a.selectedValue.length > 0&&a.selectedValue[0]!=null) + }, + // { field: 'istransfer', required: true }, + // { field: 'checkedjours', required: false, condition: (f) => !!f.istransfer }, + // { field: 'becomeRev', required: true }, + // { field: 'reviewerInfo', required: false, condition: (f) => f.becomeRev && !(Array.isArray(f.usercap) && f.usercap.includes('reviewer')) }, + // { field: 'qualification', required: true }, ] }; -async function updateStepStatus(formInput) { - const form = { ...formInput }; // 使用局部 form,避免被外部覆盖 - console.log('form at line 43:', form) - stepStatus = [ - { step: 1, status: '0' }, - { step: 2, status: '0' }, - { step: 3, status: '0' }, - { step: 4, status: '0' } +// 新增:记录每个步骤是否已保存(可从外部传入或本地存储) +var stepSavedStatus = { + 1: false, // 步骤1是否已保存 + 2: false, + 3: false, + 4: false +}; + + +export async function updateStepStatus(formInput,saveList) { + const form = { ...formInput }; + console.log('form at line 66:', form) + if(!saveList){ + saveList = []; + }else if(!Array.isArray(saveList)){ + saveList = []; + }else{ + for(let i = 1;i<=4;i++){ + stepSavedStatus[i] = saveList.includes(i); + } + } + stepStatus = [ + { step: 1, status: '0', isSaved: stepSavedStatus[1] }, // 新增isSaved字段 + { step: 2, status: '0', isSaved: stepSavedStatus[2] }, + { step: 3, status: '0', isSaved: stepSavedStatus[3] }, + { step: 4, status: '0', isSaved: stepSavedStatus[4] } ]; function checkField(field) { - // 1) 条件非必填:若没有 required 且没有 condition,直接通过 if (!field.required && !field.condition) return true; - - // 2) 有 condition:若条件不满足(即不需要填),直接通过 if (typeof field.condition === 'function' && !field.condition(form)) { return true; } - - // 3) 自定义检查:优先 if (typeof field.check === 'function') { return field.check(form); } - - // 4) 常规值检查 const value = form[field.field]; - - // null/undefined -> 未填 if (value === undefined || value === null) return false; - - // 数组 -> 必须非空 if (Array.isArray(value)) return value.length > 0; - - // 字符串 -> 非空白 if (typeof value === 'string') return value.trim() !== ''; - - // 数字 -> 只要有值即可(0 也算已填) if (typeof value === 'number') return true; - - // 布尔 -> 只要存在即可 if (typeof value === 'boolean') return true; - - // 文件或对象:简单规则,存在即视为已填(可按需加更细规则) if (typeof value === 'object') return true; - - // 其他类型默认未填 return false; } + function checkStepStatus(step) { const fields = stepFields[step]; - let allFilled = true; - let hasFilled = false; + let allFilled = true; + let hasFilled = false; for (const field of fields) { const isFilled = checkField(field); + console.log('isFilled at line 101:', isFilled,'++++++++++',field.field) if (!isFilled) { allFilled = false; } else { hasFilled = true; } } -//0 未完成 1已完成 2正在填写 - if (allFilled) return '1'; - if (hasFilled) return '2'; - return '0'; - } - - - for (let i = 1; i <= 4; i++) { - if (i !== 2) { - stepStatus[i - 1].status = await checkStepStatus(i); - } else if (i === 2 && Array.isArray(form.authorList)&&form.authorList.length>0) { - - console.log('form.authorList at line 115:', form.authorList) - - stepStatus[i - 1].status = await checkStepStatus(i); + + + const isSaved = stepSavedStatus[step]; + if (allFilled) { + return isSaved ? '1' : '3'; // 校验通过:已保存1,未保存3 + } else { + return hasFilled ? '2' : '0'; // 校验未通过:部分填写2,未填写0 } } - return stepStatus; + // 更新步骤状态 + for (let i = 1; i <= 4; i++) { + if (i !== 2) { + stepStatus[i - 1].status = await checkStepStatus(i); + } else if (i === 2 && Array.isArray(form.authorList) && form.authorList.length > 0) { + stepStatus[i - 1].status = await checkStepStatus(i); + } + // 同步更新isSaved(从全局保存状态获取) + stepStatus[i - 1].isSaved = stepSavedStatus[i]; + } + + let targetStep = null; + const stepList = stepStatus; + + + for (const step of stepList) { + if (Number(step.status) === 0) { + targetStep = step; + break; + } + } + + + if (!targetStep) { + for (const step of stepList) { + if (Number(step.status) === 2) { + targetStep = step; + break; + } + } + } + + + if (!targetStep) { + for (const step of stepList) { + if (Number(step.status) === 3) { + targetStep = step; + break; + } + } + } + + + if (!targetStep) { + targetStep = [...stepList].sort((a, b) => Number(a.step) - Number(b.step)).pop(); + } + + console.log("目标步骤:", targetStep); + return { list: stepStatus, current: targetStep }; +} +export function markStepAsSaved(step) { + if (Number.isInteger(step) && step >= 1 && step <= 4) { + stepSavedStatus[step] = true; + console.log(`步骤 ${step} 已标记为已保存`); + } else { + console.warn(`无效的步骤号:${step}(必须是1-4的整数)`); + } +} + +/** + * 新增:标记步骤为未保存(补充反向操作) + * @param {number} step - 步骤号(1-4) + */ +export function markStepAsUnsaved(step) { + if (Number.isInteger(step) && step >= 1 && step <= 4) { + stepSavedStatus[step] = false; + console.log(`步骤 ${step} 已标记为未保存`); + } else { + console.warn(`无效的步骤号:${step}(必须是1-4的整数)`); + } } -export default updateStepStatus; \ No newline at end of file diff --git a/src/components/page/components/article/journal-selector.vue b/src/components/page/components/article/journal-selector.vue index 79c5eeb..489e461 100644 --- a/src/components/page/components/article/journal-selector.vue +++ b/src/components/page/components/article/journal-selector.vue @@ -75,6 +75,11 @@ export default { type: Array, default: () => [] }, + journal_id: { + type: Number, + default: 0 + + }, check_item: { type: Object, default: () => ({}) @@ -97,6 +102,15 @@ export default { }, deep: true }, + journal_id: { + handler(newVal) { + if (this.journal_id) { + this.init(this.journal_id); + } + + }, + deep: true + }, check_item: { handler(newVal) { // if (newVal.id) { @@ -118,7 +132,7 @@ export default { } else { this.selectedJournal = null; } - console.log('this.selectedJournal at line 142:', this.selectedJournal); + }, deep: true } @@ -143,7 +157,7 @@ export default { methods: { getJournalList() { this.journals = this.$store.state.journalList; - console.log('this.journals at line 145:', this.journals); + this.$forceUpdate(); }, closeSelection() { @@ -192,11 +206,15 @@ export default { }, mounted() { - console.log('at line 194:初始化' ) + this.$nextTick(() => { this.getJournalList(); }); +console.log('this.journal_id at line 203:', this.journal_id) +if (this.journal_id) { + this.init(this.journal_id); + } document.addEventListener('click', this.handleClickOutside); }, activated() { diff --git a/src/components/page/edit_per_ewer.vue b/src/components/page/edit_per_ewer.vue index 35830b9..533626a 100644 --- a/src/components/page/edit_per_ewer.vue +++ b/src/components/page/edit_per_ewer.vue @@ -189,7 +189,16 @@ }) .then(res => { if (res.code == 0) { - this.$router.push('/per_text?Art_id=' + index); + window.open( + this.$router.resolve({ + path: '/per_text', + query: { + Art_id: index + } + }).href, + '_blank' + ); + // this.$router.push('/per_text?Art_id=' + index); } else { this.$message.error(res.msg); } @@ -271,7 +280,16 @@ .then(res => { if (res.code == 0) { this.$message.success('Successful application!'); - this.$router.push('/per_text?Art_id=' + res.data.art_rev_id); + window.open( + this.$router.resolve({ + path: '/per_text', + query: { + Art_id: res.data.art_rev_id + } + }).href, + '_blank' + ); + // this.$router.push('/per_text?Art_id=' + res.data.art_rev_id); } else { this.$message.error(res.msg); } diff --git a/src/components/page/per_ewer.vue b/src/components/page/per_ewer.vue index 8ffcc30..44d5e1f 100644 --- a/src/components/page/per_ewer.vue +++ b/src/components/page/per_ewer.vue @@ -25,12 +25,12 @@
  • - +

    {{index+1}}.{{item.article_title}}

    Review - +

    Journal : {{item.journal_title}}. @@ -233,6 +233,17 @@ this.getData(); }, methods: { + openWindow(art_rev_id) { + window.open( + this.$router.resolve({ + path: '/per_text', + query: { + Art_id: art_rev_id + } + }).href, + '_blank' + ); + }, // 获取数据 getData() { this.$api @@ -337,7 +348,8 @@ }) .then(res => { if (res.code == 0) { - this.$router.push('/per_text?Art_id=' + index); + this.openWindow(index); + // this.$router.push('/per_text?Art_id=' + index); } else { this.$message.error(res.msg); } @@ -419,7 +431,8 @@ .then(res => { if (res.code == 0) { this.$message.success('Successful application!'); - this.$router.push('/per_text?Art_id=' + res.data.art_rev_id); + this.openWindow(res.data.art_rev_id); + // this.$router.push('/per_text?Art_id=' + res.data.art_rev_id); } else { this.$message.error(res.msg); } diff --git a/src/components/page/per_text.vue b/src/components/page/per_text.vue index 22e92b4..53677f0 100644 --- a/src/components/page/per_text.vue +++ b/src/components/page/per_text.vue @@ -1,28 +1,18 @@