@@ -22,6 +22,7 @@ import {
2222 buildDefaultRearrangeGrid ,
2323 computeWorkflowRunStrategy ,
2424 createGraphNode ,
25+ getStitchInputSlotCount ,
2526 parseWorkflowGraph ,
2627 resizeRearrangeGrid ,
2728 runDagExecution ,
@@ -172,6 +173,33 @@ export default function RoninProCustomWorkflow({ onSendToFineProcess }: RoninPro
172173 )
173174 } , [ ] )
174175
176+ const adjustStitchSlotCount = useCallback ( ( id : string , delta : number ) => {
177+ let nextCount : number | null = null
178+ setGraphNodes ( ( list ) => {
179+ const node = list . find ( ( x ) => x . id === id && x . type === 'simpleStitchVertical' )
180+ if ( ! node ) return list
181+ const cur = getStitchInputSlotCount ( node )
182+ const next = Math . max ( 2 , Math . min ( 16 , cur + delta ) )
183+ if ( next === cur ) return list
184+ nextCount = next
185+ return list . map ( ( n ) =>
186+ n . id === id && n . type === 'simpleStitchVertical'
187+ ? { ...n , params : { ...n . params , stitchSlotCount : next } }
188+ : n
189+ )
190+ } )
191+ if ( nextCount !== null ) {
192+ setGraphEdges ( ( prev ) =>
193+ prev . filter ( ( ed ) => {
194+ if ( ed . target !== id ) return true
195+ const m = / ^ i n ( \d + ) $ / . exec ( ed . targetPort ?? '' )
196+ if ( ! m ) return true
197+ return parseInt ( m [ 1 ] , 10 ) <= nextCount !
198+ } )
199+ )
200+ }
201+ } , [ ] )
202+
175203 const updateCustomRearrangeDimension = useCallback (
176204 ( id : string , key : 'splitCols' | 'splitRows' | 'outRows' | 'outCols' , value : number ) => {
177205 setGraphNodes ( ( list ) =>
@@ -850,8 +878,46 @@ export default function RoninProCustomWorkflow({ onSendToFineProcess }: RoninPro
850878 </ div >
851879 </ Space >
852880 )
853- case 'simpleStitchVertical' :
854- return < Text style = { { color : '#8b93a5' , fontSize : 11 } } > { t ( 'roninProWorkflowSimpleStitchVerticalHint' ) } </ Text >
881+ case 'simpleStitchVertical' : {
882+ const slots = getStitchInputSlotCount ( n )
883+ return (
884+ < Space direction = "vertical" style = { { width : '100%' } } size = "small" >
885+ < div >
886+ < Text style = { { color : '#9aa3b5' , fontSize : 11 } } > { t ( 'roninProWorkflowStitchMode' ) } </ Text >
887+ < Select
888+ size = "small"
889+ style = { { ...INPUT_FULL , marginTop : 4 } }
890+ value = { Math . max ( 0 , Math . min ( 2 , Math . round ( p . stitchMode ?? 0 ) ) ) }
891+ options = { [
892+ { value : 0 , label : t ( 'roninProWorkflowStitchModeVertical' ) } ,
893+ { value : 1 , label : t ( 'roninProWorkflowStitchModeHorizontal' ) } ,
894+ { value : 2 , label : t ( 'roninProWorkflowStitchModeOverlay' ) } ,
895+ ] }
896+ onChange = { ( v ) => updateNodeParam ( id , 'stitchMode' , typeof v === 'number' ? v : 0 ) }
897+ />
898+ </ div >
899+ < div style = { { display : 'flex' , alignItems : 'center' , gap : 8 , flexWrap : 'wrap' } } >
900+ < Text style = { { color : '#9aa3b5' , fontSize : 11 } } > { t ( 'roninProWorkflowStitchInputSlots' , { n : slots } ) } </ Text >
901+ < Button
902+ type = "dashed"
903+ size = "small"
904+ icon = { < PlusOutlined /> }
905+ disabled = { slots >= 16 }
906+ onClick = { ( ) => adjustStitchSlotCount ( id , 1 ) }
907+ />
908+ < Button
909+ type = "default"
910+ size = "small"
911+ disabled = { slots <= 2 }
912+ onClick = { ( ) => adjustStitchSlotCount ( id , - 1 ) }
913+ >
914+ −
915+ </ Button >
916+ </ div >
917+ < Text style = { { color : '#7a8499' , fontSize : 10 } } > { t ( 'roninProWorkflowSimpleStitchVerticalHint' ) } </ Text >
918+ </ Space >
919+ )
920+ }
855921 case 'gridDeleteRow' :
856922 case 'gridDeleteCol' :
857923 case 'gridExpandRow' :
@@ -1183,7 +1249,7 @@ export default function RoninProCustomWorkflow({ onSendToFineProcess }: RoninPro
11831249 return null
11841250 }
11851251 } ,
1186- [ t , updateNodeParam , updateCustomRearrangeDimension , updateCustomRearrangeCell , fillRearrangeGridAutoSequence , fileItems ]
1252+ [ t , updateNodeParam , adjustStitchSlotCount , updateCustomRearrangeDimension , updateCustomRearrangeCell , fillRearrangeGridAutoSequence , fileItems ]
11871253 )
11881254
11891255 return (
0 commit comments