mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
feat: 增加 defaultFixed,面板可默认固定
This commit is contained in:
parent
2e616e3767
commit
eb51b5e1e2
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user