Commit f08e36cd authored by zhengke's avatar zhengke

优化高清图对比

parent ec51208e
......@@ -48,7 +48,7 @@
const slidesStore = useSlidesStore()
const { handleElement, handleElementId } = storeToRefs(mainStore)
const dialogFormVisible = ref(true)
const dialogTitle = ref('原图/清晰图对比')
const dialogTitle = ref('原图/高清图对比')
const setLoading = ref(false)
const props = defineProps({
width: { type: String, default: "500" },
......@@ -147,7 +147,6 @@
position: relative;
display: inline-block;
margin: 0 auto;
min-height: 273px;
overflow: hidden;
}
.before-image {
......
......@@ -87,10 +87,11 @@
@success="DefinitionDatas=null">
<template #left>
<span style="position: absolute;left: 10px;top:10px;background: #fff;border-radius: 3px;padding:0 5px;width: 38px;">原图</span>
<img :src="handleImageElement.src" class="images" :style="{width: imgWidth+'px'}" />
<img :src="handleImageElement.src" class="images" :style="{width: imgWidth+'px',height: imgHeigth+'px'}" />
</template>
<template #right>
<img :src="'data:image/png;base64,'+DefinitionDatas" class="images" :style="{width: imgWidth+'px'}" />
<span style="position: absolute;right: 10px;top:10px;background: #fff;border-radius: 3px;padding:0 5px;width: 53px;">高清图</span>
<img :src="'data:image/png;base64,'+DefinitionDatas" class="images" :style="{width: imgWidth+'px',height: imgHeigth+'px'}" />
</template>
</imgArticContr>
</div>
......@@ -190,6 +191,7 @@ const imgWidth = ref(500)
const imgHeigth = ref(0)
const getPictDef = async () =>{
await getImgSize()
if(handleImageElement.value.src.startsWith("data:image")){
let name = new Date().getTime()+".jpg"
const file = dataURLtoFile(handleImageElement.value.src, name)
......@@ -225,8 +227,9 @@ const getImgSize = async () => {
let TempSize = await FileService.getImageSizeWithoutDownloading(handleImageElement.value.src)
let ratio = TempSize.width/imgWidth.value
imgHeigth.value = TempSize.height/ratio
console.log(imgHeigth.value ,'------')
}
getImgSize()
const getLockCutRatio = () =>{
keyboardStore.setCtrlKeyState(ctrlKeyState.value)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment