diff --git a/src/component/Canvas/CanvasEditor/components/CropImage.vue b/src/component/Canvas/CanvasEditor/components/CropImage.vue index c2849e03..6eb5d7b7 100644 --- a/src/component/Canvas/CanvasEditor/components/CropImage.vue +++ b/src/component/Canvas/CanvasEditor/components/CropImage.vue @@ -277,16 +277,6 @@ clipData.left = x; clipData.img_width = elInfo.width; clipData.img_height = elInfo.height; - - if (!el.value) return; - const elh = el.value.offsetHeight; - const elsh = el.value.scrollHeight; - const elst = el.value.scrollTop; - if (y < elst) { - el.value.scrollTop = y; - } else if (y + clipInfo.height > elst + elh) { - el.value.scrollTop = y + clipInfo.height - elh; - } }; const mouseup = () => { window.removeEventListener("mousemove", mousemove); diff --git a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue index 2b5d104a..675c9db4 100644 --- a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue +++ b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue @@ -21,6 +21,7 @@ const props = defineProps({ type: Boolean, default: true, // 是否显示图层面板 }, + isBackgroundChangeable: Boolean, }); const emit = defineEmits([ @@ -312,7 +313,7 @@ onMounted(() => { " /> -
+
{{ $t("Canvas.color") }}
{ - console.log("========",res); - }); + }) }); }; diff --git a/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue b/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue index 33a0c17c..2c01a627 100644 --- a/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue +++ b/src/component/Canvas/CanvasEditor/components/TextEditorPanel.vue @@ -620,12 +620,19 @@ export default { // 监听显示文本编辑面板事件 document.addEventListener("showTextEditor", showEditor); document.addEventListener("hideTextEditor", close); - + if(props.canvas) { + // props.canvas.on("text:editing:entered", showEditor); + props.canvas.on("text:editing:exited", close); + } }); onUnmounted(() => { document.removeEventListener("showTextEditor", showEditor); document.removeEventListener("hideTextEditor", close); + if(props.canvas) { + // props.canvas.off("text:editing:entered", showEditor); + props.canvas.off("text:editing:exited", close); + } }); // 返回所有需要在模板中使用的数据和方法 diff --git a/src/component/Canvas/CanvasEditor/index.vue b/src/component/Canvas/CanvasEditor/index.vue index bedc9cbb..eecafc6f 100644 --- a/src/component/Canvas/CanvasEditor/index.vue +++ b/src/component/Canvas/CanvasEditor/index.vue @@ -101,7 +101,10 @@ const props = defineProps({ type: Boolean, default: false, // 是否允许擦除背景图层 }, - + isBackgroundChangeable: { + type: Boolean, + default: true, // 是否允许修改背景图层 + }, showFixedLayer: { type: Boolean, default: false, // 是否显示固定图层 @@ -305,6 +308,7 @@ onMounted(async () => { commandManager, layerManager, toolManager, + isRedGreenMode, pasteText: (text) => { // console.log("粘贴的文本:", text); handleAddText(text); @@ -530,15 +534,15 @@ onBeforeUnmount(() => { // return; // 开发环境下不卸载组件 // } console.log("onBeforeUnmount 组件卸载,清理资源..."); - // canvasManager?.dispose?.(); - // commandManager?.dispose?.(); - // layerManager?.dispose?.(); - // keyboardManager?.dispose?.(); - // toolManager?.dispose?.(); - // liquifyManager?.dispose?.(); - // selectionManager?.dispose?.(); - // redGreenModeManager?.dispose?.(); - // minimapManager?.dispose?.(); + canvasManager?.dispose?.(); + commandManager?.dispose?.(); + layerManager?.dispose?.(); + keyboardManager?.dispose?.(); + toolManager?.dispose?.(); + liquifyManager?.dispose?.(); + selectionManager?.dispose?.(); + redGreenModeManager?.dispose?.(); +// minimapManager?.dispose?.(); canvasManager = null; commandManager = null; layerManager = null; @@ -919,6 +923,7 @@ provide("cropImage", cropImage); // 提供给子组件使用 const isDragOver = ref(false); const canvasDragover = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; const types = e.dataTransfer.types; isDragOver.value = types.includes("Files"); }; @@ -926,12 +931,14 @@ const canvasDragover = (e) => { // 处理画布容器的拖离事件 const canvasDragleave = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; isDragOver.value = false; }; // 处理画布容器的拖放事件 const canvasDragdrop = (e) => { e.preventDefault(); + if (isRedGreenMode.value) return; isDragOver.value = false; const files = e.dataTransfer.files; for (const file of files) { @@ -1149,6 +1156,7 @@ defineExpose({ :brushSize="brushSize" :enabledRedGreenMode="enabledRedGreenMode" :showLayersPanel="showLayersPanel" + :isBackgroundChangeable="isBackgroundChangeable" @update:canvasWidth="canvasWidth = $event" @update:canvasHeight="canvasHeight = $event" @update:canvasColor="canvasColor = $event" @@ -1209,13 +1217,6 @@ defineExpose({ :activeTool="activeTool" /> - - - + + +
{{ t("Canvas.Scale") }}: {{ currentZoom }}%
+
+
+
{{ $t('ProductImg.Prompt') }}
+ +
+
+
+
{{ $t('poseTransfer.Selectpose') }}
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ -
- -
-
-
{{ item.label }}
-
-
-
- -
- - -
- -
- -
-
{{$t('poseTransfer.LikeVideo')}}
-
- -
- -
- -
-
-
-
-
-
{{$t('poseTransfer.InputVideo')}}
-
- -
-
-
- +
+ +
+ + +
+
+
+ + {{ $t('poseTransfer.InputVideo') }} +
+
+ +
+
+
+ \ No newline at end of file + .upload_file_item { + width: 100%; + height: 100%; + :deep(.ant-upload-picture-card-wrapper) { + width: 100% !important; + height: 100%; + .ant-upload-list-picture-card { + width: 100%; + height: 100%; + .ant-upload-select-picture-card { + width: 100%; + height: 100%; + border: 1px solid #000; + background: #fff; + } + } + } + } + .video-type-container { + margin-bottom: 4rem; + .title { + font-size: 1.8rem; + color: #000; + margin-bottom: 1.4rem; + } + :deep(.ant-select) { + width: 100%; + .ant-select-selector { + border: 2px solid #d0d0d0; + border-radius: 1rem; + } + } + } +} + diff --git a/src/component/modules/generalMiniCanvas.vue b/src/component/modules/generalMiniCanvas.vue index 8c07ac65..255ce6ad 100644 --- a/src/component/modules/generalMiniCanvas.vue +++ b/src/component/modules/generalMiniCanvas.vue @@ -5,6 +5,7 @@ @canvasInit="canvasInit" @changeCanvas="changeCanvas" is-general + :isBackgroundChangeable="false" ref="editCanvas">
diff --git a/src/lang/cn.ts b/src/lang/cn.ts index ff4a1a7c..53aea1b5 100644 --- a/src/lang/cn.ts +++ b/src/lang/cn.ts @@ -285,7 +285,7 @@ export default { AssitSubTitle: '您可以复制并使用以下提示词:', CopySuccess: '已复制到剪贴板', CopyFiled: '复制失败', - noPrompt:'请输入提示词' + noPrompt: '请输入提示词' }, poseTransfer: { SelectDesign: '产品图', @@ -308,7 +308,11 @@ export default { UploadWithModel: '创建模特穿着该服装的真实感摄影棚照片。若原有模特存在则保留,否则生成合适模特。采用站立姿势面向镜头。精确保留服装细节——图案、颜色、质地及装饰元素。', // 上传线稿,带模特 UploadWithoutModel: - '专业产品摄影:服装以自然形态展示,无模特。采用影棚灯光。保留精确细节——图案、色彩、质感、装饰元素。' // 上传线稿,不带模特 + '专业产品摄影:服装以自然形态展示,无模特。采用影棚灯光。保留精确细节——图案、色彩、质感、装饰元素。', // 上传线稿,不带模特 + VideoType: '视频类型', + FirstFrame: '首帧', + FirstAndLastFrames: '首帧和尾帧', + FirstFrameAndSkeleton: '首帧和骨架' }, LibraryPage: { library: '收藏', @@ -1225,9 +1229,9 @@ export default { basic: '基础', flipHorizontal: '水平翻转', flipVertical: '垂直翻转', - cropAndAdd: '裁剪并添加', - cropImage: '裁剪图片', - group: '组合', + cropAndAdd: '裁剪并添加', + cropImage: '裁剪图片', + group: '组合', //长毛笔 FurSettings: '长毛笔设置', FurLength: '毛发长度', diff --git a/src/lang/en.ts b/src/lang/en.ts index 6aceb62d..3fc1b348 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -295,7 +295,7 @@ export default { AssitSubTitle: 'You can copy following prompt and try:', CopySuccess: 'Copied to clipboard', CopyFiled: 'Failed to copy', - noPrompt:'Please enter prompt' + noPrompt: 'Please enter prompt' }, poseTransfer: { SelectDesign: 'Product image', @@ -318,7 +318,11 @@ export default { UploadWithModel: 'Create realistic studio photo with model wearing this garment. Keep original model if present, or generate appropriate model. Standing pose, facing camera. Preserve exact garment details - patterns, colors, textures, embellishments.', // 上传线稿,带模特 UploadWithoutModel: - 'Professional product photo: garment displayed with natural shape, no model. Studio lighting. Preserve exact details - patterns, colors, textures, embellishments.' // 上传线稿,不带模特 + 'Professional product photo: garment displayed with natural shape, no model. Studio lighting. Preserve exact details - patterns, colors, textures, embellishments.', // 上传线稿,不带模特 + VideoType: 'Video Type', + FirstFrame: 'First frame', + FirstAndLastFrames: 'First and last frames', + FirstFrameAndSkeleton: 'First frame and skeleton', }, LibraryPage: { library: 'Library', @@ -1260,9 +1264,9 @@ export default { basic: 'Basic', flipHorizontal: 'Horizontal Flip', flipVertical: 'Vertical Flip', - cropAndAdd: 'Crop and Add', - cropImage: 'Crop Image', - group: 'Group', + cropAndAdd: 'Crop and Add', + cropImage: 'Crop Image', + group: 'Group', //长毛笔 FurSettings: 'FurSettings', FurLength: 'Fur Length', diff --git a/src/store/homeStore/homeStore.ts b/src/store/homeStore/homeStore.ts index a46cda3c..e855cf3f 100644 --- a/src/store/homeStore/homeStore.ts +++ b/src/store/homeStore/homeStore.ts @@ -41,6 +41,7 @@ const HomeStoreModule : Module = { likedList:[], }, uploadElement:[], + lastFrameList:[], poseTransfer:{ list:[], likedList:[], @@ -70,6 +71,19 @@ const HomeStoreModule : Module = { mutations:{ setshowSketchList(state,data){ state.showSketchList = data + }, + setPoseTransferLastFrameList(state,data){ + console.log('设置尾帧store-------------') + // 支持两种方式:set 替换整个列表;add/删除与 uploadElement 一致 + if(data.str === 'set'){ + state.poseTransfer.lastFrameList = data.list || [] + return + } + if(data.str === 'add'){ + state.poseTransfer.lastFrameList.unshift(...(data.list || [])) + }else{ + state.poseTransfer.lastFrameList.splice(data.index,1) + } }, setDesignCollectionList(state,data){ state.designCollectionList = data