|
|
|
|
@@ -336,16 +336,17 @@ export default defineComponent({
|
|
|
|
|
})
|
|
|
|
|
if(detailDom.detailRight?.privewDetail)await (detailDom.detailRight as any).privewDetail()
|
|
|
|
|
if(detailDom.canvasBox && (detailData.currentDetailType != 'sketch' || detailData.isEditPattern.value == 'canvasEditor')){
|
|
|
|
|
let otherData = await updateOtherLayers(detailData.isEditPattern.value == 'canvasEditor'?'all':'single')
|
|
|
|
|
await detailDom.canvasBox.updateOtherLayers(otherData)
|
|
|
|
|
if(detailData.isEditPattern.value !== 'editSketch'){
|
|
|
|
|
let otherData = await updateOtherLayers(detailData.isEditPattern.value == 'canvasEditor'?'all':'single')
|
|
|
|
|
await detailDom.canvasBox.updateOtherLayers(otherData)
|
|
|
|
|
}
|
|
|
|
|
await detailDom.canvasBox.privewDetail()
|
|
|
|
|
await uploadElement()
|
|
|
|
|
}
|
|
|
|
|
for(let i = 0;i<list.length;i++){
|
|
|
|
|
detailData.selectDetail
|
|
|
|
|
let {scale,offset,priority,transpose,rotate,maskUrl,maskMinioUrl} = await (detailDom.model as any).getSubmitData(list[i])
|
|
|
|
|
let gradient = null
|
|
|
|
|
let newData = list[i]?.newDetail?.[detailData.currentDetailType]
|
|
|
|
|
let newData = list[i]?.newDetail
|
|
|
|
|
// newData[0].location=[
|
|
|
|
|
// -233.13985,
|
|
|
|
|
// 406.90964
|
|
|
|
|
@@ -355,12 +356,18 @@ export default defineComponent({
|
|
|
|
|
// 0.35822305
|
|
|
|
|
// ]
|
|
|
|
|
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
|
|
|
|
let color = ((detailData.currentDetailType == 'color' && isCurrent) || detailData.isEditPattern.value == 'canvasEditor')?
|
|
|
|
|
(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
|
|
|
|
|
(list[i].color?.rgba?.r?
|
|
|
|
|
`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:
|
|
|
|
|
'')
|
|
|
|
|
if(detailData.currentDetailType == 'sketch' && newData){
|
|
|
|
|
let color = ''
|
|
|
|
|
let gradient = {}
|
|
|
|
|
if((detailData.currentDetailType == 'color' || detailData.isEditPattern.value == 'canvasEditor') && isCurrent){
|
|
|
|
|
color = `${newData?.color.rgba.r} ${newData?.color.rgba.g} ${newData?.color.rgba.b}`
|
|
|
|
|
if(newData?.color.gradient){
|
|
|
|
|
gradient = newData?.color.gradient
|
|
|
|
|
}
|
|
|
|
|
}else if(isCurrent){
|
|
|
|
|
color = list[i].color?.rgba?.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:''
|
|
|
|
|
gradient = list[i].gradient
|
|
|
|
|
}
|
|
|
|
|
if(detailData.currentDetailType == 'sketch' && newData?.sketch){
|
|
|
|
|
color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
|
|
|
|
|
detailData.selectDetail.maskUrl = ''
|
|
|
|
|
detailData.selectDetail.maskMinioUrl = ''
|
|
|
|
|
@@ -377,9 +384,10 @@ export default defineComponent({
|
|
|
|
|
let data:any = {
|
|
|
|
|
changed:false,
|
|
|
|
|
color,
|
|
|
|
|
designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.designType:list[i].designType,
|
|
|
|
|
id:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.id:list[i].id,
|
|
|
|
|
maskMinioUrl:((newData && detailData.currentDetailType == 'sketch') || list[i].sketchString)?'':list[i]?.maskMinioUrl,
|
|
|
|
|
gradient,
|
|
|
|
|
designType:(newData?.sketch && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData?.sketch.designType:list[i].designType,
|
|
|
|
|
id:(newData?.sketch && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData?.sketch.id:list[i].id,
|
|
|
|
|
maskMinioUrl:((newData?.sketch && detailData.currentDetailType == 'sketch') || list[i].sketchString)?'':list[i]?.maskMinioUrl,
|
|
|
|
|
// maskUrl:'',
|
|
|
|
|
maskUrl:list[i]?.maskUrl || '',
|
|
|
|
|
// offset:[
|
|
|
|
|
@@ -391,23 +399,19 @@ export default defineComponent({
|
|
|
|
|
rotate,
|
|
|
|
|
partialDesign:list[i].partialDesign,
|
|
|
|
|
// partialDesign:detailData.isEditPattern.value?list[i].partialDesign:{},
|
|
|
|
|
path:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.minIOPath:list[i].minIOPath,
|
|
|
|
|
printObject:((newData && detailData.currentDetailType == 'print' && isCurrent) || detailData.isEditPattern.value == 'canvasEditor')?{prints:newData}:list[i].printObject?list[i].printObject:{prints:[]},
|
|
|
|
|
path:(newData?.sketch && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData?.sketch.minIOPath:list[i].minIOPath,
|
|
|
|
|
printObject:((newData?.prints && detailData.currentDetailType == 'print' || detailData.isEditPattern.value == 'canvasEditor') && isCurrent)?{prints:newData.prints}:list[i].printObject?list[i].printObject:{prints:[]},
|
|
|
|
|
priority,
|
|
|
|
|
// scale:[
|
|
|
|
|
// 0.5,
|
|
|
|
|
// 0.35822305
|
|
|
|
|
// ],
|
|
|
|
|
scale:[scale[0]?scale[0]:1,scale[1]?scale[1]:1],
|
|
|
|
|
type:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.level2Type || newData.categoryValue:list[i].type,
|
|
|
|
|
type:(newData?.sketch && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData?.sketch.level2Type || newData?.sketch.categoryValue:list[i].type,
|
|
|
|
|
sketchString:list[i].sketchString?list[i].sketchString:'',
|
|
|
|
|
trims:((newData && detailData.currentDetailType == 'element' && isCurrent) || detailData.isEditPattern.value == 'canvasEditor')?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
|
|
|
|
|
accessory:(newData && detailData.currentDetailType == 'accessory' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
|
|
|
|
|
trims:((newData?.trims && detailData.currentDetailType == 'element' || detailData.isEditPattern.value == 'canvasEditor') && isCurrent)?{prints:newData.trims}:list[i].trims?.prints?list[i].trims:{prints:[]},
|
|
|
|
|
}
|
|
|
|
|
console.log(JSON.parse(JSON.stringify(data)))
|
|
|
|
|
// if(!data.partialDesign.partialDesignMinioPath){
|
|
|
|
|
// data.partialDesign.partialDesignMinioPath = data.path
|
|
|
|
|
// }
|
|
|
|
|
printObjectToJSON(data.printObject.prints)
|
|
|
|
|
printObjectToJSON(data.trims.prints)
|
|
|
|
|
if((detailData.isEditPattern.value && list[i].color?.gradient) || (!detailData.isEditPattern.value && (list[i].newDetail?.color?.gradient || list[i].color?.gradient))){
|
|
|
|
|
@@ -687,11 +691,14 @@ export default defineComponent({
|
|
|
|
|
str:'print'
|
|
|
|
|
}
|
|
|
|
|
store.commit('DesignDetail/setNewDetail',printValue)
|
|
|
|
|
if(allInfo.color?.color?.rgba){
|
|
|
|
|
let canvasColor = allInfo.color.color;
|
|
|
|
|
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
|
|
|
|
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
|
|
|
|
|
let value:any = {
|
|
|
|
|
data:{
|
|
|
|
|
str:'color'
|
|
|
|
|
}
|
|
|
|
|
let canvasColor = allInfo.color.color;
|
|
|
|
|
if(allInfo.color?.color?.rgba){
|
|
|
|
|
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
|
|
|
|
value.data = {
|
|
|
|
|
hsv:{
|
|
|
|
|
h:colorData.h,
|
|
|
|
|
s:colorData.s,
|
|
|
|
|
@@ -701,8 +708,7 @@ export default defineComponent({
|
|
|
|
|
tcx:colorData.tcx,
|
|
|
|
|
rgba:canvasColor.rgba,
|
|
|
|
|
hex:rgbaToHex([canvasColor.rgba.r,canvasColor.rgba.g,canvasColor.rgba.b]),
|
|
|
|
|
},
|
|
|
|
|
str:'color'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(canvasColor.gradient){
|
|
|
|
|
value.data.gradient = canvasColor.gradient
|
|
|
|
|
@@ -725,19 +731,21 @@ export default defineComponent({
|
|
|
|
|
// await detailDom.canvasBox.saveCanvas()
|
|
|
|
|
const allInfo = await (detailDom.canvasBox as any).getCanvasElement()
|
|
|
|
|
let color:any = {}
|
|
|
|
|
if(allInfo.color?.color?.rgba){
|
|
|
|
|
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
|
|
|
|
|
let canvasColor = allInfo.color.color;
|
|
|
|
|
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
|
|
|
|
color = {
|
|
|
|
|
hsv:{
|
|
|
|
|
h:colorData.h,
|
|
|
|
|
s:colorData.s,
|
|
|
|
|
v:colorData.v,
|
|
|
|
|
},
|
|
|
|
|
name:colorData.name,
|
|
|
|
|
tcx:colorData.tcx,
|
|
|
|
|
rgba:canvasColor.rgba,
|
|
|
|
|
hex:rgbaToHex([canvasColor.rgba.r,canvasColor.rgba.g,canvasColor.rgba.b]),
|
|
|
|
|
if(allInfo.color?.color?.rgba){
|
|
|
|
|
let colorData:any = await getColorName(allInfo.color.color?.rgba)
|
|
|
|
|
color = {
|
|
|
|
|
hsv:{
|
|
|
|
|
h:colorData.h,
|
|
|
|
|
s:colorData.s,
|
|
|
|
|
v:colorData.v,
|
|
|
|
|
},
|
|
|
|
|
name:colorData.name,
|
|
|
|
|
tcx:colorData.tcx,
|
|
|
|
|
rgba:canvasColor.rgba,
|
|
|
|
|
hex:rgbaToHex([canvasColor.rgba.r,canvasColor.rgba.g,canvasColor.rgba.b]),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(canvasColor.gradient){
|
|
|
|
|
color.gradient = canvasColor.gradient
|
|
|
|
|
|