fix
This commit is contained in:
@@ -280,6 +280,14 @@ export default defineComponent({
|
||||
if(detailDom.detailRight?.privewDetail)await (detailDom.detailRight as any).privewDetail()
|
||||
let gradient = null
|
||||
let newData = list[i]?.newDetail?.[detailData.currentDetailType]
|
||||
// newData[0].location=[
|
||||
// -233.13985,
|
||||
// 406.90964
|
||||
// ]
|
||||
// newData[0].scale=[
|
||||
// 0.5,
|
||||
// 0.35822305
|
||||
// ]
|
||||
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
||||
let color = (detailData.currentDetailType == 'color' && isCurrent && newData?.rgba?.r)?(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):(list[i].color?.rgba?.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:'')
|
||||
if(detailData.currentDetailType == 'sketch' && newData){
|
||||
@@ -293,12 +301,20 @@ export default defineComponent({
|
||||
maskMinioUrl:list[i]?.maskMinioUrl,
|
||||
// maskUrl:'',
|
||||
maskUrl:list[i].maskUrl,
|
||||
// offset:[
|
||||
// -233.13985,
|
||||
// 406.90964
|
||||
// ],
|
||||
offset,
|
||||
partialDesign:detailData.isEditPattern.value?list[i].partialDesign:{},
|
||||
path:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.minIOPath:list[i].minIOPath,
|
||||
printObject:(newData && detailData.currentDetailType == 'print' && isCurrent)?{prints:newData}:list[i].printObject?list[i].printObject:{prints:[]},
|
||||
priority,
|
||||
scale,
|
||||
// scale:[
|
||||
// 0.5,
|
||||
// 0.35822305
|
||||
// ],
|
||||
scale:[scale[0]?scale[0]:1,scale[1]?scale[1]:1],
|
||||
type:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.level2Type || newData.categoryValue:list[i].type,
|
||||
sketchString:list[i].sketchString?list[i].sketchString:'',
|
||||
trims:(newData && detailData.currentDetailType == 'element' && isCurrent)?{prints:newData}:list[i].trims?list[i].trims:{prints:[]},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<editCanvas v-if="canvasLoad" :config="canvasConfig"
|
||||
@canvasInit="canvasInit"
|
||||
@changeCanvas="changeCanvas"
|
||||
:clothingImageUrl="selectDetail.undividedLayer"
|
||||
:clothingImageUrl="selectDetail.undividedLayer || selectDetail.path"
|
||||
showFixedLayer
|
||||
:canvasJSON="canvasJSON"
|
||||
:clothing-image-opts="{
|
||||
@@ -142,7 +142,7 @@ export default defineComponent({
|
||||
}else{
|
||||
if(detailData.currentView === 'redGreenExample'){
|
||||
nextTick(()=>{
|
||||
setCanvas(detailData.selectDetail.undividedLayer).then(()=>{
|
||||
setCanvas(detailData.selectDetail.undividedLayer || detailData.selectDetail.path).then(()=>{
|
||||
detailData.canvasLoad = true
|
||||
})
|
||||
})
|
||||
@@ -158,7 +158,7 @@ export default defineComponent({
|
||||
const privewDetail = async (oldSelectDetail = detailData.selectDetail)=>{
|
||||
if(!detailDom.editCanvas)return
|
||||
return new Promise((res,reject)=>{
|
||||
detailDom.editCanvas.exportImage({isContainBg:false,isContainFixed:true}).then((rv)=>{
|
||||
detailDom.editCanvas.exportImage({isContainBg:false,isContainFixed:false}).then((rv)=>{
|
||||
if(oldSelectDetail?.partialDesign)oldSelectDetail.partialDesign.partialDesignBase64 = rv
|
||||
res('')
|
||||
})
|
||||
@@ -271,9 +271,8 @@ export default defineComponent({
|
||||
})
|
||||
onMounted(()=>{
|
||||
nextTick(async ()=>{
|
||||
console.log(JSON.parse(JSON.stringify(detailData.selectDetail)))
|
||||
detailData.isShowMark = true
|
||||
if(detailData.selectDetail.canvasId){
|
||||
detailData.isShowMark = true
|
||||
await new Promise((resolve, reject) => {
|
||||
let value = {
|
||||
module:'designItemDetail',
|
||||
@@ -289,8 +288,7 @@ export default defineComponent({
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
setCanvas(detailData.selectDetail.undividedLayer).then(()=>{
|
||||
setCanvas(detailData.selectDetail.undividedLayer || detailData.selectDetail.path).then(()=>{
|
||||
detailData.canvasLoad = true
|
||||
})
|
||||
})
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
<img crossOrigin="anonymous" :src="item?.path" :style="{transform:`rotateZ(${item.pattern?.transform?.rotateZ}deg)`}" class="designOpenrtion_imgItme" draggable="false">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <img :src="selectDetail.path" alt="" class="designOpenrtion_sketch" ref="sketchImg"> -->
|
||||
<img :src="selectDetail?.undividedLayer?selectDetail.undividedLayer:selectDetail.path" alt="" class="designOpenrtion_sketch" ref="sketchImg">
|
||||
<div class="designOpenrtion_btn">
|
||||
<ul v-if="overallSingle" v-for="item,index in printStyleList[type][stateOverallSingle]" :key="item" :class="{active:item?.pattern.designOpenrtionBtn?item?.pattern.designOpenrtionBtn:false}" class="designOpenrtion_Mousingle" :style="item?.pattern.style" @mousedown.stop="itemMoveMousedown(index,getMousePosition($event,false))" @touchstart.passive="itemMoveMousedown(index,getMousePosition($event,true))">
|
||||
@@ -357,10 +358,26 @@ export default defineComponent({
|
||||
editPrintElementData.overallSingle = state
|
||||
}
|
||||
}
|
||||
img.src = editPrintElementData.selectDetail.undividedLayer
|
||||
// undividedLayer
|
||||
//计算宽高使用editPrintElementData.selectDetail.path
|
||||
// img.src = editPrintElementData.selectDetail.path
|
||||
img.src = editPrintElementData.selectDetail.undividedLayer?editPrintElementData.selectDetail.undividedLayer:editPrintElementData.selectDetail.path
|
||||
})
|
||||
}
|
||||
watch(()=>editPrintElementData.selectDetail?.id,(newVal)=>{
|
||||
// watch(()=>editPrintElementData.selectDetail?.id,(newVal)=>{
|
||||
// if(!newVal)return
|
||||
// editPrintElementData.printStyleList[props.type] = {
|
||||
// single:[],
|
||||
// overall:[],
|
||||
// }
|
||||
// setPosition()
|
||||
// },{immediate: true,})
|
||||
watch(()=>editPrintElementData.currentPrintElement,(newVal)=>{
|
||||
if(newVal){
|
||||
addPrintELement(newVal)
|
||||
}
|
||||
})
|
||||
watch(()=>((editPrintElementData.selectDetail?.undividedLayer || editPrintElementData.selectDetail?.id)),(newVal)=>{
|
||||
if(!newVal)return
|
||||
editPrintElementData.printStyleList[props.type] = {
|
||||
single:[],
|
||||
@@ -368,11 +385,6 @@ export default defineComponent({
|
||||
}
|
||||
setPosition()
|
||||
},{immediate: true,})
|
||||
watch(()=>editPrintElementData.currentPrintElement,(newVal)=>{
|
||||
if(newVal){
|
||||
addPrintELement(newVal)
|
||||
}
|
||||
})
|
||||
//设置移动
|
||||
const itemMoveMousedown = (index:number,event:any)=>{
|
||||
if (event.target.tagName === 'IMG' || event.target.nodeName === 'IMG')return
|
||||
|
||||
Reference in New Issue
Block a user