This commit is contained in:
2025-06-04 09:34:43 +08:00
parent 5f50e448cb
commit 316d7d2043
30 changed files with 963 additions and 5302 deletions

View File

@@ -67,6 +67,190 @@ function findExtentElement(blipElement) {
}
export default {
getJournalTypeName(value) {
var list = this.journalTypeList();
list = [...list,
{ name: 'EVIDENCE-BASED MEDICINE', value: 'EM' }, // ✅ 补充项
{ name: 'PROTOCOL', value: 'PT' }, // ✅ 补充项
]
const type = list.find(item => item.value === value);
return type ? type.name : 'OTHERS';
},
journalTypeList() {
var journal_type = [
{ name: 'ARTICLE', value: 'A' },
{ name: 'REVIEW', value: 'B' },
{ name: 'CASE REPORT', value: 'C' },
{ name: 'RESEARCH PROPOSAL', value: 'P' },
{ name: 'NEWS', value: 'N' },
{ name: 'COMMENT', value: 'T' },
{ name: 'CORRECTION', value: 'CT' },
{ name: 'HYPOTHESIS', value: 'HT' },
{ name: 'PREFACE', value: 'PF' },
{ name: 'EDITORIAL', value: 'ET' },
{ name: 'REPORT', value: 'RP' },
{ name: 'LETTER', value: 'LR' },
{ name: 'EMPIRICAL FORMULA', value: 'EF' },
{ name: 'EXPERT CONSENSUS', value: 'EC' },
{ name: 'LETTER TO EDITOR', value: 'LTE' },
{ name: 'QUESTIONNAIRE INVESTIGATION', value: 'QI' },
{ name: 'CASE SERIES', value: 'CS' },
{ name: 'RETRACTION', value: 'RT' },
{ name: 'MINI REVIEW', value: 'MR' },
{ name: 'OTHERS', value: 'O' }
];
return journal_type;
},
opMedicalList() {
var opMedical = [{
label: 'None',
value: ''
},
{
label: 'ARTICLE',
value: 'Article'
},
{
label: 'REVIEW',
value: 'Review'
},
{
label: 'CASE REPORT',
value: 'Case report'
},
{
label: 'RESEARCH PROPOSAL',
value: 'Research proposal'
},
{
label: 'NEWS',
value: 'News'
},
{
label: 'COMMENT',
value: 'Comment'
},
{
label: 'CORRECTION',
value: 'Correction'
},
{
label: 'HYPOTHESIS',
value: 'Hypothesis'
},
{
label: 'PREFACE',
value: 'Preface'
},
{
label: 'EDITORIAL',
value: 'Editorial'
},
{
label: 'REPORT',
value: 'Report'
},
{
label: 'LETTER',
value: 'Letter'
},
{
label: 'EMPIRICAL FORMULA',
value: 'Empirical formula'
},
{
label: 'EVIDENCE-BASED MEDICINE',
value: 'Evidence-based medicine'
},
{
label: 'EXPERT CONSENSUS',
value: 'Expert consensus'
},
{
label: 'LETTER TO EDITOR',
value: 'Letter to editor'
},
{
label: 'QUESTIONNAIRE INVESTIGATION',
value: 'Questionnaire investigation'
},
{
label: 'PROTOCOL',
value: 'Protocol'
},
{
label: 'CASE SERIES',
value: 'Case Series'
},
{
label: 'RETRACTION',
value: 'Retraction'
},
{
label: 'MINI REVIEW',
value: 'Mini Review'
},
{
label: '内经难经',
value: '内经难经'
},
{
label: '伤寒金匮',
value: '伤寒金匮'
},
{
label: '神农本草经',
value: '神农本草经'
},
{
label: '温病研究',
value: '温病研究'
},
{
label: '唐宋方药',
value: '唐宋方药'
},
{
label: '金元各家',
value: '金元各家'
},
{
label: '明清经典',
value: '明清经典'
},
{
label: '中西汇通',
value: '中西汇通'
},
{
label: '太湖选粹',
value: '太湖选粹'
},
{
label: '针灸推拿',
value: '针灸推拿'
},
{
label: '名医名方',
value: '名医名方'
},
{
label: '新冠肺炎',
value: '新冠肺炎'
},
{
label: '书评',
value: '书评'
}
]
return opMedical;
},
isImageValid(base64) {
return new Promise((resolve, reject) => {
// 创建 Image 对象
@@ -141,18 +325,18 @@ export default {
{
convertImage: mammoth.images.inline(async function (image) {
const contentType = image.contentType.toLowerCase();
// 只允许这三种格式
const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png'];
if (!allowedTypes.includes(contentType)) {
// 跳过不支持的格式(如 image/tiff、image/x-emf 等)
return { src: '' }; // 会从 HTML 中删除这张图片
}
// 读取为 base64 并构造 src
const imageBuffer = await image.read("base64");
const base64Src = `data:${contentType};base64,${imageBuffer}`;
return {
src: base64Src
};