去掉作者端 Article Proofreading (原步骤2)
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
//记得切换
|
||||
|
||||
//正式
|
||||
// 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/';
|
||||
const baseUrl = '/api'
|
||||
// const mediaUrl = 'https://submission.tmrjournals.com/public/';
|
||||
// // const mediaUrl = 'http://zmzm.tougao.dev.com/public/';
|
||||
// const baseUrl = '/api'
|
||||
|
||||
//测试环境
|
||||
|
||||
|
||||
@@ -1145,7 +1145,7 @@ const en = {
|
||||
typesettingType1: 'Vertical A4',
|
||||
AnnotationList: 'Annotation List',
|
||||
Annotations: 'Comments',
|
||||
exportWord: 'Export Word',
|
||||
exportWord: 'Generate Word file',
|
||||
exportManuscriptEmpty: 'No content to export.',
|
||||
exportManuscriptSuccess: 'Word downloaded.',
|
||||
exportManuscriptFail: 'Failed to export Word.',
|
||||
@@ -1174,8 +1174,10 @@ const en = {
|
||||
citeRelevanceBatchTip: '{n} references per batch within each paragraph',
|
||||
citeRelevanceRefBatch: 'Batch refs {nums}',
|
||||
citeRelevanceBatchProgress: 'Paragraph batch {current}/{total}',
|
||||
citeRelevanceGroupTotal: '{n} paragraphs to review',
|
||||
citeRelevanceGroupTotal: '{n} batches to review',
|
||||
citeRelevanceGroupNavLabel: 'Para {paragraph} · {refs}',
|
||||
citeRelevanceTableNavLabel: 'Table {paragraph} · {refs}',
|
||||
citeRelevancePreviewTitle: 'Preview',
|
||||
citeRelevanceJumpTo: 'Jump to',
|
||||
citeRelevanceCopyGroup: 'Copy paragraph',
|
||||
citeRelevanceDownloadHtml: 'Download HTML',
|
||||
|
||||
@@ -1131,7 +1131,7 @@ const zh = {
|
||||
typesettingType1: '竖向 A4',
|
||||
AnnotationList: '批注列表',
|
||||
Annotations: '批注',
|
||||
exportWord: '导出 Word',
|
||||
exportWord: '生成 Word 文件',
|
||||
exportManuscriptEmpty: '没有可导出的内容。',
|
||||
exportManuscriptSuccess: 'Word 已下载。',
|
||||
exportManuscriptFail: 'Word 导出失败。',
|
||||
@@ -1160,8 +1160,10 @@ const zh = {
|
||||
citeRelevanceBatchTip: '每段正文按 {n} 条参考文献一批提问',
|
||||
citeRelevanceRefBatch: '本批文献 {nums}',
|
||||
citeRelevanceBatchProgress: '本段第 {current}/{total} 批',
|
||||
citeRelevanceGroupTotal: '共 {n} 段待核查',
|
||||
citeRelevanceGroupTotal: '共 {n} 组待核查',
|
||||
citeRelevanceGroupNavLabel: '段落 {paragraph} · {refs}',
|
||||
citeRelevanceTableNavLabel: '表格 {paragraph} · {refs}',
|
||||
citeRelevancePreviewTitle: '内容预览',
|
||||
citeRelevanceJumpTo: '快速跳转',
|
||||
citeRelevanceCopyGroup: '复制本段',
|
||||
citeRelevanceDownloadHtml: '下载 HTML',
|
||||
|
||||
@@ -136,16 +136,16 @@
|
||||
<!-- <div v-else style="padding: 20px; box-sizing: border-box"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="content_box mt20 stepbox">
|
||||
<!-- 文章引用 -->
|
||||
<!-- <div class="content_box mt20 stepbox">
|
||||
|
||||
<div class="con">
|
||||
<h4 class="con-title">{{ this.$t('PreAccept.step2') }}</h4>
|
||||
<p style="color: #505050; font-size: 14px; padding: 20px; box-sizing: border-box">
|
||||
<el-button @click="goGenerateCharts(thisArtcleId)" icon="el-icon-edit" type="text">Edit</el-button>
|
||||
</p>
|
||||
<!-- <div v-else style="padding: 20px; box-sizing: border-box"></div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content_box mt20 stepbox">
|
||||
<!-- 文章引用 -->
|
||||
<div class="con">
|
||||
|
||||
@@ -92,49 +92,6 @@
|
||||
></i>
|
||||
{{ $t('commonTable.exportWord') }}
|
||||
</li>
|
||||
<li
|
||||
v-if="zyModeEnabled"
|
||||
@click="handleDownloadReferencesHtml"
|
||||
class="base-font-size base-bg-imp base-padding-all"
|
||||
:style="{ '--f-s': '12px', '--f-c': '#333' }"
|
||||
>
|
||||
<i
|
||||
class="el-icon-document base-margin"
|
||||
:style="{ '--m-r': '2px' }"
|
||||
v-if="!referencesHtmlLoading"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-loading base-margin"
|
||||
:style="{ '--m-r': '2px' }"
|
||||
v-else
|
||||
></i>
|
||||
{{ $t('commonTable.refHtmlDownload') }}
|
||||
</li>
|
||||
<li
|
||||
v-if="zyModeEnabled"
|
||||
@click="triggerReferencesHtmlToWord"
|
||||
class="base-font-size base-bg-imp base-padding-all"
|
||||
:style="{ '--f-s': '12px', '--f-c': '#333' }"
|
||||
>
|
||||
<i
|
||||
class="el-icon-upload2 base-margin"
|
||||
:style="{ '--m-r': '2px' }"
|
||||
v-if="!exportingReferencesHtmlWord"
|
||||
></i>
|
||||
<i
|
||||
class="el-icon-loading base-margin"
|
||||
:style="{ '--m-r': '2px' }"
|
||||
v-else
|
||||
></i>
|
||||
{{ $t('commonTable.refHtmlToWord') }}
|
||||
</li>
|
||||
<input
|
||||
ref="referencesHtmlFileInput"
|
||||
type="file"
|
||||
accept=".html,text/html"
|
||||
style="display: none"
|
||||
@change="handleReferencesHtmlToWord"
|
||||
/>
|
||||
<li
|
||||
v-if="zyModeEnabled"
|
||||
@click="handleOpenCitationRelevance"
|
||||
@@ -1144,11 +1101,6 @@ import { debounce, throttle } from '@/common/js/debounce';
|
||||
import { tableStyle, commonWordStyle } from '@/utils/tinymceStyles';
|
||||
import LatexDataPanel from './LatexDataPanel.vue';
|
||||
import { downloadManuscriptWord, fetchManuscriptReferenceList } from '@/utils/exportManuscriptWord';
|
||||
import {
|
||||
buildReferencesHtmlLabels,
|
||||
downloadReferencesEditableHtml,
|
||||
parseReferencesEditableHtml
|
||||
} from '@/utils/manuscriptReferenceHtml';
|
||||
import {
|
||||
buildCitationReviewQueue,
|
||||
buildCitationReviewHtmlLabels,
|
||||
@@ -1280,8 +1232,6 @@ export default {
|
||||
scrollPosition: 0,
|
||||
wordList: [],
|
||||
exportingManuscriptWord: false,
|
||||
referencesHtmlLoading: false,
|
||||
exportingReferencesHtmlWord: false,
|
||||
citationRelevanceLoading: false,
|
||||
manuscriptReferences: [],
|
||||
proofreadingList: [],
|
||||
@@ -1574,104 +1524,6 @@ export default {
|
||||
this.exportingManuscriptWord = false;
|
||||
}
|
||||
},
|
||||
async handleDownloadReferencesHtml() {
|
||||
if (this.referencesHtmlLoading) {
|
||||
return;
|
||||
}
|
||||
if (!this.$api) {
|
||||
this.$message.error(this.$t('commonTable.refHtmlLoadFail'));
|
||||
return;
|
||||
}
|
||||
|
||||
this.referencesHtmlLoading = true;
|
||||
try {
|
||||
let references = this.manuscriptReferences;
|
||||
if (!references || !references.length) {
|
||||
references = await fetchManuscriptReferenceList(this.$api, this.articleId, this.pArticleId);
|
||||
this.manuscriptReferences = references || [];
|
||||
}
|
||||
if (!references || !references.length) {
|
||||
this.$message.warning(this.$t('commonTable.refHtmlEmpty'));
|
||||
return;
|
||||
}
|
||||
|
||||
const labels = buildReferencesHtmlLabels(this.$t.bind(this));
|
||||
const fileName = 'references-editor' + (this.articleId ? '-' + this.articleId : '') + '.html';
|
||||
downloadReferencesEditableHtml(references, labels, fileName);
|
||||
this.$message.success(this.$t('commonTable.refHtmlDownloadSuccess'));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
this.$message.error(this.$t('commonTable.refHtmlLoadFail'));
|
||||
} finally {
|
||||
this.referencesHtmlLoading = false;
|
||||
}
|
||||
},
|
||||
triggerReferencesHtmlToWord() {
|
||||
if (this.exportingReferencesHtmlWord) {
|
||||
return;
|
||||
}
|
||||
const input = this.$refs.referencesHtmlFileInput;
|
||||
if (input) {
|
||||
input.value = '';
|
||||
input.click();
|
||||
}
|
||||
},
|
||||
handleReferencesHtmlToWord(event) {
|
||||
const input = event && event.target;
|
||||
const file = input && input.files && input.files[0];
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.wordList || !this.wordList.length) {
|
||||
this.$message.warning(this.$t('commonTable.exportManuscriptEmpty'));
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.exportingReferencesHtmlWord = true;
|
||||
const reader = new FileReader();
|
||||
reader.onload = async () => {
|
||||
try {
|
||||
const referenceHtmlItems = parseReferencesEditableHtml(String(reader.result || ''));
|
||||
if (!referenceHtmlItems.length) {
|
||||
this.$message.warning(this.$t('commonTable.refHtmlParseEmpty'));
|
||||
return;
|
||||
}
|
||||
|
||||
await downloadManuscriptWord(this.wordList, this.mediaUrl, 'manuscript', {
|
||||
fetchReferences: false,
|
||||
referenceHtmlItems: referenceHtmlItems,
|
||||
apiClient: this.$api,
|
||||
articleId: this.articleId,
|
||||
pArticleId: this.pArticleId
|
||||
});
|
||||
this.$message.success(this.$t('commonTable.refHtmlToWordSuccess'));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
if (err && err.message === 'NO_CONTENT') {
|
||||
this.$message.warning(this.$t('commonTable.exportManuscriptEmpty'));
|
||||
} else {
|
||||
this.$message.error(this.$t('commonTable.refHtmlToWordFail'));
|
||||
}
|
||||
} finally {
|
||||
this.exportingReferencesHtmlWord = false;
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
reader.onerror = () => {
|
||||
this.exportingReferencesHtmlWord = false;
|
||||
if (input) {
|
||||
input.value = '';
|
||||
}
|
||||
this.$message.error(this.$t('commonTable.refHtmlToWordFail'));
|
||||
};
|
||||
reader.readAsText(file, 'UTF-8');
|
||||
},
|
||||
async handleOpenCitationRelevance() {
|
||||
if (this.citationRelevanceLoading) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user