修复直接在印花preview后印花overall丢失
This commit is contained in:
@@ -1034,6 +1034,11 @@ defineExpose({
|
|||||||
width = 0,// 导出的图片宽度
|
width = 0,// 导出的图片宽度
|
||||||
height = 0, // 导出的图片高度
|
height = 0, // 导出的图片高度
|
||||||
} = {}) => {
|
} = {}) => {
|
||||||
|
console.log('导出图片',{isContainFixed,
|
||||||
|
isContainFixedOther,
|
||||||
|
isPrintTrimsNoRepeat,
|
||||||
|
isPrintTrimsRepeat,
|
||||||
|
isContainNormalLayer})
|
||||||
var base64 = await canvasManager.exportImage({
|
var base64 = await canvasManager.exportImage({
|
||||||
isContainBg,
|
isContainBg,
|
||||||
isContainFixed,
|
isContainFixed,
|
||||||
@@ -1047,6 +1052,7 @@ defineExpose({
|
|||||||
expPicType,
|
expPicType,
|
||||||
isEnhanceImg,
|
isEnhanceImg,
|
||||||
});
|
});
|
||||||
|
console.log('导出图片完成',)
|
||||||
if(width > 0 && height > 0){
|
if(width > 0 && height > 0){
|
||||||
base64 = await resizeImage(base64, width, height);
|
base64 = await resizeImage(base64, width, height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,7 +275,6 @@ export default defineComponent({
|
|||||||
const setRevocation = async ()=>{//设置撤销
|
const setRevocation = async ()=>{//设置撤销
|
||||||
let itemDetail = JSON.parse(JSON.stringify(detailData.designDetail))
|
let itemDetail = JSON.parse(JSON.stringify(detailData.designDetail))
|
||||||
let revocation:any = JSON.parse((await KeyValueDB.get("revocation") as any) || 'null')
|
let revocation:any = JSON.parse((await KeyValueDB.get("revocation") as any) || 'null')
|
||||||
console.log(itemDetail,revocation,'=========')
|
|
||||||
if(!revocation)revocation = []
|
if(!revocation)revocation = []
|
||||||
// let oppositeRevocation = JSON.parse((await KeyValueDB.get("oppositeRevocation") as any))
|
// let oppositeRevocation = JSON.parse((await KeyValueDB.get("oppositeRevocation") as any))
|
||||||
// if(revocation?.[0]?.designItemId != itemDetail.designItemId || revocation?.[0]?.designItemId == undefined){
|
// if(revocation?.[0]?.designItemId != itemDetail.designItemId || revocation?.[0]?.designItemId == undefined){
|
||||||
@@ -291,7 +290,6 @@ export default defineComponent({
|
|||||||
const revocation = async ()=>{//撤回
|
const revocation = async ()=>{//撤回
|
||||||
let oppositeRevocation = JSON.parse((await KeyValueDB.get("oppositeRevocation") as any) || 'null')
|
let oppositeRevocation = JSON.parse((await KeyValueDB.get("oppositeRevocation") as any) || 'null')
|
||||||
let revocation = JSON.parse((await KeyValueDB.get("revocation") as any) || 'null')
|
let revocation = JSON.parse((await KeyValueDB.get("revocation") as any) || 'null')
|
||||||
console.log(oppositeRevocation,revocation,'=========')
|
|
||||||
if(revocation.length <= 1)return
|
if(revocation.length <= 1)return
|
||||||
oppositeRevocation.push(revocation[revocation.length-1])
|
oppositeRevocation.push(revocation[revocation.length-1])
|
||||||
revocation.splice(revocation.length-1,1)
|
revocation.splice(revocation.length-1,1)
|
||||||
@@ -448,7 +446,6 @@ export default defineComponent({
|
|||||||
let value = {
|
let value = {
|
||||||
currentType : JSON.parse(JSON.stringify(detailData.currentDetailType)),
|
currentType : JSON.parse(JSON.stringify(detailData.currentDetailType)),
|
||||||
rv:rv,
|
rv:rv,
|
||||||
fun:setRevocation
|
|
||||||
}
|
}
|
||||||
if(detailData?.designDetail?.newModel)detailData.designDetail.oldModel = JSON.parse(JSON.stringify(detailData.designDetail.newModel))
|
if(detailData?.designDetail?.newModel)detailData.designDetail.oldModel = JSON.parse(JSON.stringify(detailData.designDetail.newModel))
|
||||||
|
|
||||||
@@ -607,7 +604,6 @@ export default defineComponent({
|
|||||||
detailDom.canvasBox.editFront(str)
|
detailDom.canvasBox.editFront(str)
|
||||||
if(str == 'canvasEditor'){
|
if(str == 'canvasEditor'){
|
||||||
let otherData = await updateOtherLayers('single')
|
let otherData = await updateOtherLayers('single')
|
||||||
console.log(otherData,'============')
|
|
||||||
await detailDom.canvasBox.updateOtherLayers(otherData)
|
await detailDom.canvasBox.updateOtherLayers(otherData)
|
||||||
}
|
}
|
||||||
detailData.isEditPattern.value = str
|
detailData.isEditPattern.value = str
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export default defineComponent({
|
|||||||
if(data?.imgUrl)data.url = data.imgUrl
|
if(data?.imgUrl)data.url = data.imgUrl
|
||||||
let value = {
|
let value = {
|
||||||
data,
|
data,
|
||||||
id,
|
|
||||||
}
|
}
|
||||||
if(detailData.currentDetailType == 'sketch'){
|
if(detailData.currentDetailType == 'sketch'){
|
||||||
detailData.selectDetail.sketchString = ''
|
detailData.selectDetail.sketchString = ''
|
||||||
|
|||||||
@@ -379,22 +379,23 @@ export default defineComponent({
|
|||||||
item.object.blendMode = 'source-over'
|
item.object.blendMode = 'source-over'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(item.ifSingle && editPrintElementData.stateOverallSingle == 'single'){
|
if(item.ifSingle){
|
||||||
editPrintElementData.printStyleList[props.type].single.push(item)
|
editPrintElementData.printStyleList[props.type].single.push(item)
|
||||||
}
|
}
|
||||||
if(!item.ifSingle && editPrintElementData.stateOverallSingle == 'overall'){
|
if(!item.ifSingle){
|
||||||
item.token = Date.now().toString() + (editPrintElementData.printStyleList[props.type].overall.length + '')
|
item.token = Date.now().toString() + (editPrintElementData.printStyleList[props.type].overall.length + '')
|
||||||
// editPrintElementData.printStyleList[props.type].overall = []
|
// editPrintElementData.printStyleList[props.type].overall = []
|
||||||
editPrintElementData.printStyleList[props.type].overall.push(item)
|
editPrintElementData.printStyleList[props.type].overall.push(item)
|
||||||
setTimeout(()=>{
|
if(editPrintElementData.stateOverallSingle == 'overall'){
|
||||||
editPrintElementDom.pingpuRef.updataList([
|
setTimeout(()=>{
|
||||||
{
|
editPrintElementDom.pingpuRef.updataList([
|
||||||
action: ACTIONS.ADD,
|
{
|
||||||
data: item,
|
action: ACTIONS.ADD,
|
||||||
},
|
data: item,
|
||||||
]);
|
},
|
||||||
})
|
]);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const setPosition = ()=>{
|
const setPosition = ()=>{
|
||||||
|
|||||||
@@ -315,6 +315,24 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
detailItem.offset = [0,0]
|
detailItem.offset = [0,0]
|
||||||
detailItem.transpose = item.transpose || [1,1]
|
detailItem.transpose = item.transpose || [1,1]
|
||||||
detailItem.rotate = item.rotate || 0
|
detailItem.rotate = item.rotate || 0
|
||||||
|
function isJSONString(str) {
|
||||||
|
try {
|
||||||
|
JSON.parse(str);
|
||||||
|
return true; // 解析成功,是有效的JSON字符串
|
||||||
|
} catch (e) {
|
||||||
|
return false; // 解析失败,不是有效的JSON字符串
|
||||||
|
}
|
||||||
|
}
|
||||||
|
item.trims?.prints?.forEach((item:any) => {
|
||||||
|
if(isJSONString(item.object)){
|
||||||
|
item.object = JSON.parse(item.object)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
item.printObject?.prints?.forEach((item:any) => {
|
||||||
|
if(isJSONString(item.object)){
|
||||||
|
item.object = JSON.parse(item.object)
|
||||||
|
}
|
||||||
|
});
|
||||||
detailItem.printObject = item.printObject
|
detailItem.printObject = item.printObject
|
||||||
detailItem.trims = item.trims
|
detailItem.trims = item.trims
|
||||||
detailItem.type = item.type
|
detailItem.type = item.type
|
||||||
@@ -345,7 +363,6 @@ const DesignDetail : Module<DesignDetail,RootState> = {
|
|||||||
uploadDetail(state.selectDetail)
|
uploadDetail(state.selectDetail)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(value.fun)value.fun()
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user