diff --git a/src/utils/export.js b/src/utils/export.js index 430ae34..0a1f433 100644 --- a/src/utils/export.js +++ b/src/utils/export.js @@ -9,7 +9,7 @@ const isDOM = (obj) => obj instanceof HTMLElement; * @param {string} name 文件名 */ export const downloadPDF = async (dom, name = '导出文件') => { - if(!isDOM(dom)) return; + if (!isDOM(dom)) return; try { // 等待一段时间确保所有图表完全渲染 @@ -89,6 +89,9 @@ export function downloadDocWithStyle(textContent) { text-align: justify; text-justify: inter-character; } + .center-subtitle { + display: flex;align-items: center;justify-content: space-between; color: red;margin-top: 30px;padding: 0 30px;font-size: 18px;font-weight: 700; + } diff --git a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/index.vue b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/index.vue index bf7fadd..b4b30b9 100644 --- a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/index.vue +++ b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/index.vue @@ -25,7 +25,7 @@

{{ nd }}年度林芝市公安战术研判报告

+ style="display: flex;align-items: center;justify-content: space-between; color: red;margin-top: 30px;padding: 0 30px;font-size: 18px;font-weight: 700;" class="center-subtitle">
{{ deptId.name }}
{{ deptId?.ord }}
{{ deptId?.time }}
@@ -113,8 +113,10 @@

{{ textContent }}

+ 下载 + @click="downloadWithStyles">下载(doc)
@@ -173,7 +175,7 @@ const tabHeightFn = () => { /** 以pdf形式下载 */ const downLoadPdf = async () => { downLoading.value = true; - ElMessage.info('下载,会展开所有内容,是正常的。'); + ElMessage.info('下载界面会展开,是正常的。'); try { // 强制刷新所有图表 @@ -236,8 +238,7 @@ const downLoadPdf = async () => { } const downloadWithStyles = async () => { if (!tableBox.value?.innerHTML) return; - // downloadDocWithStyle(tableBox.value?.innerHTML) - downLoadPdf() + downloadDocWithStyle(tableBox.value?.innerHTML) } const pageData = reactive({