@@ -91,6 +91,7 @@ export interface EoWorkbenchLayoutV2Props {
9191 } ;
9292 componentList ?: Item [ ] ;
9393 isEdit ?: boolean ;
94+ showSettingButton ?: boolean ;
9495}
9596
9697export interface EoWorkbenchLayoutV2ComponentRef {
@@ -103,6 +104,7 @@ export interface EoWorkbenchLayoutV2ComponentProps
103104 onSave ?: ( layout : Layout [ ] ) => void ;
104105 onCancel ?: ( ) => void ;
105106 onActionClick ?: ( action : SimpleAction , layouts : Layout [ ] ) => void ;
107+ onSetting ?: ( ) => void ;
106108}
107109
108110const getRealKey = ( key : string ) : string =>
@@ -119,10 +121,12 @@ export const EoWorkbenchLayoutComponent = forwardRef<
119121 toolbarBricks,
120122 componentList = [ ] ,
121123 isEdit,
124+ showSettingButton,
122125 onChange,
123126 onSave,
124127 onCancel,
125128 onActionClick,
129+ onSetting,
126130 } ,
127131 ref
128132) {
@@ -263,6 +267,10 @@ export const EoWorkbenchLayoutComponent = forwardRef<
263267 ) ;
264268 } , [ layouts , onSave ] ) ;
265269
270+ const handleSetting = ( ) => {
271+ onSetting ?.( ) ;
272+ } ;
273+
266274 const handleCancel = ( ) => {
267275 onCancel ?.( ) ;
268276 } ;
@@ -412,6 +420,14 @@ export const EoWorkbenchLayoutComponent = forwardRef<
412420 保存
413421 </ WrappedButton >
414422 < WrappedButton onClick = { handleCancel } > 取消</ WrappedButton >
423+ { showSettingButton && (
424+ < WrappedButton
425+ data-testid = "setting-button"
426+ onClick = { handleSetting }
427+ >
428+ 设置
429+ </ WrappedButton >
430+ ) }
415431 < WrappedDropdownButton
416432 btnText = "更多"
417433 icon = { {
@@ -487,6 +503,13 @@ class EoWorkbenchLayoutV2 extends ReactNextElement {
487503 attribute : false ,
488504 } )
489505 accessor componentList : Item [ ] | undefined ;
506+ /**
507+ * description: 用于设置页面样式和布局的按钮
508+ */
509+ @property ( {
510+ type : Boolean ,
511+ } )
512+ accessor showSettingButton : boolean | undefined ;
490513
491514 @event ( {
492515 type : "change" ,
@@ -515,6 +538,14 @@ class EoWorkbenchLayoutV2 extends ReactNextElement {
515538 this . #cancelEvent. emit ( ) ;
516539 } ;
517540
541+ @event ( {
542+ type : "setting" ,
543+ } )
544+ accessor #settingEvent! : EventEmitter < void > ;
545+ #handleSetting = ( ) => {
546+ this . #settingEvent. emit ( ) ;
547+ } ;
548+
518549 /**
519550 * 操作点击事件
520551 * @detail {
@@ -557,11 +588,13 @@ class EoWorkbenchLayoutV2 extends ReactNextElement {
557588 layouts = { this . layouts }
558589 toolbarBricks = { this . toolbarBricks }
559590 componentList = { this . componentList }
591+ showSettingButton = { this . showSettingButton }
560592 isEdit = { this . isEdit }
561593 onChange = { this . #handleChange}
562594 onSave = { this . #handleSave}
563595 onCancel = { this . #handleCancel}
564596 onActionClick = { this . #handleActionClick}
597+ onSetting = { this . #handleSetting}
565598 ref = { this . #componentRef}
566599 />
567600 ) ;
0 commit comments