fix: 默认剪裁功能丢失原图片信息
This commit is contained in:
parent
1864762de5
commit
3d09afd587
@ -61,7 +61,7 @@ export interface LayUploadProps {
|
|||||||
number?: number;
|
number?: number;
|
||||||
drag?: boolean;
|
drag?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
disabledPreview?:boolean;
|
disabledPreview?: boolean;
|
||||||
cut?: boolean;
|
cut?: boolean;
|
||||||
cutOptions: cutOptions;
|
cutOptions: cutOptions;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,9 @@ const getCutDownResult = () => {
|
|||||||
const canvas = _cropper.getCroppedCanvas();
|
const canvas = _cropper.getCroppedCanvas();
|
||||||
let imgData = canvas.toDataURL('"image/png"');
|
let imgData = canvas.toDataURL('"image/png"');
|
||||||
let currentTimeStamp = new Date().valueOf();
|
let currentTimeStamp = new Date().valueOf();
|
||||||
emit("cutdone", Object.assign({ currentTimeStamp, msg: imgData }));
|
let orgInfo = activeUploadFiles.value[0];
|
||||||
|
console.log(orgInfo);
|
||||||
|
emit("cutdone", Object.assign({ currentTimeStamp, cutResult: imgData,orginal:orgInfo }));
|
||||||
let newFile = dataURLtoFile(imgData);
|
let newFile = dataURLtoFile(imgData);
|
||||||
commonUploadTransaction([newFile]);
|
commonUploadTransaction([newFile]);
|
||||||
nextTick(() => clearAllCutEffect());
|
nextTick(() => clearAllCutEffect());
|
||||||
@ -113,7 +115,7 @@ const props = withDefaults(defineProps<LayUploadProps>(), {
|
|||||||
number: 0,
|
number: 0,
|
||||||
drag: false,
|
drag: false,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
disabledPreview:false,
|
disabledPreview: false,
|
||||||
cut: false,
|
cut: false,
|
||||||
cutOptions: void 0,
|
cutOptions: void 0,
|
||||||
});
|
});
|
||||||
@ -350,7 +352,10 @@ const cutTransaction = () => {};
|
|||||||
//内部方法 -> end
|
//内部方法 -> end
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="layui-upload layui-upload-wrap" :class="disabledPreview?'layui-upload-file-disabled':''">
|
<div
|
||||||
|
class="layui-upload layui-upload-wrap"
|
||||||
|
:class="disabledPreview ? 'layui-upload-file-disabled' : ''"
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
class="layui-upload-file"
|
class="layui-upload-file"
|
||||||
@click="clickOrgInput"
|
@click="clickOrgInput"
|
||||||
@ -417,7 +422,10 @@ const cutTransaction = () => {};
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</lay-layer>
|
</lay-layer>
|
||||||
<div class="layui-upload-list" :class="disabledPreview?'layui-upload-list-disabled':''">
|
<div
|
||||||
|
class="layui-upload-list"
|
||||||
|
:class="disabledPreview ? 'layui-upload-list-disabled' : ''"
|
||||||
|
>
|
||||||
<slot name="preview"></slot>
|
<slot name="preview"></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user