From a78056c898aac398eaefed7e30763f190d268e37 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 21 Jan 2026 09:41:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dcanvas=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E9=9A=90=E8=97=8F=E9=97=AE=E9=A2=98=E3=80=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4preview=E5=90=8E=E5=88=87=E6=8D=A2sketch?= =?UTF-8?q?=E5=86=8D=E5=88=87=E5=9B=9E=E6=9D=A5=E5=89=8D=E5=90=8E=E7=89=87?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=E6=9C=80=E6=97=A9=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Detail/DesignDetail.vue | 40 +++---------------- .../Detail/detailRight/editPrintElement.vue | 1 + 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index c240ac61..4192745e 100644 --- a/src/component/Detail/DesignDetail.vue +++ b/src/component/Detail/DesignDetail.vue @@ -190,7 +190,7 @@ export default defineComponent({ watch(()=>detailData.selectDetail,async (newValue,oldValue)=>{ detailData.imgDomIndex = detailData.frontBack.front.findIndex((item:any)=>item.id == newValue.id) if(newValue?.path)await getSketchSize() - if(newValue?.id && oldValue?.id && (newValue.id != oldValue.id)){ + if(newValue?.id && (newValue.id != oldValue.id)){ store.commit('DesignDetail/changeCanvasKey') } // privewDetail(oldValue) @@ -561,11 +561,10 @@ export default defineComponent({ segmentImage(detailData.selectDetail.maskUrl,partialDesign,size).then(async (rv)=>{ let front = detailData.frontBack.front[detailData.imgDomIndex] let back = detailData.frontBack.back[detailData.imgDomIndex] - if(!front?.oldImageUrl)front.oldImageUrl = front.imageUrl - if(!front?.oldMaskUrl)front.oldMaskUrl = front.maskUrl - if(!back?.oldImageUrl)back.oldImageUrl = back.imageUrl - if(!front?.oldMaskUrl)store.commit('DesignDetail/updataDetailItem',{maskUrl:front.oldMaskUrl}) + front.oldImageUrl = '' + front.oldMaskUrl = '' + back.oldImageUrl = '' front.imageUrl = rv.targetFrontUrl back.imageUrl = rv.targetBackUrl store.commit('DesignDetail/canvasPreviewUpdata',{type:detailData.isEditPattern.value?'all':detailData.currentDetailType,callBack:setRevocation}) @@ -775,36 +774,7 @@ export default defineComponent({ window.removeEventListener('beforeunload',beforeunload) } window.addEventListener('beforeunload',beforeunload) - // let url = Https.httpUrls.getDesignDetail + `?designItemId=34242&designPythonOutfitId=34004` - // this.loadingShow = true - // Https.axiosGet(url).then( - // async (rv: any) => { - // rv.clothes.forEach((item:any)=>{ - // let a - // if(item.layersObject[0].imageCategory.indexOf("back") == -1){ - // a = item.layersObject[0] - // item.layersObject[0] = item.layersObject[1] - // item.layersObject[1] = a - // } - // if(item.printObject.prints == null){ - // item.printObject.prints = [{}] - // } - // }) - // this.store.commit('setDesignItemDetail',rv) - // if(rv.others[0].printObject.path == null){ - // this.body = false - // }else{ - // this.body = true - // } - // this.setImgSize() - // this.generateHighDesignImg = rv.highDesignUrl - // this.designShowPrview = 1 - // this.designDetailShow = true - // this.loadingShow = false - // } - // ).catch(rv=>{ - // this.loadingShow = false - // }) + }, }) diff --git a/src/component/Detail/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue index 5da86c46..60b0b348 100644 --- a/src/component/Detail/detailRight/editPrintElement.vue +++ b/src/component/Detail/detailRight/editPrintElement.vue @@ -901,6 +901,7 @@ export default defineComponent({ const inputFillOffset = (offset:any)=>{ let arr = editPrintElementData.printStyleList[props.type].overall arr[editPrintElementData.imgDomIndex].location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100] + console.log(arr[editPrintElementData.imgDomIndex].location) editPrintElementDom.pingpuRef.updataList([ { action: ACTIONS.UPDATE, From b10fd72008fd148f981c7e87d3338fad1cd9b5c5 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 21 Jan 2026 09:43:26 +0800 Subject: [PATCH 2/3] fix --- src/component/Detail/canvas/index.vue | 7 +++---- src/component/Detail/model/modelNav.vue | 1 + src/store/Detail/designDetail.ts | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/component/Detail/canvas/index.vue b/src/component/Detail/canvas/index.vue index de6484e6..2f4d88eb 100644 --- a/src/component/Detail/canvas/index.vue +++ b/src/component/Detail/canvas/index.vue @@ -18,7 +18,7 @@ :clothing-image-opts="{ imageMode:'contains', }" - :hideCanvas="hideCanvas" + :hideCanvas="hideCanvas && !isEditPattern" ref="editCanvas"> @@ -34,7 +34,7 @@ :clothing-image-opts="{ imageMode:'contains', }" - :hideCanvas="hideCanvas" + :hideCanvas="hideCanvas && !isEditPattern" ref="editCanvasBackFront"> @@ -117,7 +117,7 @@ export default defineComponent({ getCanvasIfEdit:inject('getCanvasIfEdit')as any, canvasInstance:null as any, canvasJSON:'', - hideCanvas: computed(()=>(store.state.Workspace.projectPath !== route.fullPath && props.isEditPattern)), + hideCanvas: computed(()=>(store.state.Workspace.projectPath !== route.fullPath)), otherData:computed(()=>({ canvasId: store.state.DesignDetail.selectDetail.canvasId, color: store.state.DesignDetail.selectDetail.color, @@ -340,7 +340,6 @@ export default defineComponent({ const canvasLoadJsonSuccess = async ()=>{ let otherData = await props.updateOtherLayers() await updateOtherLayers(otherData) - if(detailData.changeSketchUpdateFrontBack){ await detailData.changeSketchUpdateFrontBack() detailData.changeSketchUpdateFrontBack = null diff --git a/src/component/Detail/model/modelNav.vue b/src/component/Detail/model/modelNav.vue index 4e9cd8cc..3b3033d2 100644 --- a/src/component/Detail/model/modelNav.vue +++ b/src/component/Detail/model/modelNav.vue @@ -102,6 +102,7 @@ export default defineComponent({ } }).then((rv)=>{ if(rv)store.commit('DesignDetail/setDesignColthes',item.id) + console.log(JSON.parse(JSON.stringify(item)),'==========') }) } const deleteDetailItem = (id:number)=>{ diff --git a/src/store/Detail/designDetail.ts b/src/store/Detail/designDetail.ts index f667dc7e..ea6b3cf4 100644 --- a/src/store/Detail/designDetail.ts +++ b/src/store/Detail/designDetail.ts @@ -175,12 +175,12 @@ const DesignDetail : Module = { state.designDetail.clothes.forEach((item:any) => { if(item.id == data){ state.selectDetail = item - state.frontBack.front.forEach((v:any,index:any)=>{ - v.designOpenrtionBtn = false - if(v.id == data){ - v.designOpenrtionBtn = true - } - }) + // state.frontBack.front.forEach((v:any,index:any)=>{ + // v.designOpenrtionBtn = false + // if(v.id == data){ + // v.designOpenrtionBtn = true + // } + // }) } }); }, From 62e977c703f9b36b3fd0acacd1d509e4773c1a98 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 21 Jan 2026 09:59:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=B0=E8=8A=B1overall?= =?UTF-8?q?=E5=81=8F=E7=A7=BB=E5=92=8C=E7=94=BB=E5=B8=83=E5=AF=B9=E4=B8=8D?= =?UTF-8?q?=E4=B8=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Detail/DesignDetail.vue | 7 +++++-- src/component/Detail/detailRight/editPrintElement.vue | 6 +++--- .../Detail/detailRight/overallSetting/RepeatSetting.vue | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index 4192745e..96baf9ff 100644 --- a/src/component/Detail/DesignDetail.vue +++ b/src/component/Detail/DesignDetail.vue @@ -603,8 +603,11 @@ export default defineComponent({ // detailDom.canvasBox.editFront(str) // } detailDom.canvasBox.editFront(str) - let otherData = await updateOtherLayers('single') - await detailDom.canvasBox.updateOtherLayers(otherData) + if(str == 'canvasEditor'){ + let otherData = await updateOtherLayers('single') + console.log(otherData,'============') + await detailDom.canvasBox.updateOtherLayers(otherData) + } detailData.isEditPattern.value = str } }else{ diff --git a/src/component/Detail/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue index 65942d06..5a0e8b18 100644 --- a/src/component/Detail/detailRight/editPrintElement.vue +++ b/src/component/Detail/detailRight/editPrintElement.vue @@ -252,7 +252,7 @@ export default defineComponent({ designType:data.designType, ifSingle:editPrintElementData.stateOverallSingle == 'single', level2Type:data.level2Type, - location, + location:editPrintElementData.stateOverallSingle == 'single'?location:[0,0], minIOPath:data.minIOPath || data.originalUrl, path:data.url, priority:editPrintElementData.printZIndex, @@ -276,7 +276,8 @@ export default defineComponent({ }else{ let x = Number(style.left.replace(/px/g,'')) let y = Number(style.top.replace(/px/g,'')) - location = [(x*sketchWH[0]) ,(y*sketchWH[1])] + location = item.location + // location = [(x*sketchWH[0]) ,(y*sketchWH[1])] scale = item.scale // scale = [item.pattern.style.width/item.pattern.style.height,item.pattern.style.height/item.pattern.style.width] // location = [item.pattern.style.left,item.pattern.style.top] @@ -901,7 +902,6 @@ export default defineComponent({ const inputFillOffset = (offset:any)=>{ let arr = editPrintElementData.printStyleList[props.type].overall arr[editPrintElementData.imgDomIndex].location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100] - console.log(arr[editPrintElementData.imgDomIndex].location) editPrintElementDom.pingpuRef.updataList([ { action: ACTIONS.UPDATE, diff --git a/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue b/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue index b1142f27..2f5418db 100644 --- a/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue +++ b/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue @@ -17,7 +17,7 @@ :max="1000" :step="1" is-input - :tipFormatter="(v) => `${scale}%`" + :tipFormatter="(v) => `${scale.toFixed(0)}%`" :value="scale" @input="inputFillScale" /> @@ -121,8 +121,8 @@ ]); const inputFillScale = (e) => { const scale = e / 100; - console.log(scale) - emit("inputFillScale", scale); + console.log(scale.toFixed(2)) + emit("inputFillScale", scale.toFixed(2)); }; const inputOffset = async (e:any)=>{ emit('inputFillOffset', {...e,size: await sketchSize()})