feat: OCR 服务 + 会议材料模块
ry-ocr/ (新)
本地发票识别微服务 (PaddleOCR 3.x + FastAPI, 8801)
- QR 优先: 扫到二维码即取开票时间/发票号/金额; 没扫到/格式不合法直接判非发票, 不跑 OCR
- 配置 QR_FULL_OCR 控制快路径(false, 0.2s)还是全字段(true, 4.5s)
- /recognize/invoice (multipart) + /recognize/invoice/by-path (本地路径, 白名单) + /recognize/text
- is_invoice / from_qr / qr_raw / qr_error / error_code 字段
- 12 字段发票抽取 (regex + 启发式, 左右主体识别)
- 超时保护 (15s 单页 / 60s 总流程) + PaddleOCR 单例 + ThreadPoolExecutor
ry-api/ruoyi-business/
- pom.xml: 加 hutool-http/json/core 5.8.27, lombok 1.18.30 (OcrClient @Slf4j 所需)
- ocr/: OcrClient + InvoiceResult/Fields/Line + ZipExtractor + InvoiceOcrScheduler
- oss/: OssUploader + OssConfMeta (OCR 识别后重传 OSS)
- config/: OcrConfig + OcrExecutorConfig (后台线程池)
- service/impl/InvoiceOcrService: 后台提交 OCR, ZIP 路径解压识别, 替换场景先清旧
- 会议材料 CRUD 全套 (BizMeetingAuditLog/Executor/Invoice/Material/Supervisor):
controller + service + mapper + domain + xml
ry-vue3/
- MeetingDetail.vue (新建): 会议详情页 (含评分维度章节, 改只读)
- Meetings.vue / OssFileUploader.vue / router / Login.vue: 适配新字段
ry-api/ruoyi-admin/
- RuoYiApplication.java + application.yml: 启用 @Async 异步支持
_self/
- manager_meetings.md / manager_meeting_detail.md: 文档
This commit is contained in:
@@ -24,6 +24,14 @@
|
||||
<span class="file-type">{{ ext.toUpperCase() }} · {{ fileSizeText }}</span>
|
||||
</div>
|
||||
<el-button v-if="!readonly" link type="danger" size="small" class="remove-btn" @click.stop="onRemove">移除</el-button>
|
||||
<!-- 右侧预览框 (图片用 el-image, 其他用 icon + 点击新窗口打开) -->
|
||||
<div v-if="showPreview" class="preview-box">
|
||||
<el-image v-if="isImage" :src="modelValue" :preview-src-list="[modelValue]" :initial-index="0" fit="cover" class="preview-img" />
|
||||
<a v-else :href="modelValue" target="_blank" class="preview-file" @click.stop>
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
<span class="preview-text">{{ getFileType(modelValue) }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
@@ -38,6 +46,7 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Document } from '@element-plus/icons-vue'
|
||||
import { uploadToOss } from '@/utils/oss'
|
||||
|
||||
const props = defineProps({
|
||||
@@ -48,7 +57,8 @@ const props = defineProps({
|
||||
accept: { type: String, default: '.pdf,.png,.jpg,.jpeg' },
|
||||
maxSize: { type: Number, default: 10 }, // MB
|
||||
block: { type: Boolean, default: false },
|
||||
readonly: { type: Boolean, default: false }
|
||||
readonly: { type: Boolean, default: false },
|
||||
showPreview: { type: Boolean, default: true } // 右侧预览框 (图片/PDF/其他)
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
@@ -69,6 +79,24 @@ const ext = computed(() => {
|
||||
})
|
||||
const fileSizeText = computed(() => '已上传')
|
||||
|
||||
// 图片扩展名 (用于 el-image 预览)
|
||||
const isImage = computed(() => {
|
||||
if (!props.modelValue) return false
|
||||
return ['png', 'jpg', 'jpeg', 'gif', 'webp', 'bmp', 'svg'].includes(ext.value)
|
||||
})
|
||||
// 文件类型标签 (PDF / DOC / XLS / ZIP 等)
|
||||
const typeLabelMap = {
|
||||
pdf: 'PDF', doc: 'DOC', docx: 'DOCX',
|
||||
xls: 'XLS', xlsx: 'XLSX', ppt: 'PPT', pptx: 'PPTX',
|
||||
zip: 'ZIP', rar: 'RAR', '7z': '7Z',
|
||||
txt: 'TXT', csv: 'CSV'
|
||||
}
|
||||
function getFileType(url) {
|
||||
if (!url) return 'FILE'
|
||||
const e = url.split('?')[0].split('.').pop().toLowerCase()
|
||||
return typeLabelMap[e] || (e ? e.toUpperCase() : 'FILE')
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
if (props.readonly || uploading.value) return
|
||||
fileInput.value?.click()
|
||||
@@ -149,4 +177,30 @@ function onRemove() {
|
||||
.file-name:hover { color: #1890ff; text-decoration: underline; }
|
||||
.file-type { font-size: 12px; color: #909399; }
|
||||
.remove-btn { flex-shrink: 0; }
|
||||
|
||||
/* 右侧预览框 (方形, 64x64) */
|
||||
.preview-box {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border: 1px solid #f0f0f0;
|
||||
border-radius: 4px;
|
||||
background: #fafafa;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.preview-img { width: 100%; height: 100%; cursor: pointer; }
|
||||
.preview-file {
|
||||
display: flex; flex-direction: column;
|
||||
align-items: center; justify-content: center;
|
||||
gap: 2px;
|
||||
width: 100%; height: 100%;
|
||||
color: #8c8c8c;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.preview-file:hover { color: var(--brand-primary); }
|
||||
.preview-text { font-size: 10px; font-weight: 500; }
|
||||
</style>
|
||||
Reference in New Issue
Block a user