Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
Yvan 4 years ago
parent
commit
a38a98c099
  1. 2
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  2. 14
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  3. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js
  4. 21
      designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java
  5. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  6. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ElementCaseDefinePane.java
  7. 10
      designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java

2
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -37,7 +37,7 @@ public interface UIConstants {
public static final Image APPFIT_H3 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H3.png");
public static final Image APPFIT_H4 = IOUtils.readImage("/com/fr/design/images/dialog/appfit/H4.png");
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 0, 0, 0);
public static final Border CELL_ATTR_ZEROBORDER = BorderFactory.createEmptyBorder(0, 1, 0, 0);
public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 0);
public static final Border CELL_ATTR_PRESENTBORDER = BorderFactory.createEmptyBorder(0, 5, 0, 0);
public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0, 10, 0, 15);

14
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -107,6 +107,16 @@
_cleanHtml: function (value) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var dimensionIds = this.options.dimensionIds;
var dataIdMap = {};
for (var i = 0, len = dimensionIds.length; i < len; i++) {
var dimensionId = dimensionIds[i];
var key = BI.keys(dimensionId)[0];
dataIdMap[key] = dimensionId[key];
}
var result = BI.replaceAll(value, "<p></p>", "");
// 去掉image的src属性,因为数据太大了
result = value.replaceAll("<img.*?>", function (imageStr) {
@ -117,6 +127,10 @@
return;
}
str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value]) {
str += " " + "data-id" + "=\"" + dataIdMap[value] + "\"";
}
});
return str + " />";

2
designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js

@ -21,7 +21,7 @@
return {
type: "bi.design.chart.common.editor.search",
text: key,
value: dId[key]
value: key
};
});
}

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;
@ -201,9 +202,20 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
this.mobileCollapsedStyleEditor.setStyle(style);
fix(style);
this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork());
}
/**
* 根据组件当前位置修正下属性
*
* @param style
*/
private void fix(MobileCollapsedStyle style) {
style.setCollapsedWork(style.isCollapsedWork() && !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

@ -176,9 +176,19 @@ public class ElementCaseDefinePane extends MobileWidgetDefinePane {
this.allowFullCheckBox.setSelected(elementCaseEditor.isAllowFullScreen());
this.functionalWhenUnactivatedCheckBox.setSelected(!elementCaseEditor.isFunctionalWhenUnactivated());
this.mobileCollapsedStyleEditor.setStyle(elementCaseEditor.getMobileCollapsedStyle());
fix(elementCaseEditor.getMobileCollapsedStyle());
this.mobileCollapsedStyleEditor.setSelected(elementCaseEditor.getMobileCollapsedStyle().isCollapsedWork());
}
/**
* 根据组件当前位置修正下属性
*
* @param style
*/
private void fix(MobileCollapsedStyle style) {
style.setCollapsedWork(style.isCollapsedWork() && !FormDesignerUtils.isInAbsoluteLayout(xCreator));
}
@Override
public void update() {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来
@ -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);
}
}

10
designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java

@ -3,6 +3,7 @@
*/
package com.fr.design.actions.cell.style;
import com.fr.stable.os.OperatingSystem;
import java.awt.Dimension;
import javax.swing.ComboBoxModel;
@ -49,6 +50,7 @@ public class ReportFontNameAction extends AbstractStyleAction {
public void setFontName(String fontName) {
Object object = this.getValue(UIComboBox.class.getName());
boolean find = false;
if (object != null && object instanceof UIComboBox) {
UIComboBox comboBox = (UIComboBox) object;
ComboBoxModel comboBoxModel = comboBox.getModel();
@ -60,9 +62,17 @@ public class ReportFontNameAction extends AbstractStyleAction {
comboBox.removeActionListener(this);
comboBox.setSelectedIndex(i);
comboBox.addActionListener(this);
find = true;
break;
}
}
// linux设计器下面 找不到默认就是第一个字体
boolean access = OperatingSystem.isLinux() && !find && comboBoxModel.getSize() > 0;
if (access) {
comboBox.removeActionListener(this);
comboBox.setSelectedIndex(0);
comboBox.addActionListener(this);
}
}
}

Loading…
Cancel
Save