mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 22:58:15 +00:00
feat: 增加 defaultFixed,面板可默认固定
This commit is contained in:
parent
2e616e3767
commit
eb51b5e1e2
@ -47,6 +47,8 @@ export interface OldPaneConfig {
|
|||||||
index?: number; // todo
|
index?: number; // todo
|
||||||
isAction?: boolean; // as normal dock
|
isAction?: boolean; // as normal dock
|
||||||
fullScreen?: boolean; // todo
|
fullScreen?: boolean; // todo
|
||||||
|
canSetFixed?: boolean; // 是否可以设置固定模式
|
||||||
|
defaultFixed?: boolean; // 是否默认固定
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: string } {
|
function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: string } {
|
||||||
@ -68,7 +70,19 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
newConfig.type = 'PanelDock';
|
newConfig.type = 'PanelDock';
|
||||||
newConfig.area = 'left';
|
newConfig.area = 'left';
|
||||||
newConfig.props.description = description || title;
|
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) {
|
if (menu) {
|
||||||
newConfig.props.title = menu;
|
newConfig.props.title = menu;
|
||||||
}
|
}
|
||||||
@ -88,6 +102,10 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
onDestroy: destroy,
|
onDestroy: destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (defaultFixed) {
|
||||||
|
newConfig.panelProps.area = 'leftFixedArea';
|
||||||
|
}
|
||||||
|
|
||||||
if (contents && Array.isArray(contents)) {
|
if (contents && Array.isArray(contents)) {
|
||||||
newConfig.content = contents.map(({ title, content, tip }, index) => {
|
newConfig.content = contents.map(({ title, content, tip }, index) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user