离职离岗校验修改

ln_ry20250512
dshclm 1 week ago
parent 225b3b8ffe
commit e86aca478e

@ -20,7 +20,7 @@ import java.util.Map;
public class LeavePdfService {
// 定义最大和最小字体大小,用于动态调整
private static final float MAX_FONT_SIZE = 14;
private static final float MAX_FONT_SIZE = 12;
private static final float MIN_FONT_SIZE = 8;
// 预估的字段宽度根据实际PDF调整
private static final float ESTIMATED_FIELD_WIDTH = 100f;

@ -275,13 +275,16 @@
</div>
</div>
</div>
<div class="flex items-center justify-between mb-4">
<div style="display: ruby;" class="flex items-center justify-between mb-4">
<button type="submit" class="group relative w-full max-w-xs flex justify-center py-3 px-6 border border-transparent text-base font-medium rounded-lg text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-all duration-200">
<span class="absolute left-0 inset-y-0 flex items-center pl-3" style="margin-right: 5px;">
<i class="fa-solid fa-file-pdf text-white transform group-hover:translate-x-0.5 transition-transform duration-200"></i>
</span>
生成离职离岗审批表
</button>
<a v-if="showResult" :href="pdfUrl" download="涉密人员离职离岗审批表.pdf" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">
<i class="fa-solid fa-download mr-2"></i> 下载PDF
</a>
</div>
<h4 class="form-header h4">材料上传</h4>
<!-- 材料上传区域 - 使用循环生成 -->
@ -351,26 +354,6 @@
</div>
</div>
</div>
<!-- 结果区域 -->
<div v-if="showResult" class="bg-white rounded-xl shadow-soft p-6 mb-8 transform hover:shadow-lg transition-all duration-300">
<div class="flex items-start">
<div class="flex-shrink-0 bg-green-100 p-3 rounded-lg">
<i class="fa-solid fa-check text-green-500 text-xl"></i>
</div>
<div class="ml-4">
<h3 class="text-lg font-medium text-gray-800">PDF生成成功</h3>
<p class="mt-1 text-sm text-gray-600">您的PDF表单已成功填写可以点击下方按钮下载。</p>
<div class="mt-4 flex flex-wrap gap-3">
<a :href="pdfUrl" download="涉密人员离职离岗审批表.pdf" class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">
<i class="fa-solid fa-download mr-2"></i> 下载PDF
</a>
<button @click="showResult = false" class="inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md shadow-sm text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors duration-200">
<i class="fa-solid fa-times mr-2"></i> 关闭
</button>
</div>
</div>
</div>
</div>
<!-- 加载中 -->
<div v-if="isLoading" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
<div class="bg-white rounded-xl p-6 shadow-lg max-w-md w-full">
@ -629,7 +612,7 @@
// 创建下载URL
let blob = new Blob([response.data], { type: 'application/pdf' });
this.pdfUrl = window.URL.createObjectURL(blob);
this.$message.success('生成pdf成功请点击下载');
// 隐藏加载状态,显示结果
this.isLoading = false;
this.showResult = true;
@ -696,11 +679,10 @@
});
},
submitHandler() {
if (this.uploadedFiles.length == 0) {
if (this.uploadedFiles[0].length == 0) {
this.$message.warning('请上传所需材料');
return;
}
this.$confirm('确认提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',

Loading…
Cancel
Save