提交 4a328e1b 编写于 作者: Shine-zwj's avatar Shine-zwj

更新:多数据容器

上级 80c4f608
......@@ -141,10 +141,13 @@ export class PanelContainerModel extends PanelDetailModel {
this.data = this.panel.data;
}
} else {
const parentItem = this.panel.layoutModelDetails[this.parentName];
let parentItem = this.panel.layoutModelDetails[`${this.parentName}_${this.index}`];
if (!parentItem) {
parentItem = this.panel.layoutModelDetails[this.parentName];
}
if (parentItem) {
if (parentItem.dataRegionType === 'MULTIDATA' && parentItem['data'] && parentItem['data'].length > 0) {
this.data = parentItem.getData()[this.getIndex()];
this.data = parentItem.getData()[this.getIndex()];
} else {
this.data = parentItem.getData();
}
......
......@@ -440,26 +440,28 @@ export class PanelDetailModel {
if (this.parentName && this.panel) {
const parentItem = this.panel.layoutModelDetails[this.parentName];
// 识别父FLEX
if (parentItem.layout == 'FLEX') {
Object.assign(boxStyle, { 'display': 'contents' });
Object.assign(boxStyle, { 'flex-grow': this.flexGrow ? this.flexGrow : 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%' });
if (parentItem) {
if (parentItem.layout == 'FLEX') {
Object.assign(boxStyle, { 'display': 'contents' });
Object.assign(boxStyle, { 'flex-grow': this.flexGrow ? this.flexGrow : 0 });
}
} 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 });
// 识别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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册