修复印花画布不同步问题和overall模式大小没有同步
This commit is contained in:
@@ -358,25 +358,6 @@ export default defineComponent({
|
|||||||
detailData.selectDetail.maskUrl = ''
|
detailData.selectDetail.maskUrl = ''
|
||||||
detailData.selectDetail.maskMinioUrl = ''
|
detailData.selectDetail.maskMinioUrl = ''
|
||||||
}
|
}
|
||||||
function isNetworkPath(str) {
|
|
||||||
if (typeof str !== 'string' || str.trim() === '') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
const urlPatterns = [
|
|
||||||
/^https?:\/\//i, // http:// 或 https://
|
|
||||||
/^ftp:\/\//i, // ftp://
|
|
||||||
/^ws:\/\//i, // ws://
|
|
||||||
/^wss:\/\//i, // wss://
|
|
||||||
/^\/\//, // 协议相对路径 //example.com
|
|
||||||
/^data:/i, // data:image/png;base64,...(这是Base64,不是网络路径)
|
|
||||||
];
|
|
||||||
// 排除data:URL(这实际上是Base64)
|
|
||||||
if (str.startsWith('data:')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return urlPatterns.some(pattern => pattern.test(str));
|
|
||||||
}
|
|
||||||
const printObjectToJSON = (list:any)=>{
|
const printObjectToJSON = (list:any)=>{
|
||||||
if(list?.length > 0){
|
if(list?.length > 0){
|
||||||
list.forEach((item:any)=>{
|
list.forEach((item:any)=>{
|
||||||
@@ -417,8 +398,8 @@ export default defineComponent({
|
|||||||
if(!data.partialDesign.partialDesignMinioPath){
|
if(!data.partialDesign.partialDesignMinioPath){
|
||||||
data.partialDesign.partialDesignMinioPath = data.path
|
data.partialDesign.partialDesignMinioPath = data.path
|
||||||
}
|
}
|
||||||
data.printObject.prints = printObjectToJSON(data.printObject.prints)
|
printObjectToJSON(data.printObject.prints)
|
||||||
data.trims.prints = printObjectToJSON(data.trims.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))){
|
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)
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ export default defineComponent({
|
|||||||
let x = Number(style.left.replace(/px/g,''))
|
let x = Number(style.left.replace(/px/g,''))
|
||||||
let y = Number(style.top.replace(/px/g,''))
|
let y = Number(style.top.replace(/px/g,''))
|
||||||
location = [(x*sketchWH[0]) ,(y*sketchWH[1])]
|
location = [(x*sketchWH[0]) ,(y*sketchWH[1])]
|
||||||
scale =[ editPrintElementData.systemDesignerPercentage/100, editPrintElementData.systemDesignerPercentage/100]
|
scale = item.scale
|
||||||
// scale = [item.pattern.style.width/item.pattern.style.height,item.pattern.style.height/item.pattern.style.width]
|
// 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]
|
// location = [item.pattern.style.left,item.pattern.style.top]
|
||||||
}
|
}
|
||||||
@@ -911,6 +911,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
const inputFillScale = (scale:any)=>{
|
const inputFillScale = (scale:any)=>{
|
||||||
let arr = editPrintElementData.printStyleList[props.type].overall
|
let arr = editPrintElementData.printStyleList[props.type].overall
|
||||||
|
console.log(arr,scale,editPrintElementData.imgDomIndex)
|
||||||
arr[editPrintElementData.imgDomIndex].scale = [scale,scale]
|
arr[editPrintElementData.imgDomIndex].scale = [scale,scale]
|
||||||
editPrintElementDom.pingpuRef.updataList([
|
editPrintElementDom.pingpuRef.updataList([
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user