|
@@ -12,7 +12,7 @@
|
|
<h4>支持jpg, png, bmp, pdf等文件格式</h4>
|
|
<h4>支持jpg, png, bmp, pdf等文件格式</h4>
|
|
</el-row>
|
|
</el-row>
|
|
<div class="common-layout">
|
|
<div class="common-layout">
|
|
- <el-upload class="upload-demo" drag :before-upload="beforeUpload" multiple>
|
|
|
|
|
|
+ <el-upload class="upload-demo" drag action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" :before-upload="beforeUpload" multiple>
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
<div class="el-upload__text">
|
|
<div class="el-upload__text">
|
|
Drop file here or <em>click to upload</em>
|
|
Drop file here or <em>click to upload</em>
|
|
@@ -184,7 +184,7 @@ const predict = async () => {
|
|
// console.log('is_pdf' + is_pdf.value)
|
|
// console.log('is_pdf' + is_pdf.value)
|
|
if (is_pdf.value) {
|
|
if (is_pdf.value) {
|
|
const file: any = convertCanvasToFile(canvas.value, "pdf.png").then(result => {
|
|
const file: any = convertCanvasToFile(canvas.value, "pdf.png").then(result => {
|
|
- // console.log(result)
|
|
|
|
|
|
+ console.log(result)
|
|
data.append('image', result);
|
|
data.append('image', result);
|
|
TableRec(api, data).then(res => {
|
|
TableRec(api, data).then(res => {
|
|
console.log(api)
|
|
console.log(api)
|
|
@@ -318,6 +318,9 @@ function getPdfImage(index: number) {
|
|
pdf_img.value = dataURLtoBlob(canvas.value.toDataURL('images/png', 1.0))
|
|
pdf_img.value = dataURLtoBlob(canvas.value.toDataURL('images/png', 1.0))
|
|
const showImg = document.getElementById("show-img") as HTMLImageElement;
|
|
const showImg = document.getElementById("show-img") as HTMLImageElement;
|
|
showImg.src = canvas.value.toDataURL('images/png', 1.0);
|
|
showImg.src = canvas.value.toDataURL('images/png', 1.0);
|
|
|
|
+ showImg.onload = () => {
|
|
|
|
+ console.log(canvas.value.toDataURL('images/png', 1.0))
|
|
|
|
+ }
|
|
});
|
|
});
|
|
})
|
|
})
|
|
});
|
|
});
|