File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
client/packages/lowcoder/src/comps/queries Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -773,12 +773,24 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
773773 if ( ! originQuery ) {
774774 return ;
775775 }
776+
777+ const jsonData = originQuery . toJsonValue ( ) ;
778+ //Regenerate variable header
779+ jsonData . variables ?. variables ?. forEach ( kv => {
780+ const [ prefix , _ ] = ( kv . key as string ) . split ( / (? = \d + $ ) / ) ;
781+ let i = 2 , newName = "" ;
782+ do {
783+ newName = prefix + ( i ++ ) ;
784+ } while ( editorState . checkRename ( "" , newName ) ) ;
785+ kv . key = newName ;
786+ } )
787+
776788 const newQueryName = this . genNewName ( editorState ) ;
777789 const id = genQueryId ( ) ;
778790 this . dispatch (
779791 wrapActionExtraInfo (
780792 this . pushAction ( {
781- ...originQuery . toJsonValue ( ) ,
793+ ...jsonData ,
782794 id : id ,
783795 name : newQueryName ,
784796 isNewCreate : true ,
@@ -789,7 +801,7 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
789801 {
790802 type : "add" ,
791803 compName : name ,
792- compType : originQuery . children . compType . getView ( ) ,
804+ compType : jsonData . compType ,
793805 } ,
794806 ] ,
795807 }
You can’t perform that action at this time.
0 commit comments