feat: 下载调整

This commit is contained in:
2025-12-11 18:44:06 +08:00
parent 1ac4807851
commit 3b78393e54
2 changed files with 10 additions and 6 deletions

View File

@ -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;
}
</style>
</head>
<body>

View File

@ -25,7 +25,7 @@
<div style="border-bottom: 1px #ccc solid;padding-bottom: 30px;">
<h1 style="text-align: center;color: red;">{{ nd }}年度林芝市公安战术研判报告</h1>
<div
style="display: flex;align-items: center;justify-content: space-between; color: red;margin-top: 30px;padding: 0 30px;font-size: 18px;font-weight: 700;">
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">
<div>{{ deptId.name }}</div>
<div>{{ deptId?.ord }}</div>
<div>{{ deptId?.time }}</div>
@ -113,8 +113,10 @@
<p style="min-height: 100px;" v-loading="loading">{{ textContent }} </p>
</div>
<!-- <el-button :loading="downLoading" style="position: absolute;bottom: 0;left: 40%;" type="primary" size="default"
@click="downLoadPdf">pdf下载</el-button> -->
<el-button :loading="downLoading" style="position: absolute;bottom: 0;left: 45%;" type="primary" size="default"
@click="downloadWithStyles">下载</el-button>
@click="downloadWithStyles">下载doc</el-button>
</div>
<AddForm ref="addForm" :dict="{ D_GS_XS_LX }" />
@ -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({