File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
admin-ui/src/components/Flow Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -279,12 +279,11 @@ const NodePanel: React.FC<NodePanelProps> = (props) => {
279279 visible = { userSelectVisible }
280280 setVisible = { setUserSelectVisible }
281281 userSelectType = { "users" }
282- specifyUserIds = { [ ] }
282+ specifyUserIds = { GroovyScript . getOperatorUsers ( props . form . getFieldValue ( "operatorMatcher" ) ) }
283283 mode = { "multiple" }
284- onFinish = { ( values ) => {
285- const operatorMatcher = props . form . getFieldValue ( "operatorMatcher" ) ;
286- const script = operatorMatcher . replaceAll ( "%s" , values . map ( ( item :any ) => item . id ) . join ( "," ) ) ;
287- console . log ( script ) ;
284+ onFinish = { ( values ) => {
285+ setUserSelectVisible ( false ) ;
286+ const script = GroovyScript . specifyOperatorMatcher . replaceAll ( "%s" , values . map ( ( item : any ) => item . id ) . join ( "," ) ) ;
288287 props . form . setFieldsValue ( {
289288 operatorMatcher : script
290289 } ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,19 @@ class GroovyScript {
2020 }
2121 }
2222
23+
24+ static getOperatorUsers ( script :string ) {
25+ if ( script ) {
26+ const match = script . match ( / \[ ( [ \d , \s ] + ) \] / ) ;
27+ if ( match && match [ 1 ] ) {
28+ return match [ 1 ]
29+ . split ( ',' )
30+ . map ( num => parseInt ( num . trim ( ) , 10 ) ) ;
31+ }
32+ }
33+ return [ ] ;
34+ }
35+
2336 static errTriggerType ( errTrigger : string ) {
2437 if ( errTrigger === GroovyScript . defaultOutTrigger ) {
2538 return "default" ;
You can’t perform that action at this time.
0 commit comments