| | |
| | | class="upload-demo" |
| | | :action="uploadAction" |
| | | :headers="uploadHeaders" |
| | | :data="uploadData" |
| | | :show-file-list="false" |
| | | :on-success="handleDefaultUploadSuccess" |
| | | :on-error="handleDefaultUploadError"> |
| | |
| | | type: String, |
| | | default: `${import.meta.env.VITE_APP_BASE_API}/file/upload`, |
| | | }, |
| | | uploadData: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | uploadDirectSave: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | isShowPagination: { |
| | | type: Boolean, |
| | | default: false, |
| | |
| | | ElMessage.error(res?.msg || "文件上传失败"); |
| | | return; |
| | | } |
| | | if (props.uploadDirectSave) { |
| | | ElMessage.success("上传成功"); |
| | | emit("upload", res?.data || {}); |
| | | return; |
| | | } |
| | | if (!props.rulesRegulationsManagementId) { |
| | | ElMessage.error("缺少规章制度ID,无法保存附件"); |
| | | ElMessage.error("缺少业务ID,无法保存附件"); |
| | | return; |
| | | } |
| | | const fileName = res?.data?.originalName || file?.name; |