From c1fee6c4a453a22e292e6033b7f35df452c04c77 Mon Sep 17 00:00:00 2001 From: "X1627315083@163.com" <1627315083@qq.com> Date: Fri, 20 Mar 2026 13:37:58 +0800 Subject: [PATCH] fix --- src/assets/icons/canvas-mode-2.svg | 4 + src/assets/icons/canvas-mode.svg | 4 + src/assets/icons/fast-mode-2.svg | 4 + src/assets/icons/fast-mode.svg | 4 + .../components/nodes/cards/cards-select.vue | 49 +++++++++--- .../components/nodes/cards/fast-mode.vue | 77 +++++++++++++++++++ .../components/nodes/cards/index.vue | 44 +++++++++-- .../components/nodes/result-image.vue | 2 +- .../components/tools/threeModel/index.vue | 3 +- .../Canvas/FlowCanvas/tools/index.d.ts | 4 + src/components/Canvas/tools/tools.ts | 12 +++ 11 files changed, 185 insertions(+), 22 deletions(-) create mode 100644 src/assets/icons/canvas-mode-2.svg create mode 100644 src/assets/icons/canvas-mode.svg create mode 100644 src/assets/icons/fast-mode-2.svg create mode 100644 src/assets/icons/fast-mode.svg create mode 100644 src/components/Canvas/FlowCanvas/components/nodes/cards/fast-mode.vue diff --git a/src/assets/icons/canvas-mode-2.svg b/src/assets/icons/canvas-mode-2.svg new file mode 100644 index 0000000..145959a --- /dev/null +++ b/src/assets/icons/canvas-mode-2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/icons/canvas-mode.svg b/src/assets/icons/canvas-mode.svg new file mode 100644 index 0000000..6d79cf8 --- /dev/null +++ b/src/assets/icons/canvas-mode.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/icons/fast-mode-2.svg b/src/assets/icons/fast-mode-2.svg new file mode 100644 index 0000000..145959a --- /dev/null +++ b/src/assets/icons/fast-mode-2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/icons/fast-mode.svg b/src/assets/icons/fast-mode.svg new file mode 100644 index 0000000..6d79cf8 --- /dev/null +++ b/src/assets/icons/fast-mode.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/Canvas/FlowCanvas/components/nodes/cards/cards-select.vue b/src/components/Canvas/FlowCanvas/components/nodes/cards/cards-select.vue index 4fa4e73..b811b92 100644 --- a/src/components/Canvas/FlowCanvas/components/nodes/cards/cards-select.vue +++ b/src/components/Canvas/FlowCanvas/components/nodes/cards/cards-select.vue @@ -1,7 +1,7 @@ @@ -31,6 +37,7 @@ import CardsSelect from './cards-select.vue' import ToRealStyle from './to-real-style.vue' import SurfaceEdit from './surface-edit.vue' + import FastMode from './fast-mode.vue' import SceneComposition from './scene-composition.vue' import ColorPalette from './color-palette.vue' import To3View from './to-3view.vue' @@ -41,6 +48,8 @@ // import ToVideo from './to-video.vue' // import AddPrint from './add-print.vue' // import ToCAD from './to-cad.vue' + const attrs = useAttrs() + const componentRef = ref(null) const components = [ { tier: NODE_DATATIER.CARDS_SELECT, @@ -58,12 +67,23 @@ api: toRealStyleApi }, { - tier: NODE_DATATIER.SURFACE_EDIT, - type: NODE_DATATYPE.SURFACE_EDIT, + tier: NODE_DATATIER.Fast_MODE, + type: NODE_DATATYPE.Fast_MODE, title: 'Surface Edit', component: SurfaceEdit, api: sketchAddPrintApi }, + { + tier: NODE_DATATIER.CANVAS_MODE, + type: NODE_DATATYPE.CANVAS_MODE, + title: 'Surface Edit (Canvas)', + component: FastMode, + hideFooter: true, + showCanvasEdit: true, + on: ()=>{ + componentRef.value?.opCanvas() + } + }, { tier: NODE_DATATIER.SCENE_COMPOSITION, type: NODE_DATATYPE.SCENE_COMPOSITION, @@ -117,11 +137,9 @@ default: () => ({}) } }) - const attrs = useAttrs() const currentComponent = computed(() => { return components.find((item) => item.type === props.type) }) - const componentRef = ref(null) const onGenerateClick = async () => { const data = componentRef.value?.getApiData?.() || {} @@ -140,13 +158,16 @@ }) || [] // const taskList = [{taskId:'123'}] // if (!subordNode) { + + //如果是添加印花的结果就作为一级节点可以再次选择添加印花或者生成真实图 + let tier = NODE_DATATIER.Fast_MODE == currentComponent.value.tier?0:currentComponent.value.tier taskList.forEach((item,index) => { nodeManager.createResultNode({ data: { superiorID: attrs.node.id, superiorNodeType: attrs.node?.data?.type, createIndexPosition: index + subordNodes.length, - tier: currentComponent.value.tier, + tier: tier, isActive: index == 0 && subordNodes.length == 0, data: { imageProcessTasks:[item], @@ -251,6 +272,7 @@ font-size: 12px; font-family: SemiBold; cursor: pointer; + &:active { opacity: 0.5; } @@ -260,6 +282,12 @@ margin-right: 4px; } } + &.canvasEdit{ + > button{ + margin: 0 8px; + width: 201px; + } + } } } diff --git a/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue b/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue index 64176b8..81f9d70 100644 --- a/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue +++ b/src/components/Canvas/FlowCanvas/components/nodes/result-image.vue @@ -181,7 +181,7 @@ ]) const onPreview = (item: any) => { if(data.superiorNodeType == NODE_DATATYPE.TO_3D_MODEL){ - openThreeModelPreview({url:item?.glbPath,glbInfoObj:item?.glbInfoObj}) + openThreeModelPreview({glbPath:item?.glbPath,glbInfoObj:item?.glbInfoObj}) }else{ openImagePreview(item.url) } diff --git a/src/components/Canvas/FlowCanvas/components/tools/threeModel/index.vue b/src/components/Canvas/FlowCanvas/components/tools/threeModel/index.vue index fc522db..dee681c 100644 --- a/src/components/Canvas/FlowCanvas/components/tools/threeModel/index.vue +++ b/src/components/Canvas/FlowCanvas/components/tools/threeModel/index.vue @@ -18,8 +18,7 @@ let data = reactive({ const modelRef = ref(null) onMounted(()=>{ - console.log(props?.currentData?.url) - if(props?.currentData?.url)modelRef.value.open(props?.currentData?.url) + if(props?.currentData?.glbPath)modelRef.value.open(props?.currentData?.glbPath) }) onUnmounted(()=>{ }) diff --git a/src/components/Canvas/FlowCanvas/tools/index.d.ts b/src/components/Canvas/FlowCanvas/tools/index.d.ts index 49c4d93..0cd2e03 100644 --- a/src/components/Canvas/FlowCanvas/tools/index.d.ts +++ b/src/components/Canvas/FlowCanvas/tools/index.d.ts @@ -25,6 +25,8 @@ export const NODE_DATATYPE = { CARDS_SELECT: 'cards-select', TO_REAL_STYLE: 'to-real-style', SURFACE_EDIT: 'surface-edit', + CANVAS_MODE: 'canvas-mode', + Fast_MODE: 'fast-mode', SCENE_COMPOSITION: 'scene-composition', COLOR_PALETTE: 'color-palette', TO_3D_MODEL: 'to-3d-model', @@ -38,6 +40,8 @@ export const NODE_DATATIER = { CARDS_SELECT: 0, TO_REAL_STYLE: 1, SURFACE_EDIT: 1, + CANVAS_MODE: 1, + Fast_MODE: 1, SCENE_COMPOSITION: 2, COLOR_PALETTE: 2, TO_3D_MODEL: 2, diff --git a/src/components/Canvas/tools/tools.ts b/src/components/Canvas/tools/tools.ts index 3e8dab7..e08e6f5 100644 --- a/src/components/Canvas/tools/tools.ts +++ b/src/components/Canvas/tools/tools.ts @@ -77,4 +77,16 @@ export const base64Tofile = (base64: string,name: string) => { // 4. 创建 File 对象(可选) const file = new File([blob], name, { type: mime }) return file +} +//获取当前时间2026-03-20 11:38:29 +export const getCurrentTime = () => { + const now = new Date() + const currentTime = + now.getFullYear() + '-' + + String(now.getMonth() + 1).padStart(2, '0') + '-' + + String(now.getDate()).padStart(2, '0') + ' ' + + String(now.getHours()).padStart(2, '0') + ':' + + String(now.getMinutes()).padStart(2, '0') + ':' + + String(now.getSeconds()).padStart(2, '0') + return currentTime } \ No newline at end of file