Merge remote-tracking branch 'origin/StableVersion' into dev_vite
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
@addSketch="()=>isEditPattern.value = ''"
|
@addSketch="()=>isEditPattern.value = ''"
|
||||||
@revocation="revocation"
|
@revocation="revocation"
|
||||||
@oppositeRevocation="oppositeRevocation"
|
@oppositeRevocation="oppositeRevocation"
|
||||||
|
@modelOnLoad="modelOnLoad"
|
||||||
></model>
|
></model>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<div class="gallery_btn" style="margin-right: 0;" @click="submit">{{$t('DesignPrintOperation.Submit')}}</div>
|
<div class="gallery_btn" style="margin-right: 0;" @click="submit">{{$t('DesignPrintOperation.Submit')}}</div>
|
||||||
@@ -154,6 +155,7 @@ export default defineComponent({
|
|||||||
fun:null,
|
fun:null,
|
||||||
},
|
},
|
||||||
positionKey:0,
|
positionKey:0,
|
||||||
|
isUndividedLayerWithSinglePrint:false,
|
||||||
})
|
})
|
||||||
|
|
||||||
provide('getCanvasIfEdit',detailData.getCanvasIfEdit)
|
provide('getCanvasIfEdit',detailData.getCanvasIfEdit)
|
||||||
@@ -207,16 +209,24 @@ export default defineComponent({
|
|||||||
element.designType = 'Library'
|
element.designType = 'Library'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(!item.layersObject[0].undividedLayerWithSinglePrint){
|
||||||
|
detailData.isUndividedLayerWithSinglePrint = true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
detailData.singleOveral.value = rv.singleOverall
|
detailData.singleOveral.value = rv.singleOverall
|
||||||
detailData.designDetailShow = true
|
detailData.designDetailShow = true
|
||||||
// this.deleteShow = false
|
// this.deleteShow = false
|
||||||
initialize()
|
initialize()
|
||||||
setRevocation()
|
setRevocation()
|
||||||
detailData.loadingShow = false
|
|
||||||
if(rv.singleOverall == "single"){
|
if(rv.singleOverall == "single"){
|
||||||
store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
|
store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(detailData.isUndividedLayerWithSinglePrint){
|
||||||
|
}else{
|
||||||
|
detailData.loadingShow = false
|
||||||
|
}
|
||||||
resolve(rv)
|
resolve(rv)
|
||||||
}
|
}
|
||||||
).catch(rv=>{
|
).catch(rv=>{
|
||||||
@@ -340,7 +350,7 @@ export default defineComponent({
|
|||||||
sketchString:list[i].sketchString?list[i].sketchString:'',
|
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:[]},
|
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 = list[i].newDetail?.color?.gradient || list[i].color.gradient
|
||||||
gradient.colorImg = await setGradual(gradient,320,700)
|
gradient.colorImg = await setGradual(gradient,320,700)
|
||||||
data.gradient = gradient
|
data.gradient = gradient
|
||||||
@@ -352,9 +362,9 @@ export default defineComponent({
|
|||||||
const getSubmitData = async (str:string)=>{
|
const getSubmitData = async (str:string)=>{
|
||||||
// return
|
// return
|
||||||
let workspace = store.state.Workspace.probjects
|
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
|
let clothes:any
|
||||||
if(detailData.currentDetailType == 'models'){
|
if(detailData.currentDetailType == 'models' || detailData.isUndividedLayerWithSinglePrint){
|
||||||
clothes = await setClothes(detailData.designDetail.clothes)
|
clothes = await setClothes(detailData.designDetail.clothes)
|
||||||
}else{
|
}else{
|
||||||
clothes = await setClothes([detailData.selectDetail])
|
clothes = await setClothes([detailData.selectDetail])
|
||||||
@@ -383,6 +393,7 @@ export default defineComponent({
|
|||||||
delete detailData.designDetail.newModel
|
delete detailData.designDetail.newModel
|
||||||
store.commit('DesignDetail/setPraeview',value)
|
store.commit('DesignDetail/setPraeview',value)
|
||||||
detailData.loadingShow = false
|
detailData.loadingShow = false
|
||||||
|
detailData.isUndividedLayerWithSinglePrint = false
|
||||||
canvasReload()
|
canvasReload()
|
||||||
// setRevocation()
|
// setRevocation()
|
||||||
}).catch(res=>{
|
}).catch(res=>{
|
||||||
@@ -432,6 +443,12 @@ export default defineComponent({
|
|||||||
let data = getSubmitData('preview')
|
let data = getSubmitData('preview')
|
||||||
store.dispatch('DesignDetail/setSubmit',data)
|
store.dispatch('DesignDetail/setSubmit',data)
|
||||||
}
|
}
|
||||||
|
const modelOnLoad = ()=>{
|
||||||
|
if(!detailData.isUndividedLayerWithSinglePrint)return
|
||||||
|
setTimeout(()=>{
|
||||||
|
previwe()
|
||||||
|
})
|
||||||
|
}
|
||||||
const detailEdit = async (str:any)=>{
|
const detailEdit = async (str:any)=>{
|
||||||
if(str){
|
if(str){
|
||||||
if(detailData.isEditPattern.value && detailData.isEditPattern.value == str){
|
if(detailData.isEditPattern.value && detailData.isEditPattern.value == str){
|
||||||
@@ -483,6 +500,7 @@ export default defineComponent({
|
|||||||
oppositeRevocation,
|
oppositeRevocation,
|
||||||
detailEdit,
|
detailEdit,
|
||||||
canvasReload,
|
canvasReload,
|
||||||
|
modelOnLoad,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <img :src="selectDetail.path" alt="" class="designOpenrtion_sketch" ref="sketchImg"> -->
|
<!-- <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">
|
<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))">
|
<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>
|
<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,
|
loadingShow:false,
|
||||||
printElementList:null as any,
|
printElementList:null as any,
|
||||||
|
isSketchLoad:false,
|
||||||
})
|
})
|
||||||
const collItemSize = reactive({
|
const collItemSize = reactive({
|
||||||
collValue:18,
|
collValue:18,
|
||||||
@@ -202,7 +203,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const addPrintELement = async (data:any)=>{
|
const addPrintELement = async (data:any)=>{
|
||||||
console.log(data)
|
if(!editPrintElementData.isSketchLoad)return
|
||||||
let {scale,location} = await setScaleLocation(data)
|
let {scale,location} = await setScaleLocation(data)
|
||||||
let item = {
|
let item = {
|
||||||
angle:0,
|
angle:0,
|
||||||
@@ -378,6 +379,7 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
watch(()=>((editPrintElementData.selectDetail?.undividedLayer || editPrintElementData.selectDetail?.id)),(newVal)=>{
|
watch(()=>((editPrintElementData.selectDetail?.undividedLayer || editPrintElementData.selectDetail?.id)),(newVal)=>{
|
||||||
if(!newVal)return
|
if(!newVal)return
|
||||||
|
editPrintElementData.isSketchLoad = false,
|
||||||
editPrintElementData.printStyleList[props.type] = {
|
editPrintElementData.printStyleList[props.type] = {
|
||||||
single:[],
|
single:[],
|
||||||
overall:[],
|
overall:[],
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<i class="fi fi-rr-copy" :title="$t('DesignDetail.compareTitle')" @mousedown="mousedownDesignImg" @mouseup="mousedownDesignImg" @touchstart="mousedownDesignImg" @touchend="mousedownDesignImg"></i>
|
<i class="fi fi-rr-copy" :title="$t('DesignDetail.compareTitle')" @mousedown="mousedownDesignImg" @mouseup="mousedownDesignImg" @touchstart="mousedownDesignImg" @touchend="mousedownDesignImg"></i>
|
||||||
|
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -47,7 +47,7 @@ export default defineComponent({
|
|||||||
components:{
|
components:{
|
||||||
position,modelNav
|
position,modelNav
|
||||||
},
|
},
|
||||||
emits:['detailEdit','canvasReload','addSketch','revocation','oppositeRevocation'],
|
emits:['detailEdit','canvasReload','addSketch','revocation','oppositeRevocation','modelOnLoad'],
|
||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default defineComponent({
|
|||||||
type:Boolean,
|
type:Boolean,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits:['canvasReload','addSketch'],
|
emits:['canvasReload','addSketch','modelOnLoad'],
|
||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -119,6 +119,8 @@ export default defineComponent({
|
|||||||
// detailData.frontBack.back[index].style[key] = value*sacle+'px'
|
// detailData.frontBack.back[index].style[key] = value*sacle+'px'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log(111,detailData.frontBack?.body?.path)
|
||||||
|
emit('modelOnLoad')
|
||||||
};
|
};
|
||||||
img.src = detailData.frontBack?.body?.path;
|
img.src = detailData.frontBack?.body?.path;
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import {Module} from 'vuex'
|
import {Module} from 'vuex'
|
||||||
import {RootState} from '../index'
|
import {RootState} from '../index'
|
||||||
|
import { forEach } from 'jszip'
|
||||||
|
|
||||||
interface DesignDetail{
|
interface DesignDetail{
|
||||||
designDetail:any,
|
designDetail:any,
|
||||||
@@ -42,7 +43,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
state.currentPrintElement = null
|
state.currentPrintElement = null
|
||||||
},
|
},
|
||||||
setDesignDetail(state,data){
|
setDesignDetail(state,data){
|
||||||
console.log(data)
|
|
||||||
if(data.others.length > 0 && data.others[0].type == "Body"){
|
if(data.others.length > 0 && data.others[0].type == "Body"){
|
||||||
state.frontBack.body = data.others[0]
|
state.frontBack.body = data.others[0]
|
||||||
}
|
}
|
||||||
@@ -208,7 +208,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
},
|
},
|
||||||
async setPraeview(state,value){//preview
|
async setPraeview(state,value){//preview
|
||||||
let data = value?.rv || value
|
let data = value?.rv || value
|
||||||
console.log(data,'preview')
|
|
||||||
let currentType = value?.currentType
|
let currentType = value?.currentType
|
||||||
if(state.designDetail.oldModel?.url)state.frontBack.body.path = state.designDetail.oldModel.url
|
if(state.designDetail.oldModel?.url)state.frontBack.body.path = state.designDetail.oldModel.url
|
||||||
if(value?.rv?.currentFullBodyView)state.designDetail.currentFullBodyView = value.rv.currentFullBodyView
|
if(value?.rv?.currentFullBodyView)state.designDetail.currentFullBodyView = value.rv.currentFullBodyView
|
||||||
@@ -220,10 +219,16 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
}
|
}
|
||||||
let id_:any
|
let id_:any
|
||||||
if(state.currentDetailType != 'models'){
|
if(state.currentDetailType != 'models'){
|
||||||
|
if(data.clothes.length > 2){
|
||||||
|
//缺少字段临时添加
|
||||||
|
id_ = item.id || state.selectDetail.newDetail?.sketch?.id
|
||||||
|
}else{
|
||||||
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
|
id_ = state.selectDetail.id || state.selectDetail.newDetail?.sketch?.id
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
id_ = item.id
|
id_ = item.id
|
||||||
}
|
}
|
||||||
|
console.log(id_)
|
||||||
let el:any = document.querySelector('.molepositon .perview_img')
|
let el:any = document.querySelector('.molepositon .perview_img')
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
if(!state.frontBack?.body?.path){
|
if(!state.frontBack?.body?.path){
|
||||||
@@ -273,25 +278,27 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
resolve('')
|
resolve('')
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
if(state.currentDetailType != 'models'){
|
let uploadDetail = (detailItem)=>{
|
||||||
state.selectDetail.change = item.change
|
detailItem.change = item.change
|
||||||
if(state.selectDetail?.newDetail?.color && currentType != 'color'){
|
if(detailItem?.newDetail?.color && currentType != 'color'){
|
||||||
state.selectDetail.color = state.selectDetail?.newDetail?.color
|
detailItem.color = detailItem?.newDetail?.color
|
||||||
state.selectDetail.newDetail.color = null
|
detailItem.newDetail.color = null
|
||||||
}
|
}
|
||||||
if(item.partialDesign){
|
if(item.partialDesign){
|
||||||
state.selectDetail.partialDesign = item.partialDesign
|
detailItem.partialDesign = item.partialDesign
|
||||||
}
|
}
|
||||||
state.selectDetail.designType = item.designType
|
detailItem.designType = item.designType
|
||||||
state.selectDetail.layersObject = item.layersObject
|
detailItem.layersObject = item.layersObject
|
||||||
state.selectDetail.path = item.path
|
detailItem.path = item.path
|
||||||
state.selectDetail.minIOPath = item.minIOPath
|
detailItem.minIOPath = item.minIOPath
|
||||||
state.selectDetail.scale = [1,1]
|
detailItem.scale = [1,1]
|
||||||
state.selectDetail.offset = [0,0]
|
detailItem.offset = [0,0]
|
||||||
state.selectDetail.printObject = item.printObject
|
detailItem.printObject = item.printObject
|
||||||
state.selectDetail.trims = item.trims
|
detailItem.trims = item.trims
|
||||||
state.selectDetail.type = item.type
|
detailItem.type = item.type
|
||||||
state.selectDetail.color = {
|
detailItem.maskMinioUrl = item.layersObject?.[0]?.maskMinioUrl
|
||||||
|
detailItem.maskUrl = item.layersObject?.[0]?.maskUrl
|
||||||
|
detailItem.color = {
|
||||||
...item.color,
|
...item.color,
|
||||||
rgba:{
|
rgba:{
|
||||||
r:item.color?.r,
|
r:item.color?.r,
|
||||||
@@ -300,13 +307,60 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
},
|
},
|
||||||
gradient:item.gradient,
|
gradient:item.gradient,
|
||||||
}
|
}
|
||||||
state.selectDetail.undividedLayer = item.undividedLayer
|
detailItem.undividedLayer = item.undividedLayer
|
||||||
state.selectDetail.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
|
detailItem.undividedLayerWithSinglePrint = item?.undividedLayerWithSinglePrint
|
||||||
if(state.selectDetail.newDetail?.sketch?.id && !state.selectDetail.id){
|
if(detailItem.newDetail?.sketch?.id && !detailItem.id){
|
||||||
state.designDetail.clothes.push(state.selectDetail)
|
state.designDetail.clothes.push(detailItem)
|
||||||
}
|
}
|
||||||
state.selectDetail.id = item.id
|
detailItem.id = item.id
|
||||||
if(currentType)if(state.selectDetail.newDetail?.[currentType] && currentType != 'color')delete state.selectDetail.newDetail[currentType]
|
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()
|
if(value.fun)value.fun()
|
||||||
|
|||||||
Reference in New Issue
Block a user