diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 2b7677f5c0..3434e1ae36 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -26,6 +26,8 @@ var initParams = Pool.data.getInitParams(); var align = Pool.data.getAlign(); + var insert_param; + var getDimensionIds = function (params) { var result = []; var paramGroup = params.split("|"); @@ -88,7 +90,13 @@ {type: "bi.rich_editor_color_chooser"}, {type: "bi.rich_editor_align_left_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) { @@ -119,27 +127,11 @@ }; 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(); - if (addition) { - // todo 暂时先处理成在content后加一行 - content += '

' + editorService.getEditorParamImage(addition) + '

'; + if (addition && insert_param) { + insert_param.selectedParam(addition); } - - rich_editor.editor.bindToolbar(rich_editor.bar); - - rich_editor.setValue({ - content: content, - isAuto: isAuto, - dimensionIds: getDimensionIds(params) - }); - - rich_editor.setFocus(); }; Pool.update = function () { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js index 7cf11f9ce9..2db38878c7 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js @@ -54,6 +54,7 @@ type: "bi.combo", direction: "bottom,left", isNeedAdjustWidth: true, + invisible: true, el: { type: "bi.vertical_adapt", items: [{ @@ -99,6 +100,11 @@ _getInstance: function () { 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); } });