Merge remote-tracking branch 'origin/StableVersion' into dev_vite

This commit is contained in:
X1627315083
2025-09-26 21:57:29 +08:00
5 changed files with 110 additions and 34 deletions

View File

@@ -62,6 +62,7 @@
@addSketch="()=>isEditPattern.value = ''"
@revocation="revocation"
@oppositeRevocation="oppositeRevocation"
@modelOnLoad="modelOnLoad"
></model>
<div class="btn">
<div class="gallery_btn" style="margin-right: 0;" @click="submit">{{$t('DesignPrintOperation.Submit')}}</div>
@@ -154,6 +155,7 @@ export default defineComponent({
fun:null,
},
positionKey:0,
isUndividedLayerWithSinglePrint:false,
})
provide('getCanvasIfEdit',detailData.getCanvasIfEdit)
@@ -207,16 +209,24 @@ export default defineComponent({
element.designType = 'Library'
}
});
if(!item.layersObject[0].undividedLayerWithSinglePrint){
detailData.isUndividedLayerWithSinglePrint = true
}
})
detailData.singleOveral.value = rv.singleOverall
detailData.designDetailShow = true
// this.deleteShow = false
initialize()
setRevocation()
detailData.loadingShow = false
if(rv.singleOverall == "single"){
store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
}
if(detailData.isUndividedLayerWithSinglePrint){
}else{
detailData.loadingShow = false
}
resolve(rv)
}
).catch(rv=>{
@@ -340,7 +350,7 @@ export default defineComponent({
sketchString:list[i].sketchString?list[i].sketchString:'',
trims:(newData && detailData.currentDetailType == 'element' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
}
if((list[i].color?.gradient || list[i].newDetail?.color?.gradient) && !detailData.isEditPattern.value){
if((detailData.isEditPattern.value && list[i].color?.gradient) || (!detailData.isEditPattern.value && (list[i].newDetail?.color?.gradient || list[i].color?.gradient))){
gradient = list[i].newDetail?.color?.gradient || list[i].color.gradient
gradient.colorImg = await setGradual(gradient,320,700)
data.gradient = gradient
@@ -352,9 +362,9 @@ export default defineComponent({
const getSubmitData = async (str:string)=>{
// return
let workspace = store.state.Workspace.probjects
if(!detailData.selectDetail.path && !detailData.selectDetail.newDetail?.sketch?.minIOPath)return
if(!detailData?.selectDetail?.path && !detailData?.selectDetail?.newDetail?.sketch?.minIOPath)return
let clothes:any
if(detailData.currentDetailType == 'models'){
if(detailData.currentDetailType == 'models' || detailData.isUndividedLayerWithSinglePrint){
clothes = await setClothes(detailData.designDetail.clothes)
}else{
clothes = await setClothes([detailData.selectDetail])
@@ -383,6 +393,7 @@ export default defineComponent({
delete detailData.designDetail.newModel
store.commit('DesignDetail/setPraeview',value)
detailData.loadingShow = false
detailData.isUndividedLayerWithSinglePrint = false
canvasReload()
// setRevocation()
}).catch(res=>{
@@ -432,6 +443,12 @@ export default defineComponent({
let data = getSubmitData('preview')
store.dispatch('DesignDetail/setSubmit',data)
}
const modelOnLoad = ()=>{
if(!detailData.isUndividedLayerWithSinglePrint)return
setTimeout(()=>{
previwe()
})
}
const detailEdit = async (str:any)=>{
if(str){
if(detailData.isEditPattern.value && detailData.isEditPattern.value == str){
@@ -483,6 +500,7 @@ export default defineComponent({
oppositeRevocation,
detailEdit,
canvasReload,
modelOnLoad,
}
},

View File

@@ -70,7 +70,7 @@
</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">
<img :src="selectDetail?.undividedLayer?selectDetail.undividedLayer:selectDetail.path" alt="" class="designOpenrtion_sketch" ref="sketchImg" @load="()=>isSketchLoad = true">
<div class="designOpenrtion_btn">
<ul v-if="stateOverallSingle == 'single'" 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))">
<li class="designOpenrtion_btn_top" @mousedown.stop="itemSizeMousedown('top',getMousePosition($event,false))" @touchstart.passive="itemSizeMousedown('top',getMousePosition($event,true))"></li>
@@ -147,6 +147,7 @@ export default defineComponent({
},
loadingShow:false,
printElementList:null as any,
isSketchLoad:false,
})
const collItemSize = reactive({
collValue:18,
@@ -202,7 +203,7 @@ export default defineComponent({
})
}
const addPrintELement = async (data:any)=>{
console.log(data)
if(!editPrintElementData.isSketchLoad)return
let {scale,location} = await setScaleLocation(data)
let item = {
angle:0,
@@ -378,6 +379,7 @@ export default defineComponent({
})
watch(()=>((editPrintElementData.selectDetail?.undividedLayer || editPrintElementData.selectDetail?.id)),(newVal)=>{
if(!newVal)return
editPrintElementData.isSketchLoad = false,
editPrintElementData.printStyleList[props.type] = {
single:[],
overall:[],

View File

@@ -28,7 +28,7 @@
<i class="fi fi-rr-copy" :title="$t('DesignDetail.compareTitle')" @mousedown="mousedownDesignImg" @mouseup="mousedownDesignImg" @touchstart="mousedownDesignImg" @touchend="mousedownDesignImg"></i>
</div>
<position ref="position" @canvasReload="()=>$emit('canvasReload')" @addSketch="()=>$emit('addSketch')" :imgDesignImg=imgDesignImg></position>
<position ref="position" @modelOnLoad="()=>$emit('modelOnLoad')" @canvasReload="()=>$emit('canvasReload')" @addSketch="()=>$emit('addSketch')" :imgDesignImg=imgDesignImg></position>
</div>
</div>
@@ -47,7 +47,7 @@ export default defineComponent({
components:{
position,modelNav
},
emits:['detailEdit','canvasReload','addSketch','revocation','oppositeRevocation'],
emits:['detailEdit','canvasReload','addSketch','revocation','oppositeRevocation','modelOnLoad'],
setup(props,{emit}) {
const {t} = useI18n()
const store = useStore();

View File

@@ -49,7 +49,7 @@ export default defineComponent({
type:Boolean,
}
},
emits:['canvasReload','addSketch'],
emits:['canvasReload','addSketch','modelOnLoad'],
setup(props,{emit}) {
const {t} = useI18n()
const store = useStore();
@@ -119,6 +119,8 @@ export default defineComponent({
// detailData.frontBack.back[index].style[key] = value*sacle+'px'
}
});
console.log(111,detailData.frontBack?.body?.path)
emit('modelOnLoad')
};
img.src = detailData.frontBack?.body?.path;
})

View File

@@ -1,5 +1,6 @@
import {Module} from 'vuex'
import {RootState} from '../index'
import { forEach } from 'jszip'
interface DesignDetail{
designDetail:any,
@@ -42,7 +43,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
state.currentPrintElement = null
},
setDesignDetail(state,data){
console.log(data)
if(data.others.length > 0 && data.others[0].type == "Body"){
state.frontBack.body = data.others[0]
}
@@ -208,7 +208,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
},
async setPraeview(state,value){//preview
let data = value?.rv || value
console.log(data,'preview')
let currentType = value?.currentType
if(state.designDetail.oldModel?.url)state.frontBack.body.path = state.designDetail.oldModel.url
if(value?.rv?.currentFullBodyView)state.designDetail.currentFullBodyView = value.rv.currentFullBodyView
@@ -220,10 +219,16 @@ const DesignDetail : Module<DesignDetail,RootState> = {
}
let id_:any
if(state.currentDetailType != 'models'){
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
if(data.clothes.length > 2){
//缺少字段临时添加
id_ = item.id || state.selectDetail.newDetail?.sketch?.id
}else{
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
}
}else{
id_ = item.id
}
console.log(id_)
let el:any = document.querySelector('.molepositon .perview_img')
await new Promise((resolve, reject) => {
if(!state.frontBack?.body?.path){
@@ -273,25 +278,27 @@ const DesignDetail : Module<DesignDetail,RootState> = {
resolve('')
};
})
if(state.currentDetailType != 'models'){
state.selectDetail.change = item.change
if(state.selectDetail?.newDetail?.color && currentType != 'color'){
state.selectDetail.color = state.selectDetail?.newDetail?.color
state.selectDetail.newDetail.color = null
let uploadDetail = (detailItem)=>{
detailItem.change = item.change
if(detailItem?.newDetail?.color && currentType != 'color'){
detailItem.color = detailItem?.newDetail?.color
detailItem.newDetail.color = null
}
if(item.partialDesign){
state.selectDetail.partialDesign = item.partialDesign
detailItem.partialDesign = item.partialDesign
}
state.selectDetail.designType = item.designType
state.selectDetail.layersObject = item.layersObject
state.selectDetail.path = item.path
state.selectDetail.minIOPath = item.minIOPath
state.selectDetail.scale = [1,1]
state.selectDetail.offset = [0,0]
state.selectDetail.printObject = item.printObject
state.selectDetail.trims = item.trims
state.selectDetail.type = item.type
state.selectDetail.color = {
detailItem.designType = item.designType
detailItem.layersObject = item.layersObject
detailItem.path = item.path
detailItem.minIOPath = item.minIOPath
detailItem.scale = [1,1]
detailItem.offset = [0,0]
detailItem.printObject = item.printObject
detailItem.trims = item.trims
detailItem.type = item.type
detailItem.maskMinioUrl = item.layersObject?.[0]?.maskMinioUrl
detailItem.maskUrl = item.layersObject?.[0]?.maskUrl
detailItem.color = {
...item.color,
rgba:{
r:item.color?.r,
@@ -300,13 +307,60 @@ const DesignDetail : Module<DesignDetail,RootState> = {
},
gradient:item.gradient,
}
state.selectDetail.undividedLayer = item.undividedLayer
state.selectDetail.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
state.designDetail.clothes.push(state.selectDetail)
detailItem.undividedLayer = item.undividedLayer
detailItem.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
if(detailItem.newDetail?.sketch?.id && !detailItem.id){
state.designDetail.clothes.push(detailItem)
}
state.selectDetail.id = item.id
if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
detailItem.id = item.id
if(currentType)if(detailItem.newDetail?.[currentType] && currentType != 'color')delete detailItem.newDetail[currentType]
}
if(data.clothes.length > 2){
state.designDetail.clothes.forEach((detailItem:any) => {
if(detailItem.id == id_){
uploadDetail(detailItem)
}
});
}else{
uploadDetail(state.selectDetail)
}
if(state.currentDetailType != 'models'){
// state.selectDetail.change = item.change
// if(state.selectDetail?.newDetail?.color && currentType != 'color'){
// state.selectDetail.color = state.selectDetail?.newDetail?.color
// state.selectDetail.newDetail.color = null
// }
// if(item.partialDesign){
// state.selectDetail.partialDesign = item.partialDesign
// }
// state.selectDetail.designType = item.designType
// state.selectDetail.layersObject = item.layersObject
// state.selectDetail.path = item.path
// state.selectDetail.minIOPath = item.minIOPath
// state.selectDetail.scale = [1,1]
// state.selectDetail.offset = [0,0]
// state.selectDetail.printObject = item.printObject
// state.selectDetail.trims = item.trims
// state.selectDetail.type = item.type
// state.selectDetail.maskMinioUrl = item.layersObject?.[0]?.maskMinioUrl
// state.selectDetail.maskUrl = item.layersObject?.[0]?.maskUrl
// state.selectDetail.color = {
// ...item.color,
// rgba:{
// r:item.color?.r,
// g:item.color?.g,
// b:item.color?.b,
// },
// gradient:item.gradient,
// }
// state.selectDetail.undividedLayer = item.undividedLayer
// state.selectDetail.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
// if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
// state.designDetail.clothes.push(state.selectDetail)
// }
// state.selectDetail.id = item.id
// if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
}
}
if(value.fun)value.fun()