Browse Source

MOBILE-29490 【H5】10.4.80升级到10.4.90后,模板中有些内容显示不全

feature/big-screen
hades 4 years ago
parent
commit
d1108bf94a
  1. 21
      designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java
  2. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  3. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

21
designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java

@ -1,5 +1,8 @@
package com.fr.design.form.util;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.FormDesigner;
@ -8,6 +11,7 @@ import com.fr.design.mainframe.template.info.ComponentCreateOperate;
import com.fr.design.mainframe.template.info.ComponentDeleteOperate;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WFitLayout;
import java.awt.Container;
public class FormDesignerUtils {
@ -46,4 +50,21 @@ public class FormDesignerUtils {
jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentDeleteOperate(widget));
}
/**
* 判断当前UI组件是否在绝对画布块中
*
* @param xCreator
* @return
*/
public static boolean isInAbsoluteLayout(XCreator xCreator) {
Container parent = xCreator.getParent();
while (parent != null) {
if (parent instanceof XWAbsoluteLayout && !(parent instanceof XWAbsoluteBodyLayout)) {
return true;
}
parent = parent.getParent();
}
return false;
}
}

14
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -24,6 +24,7 @@ import com.fr.design.mainframe.mobile.ui.MobileCollapsedStylePane;
import com.fr.design.mainframe.mobile.ui.MobileComboBoxDialogEditor;
import com.fr.form.ui.BaseChartEditor;
import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.mobile.MobileCollapsedStyle;
import javax.swing.BorderFactory;
@ -202,8 +203,19 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
this.mobileCollapsedStyleEditor.setStyle(style);
this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork());
fix(style);
}
/**
* 根据组件当前位置修正下属性
*
* @param style
*/
private void fix(MobileCollapsedStyle style) {
style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator));
}
@Override
public void update() {
ChartMobileAttrProvider mobileAttr = ((BaseChartEditor)xCreator.toData()).getMobileAttr();
@ -219,7 +231,7 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle();
if (style != null) {
((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style);
style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom());
style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator));
}
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
}

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java

@ -177,6 +177,16 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane {
this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated());
this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle());
this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork());
fix(elementCaseEditor.getMobileCollapsedStyle());
}
/**
* 根据组件当前位置修正下属性
*
* @param style
*/
private void fix(MobileCollapsedStyle style) {
style.setCollapsedWork(!FormDesignerUtils.isInAbsoluteLayout(xCreator));
}
@Override
@ -207,7 +217,7 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane {
}
MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle();
if (style != null) {
style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom());
style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator));
((ElementCaseEditor) xCreator.toData()).setMobileCollapsedStyle(style);
}
}

Loading…
Cancel
Save