Browse Source

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

bugfix/11.0
Yvan 3 years ago
parent
commit
42a314fb13
  1. 27
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java
  3. 27
      designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java

27
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -20,6 +20,33 @@
<script src="script/editor.service.js"></script> <script src="script/editor.service.js"></script>
<script> <script>
window.onload = function () { window.onload = function () {
BI.config("bi.constant.materials.rich_editor.font_size", function (items) {
return [
{
value: 9,
text: 9
},
{
value: 10,
text: 10
},
{
value: 11,
text: 11
},
].concat(items);
});
BI.config("bi.constant.materials.rich_editor.font_size_range", function (range) {
return {
MIN: 9,
MAX: 128
};
});
var content = Pool.data.getContent(); var content = Pool.data.getContent();
var isAuto = Pool.data.isAuto(); var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams(); var params = Pool.data.getParams();

4
designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

@ -273,9 +273,9 @@ public class CreateComponentAction extends UpdateAction {
XChartEditor chartEditor = (XChartEditor) body; XChartEditor chartEditor = (XChartEditor) body;
Dimension size = chartEditor.getSize(); Dimension size = chartEditor.getSize();
BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB);
Insets margin = chartEditor.getInsets();; Insets margin = chartEditor.getInsets();
chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin); chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin);
im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null); im.getGraphics().drawImage(chartImage, chartEditor.getX(), chartEditor.getY(), null);
} }
} }
return im; return im;

27
designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java

@ -3,15 +3,11 @@ package com.fr.design.mainframe.app;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
import com.fr.plugin.context.PluginMarker; import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.context.PluginMarkerAdapter; import com.fr.plugin.context.PluginMarkerAdapter;
import com.fr.plugin.engine.remote.PluginRemoteSync;
import com.fr.stable.TemplateIOErrorContextHolder; import com.fr.stable.TemplateIOErrorContextHolder;
import com.fr.third.guava.collect.Multimap; import com.fr.third.guava.collect.Multimap;
import org.easymock.EasyMock;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.modules.junit4.PowerMockRunner;
import java.util.Collection; import java.util.Collection;
@ -24,7 +20,6 @@ import java.util.HashSet;
* Created by vito on 2021/5/31 * Created by vito on 2021/5/31
*/ */
@RunWith(PowerMockRunner.class) @RunWith(PowerMockRunner.class)
@PrepareForTest({PluginRemoteSync.class})
public class DesignerAppUtilsTest { public class DesignerAppUtilsTest {
@Test @Test
public void testDealWithErrorDetailMultiLineAndCache() { public void testDealWithErrorDetailMultiLineAndCache() {
@ -62,17 +57,17 @@ public class DesignerAppUtilsTest {
@Test @Test
public void testRearrange() { public void testRearrange() {
// 远程插件模拟注册 // 远程插件模拟注册
PluginRemoteSync pluginRemoteSync = EasyMock.createMock(PluginRemoteSync.class); // PluginRemoteSync pluginRemoteSync = EasyMock.createMock(PluginRemoteSync.class);
EasyMock.expect(pluginRemoteSync.getPluginRemoteStatusByIdIndex()).andReturn(new HashMap<String, PluginRemoteSync.PluginStatus>(){{ // EasyMock.expect(pluginRemoteSync.getPluginRemoteStatusByIdIndex()).andReturn(new HashMap<String, PluginRemoteSync.PluginStatus>(){{
put("com.fr.plugin1", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin1","1",true).get()); // put("com.fr.plugin1", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin1","1",true).get());
put("com.fr.plugin2", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin2","1",true).get()); // put("com.fr.plugin2", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin2","1",true).get());
put("com.fr.plugin3", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin3","1",false).get()); // put("com.fr.plugin3", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin3","1",false).get());
put("com.fr.plugin4", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin4","1",false).get()); // put("com.fr.plugin4", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin4","1",false).get());
}}).anyTimes(); // }}).anyTimes();
EasyMock.replay(pluginRemoteSync); // EasyMock.replay(pluginRemoteSync);
PowerMock.mockStaticPartial(PluginRemoteSync.class, "getInstance"); // PowerMock.mockStaticPartial(PluginRemoteSync.class, "getInstance");
EasyMock.expect(PluginRemoteSync.getInstance()).andReturn(pluginRemoteSync).anyTimes(); // EasyMock.expect(PluginRemoteSync.getInstance()).andReturn(pluginRemoteSync).anyTimes();
PowerMock.replay(PluginRemoteSync.class); // PowerMock.replay(PluginRemoteSync.class);
// 本地插件模拟检查 // 本地插件模拟检查
TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap<String, String>() {{ TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap<String, String>() {{

Loading…
Cancel
Save