@@ -28,7 +28,22 @@
{
tier: NODE_DATATIER.SURFACE_EDIT,
type: NODE_DATATYPE.SURFACE_EDIT,
- title: 'Surface Edit'
+ title: 'Surface Edit',
+ secondaryMenu: {
+ title: 'Surface Edit',
+ icon: NODE_DATATYPE.SURFACE_EDIT,
+ selectList: [
+ {
+ tier: NODE_DATATIER.CANVAS_MODE,
+ type: NODE_DATATYPE.CANVAS_MODE,
+ title: 'Surface Edit (Canvas)',
+ },{
+ tier: NODE_DATATIER.Fast_MODE,
+ type: NODE_DATATYPE.Fast_MODE,
+ title: 'Surface Edit',
+ },
+ ]
+ }
},
{
tier: NODE_DATATIER.SCENE_COMPOSITION,
@@ -55,15 +70,27 @@
const id = props.node.id
if (!id) return
stateManager.deleteNode(id)
- const superiorID = props.node.data.superiorID
- nodeManager.createCardNode({
- data: {
- tier: v.tier,
- type: v.type,
- superiorID,
- originalImage: props.node.data?.originalImage,
- }
- })
+ console.log(props.node)
+ if(v.secondaryMenu){
+ nodeManager.createCardsSelect({
+ data: {
+ tier: props.node.data?.tier,
+ superiorID: props.node.data?.superiorID,
+ originalImage: props.node.data?.originalImage,
+ secondaryMenu: v.secondaryMenu
+ }
+ })
+ }else{
+ const superiorID = props.node.data.superiorID
+ nodeManager.createCardNode({
+ data: {
+ tier: v.tier,
+ type: v.type,
+ superiorID,
+ originalImage: props.node.data?.originalImage,
+ }
+ })
+ }
}
defineExpose({})
diff --git a/src/components/Canvas/FlowCanvas/components/nodes/cards/fast-mode.vue b/src/components/Canvas/FlowCanvas/components/nodes/cards/fast-mode.vue
new file mode 100644
index 0000000..bdf6c78
--- /dev/null
+++ b/src/components/Canvas/FlowCanvas/components/nodes/cards/fast-mode.vue
@@ -0,0 +1,77 @@
+
+
+
+
Output
+
+
![]()
+
+
+
+
+
+
+
diff --git a/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue b/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
index ee7c74c..41da0ec 100644
--- a/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
+++ b/src/components/Canvas/FlowCanvas/components/nodes/cards/index.vue
@@ -2,13 +2,13 @@
+
@@ -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