diff --git a/client/packages/lowcoder/src/comps/queries/queryComp.tsx b/client/packages/lowcoder/src/comps/queries/queryComp.tsx index 066b351fe..31e101b85 100644 --- a/client/packages/lowcoder/src/comps/queries/queryComp.tsx +++ b/client/packages/lowcoder/src/comps/queries/queryComp.tsx @@ -777,13 +777,15 @@ class QueryListComp extends QueryListTmpComp implements BottomResListComp { const jsonData = originQuery.toJsonValue(); //Regenerate variable header + const newKeys:string[] = []; jsonData.variables?.variables?.forEach(kv => { const [prefix, _] = (kv.key as string).split(/(?=\d+$)/); let i=1, newName = ""; do { newName = prefix + (i++); - } while(editorState.checkRename("", newName)); + } while(editorState.checkRename("", newName) || newKeys.includes(newName)); kv.key = newName; + newKeys.push(newName); }) const newQueryName = this.genNewName(editorState);