|
@@ -49,7 +49,7 @@ export default {
|
|
|
// 选择多张图片
|
|
// 选择多张图片
|
|
|
selectImg(event) {
|
|
selectImg(event) {
|
|
|
const file = event.target.files;
|
|
const file = event.target.files;
|
|
|
- const size = 2097152; //2M
|
|
|
|
|
|
|
+ const size = 10485760; //10M
|
|
|
const newArr = [];
|
|
const newArr = [];
|
|
|
if (file.length > 1) {
|
|
if (file.length > 1) {
|
|
|
Notice.warning({
|
|
Notice.warning({
|
|
@@ -61,12 +61,12 @@ export default {
|
|
|
const el = file[j];
|
|
const el = file[j];
|
|
|
if (el.size >= size) {
|
|
if (el.size >= size) {
|
|
|
Notice.warning({
|
|
Notice.warning({
|
|
|
- desc: el.name + "大小超过2M限制请重新上传",
|
|
|
|
|
|
|
+ desc: el.name + "大小超过10M限制请重新上传",
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
|
- } else if (el.size >= size * 0.5) {
|
|
|
|
|
|
|
+ } else if (el.size >= size * 0.2) {
|
|
|
Notice.warning({
|
|
Notice.warning({
|
|
|
- desc: el.name + "大小超过限制将被压缩",
|
|
|
|
|
|
|
+ desc: el.name + "大小超过2M限制将被压缩",
|
|
|
});
|
|
});
|
|
|
// 压缩
|
|
// 压缩
|
|
|
new ImageCompressor({
|
|
new ImageCompressor({
|
|
@@ -74,6 +74,7 @@ export default {
|
|
|
quality: 0.3,
|
|
quality: 0.3,
|
|
|
mimeType: "image/jpeg",
|
|
mimeType: "image/jpeg",
|
|
|
success: (result) => {
|
|
success: (result) => {
|
|
|
|
|
+ console.log('压缩后',result);
|
|
|
newArr.push({
|
|
newArr.push({
|
|
|
url: this.getObjectURL(result),
|
|
url: this.getObjectURL(result),
|
|
|
data: result,
|
|
data: result,
|
|
@@ -209,8 +210,9 @@ export default {
|
|
|
async reGetData(url,start) {
|
|
async reGetData(url,start) {
|
|
|
const res = await axios.get(url);
|
|
const res = await axios.get(url);
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
- if(!res.data || !res.data.invoice_data.words_result || !res.data.invoice_data.words_result.length) throw new Error("识别错误");
|
|
|
|
|
- this.table = this.setData(res.data.invoice_data.words_result[0].result);
|
|
|
|
|
|
|
+ if(res.data && res.data.invoice_data.words_result && res.data.invoice_data.words_result.length){
|
|
|
|
|
+ this.table = this.setData(res.data.invoice_data.words_result[0].result);
|
|
|
|
|
+ }
|
|
|
const end = Date.now();
|
|
const end = Date.now();
|
|
|
Message.info({
|
|
Message.info({
|
|
|
content: "识别总用时:" + Math.abs((start - end) / 1000) + "s",
|
|
content: "识别总用时:" + Math.abs((start - end) / 1000) + "s",
|