feat:职代会文件类型筛选去除图片、压缩包;文件预览支持ppt;查看已投票样式优化;

This commit is contained in:
2026-08-31 18:04:14 +08:00
parent bbf2bb798d
commit 8b3bc19757
3 changed files with 55 additions and 3 deletions
@@ -3,6 +3,7 @@ package com.budwk.app.base.utils;
import cn.hutool.core.io.FileUtil;
import com.aspose.cells.PdfSaveOptions;
import com.aspose.cells.Workbook;
import com.aspose.slides.Presentation;
import com.aspose.words.Document;
import com.aspose.words.SaveFormat;
import com.budwk.app.base.exception.BaseException;
@@ -30,11 +31,34 @@ public class OfficePlusUtil {
wordConvertPdf(sourcePath, targetPath);
} else if (suffix.equals("xls") || suffix.equals("xlsx")) {
excelConvertPdf(sourcePath, targetPath);
} else if (suffix.equals("ppt") || suffix.equals("pptx")) {
presentationConvertPdf(sourcePath, targetPath);
} else {
throw new BaseException("不支持的文档格式");
}
}
/**
* PPT演示文稿转PDF
*
* @param sourcePath 源文件路径
* @param targetPath 目标文件路径
*/
public static void presentationConvertPdf(String sourcePath, String targetPath) {
Presentation presentation = null;
try {
presentation = new Presentation(sourcePath);
presentation.save(targetPath, com.aspose.slides.SaveFormat.Pdf);
} catch (Exception e) {
log.info("转换pdf报错", e);
throw new BaseException("PPT转换PDF失败");
} finally {
if (presentation != null) {
presentation.dispose();
}
}
}
/**
* excel转pdf
*
@@ -136,9 +136,7 @@ layout("/layouts/platform_h5.html"){
{text: "PDF", value: "pdf"},
{text: "Word", value: "doc,docx"},
{text: "Excel", value: "xls,xlsx"},
{text: "PPT", value: "ppt,pptx"},
{text: "图片", value: "jpg,jpeg,png,gif,bmp,webp"},
{text: "压缩包", value: "zip,rar"}
{text: "PPT", value: "ppt,pptx"}
]
},
uploadTimeSortOptions() {
@@ -1440,12 +1438,16 @@ layout("/layouts/platform_h5.html"){
.file-grid-mode .file-card__header .file-name {
width: 100%;
height: 34px;
max-height: 34px;
flex: 0 0 34px;
display: -webkit-box;
overflow: hidden;
color: #23344a;
font-size: 12px;
line-height: 17px;
text-align: center;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
@@ -381,6 +381,32 @@ layout("/layouts/platform_h5.html"){
cursor: default;
}
.readonly-option input[type="radio"] {
width: 16px;
height: 16px;
flex: 0 0 16px;
appearance: none;
-webkit-appearance: none;
border: 1px solid #c8d2df;
border-radius: 50%;
background: #fff;
box-sizing: border-box;
opacity: 1;
cursor: default;
}
.readonly-option input[type="radio"]:checked {
border-color: #1989fa;
background: #1989fa;
box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px rgba(25, 137, 250, 0.14);
}
.readonly-option input[type="radio"]:checked + .radio-text,
.readonly-option input[type="radio"]:checked + .option-text {
color: #1989fa;
font-weight: 600;
}
.vote-footer {
position: fixed;
bottom: 0;