Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1aa2cb0

Browse files
committed
check variable name duplication when duplicating the query
1 parent041aef5 commit1aa2cb0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

‎client/packages/lowcoder/src/comps/queries/queryComp.tsx‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,12 +773,24 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp {
773773
if(!originQuery){
774774
return;
775775
}
776+
777+
constjsonData=originQuery.toJsonValue();
778+
//Regenerate variable header
779+
jsonData.variables?.variables?.forEach(kv=>{
780+
const[prefix,_]=(kv.keyasstring).split(/(?=\d+$)/);
781+
leti=2,newName="";
782+
do{
783+
newName=prefix+(i++);
784+
}while(editorState.checkRename("",newName));
785+
kv.key=newName;
786+
})
787+
776788
constnewQueryName=this.genNewName(editorState);
777789
constid=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
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp