File tree 1 file changed +14
-2
lines changed
client/packages/lowcoder/src/comps/queries
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 {
773
773
if ( ! originQuery ) {
774
774
return ;
775
775
}
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
+
776
788
const newQueryName = this . genNewName ( editorState ) ;
777
789
const id = genQueryId ( ) ;
778
790
this . dispatch (
779
791
wrapActionExtraInfo (
780
792
this . pushAction ( {
781
- ...originQuery . toJsonValue ( ) ,
793
+ ...jsonData ,
782
794
id : id ,
783
795
name : newQueryName ,
784
796
isNewCreate : true ,
@@ -789,7 +801,7 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
789
801
{
790
802
type : "add" ,
791
803
compName : name ,
792
- compType : originQuery . children . compType . getView ( ) ,
804
+ compType : jsonData . compType ,
793
805
} ,
794
806
] ,
795
807
}
You can’t perform that action at this time.
0 commit comments