feat(报销/拨款): 进入页面检测OCR服务状态
- 后端新增 GET /ocr-health 端点,探测 Python OCR 服务 /health - 前端页面 created 时调用健康检查,服务不可用时顶部显示红色警告 "发票识别服务已停止,请联系信息化部门" - 服务不可用时禁用附件上传区域(FileUpload 新增 disabled prop) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<el-upload multiple :drag="dragShow" :action="uploadFileUrl" :before-upload="handleBeforeUpload"
|
||||
:file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess" :show-file-list="false" :data="{ isPublic: extraData }" :headers="headers"
|
||||
class="upload-file-uploader" ref="fileUpload">
|
||||
:disabled="disabled" class="upload-file-uploader" ref="fileUpload">
|
||||
<i class="el-icon-upload" v-if="dragShow"></i>
|
||||
<div class="el-upload__text" v-if="dragShow">
|
||||
将文件拖到此处,或<em>点击上传</em>
|
||||
@@ -71,6 +71,10 @@ export default {
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
inject: ['$folder'],
|
||||
@@ -126,6 +130,7 @@ export default {
|
||||
this.$download.oss(file.ossId);
|
||||
},
|
||||
handleBeforeUpload (file) {
|
||||
if (this.disabled) return false;
|
||||
const ext = file.name.split('.').pop().toLowerCase();
|
||||
if (this.fileType && !this.fileType.includes(ext)) {
|
||||
this.$modal.msgError(`文件格式不正确,请上传${this.fileType.join('/')}格式文件!`);
|
||||
|
||||
Reference in New Issue
Block a user