提交 315e88da 编写于 作者: tony001's avatar tony001

update:更新

上级 98cc5c9c
...@@ -437,26 +437,30 @@ export class PanelDetailModel { ...@@ -437,26 +437,30 @@ export class PanelDetailModel {
*/ */
protected getBoxLayOutStyle() { protected getBoxLayOutStyle() {
const boxStyle = {}; const boxStyle = {};
// 识别FLEX
if (this.layout == 'FLEX') {
Object.assign(boxStyle, { 'flex-grow': this.flexGrow ? this.flexGrow : 0 });
}
// 识别SIMPLEFLEX
if (this.layout == 'SIMPLEFLEX') {
if (this.flexGrow) {
Object.assign(boxStyle, { 'width': `${(100 / 12) * this.flexGrow}%`, 'height': '100%' });
} else {
// 简单FLEX布局自适应
Object.assign(boxStyle, { 'flex-grow': 1, 'min-width': `${(100 / 12)}%`, 'height': '100%' });
}
}
if (this.parentName && this.panel) { if (this.parentName && this.panel) {
const parentItem = this.panel.layoutModelDetails[this.parentName]; const parentItem = this.panel.layoutModelDetails[this.parentName];
// 当前项兄弟项个数大于1且本身设置宽或者高默认不占满 // 识别父FLEX
if (parentItem && parentItem.details && parentItem.details.length > 1) { if (parentItem.layout == 'FLEX') {
const boxSizeStyle: any = this.getBoxSizeStyle(); Object.assign(boxStyle, { 'display': 'contents' });
if (boxSizeStyle && Object.keys(boxSizeStyle).length > 0) { Object.assign(boxStyle, { 'flex-grow': this.flexGrow ? this.flexGrow : 0 });
Object.assign(boxStyle, { 'flex-grow': 0 }); }
// 识别SIMPLEFLEX
else if (parentItem.layout == 'SIMPLEFLEX') {
// SIMPLEFLEX 按照内容撑大小
Object.assign(boxStyle, { 'flex-grow': 0 });
if (this.flexGrow !== -1) {
Object.assign(boxStyle, { 'width': `${(100 / 12) * this.flexGrow}%`, 'height': '100%' });
} else {
// 简单FLEX布局自适应
Object.assign(boxStyle, { 'flex-grow': 1, 'min-width': `${(100 / 12)}%`, 'height': '100%' });
}
} else {
// 当前项兄弟项个数大于1且本身设置宽或者高默认不占满
if (parentItem && parentItem.details && parentItem.details.length > 1) {
const boxSizeStyle: any = this.getBoxSizeStyle();
if (boxSizeStyle && Object.keys(boxSizeStyle).length > 0) {
Object.assign(boxStyle, { 'flex-grow': 0 });
}
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册