|
|
|
@ -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<DCTableData> {
|
|
|
|
|
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<String> dataCenterJxUIPane; |
|
|
|
|
private final JxTableDataNamePane namePane = new JxTableDataNamePane(this); |
|
|
|
|
// 用于复制粘贴场景
|
|
|
|
@ -62,7 +64,15 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static JxUIPane<String> getJxUIPane() { |
|
|
|
|
|
|
|
|
|
if (DesignerUIModeConfig.getInstance().isUIDevMode() |
|
|
|
|
&& StringUtils.isNotBlank(DATACENTERS_URL)) { |
|
|
|
|
return new JxUIPane.Builder<String>() |
|
|
|
|
.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<String>() |
|
|
|
|
.engine(JX_ENGINE) |
|
|
|
|
.namespace(DATA_CENTER) |
|
|
|
@ -70,6 +80,7 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
.withEMB(DC_INDEX_HTML, ImmutableMap.of(DATA_CENTER_INJECT_URL, getDatacentersUrl())) |
|
|
|
|
.build(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static String getDatacentersUrl() { |
|
|
|
|
if (!WorkContext.getCurrent().isLocal()) { |
|
|
|
@ -96,7 +107,10 @@ public class DCTableDataPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|