diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue index c240ac61..96baf9ff 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}) @@ -604,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{ @@ -775,36 +777,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/canvas/index.vue b/src/component/Detail/canvas/index.vue index 5bbab7c2..70c0477e 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/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue index db206827..a93bd5fa 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] @@ -900,8 +901,7 @@ export default defineComponent({ } const inputFillOffset = (offset:any)=>{ let arr = editPrintElementData.printStyleList[props.type].overall - let location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100] - arr[editPrintElementData.imgDomIndex].location = location + arr[editPrintElementData.imgDomIndex].location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100] 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()}) 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 + // } + // }) } }); },