From 09dcec30b3dd032500d42a014c267b2549286ace Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 24 Oct 2024 17:00:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=BF=83=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledata/datacenter/DCTableDataPane.java | 30 ++++++++++++++----- .../com/fr/design/jxbrowser/JxUIPane.java | 4 ++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java index c5950ae57d..61cf5aefbe 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataPane.java @@ -9,6 +9,7 @@ import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.i18n.Toolkit; import com.fr.design.jxbrowser.JxEngine; import com.fr.design.jxbrowser.JxUIPane; +import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.json.revise.EmbedJson; import com.fr.stable.StringUtils; import com.fr.third.guava.collect.ImmutableMap; @@ -36,6 +37,7 @@ public class DCTableDataPane extends AbstractTableDataPane { private static final String DATA_CENTER_HELPER = "dcHelper"; private static final String DATA_CENTER_INJECT_URL = "fineServletURL"; private static final String DC_INDEX_HTML = "com/fr/design/data/tabledata/datacenter/web/data-choose.prod.html"; + private static final String DATACENTERS_URL = System.getProperty("devMode.datacenters.url"); private final JxUIPane dataCenterJxUIPane; private final JxTableDataNamePane namePane = new JxTableDataNamePane(this); // 用于复制粘贴场景 @@ -62,13 +64,22 @@ public class DCTableDataPane extends AbstractTableDataPane { } private static JxUIPane getJxUIPane() { - - return new JxUIPane.Builder() - .engine(JX_ENGINE) - .namespace(DATA_CENTER) - .bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge) - .withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())) - .build(); + if (DesignerUIModeConfig.getInstance().isUIDevMode() + && StringUtils.isNotBlank(DATACENTERS_URL)) { + return new JxUIPane.Builder() + .engine(JX_ENGINE) + .namespace(DATA_CENTER) + .bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge) + .withURL(DATACENTERS_URL, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())) + .build(); + } else { + return new JxUIPane.Builder() + .engine(JX_ENGINE) + .namespace(DATA_CENTER) + .bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge) + .withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())) + .build(); + } } private static String getDatacentersUrl() { @@ -96,7 +107,10 @@ public class DCTableDataPane extends AbstractTableDataPane { } private void reload() { - dataCenterJxUIPane.redirect(EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML, + dataCenterJxUIPane.redirect( + DesignerUIModeConfig.getInstance().isUIDevMode() && StringUtils.isNotBlank(DATACENTERS_URL) + ? DATACENTERS_URL + : EMB_TAG + SCHEME_HEADER + DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())); } diff --git a/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java b/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java index a40a11e3bc..8de367df08 100644 --- a/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java +++ b/designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java @@ -6,6 +6,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.ui.ModernUIConstants; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; @@ -99,7 +100,8 @@ public class JxUIPane extends BasicPane { * 按需初始化debug界面UI */ private void initDebugIfNeeded() { - if (DesignerEnvManager.getEnvManager().isOpenDebug()) { + if (DesignerEnvManager.getEnvManager().isOpenDebug() + || DesignerUIModeConfig.getInstance().isUIDevMode()) { UIToolbar toolbar = new UIToolbar(); add(toolbar, BorderLayout.NORTH); UIButton openDebugButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Open_Debug_Window"));