diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue
index 53f4455b..882c556f 100644
--- a/src/component/Canvas/CanvasEditor/index.vue
+++ b/src/component/Canvas/CanvasEditor/index.vue
@@ -1,1739 +1,1717 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
- {{ t("Canvas.Scale") }}: {{ currentZoom }}%
-
-
-
+
+ {{ t("Canvas.Scale") }}: {{ currentZoom }}%
+
+
+
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/component/Canvas/CanvasEditor/managers/CanvasManager.js b/src/component/Canvas/CanvasEditor/managers/CanvasManager.js
index 3ef78c99..84fc497b 100644
--- a/src/component/Canvas/CanvasEditor/managers/CanvasManager.js
+++ b/src/component/Canvas/CanvasEditor/managers/CanvasManager.js
@@ -1335,7 +1335,7 @@ backgroundObject.scaleY,'CanvasManager resetCanvasSizeByFixedLayer')
}
}
loadJSON(json, calllBack) {
-
+ this.canvas.loading.value = true;
// 确保传入的json是字符串格式
if (typeof json === "object") {
json = JSON.stringify(json);
@@ -1507,7 +1507,6 @@ backgroundObject.scaleY,'CanvasManager resetCanvasSizeByFixedLayer')
*/
async createOtherLayers(otherData) {
if (!otherData) return console.warn("otherData 为空不需要添加");
- this.canvas.loading.value = true;
let resolve = ()=>{};
this.awaitCanvasRun = ()=>(new Promise((v) => resolve = v))
const otherData_ = JSON.parse(JSON.stringify(otherData));
@@ -1555,7 +1554,6 @@ backgroundObject.scaleY,'CanvasManager resetCanvasSizeByFixedLayer')
console.log("==========创建其他图层成功");
resolve();
this.awaitCanvasRun = null;
- this.canvas.loading.value = false;
}
// 设置画布对象的裁剪信息
diff --git a/src/component/Canvas/CanvasEditor/managers/LayerManager.js b/src/component/Canvas/CanvasEditor/managers/LayerManager.js
index b0935346..ab64fa9f 100644
--- a/src/component/Canvas/CanvasEditor/managers/LayerManager.js
+++ b/src/component/Canvas/CanvasEditor/managers/LayerManager.js
@@ -1580,7 +1580,7 @@ export class LayerManager {
/**
* 排序图层,确保图层顺序: 普通图层 > 固定图层 > 背景图层
*/
- sortLayers() {
+ async sortLayers() {
// 对图层进行排序:背景图层在最底层(数组最后),固定图层在中间
this.layers.value.sort((a, b) => {
// 如果a是背景图层,它应该排在后面(最底层)
@@ -1604,17 +1604,17 @@ export class LayerManager {
});
// 更新画布对象顺序
- this._rearrangeObjects();
+ await this._rearrangeObjects();
}
/**
* 重新排列画布上的对象以匹配图层顺序
* @private
*/
- _rearrangeObjects() {
+ async _rearrangeObjects() {
if (this.layerSort) {
// 使用LayerSort的高级排序
- this.layerSort.rearrangeObjects();
+ await this.layerSort.rearrangeObjects();
return;
}
diff --git a/src/component/Canvas/CanvasEditor/utils/LayerSort.js b/src/component/Canvas/CanvasEditor/utils/LayerSort.js
index d7c16369..ad12bafe 100644
--- a/src/component/Canvas/CanvasEditor/utils/LayerSort.js
+++ b/src/component/Canvas/CanvasEditor/utils/LayerSort.js
@@ -30,27 +30,30 @@ export class LayerSort {
if (canvasObjects.length === 0) return;
// 使用画布渲染优化
- await optimizeCanvasRendering(this.canvas, () => {
- // 计算每个对象应该在的 z-index 位置
- const objectZIndexMap = this.calculateObjectZIndexes();
+ await new Promise((resolve) => {
+ optimizeCanvasRendering(this.canvas, () => {
+ // 计算每个对象应该在的 z-index 位置
+ const objectZIndexMap = this.calculateObjectZIndexes();
- // 按照新的 z-index 排序对象
- const sortedObjects = canvasObjects
- .map((obj) => ({
- object: obj,
- targetZIndex: objectZIndexMap.get(obj.id) ?? -1,
- }))
- .filter((item) => item.targetZIndex >= 0) // 过滤掉无效对象
- .sort((a, b) => a.targetZIndex - b.targetZIndex);
+ // 按照新的 z-index 排序对象
+ const sortedObjects = canvasObjects
+ .map((obj) => ({
+ object: obj,
+ targetZIndex: objectZIndexMap.get(obj.id) ?? -1,
+ }))
+ .filter((item) => item.targetZIndex >= 0) // 过滤掉无效对象
+ .sort((a, b) => a.targetZIndex - b.targetZIndex);
- // 使用 fabric.js 的 moveTo 方法重新排序
- sortedObjects.forEach((item, index) => {
- const currentIndex = this.canvas.getObjects().indexOf(item.object);
- if (currentIndex !== index && currentIndex !== -1) {
- // 将对象移动到正确的位置
- this.canvas.moveTo(item.object, index);
- }
- });
+ // 使用 fabric.js 的 moveTo 方法重新排序
+ sortedObjects.forEach((item, index) => {
+ const currentIndex = this.canvas.getObjects().indexOf(item.object);
+ if (currentIndex !== index && currentIndex !== -1) {
+ // 将对象移动到正确的位置
+ this.canvas.moveTo(item.object, index);
+ }
+ });
+ resolve();
+ });
});
}
diff --git a/src/component/Detail/DesignDetail.vue b/src/component/Detail/DesignDetail.vue
index 3f0e7ca4..0814af8e 100644
--- a/src/component/Detail/DesignDetail.vue
+++ b/src/component/Detail/DesignDetail.vue
@@ -759,7 +759,6 @@ export default defineComponent({
const uploadSelectDetail = async ()=>{//更新选中的detail
// await detailDom.canvasBox.saveCanvas()
const allInfo = await (detailDom.canvasBox as any).getCanvasElement()
- console.log(allInfo)
let color:any = {}
if(allInfo.color?.color?.rgba || allInfo.color?.color?.gradient){
let canvasColor = allInfo.color.color;
diff --git a/src/component/Detail/canvas/index.vue b/src/component/Detail/canvas/index.vue
index ac0c3544..6023a4e6 100644
--- a/src/component/Detail/canvas/index.vue
+++ b/src/component/Detail/canvas/index.vue
@@ -12,7 +12,6 @@
is-edit
:clothingImageUrl="selectDetail.path"
:clothingImageUrl2="selectDetail.maskUrl || selectDetail.layersObject[0].maskUrl"
- :clothingMinIOPath="selectDetail.minIOPath"
showFixedLayer
:canvasJSON="canvasJSON"
@canvasLoadJsonSuccess="canvasLoadJsonSuccess"
@@ -52,9 +51,9 @@
-
+
diff --git a/src/component/Detail/detailRight/editPrintElement.vue b/src/component/Detail/detailRight/editPrintElement.vue
index 1b8c393d..ae2b63a8 100644
--- a/src/component/Detail/detailRight/editPrintElement.vue
+++ b/src/component/Detail/detailRight/editPrintElement.vue
@@ -273,7 +273,7 @@ export default defineComponent({
minIOPath:data.minIOPath || data.originalUrl,
path:data.url,
priority:printIndex,
- scale,
+ scale:editPrintElementData.stateOverallSingle == 'single'?scale:[1,1],
globalCompositeOperation:'',
}
getItemPosition(item)
@@ -300,7 +300,7 @@ export default defineComponent({
// location = [item.pattern.style.left,item.pattern.style.top]
}
let value ={
- angle : item.pattern.transform.rotateZ,
+ angle:0,
// angle : !this.overallSingle ? 0:item.pattern.transform.rotateZ,
location : location,
priority:item.priority,
@@ -312,7 +312,9 @@ export default defineComponent({
ifSingle:!!item.ifSingle,
globalCompositeOperation:'',
}
- if(item.object)value.object = item.object
+ if(item.object)value.object = item.object;
+ value.angle = value.ifSingle?item.pattern.transform.rotateZ:item.angle
+
return value
}
if(editPrintElementData.printStyleList[props.type].single.length>0){
@@ -359,7 +361,7 @@ export default defineComponent({
//overall
left = item.location[0] / editPrintElementData.sketchWH.scale[0]
top = item.location[1] / editPrintElementData.sketchWH.scale[1]
- item.scale = [1,1]
+ item.scale = item.scale || [1,1]
}
let pattern = {
centers:{left:0,top:0},
@@ -915,6 +917,7 @@ export default defineComponent({
}
const inputFillAngle = (angle:any)=>{
let arr = editPrintElementData.printStyleList[props.type].overall
+ console.log(angle)
arr[editPrintElementData.imgDomIndex].angle = angle
editPrintElementDom.pingpuRef.updataList([
{
diff --git a/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue b/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue
index 05a30feb..b7c6d5ab 100644
--- a/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue
+++ b/src/component/Detail/detailRight/overallSetting/RepeatSetting.vue
@@ -25,7 +25,7 @@
Gap X
Gap Y
{
// let scaleValue = props.object?.scale/10;
// return props.object?.scale/10;
- return props.object?.scale[0] * 100;
+ return (props.object?.scale[0] * 100).toFixed(0);
});
const scalePrint = computed(() => {
let index = sketchWH.value[0] > sketchWH.value[1]?0:1;
diff --git a/src/tool/listData.js b/src/tool/listData.js
index c5d18b96..b896abbd 100644
--- a/src/tool/listData.js
+++ b/src/tool/listData.js
@@ -272,12 +272,12 @@ const navTypeList = (t)=>{
// },
- {
- icon:'fi fi-rr-puzzle-alt',
- value:'deReconstruction',
- label:t('Header.toolsDeReconstruction'),
- router:'tools=deReconstruction'
- },
+ // {
+ // icon:'fi fi-rr-puzzle-alt',
+ // value:'deReconstruction',
+ // label:t('Header.toolsDeReconstruction'),
+ // router:'tools=deReconstruction'
+ // },
{
icon:'fi fi-ss-box-open',
value:'toProduct',
@@ -294,18 +294,18 @@ const navTypeList = (t)=>{
label:t('Header.toolsToTransferPose'),
router:'tools=poseTransfer'
},
- {
- icon:'fi fi-rr-cubes',
- value:'patternMaking3D',
- label:t('Header.toolsPatternMaking'),
- router:'tools=patternMaking3D'
- },
- {
- icon:'fi fi-rr-pen-swirl',
- value:'canvasUpload',
- label:t('Header.toolsCanvas'),
- router:'tools=canvasUpload'
- },
+ // {
+ // icon:'fi fi-rr-cubes',
+ // value:'patternMaking3D',
+ // label:t('Header.toolsPatternMaking'),
+ // router:'tools=patternMaking3D'
+ // },
+ // {
+ // icon:'fi fi-rr-pen-swirl',
+ // value:'canvasUpload',
+ // label:t('Header.toolsCanvas'),
+ // router:'tools=canvasUpload'
+ // },
]
},
library:{