修改邮件模版预览按钮

This commit is contained in:
2026-04-24 14:51:25 +08:00
parent fe4bd7c9b0
commit bb36bcc645
3 changed files with 141 additions and 101 deletions

View File

@@ -62,6 +62,10 @@ export default {
default: ''
},
language: {
type: String,
default: 'en'
},
placeholder: {
type: String,
default: ''
@@ -87,13 +91,29 @@ export default {
expert_name: "John Doe", // 专家姓名
expert_field: "Biomedical Engineering", // 专家研究领域
representative_work_title: "Advanced Applications of AI in Medical Imaging", // 专家代表作标题
// ai_content_analysis: "", // AI 约稿理由分析
ai_content_analysis: "【AI分析文章一句话总结】", // AI solicitation rationale
ai_advised_topics: "Based on your research expertise, we would particularly welcome submissions on topics such as 【这里是AI针对学者领域给特定约稿主题】, or other closely related areas that align with your work.", // AI suggested directions
}
}
},
computed: {
isZhLanguage() {
return String(this.language || '').toLowerCase() === 'zh';
},
localizedAiMockData() {
if (this.isZhLanguage) {
return {
ai_content_analysis: '【AI分析这篇文章一句话总结】。【我们希望也关注个领域】',
ai_advised_topics: '我们尤其关注如【方向/题目建议1】、【方向/题目建议2】以及【方向/题目建议3】等相关议题的研究进展。'
};
}
return {
ai_content_analysis: '【AI分析文章一句话总结】',
ai_advised_topics: 'Based on your research expertise, we would particularly welcome submissions on topics such as 【这里是AI针对学者领域给特定约稿主题】, or other closely related areas that align with your work.'
};
},
resolvedPlaceholder() {
return this.placeholder || (this.$t && this.$t('tmrEmailEditor.placeholder')) || '请输入邮件内容...';
},
@@ -141,6 +161,7 @@ const deadlineStr = oneMonthLater.toISOString().split('T')[0];
const map = {
...this.variableMockData,
...this.localizedAiMockData,
journal_abbr: journal_info.jabbr, // 期刊缩写
journal_name: journal_info.title,// 期刊全称
journal_url: journal_info.website, // 期刊官网链接

View File

@@ -2,7 +2,6 @@
<div class="country-manage">
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item> <i class="el-icon-place"></i> {{ $t('countryManagement.title') }}</el-breadcrumb-item>
</el-breadcrumb>
</div>
@@ -36,9 +35,11 @@
{{ $t('countryManagement.searchBtn') }}
</el-button>
<el-button @click="handleReset">{{ $t('countryManagement.resetBtn') }}</el-button>
<el-button type="warning" plain icon="el-icon-upload2" @click="openBatchPartitionDialog">
<!-- 批量修改分区按钮 -->
<!-- <el-button type="warning" plain icon="el-icon-upload2" @click="openBatchPartitionDialog">
{{ $t('countryManagement.batchPartitionBtn') }}
</el-button>
</el-button> -->
</el-form-item>
</el-form>
</div>
@@ -132,101 +133,115 @@
destroy-on-close
@closed="resetBatchPartitionDialog"
>
<div style="display: flex;align-items: center;justify-content: space-between;">
<div class="batch-partition-content" style="width: 100%;">
<el-form label-width="120px" size="small" class="batch-partition-target-form">
<el-form-item :label="$t('countryManagement.batchPartitionTargetLabel')">
<el-select v-model="batchPartitionTargetPartition" style="width: 220px" @change="handleBatchPartitionDraftChange">
<el-option :label="$t('countryManagement.partition1')" value="1" />
<el-option :label="$t('countryManagement.partition2')" value="2" />
<el-option :label="$t('countryManagement.partition3')" value="3" />
</el-select>
</el-form-item>
</el-form>
<p class="batch-partition-help">{{ $t('countryManagement.batchPartitionHelp') }}</p>
<el-input
v-model="batchPartitionInput"
type="textarea"
:rows="20"
:placeholder="$t('countryManagement.batchPartitionPlaceholder')"
@input="handleBatchPartitionDraftChange"
/>
<div class="batch-partition-actions">
<el-button type="primary" plain :loading="batchPartitionPreviewLoading" @click="previewBatchPartition">
{{ $t('countryManagement.batchPartitionPreview') }}
</el-button>
<el-button
v-if="batchPartitionToApplyBaseRows.length > 0"
type="success"
:loading="batchPartitionApplyLoading"
:disabled="!batchPartitionPreviewRows.length"
@click="applyBatchPartition"
>
{{ $t('countryManagement.batchPartitionApply') }}
</el-button>
</div>
</div>
<div v-if="batchPartitionStats.input > 0" class="batch-partition-summary-container" style="margin-left: 20px;">
<div v-if="batchPartitionStats.input > 0" class="batch-partition-summary">
{{
$t('countryManagement.batchPartitionSummaryLine', {
input: String(batchPartitionStats.input),
matched: String(batchPartitionStats.matched),
miss: String(batchPartitionStats.miss),
same: String(batchPartitionStats.skipSame),
will: String(batchPartitionStats.willUpdate)
})
}}
</div>
<p v-if="batchPartitionPreviewRows.length" class="batch-partition-selection-hint">{{ $t('countryManagement.batchPartitionSelectionHint') }}</p>
<el-table
v-if="batchPartitionPreviewRows.length"
:data="batchPartitionFilteredPreviewRows"
border
stripe
size="small"
max-height="400"
class="batch-partition-table"
:row-class-name="batchPartitionRowClassName"
>
<el-table-column type="index" :label="$t('countryManagement.table.no')" width="64" align="center" />
<el-table-column prop="key" :label="$t('countryManagement.batchPartitionColKey')" min-width="120" show-overflow-tooltip />
<el-table-column prop="country_id" :label="$t('countryManagement.batchPartitionColId')" width="90" align="center" />
<el-table-column prop="en_name" :label="$t('countryManagement.batchPartitionColName')" min-width="140" show-overflow-tooltip />
<el-table-column :label="$t('countryManagement.batchPartitionColCurrentPartition')" width="140" align="center">
<template slot-scope="scope">
<span :class="['partition-chip', scope.row.status === 'diff' ? 'partition-chip--warn' : '']">
{{ scope.row.currentPartition || '—' }}
</span>
</template>
</el-table-column>
<el-table-column :label="$t('countryManagement.batchPartitionColMatch')" width="150" align="center">
<template slot-scope="scope">
<span
:class="[
'match-chip',
scope.row.status === 'not_found'
? 'match-chip--danger'
: scope.row.status === 'diff'
? 'match-chip--warn'
: 'match-chip--ok'
]"
<div style="display: flex; align-items: center; justify-content: space-between">
<div class="batch-partition-content" style="width: 100%">
<el-form label-width="120px" size="small" class="batch-partition-target-form">
<el-form-item :label="$t('countryManagement.batchPartitionTargetLabel')">
<el-select
v-model="batchPartitionTargetPartition"
style="width: 220px"
@change="handleBatchPartitionDraftChange"
>
<el-option :label="$t('countryManagement.partition1')" value="1" />
<el-option :label="$t('countryManagement.partition2')" value="2" />
<el-option :label="$t('countryManagement.partition3')" value="3" />
</el-select>
</el-form-item>
</el-form>
<p class="batch-partition-help">{{ $t('countryManagement.batchPartitionHelp') }}</p>
<el-input
v-model="batchPartitionInput"
type="textarea"
:rows="20"
:placeholder="$t('countryManagement.batchPartitionPlaceholder')"
@input="handleBatchPartitionDraftChange"
/>
<div class="batch-partition-actions">
<el-button type="primary" plain :loading="batchPartitionPreviewLoading" @click="previewBatchPartition">
{{ $t('countryManagement.batchPartitionPreview') }}
</el-button>
<el-button
v-if="batchPartitionToApplyBaseRows.length > 0"
type="success"
:loading="batchPartitionApplyLoading"
:disabled="!batchPartitionPreviewRows.length"
@click="applyBatchPartition"
>
{{ scope.row.matchLabel }}
</span>
</template>
</el-table-column>
</el-table>
{{ $t('countryManagement.batchPartitionApply') }}
</el-button>
</div>
</div>
<div v-if="batchPartitionStats.input > 0" class="batch-partition-summary-container" style="margin-left: 20px">
<div v-if="batchPartitionStats.input > 0" class="batch-partition-summary">
{{
$t('countryManagement.batchPartitionSummaryLine', {
input: String(batchPartitionStats.input),
matched: String(batchPartitionStats.matched),
miss: String(batchPartitionStats.miss),
same: String(batchPartitionStats.skipSame),
will: String(batchPartitionStats.willUpdate)
})
}}
</div>
<p v-if="batchPartitionPreviewRows.length" class="batch-partition-selection-hint">
{{ $t('countryManagement.batchPartitionSelectionHint') }}
</p>
<el-table
v-if="batchPartitionPreviewRows.length"
:data="batchPartitionFilteredPreviewRows"
border
stripe
size="small"
max-height="400"
class="batch-partition-table"
:row-class-name="batchPartitionRowClassName"
>
<el-table-column type="index" :label="$t('countryManagement.table.no')" width="64" align="center" />
<el-table-column
prop="key"
:label="$t('countryManagement.batchPartitionColKey')"
min-width="120"
show-overflow-tooltip
/>
<el-table-column prop="country_id" :label="$t('countryManagement.batchPartitionColId')" width="90" align="center" />
<el-table-column
prop="en_name"
:label="$t('countryManagement.batchPartitionColName')"
min-width="140"
show-overflow-tooltip
/>
<el-table-column :label="$t('countryManagement.batchPartitionColCurrentPartition')" width="140" align="center">
<template slot-scope="scope">
<span :class="['partition-chip', scope.row.status === 'diff' ? 'partition-chip--warn' : '']">
{{ scope.row.currentPartition || '—' }}
</span>
</template>
</el-table-column>
<el-table-column :label="$t('countryManagement.batchPartitionColMatch')" width="150" align="center">
<template slot-scope="scope">
<span
:class="[
'match-chip',
scope.row.status === 'not_found'
? 'match-chip--danger'
: scope.row.status === 'diff'
? 'match-chip--warn'
: 'match-chip--ok'
]"
>
{{ scope.row.matchLabel }}
</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
@@ -286,9 +301,7 @@ export default {
},
batchPartitionToApplyBaseRows() {
return (this.batchPartitionPreviewRows || []).filter(
(r) =>
r._row &&
String(r._row.partition != null ? r._row.partition : '') !== String(r.partition)
(r) => r._row && String(r._row.partition != null ? r._row.partition : '') !== String(r.partition)
);
},
batchPartitionEffectiveToApplyRows() {
@@ -603,7 +616,12 @@ export default {
}
const lower = key.toLowerCase();
return (
rows.find((r) => String(r.en_name || '').trim().toLowerCase() === lower) ||
rows.find(
(r) =>
String(r.en_name || '')
.trim()
.toLowerCase() === lower
) ||
rows.find((r) => String(r.zh_name || '').trim() === key) ||
null
);

View File

@@ -100,6 +100,7 @@
v-model="form.body"
:journalList="journalList"
:journalId="form.journalId"
:language="form.lang"
placeholder=""
/>
<CkeditorMail v-model="form.body" />