From eb51b5e1e270aabea02b6b18e21b8256b354469c Mon Sep 17 00:00:00 2001 From: "mario.gk" Date: Thu, 10 Sep 2020 15:57:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20defaultFixed?= =?UTF-8?q?=EF=BC=8C=E9=9D=A2=E6=9D=BF=E5=8F=AF=E9=BB=98=E8=AE=A4=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor-preset-vision/src/panes.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/editor-preset-vision/src/panes.ts b/packages/editor-preset-vision/src/panes.ts index 592e1f7c2..9aebd421f 100644 --- a/packages/editor-preset-vision/src/panes.ts +++ b/packages/editor-preset-vision/src/panes.ts @@ -47,6 +47,8 @@ export interface OldPaneConfig { index?: number; // todo isAction?: boolean; // as normal dock fullScreen?: boolean; // todo + canSetFixed?: boolean; // 是否可以设置固定模式 + defaultFixed?: boolean; // 是否默认固定 } function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: string } { @@ -68,7 +70,19 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin newConfig.type = 'PanelDock'; newConfig.area = 'left'; newConfig.props.description = description || title; - const { contents, hideTitleBar, tip, width, maxWidth, height, maxHeight, menu, isAction, canSetFixed } = config; + const { + contents, + hideTitleBar, + tip, + width, + maxWidth, + height, + maxHeight, + menu, + isAction, + canSetFixed, + defaultFixed, + } = config; if (menu) { newConfig.props.title = menu; } @@ -88,6 +102,10 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin onDestroy: destroy, }; + if (defaultFixed) { + newConfig.panelProps.area = 'leftFixedArea'; + } + if (contents && Array.isArray(contents)) { newConfig.content = contents.map(({ title, content, tip }, index) => { return {