Browse Source

Merge pull request #2946 in DESIGN/design from feature/10.0 to research/10.0

* commit 'd44b478d4b9146498f2cee78596ad01fb88dc948':
  CHART-16853 处理富文本国际化
  增加空判断
  CHART-16853 处理富文本国际化
  REPORT-41512 存储过程返回多个数据集在fr中调用只能返回一个
research/10.0
superman 4 years ago
parent
commit
14966c10c2
  1. 18
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  2. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  3. 19
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  4. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  5. 6
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js
  6. 15
      designer-chart/src/main/resources/com/fr/design/editor/script/enums.js
  7. 123
      designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js

18
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator;
import com.fr.design.actions.UpdateAction;
@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true);
sp.creatDataModel(Calculator.createCalculator());
ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false);
sp.refreshDataModelListAndResultNames(dataModels);
return null;
}

20
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -1,7 +1,9 @@
package com.fr.van.chart.designer.component;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ui.ModernUIPane;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.type.TextAlign;
@ -11,6 +13,7 @@ import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -63,6 +66,11 @@ public class VanChartRichEditorPane {
browser = event.getBrowser();
browser.getCacheStorage().clearCache();
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/fineui.min.js"));
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/design/editor/script/i18n.js"));
browser.executeJavaScript(generateTransformI18nJS());
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js"));
JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, model);
}
@ -110,6 +118,18 @@ public class VanChartRichEditorPane {
return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align);
}
public static String generateTransformI18nJS() {
String language = "zh_CN";
Locale locale = DesignerEnvManager.getEnvManager().getLanguage();
if (locale != null) {
language = locale.toString();
}
return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());";
}
public static class RichEditorModel {
private String content = StringUtils.EMPTY;
private boolean auto = true;

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

@ -5,26 +5,9 @@
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="./rich_editor.css"/>
<script src="http://fanruan.design/fineui/2.0/fineui.js"></script>
<script src="https://fanruan.design/fineui/materials.bundle.min.js"></script>
</head>
<body>
<script>
BICst.RICH_TEXT_INFO = {
DATA_ID: "data-id",
DATA_NAME: "data-name",
DATA_FULL_NAME: "data-full-name",
DATA_ORIGIN_ID: "data-origin-id",
DATA_ORIGIN_NAME: "data-origin-name",
DATA_ORIGIN_FULL_NAME: "data-origin-full-name",
DATA_IS_INSERT_PARAM: "data-is-insert-param",
DATA_IS_MISSING_FIELD: "data-is-missing-field",
DATA_UN_VALID: "data-unvalid",
NAME: "name",
ALT: "alt",
SRC: "src"
};
</script>
<script src="script/enums.js"></script>
<script src="script/insertcombo/item/item.js"></script>
<script src="script/insertcombo/combo.insert_param.js"></script>
<script src="script/insertcombo/combo.insert_param.model.js"></script>

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

@ -52,7 +52,7 @@
type: "bi.htape",
items: [{
type: "bi.label",
text: "字体样式: ",
text: BI.i18nText("BI-Design_Font_Style") + ": ",
textAlign: "left",
width: 70
}, {

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

@ -17,8 +17,9 @@
fontStyleItems: function () {
return [{
type: "bi.single_select_radio_item",
text: "自动",
text: BI.i18nText("BI-Basic_Auto"),
hgap: 5,
width: 50,
logic: {
dynamic: true
},
@ -26,8 +27,9 @@
selected: this.options.isAuto
}, {
type: "bi.single_select_radio_item",
text: "自定义",
text: BI.i18nText("BI-Basic_Custom"),
hgap: 5,
width: 60,
logic: {
dynamic: true
},

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

@ -0,0 +1,15 @@
window.BICst = window.BICst || {};
BICst.RICH_TEXT_INFO = {
DATA_ID: "data-id",
DATA_NAME: "data-name",
DATA_FULL_NAME: "data-full-name",
DATA_ORIGIN_ID: "data-origin-id",
DATA_ORIGIN_NAME: "data-origin-name",
DATA_ORIGIN_FULL_NAME: "data-origin-full-name",
DATA_IS_INSERT_PARAM: "data-is-insert-param",
DATA_IS_MISSING_FIELD: "data-is-missing-field",
DATA_UN_VALID: "data-unvalid",
NAME: "name",
ALT: "alt",
SRC: "src"
};

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

@ -0,0 +1,123 @@
!(function () {
var chinese = {
"BI-Design_Font_Style": "字体样式",
"BI-Font_Size": "字号",
"BI-Basic_Auto": "自动",
"BI-Basic_Custom": "自定义",
"BI-Basic_Default": "默认",
"BI-Basic_Sim_Hei": "黑体",
"BI-Basic_Sim_Sun": "宋体",
"BI-Basic_Fang_Song": "仿宋",
"BI-Basic_Kai_Ti": "楷体",
"BI-Basic_Bold": "加粗",
"BI-Basic_Italic": "斜体",
"BI-Basic_Underline": "下划线",
"BI-Basic_Font_Color": "文字颜色",
"BI-Word_Align_Left": "文字居左",
"BI-Word_Align_Center": "文字居中",
"BI-Word_Align_Right": "文字居右"
};
var taiwan = {
"BI-Design_Font_Style": "字體樣式",
"BI-Font_Size": "字號",
"BI-Basic_Auto": "自動",
"BI-Basic_Custom": "自定義",
"BI-Basic_Default": "默認",
"BI-Basic_Sim_Hei": "黑體",
"BI-Basic_Sim_Sun": "宋體",
"BI-Basic_Fang_Song": "仿宋",
"BI-Basic_Kai_Ti": "楷體",
"BI-Basic_Bold": "加粗",
"BI-Basic_Italic": "斜體",
"BI-Basic_Underline": "下劃線",
"BI-Basic_Font_Color": "文字顏色",
"BI-Word_Align_Left": "文字居左",
"BI-Word_Align_Center": "文字居中",
"BI-Word_Align_Right": "文字居右"
};
var english = {
"BI-Design_Font_Style": "Font style",
"BI-Font_Size": "Font size",
"BI-Basic_Auto": "auto",
"BI-Basic_Custom": "custom",
"BI-Basic_Default": "default",
"BI-Basic_Sim_Hei": "Sim_Hei",
"BI-Basic_Sim_Sun": "Sim_Sun",
"BI-Basic_Fang_Song": "Fang_Song",
"BI-Basic_Kai_Ti": "Kai_Ti",
"BI-Basic_Bold": "Bold",
"BI-Basic_Italic": "Italic",
"BI-Basic_Underline": "UnderLine",
"BI-Basic_Font_Color": "Font Color",
"BI-Word_Align_Left": "Align Left",
"BI-Word_Align_Center": "Align Center",
"BI-Word_Align_Right": "Align Right"
};
var japanese = {
"BI-Design_Font_Style": "フォントスタイル",
"BI-Font_Size": "フォントサイズ",
"BI-Basic_Auto": "自動",
"BI-Basic_Custom": "カスタマイズ",
"BI-Basic_Default": "デフォルト",
"BI-Basic_Sim_Hei": "黒い体",
"BI-Basic_Sim_Sun": "ソンティ",
"BI-Basic_Fang_Song": "イミテーションソング",
"BI-Basic_Kai_Ti": "イタリック",
"BI-Basic_Bold": "大胆な",
"BI-Basic_Italic": "イタリック",
"BI-Basic_Underline": "アンダースコア",
"BI-Basic_Font_Color": "テキストの色",
"BI-Word_Align_Left": "左のテキスト",
"BI-Word_Align_Center": "テキスト中心",
"BI-Word_Align_Right": "右のテキスト"
};
var korean = {
"BI-Design_Font_Style": "글꼴 스타일",
"BI-Font_Size": "글꼴 크기",
"BI-Basic_Auto": "자동적 인",
"BI-Basic_Custom": "맞춤 설정",
"BI-Basic_Default": "기본",
"BI-Basic_Sim_Hei": "블랙 바디",
"BI-Basic_Sim_Sun": "송티",
"BI-Basic_Fang_Song": "모조 노래",
"BI-Basic_Kai_Ti": "기울임 꼴",
"BI-Basic_Bold": "굵게",
"BI-Basic_Italic": "이탤릭체",
"BI-Basic_Underline": "밑줄",
"BI-Basic_Font_Color": "텍스트 색상",
"BI-Word_Align_Left": "왼쪽 텍스트",
"BI-Word_Align_Center": "텍스트 중심",
"BI-Word_Align_Right": "오른쪽 텍스트"
};
function transformI18n(language) {
var BI = window.BI;
if (BI == null) {
return;
}
if (language == null) {
BI.addI18n(chinese);
}
if (language.indexOf('zh_TW') > -1) {
BI.addI18n(taiwan);
} else if (language.indexOf('en_US') > -1) {
BI.addI18n(english);
} else if (language.indexOf('ja_JP') > -1) {
BI.addI18n(japanese);
} else if (language.indexOf('ko_KR') > -1) {
BI.addI18n(korean);
} else {
BI.addI18n(chinese);
}
}
window.transformI18n = transformI18n;
}());
Loading…
Cancel
Save