|
@@ -1956,6 +1956,7 @@ import Time from "./tools/time.vue";
|
|
|
import Mind from "./tools/jsmind.vue";
|
|
|
import Sunburst from "./tools/sunburst";
|
|
|
import SeeBoard from "./tools/seeBoard";
|
|
|
+import * as imageConversion from 'image-conversion'
|
|
|
export default {
|
|
|
components: { EditorBar, Time, pdf, AskStatic, Mind, Sunburst, SeeBoard, AnswerData2 },
|
|
|
data() {
|
|
@@ -2809,7 +2810,7 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- beforeUpload1(event, type, i) {
|
|
|
+ async beforeUpload1(event, type, i) {
|
|
|
var file = event.target.files[0];
|
|
|
var credentials = {
|
|
|
accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
@@ -2837,6 +2838,7 @@ export default {
|
|
|
"PPSM",
|
|
|
];
|
|
|
var excelA = ['XLSX', 'XLXB', 'XLS', 'XLSM']
|
|
|
+ var photoA = ["BMP", "GIF", "PNG", "JPGE", "JPG", "TIF", "PCX", "TGA", "EXIF", "FPX", "SVG", "APNG"];
|
|
|
if (
|
|
|
b.indexOf(
|
|
|
file.name
|
|
@@ -2862,6 +2864,15 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+ if (photoA.indexOf(
|
|
|
+ file.name
|
|
|
+ .split(".")
|
|
|
+ [file.name.split(".").length - 1].toLocaleUpperCase()
|
|
|
+ ) != -1) {
|
|
|
+ // const blob = await imageConversion.compress(file, 0.8)
|
|
|
+ const blob = await imageConversion.compressAccurately(file, 32)
|
|
|
+ file = new File([blob], file.name, {type: file.type})
|
|
|
+ }
|
|
|
_this.progress = 0;
|
|
|
_this.proVisible = true;
|
|
|
|