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

Commiteb2c7cb

Browse files
authored
Merge pull request#444 from Nangelov7/add-link-to-edit-module
Add link to edit module
2 parents2c3f5b5 +68980e6 commiteb2c7cb

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

‎client/packages/lowcoder-design/src/components/popover.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface EditPopoverProps extends PopoverProps {
122122
items?:EditPopoverItemType[];// FIXME: refactor props below into this structure
123123
addText?:string;
124124
add?:()=>void;
125+
edit?:()=>void;
125126
rename?:()=>void;
126127
copy?:()=>void;
127128
del?:()=>void;
@@ -134,6 +135,7 @@ const EditPopover = (props: EditPopoverProps) => {
134135
items,
135136
addText,
136137
add,
138+
edit,
137139
rename,
138140
copy,
139141
del,
@@ -193,6 +195,17 @@ const EditPopover = (props: EditPopoverProps) => {
193195
<HandleText>{addText||trans("addItem")}</HandleText>
194196
</Handle>
195197
)}
198+
{edit&&(
199+
<Handle
200+
onClick={(e)=>{
201+
e.stopPropagation();
202+
edit?.();
203+
hide();
204+
}}
205+
>
206+
<HandleText>{trans("edit")}</HandleText>
207+
</Handle>
208+
)}
196209
{copy&&(
197210
<Handle
198211
onClick={(e)=>{

‎client/packages/lowcoder/src/components/CompName.tsx‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,22 @@ export const CompName = (props: Iprops) => {
143143
style={{color:showSearch ?"#315EFB" :"#8B8FA3"}}
144144
/>
145145
)}
146-
<EditPopover
147-
items={items}
148-
del={()=>GridCompOperator.deleteComp(editorState,editorState.selectedComps())}
149-
>
150-
<IcontabIndex={-1}/>
151-
</EditPopover>
146+
{compType==="module" ?(
147+
<EditPopover
148+
items={items}
149+
edit={()=>GridCompOperator.editComp(editorState)}
150+
del={()=>GridCompOperator.deleteComp(editorState,editorState.selectedComps())}
151+
>
152+
<IcontabIndex={-1}/>
153+
</EditPopover>
154+
) :(
155+
<EditPopover
156+
items={items}
157+
del={()=>GridCompOperator.deleteComp(editorState,editorState.selectedComps())}
158+
>
159+
<IcontabIndex={-1}/>
160+
</EditPopover>
161+
)}
152162
</CompDiv>
153163
);
154164
return(

‎client/packages/lowcoder/src/comps/utils/gridCompOperator.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { CustomModal, messageInstance } from "lowcoder-design";
2727
import{pasteKey,undoKey}from"util/keyUtils";
2828
import{genRandomKey}from"./idGenerator";
2929
import{getLatestVersion,getRemoteCompType,parseCompType}from"./remote";
30+
import{APPLICATION_VIEW_URL}from"@lowcoder-ee/constants/routesURL";
3031

3132
exporttypeCopyCompType={
3233
layout:LayoutItem;
@@ -186,6 +187,12 @@ export class GridCompOperator {
186187
returntrue;
187188
}
188189

190+
staticeditComp(editorState:EditorState){
191+
constselectedComp=Object.values(editorState.selectedComps())[0];
192+
constapplicationId=selectedComp.children.comp.children.appId.value
193+
window.open(APPLICATION_VIEW_URL(applicationId,"edit"))
194+
}
195+
189196
staticcutComp(editorState:EditorState,compRecords:Record<string,Comp>){
190197
this.copyComp(editorState,compRecords)&&
191198
this.doDelete(editorState,compRecords)&&

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp