Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
李志鹏
2026-01-21 10:06:13 +08:00
6 changed files with 27 additions and 54 deletions

View File

@@ -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
// })
},
})

View File

@@ -18,7 +18,7 @@
:clothing-image-opts="{
imageMode:'contains',
}"
:hideCanvas="hideCanvas"
:hideCanvas="hideCanvas && !isEditPattern"
ref="editCanvas">
</editCanvas>
<!-- <canvasContent ref="canvasContent"></canvasContent> -->
@@ -34,7 +34,7 @@
:clothing-image-opts="{
imageMode:'contains',
}"
:hideCanvas="hideCanvas"
:hideCanvas="hideCanvas && !isEditPattern"
ref="editCanvasBackFront">
</editCanvas>
</div>
@@ -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

View File

@@ -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,

View File

@@ -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()})

View File

@@ -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)=>{