@@ -224,8 +224,8 @@ function changeScale(event) { | |||||
let deltaY = touchStart.pageY - y; | let deltaY = touchStart.pageY - y; | ||||
let boxDistance2 = Math.sqrt(deltaX ** 2 + deltaY ** 2); | let boxDistance2 = Math.sqrt(deltaX ** 2 + deltaY ** 2); | ||||
if (deltaX < 0) { | if (deltaX < 0) { | ||||
if (props.materialList.virtual.w < 0.4) { | |||||
props.materialList.virtual.w = 0.4; | |||||
if (props.materialList.virtual.w < 0.1) { | |||||
props.materialList.virtual.w = 0.1; | |||||
return; | return; | ||||
} | } | ||||
props.materialList.virtual.w = (baseLineScale + boxDistance2) / baseLine; | props.materialList.virtual.w = (baseLineScale + boxDistance2) / baseLine; | ||||
@@ -256,6 +256,10 @@ const handleDragSc = (item, index, event) => { | |||||
realImgUrl.value = item.material; | realImgUrl.value = item.material; | ||||
scBorderActive.value= index | scBorderActive.value= index | ||||
showBorderActive.value = item.id; | showBorderActive.value = item.id; | ||||
props.materialList.scList.forEach(res => { | |||||
res.activeIndex ='' | |||||
}) | |||||
item.activeIndex = item.id | |||||
event.preventDefault(); | event.preventDefault(); | ||||
const imageElement = fatherBox.value; | const imageElement = fatherBox.value; | ||||
const startX = event.clientX; //保存初始值,避免闪烁 | const startX = event.clientX; //保存初始值,避免闪烁 | ||||
@@ -2,6 +2,7 @@ | |||||
export {} | export {} | ||||
declare global { | declare global { | ||||
const EffectScope: typeof import('vue')['EffectScope'] | const EffectScope: typeof import('vue')['EffectScope'] | ||||
const ElForm: typeof import('element-plus/es')['ElForm'] | |||||
const ElMessage: typeof import('element-plus/es')['ElMessage'] | const ElMessage: typeof import('element-plus/es')['ElMessage'] | ||||
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] | const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] | ||||
const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] | const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] | ||||
@@ -270,6 +271,7 @@ import { UnwrapRef } from 'vue' | |||||
declare module 'vue' { | declare module 'vue' { | ||||
interface ComponentCustomProperties { | interface ComponentCustomProperties { | ||||
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> | readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> | ||||
readonly ElForm: UnwrapRef<typeof import('element-plus/es')['ElForm']> | |||||
readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']> | readonly ElMessage: UnwrapRef<typeof import('element-plus/es')['ElMessage']> | ||||
readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']> | readonly ElMessageBox: UnwrapRef<typeof import('element-plus/es')['ElMessageBox']> | ||||
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> | readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> | ||||
@@ -355,7 +355,7 @@ | |||||
<el-input-number | <el-input-number | ||||
:precision="2" | :precision="2" | ||||
v-model="showImgInfo.data.w" | v-model="showImgInfo.data.w" | ||||
:min="0.4" | |||||
:min="0.1" | |||||
:max="1.3" | :max="1.3" | ||||
size="large" | size="large" | ||||
controls-position="right" | controls-position="right" | ||||
@@ -1420,7 +1420,7 @@ watch( | |||||
showImgInfo.value.data = materialList.virtual; | showImgInfo.value.data = materialList.virtual; | ||||
} else { | } else { | ||||
showImgInfo.value.data = materialList.scList.find( | showImgInfo.value.data = materialList.scList.find( | ||||
(item) => item.id == showImgInfo.value.id | |||||
(item) => (item.id == showImgInfo.value.id && item.activeIndex == showImgInfo.value.id) | |||||
); | ); | ||||
} | } | ||||
}, | }, | ||||