Browse Source

CHART-18139 调整富文本增加字段交互效果

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
becbf56312
  1. 30
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  2. 6
      designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js

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

@ -26,6 +26,8 @@
var initParams = Pool.data.getInitParams(); var initParams = Pool.data.getInitParams();
var align = Pool.data.getAlign(); var align = Pool.data.getAlign();
var insert_param;
var getDimensionIds = function (params) { var getDimensionIds = function (params) {
var result = []; var result = [];
var paramGroup = params.split("|"); var paramGroup = params.split("|");
@ -88,7 +90,13 @@
{type: "bi.rich_editor_color_chooser"}, {type: "bi.rich_editor_color_chooser"},
{type: "bi.rich_editor_align_left_button"}, {type: "bi.rich_editor_align_left_button"},
{type: "bi.rich_editor_align_center_button"}, {type: "bi.rich_editor_align_center_button"},
{type: "bi.rich_editor_align_right_button"} {type: "bi.rich_editor_align_right_button"},
{
type: "bi.design.chart.common.editor.insert_param",
ref: function (_ref) {
insert_param = _ref;
}
}
] ]
}, },
ref: function (_ref) { ref: function (_ref) {
@ -119,27 +127,11 @@
}; };
Pool.addField = function () { Pool.addField = function () {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var content = Pool.data.getContent();
var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams();
var addition = Pool.data.getAddition(); var addition = Pool.data.getAddition();
if (addition) { if (addition && insert_param) {
// todo 暂时先处理成在content后加一行 insert_param.selectedParam(addition);
content += '<p style="text-align:' + align + ';">' + editorService.getEditorParamImage(addition) + '<br></p>';
} }
rich_editor.editor.bindToolbar(rich_editor.bar);
rich_editor.setValue({
content: content,
isAuto: isAuto,
dimensionIds: getDimensionIds(params)
});
rich_editor.setFocus();
}; };
Pool.update = function () { Pool.update = function () {

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

@ -54,6 +54,7 @@
type: "bi.combo", type: "bi.combo",
direction: "bottom,left", direction: "bottom,left",
isNeedAdjustWidth: true, isNeedAdjustWidth: true,
invisible: true,
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
items: [{ items: [{
@ -99,6 +100,11 @@
_getInstance: function () { _getInstance: function () {
return this.options.editor.selectedInstance || this.options.editor.getInstance(); return this.options.editor.selectedInstance || this.options.editor.getInstance();
},
selectedParam: function (param) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
this.addParam(param, editorService.encode);
} }
}); });

Loading…
Cancel
Save