Browse Source

Pull request #2418: CHART-15947 修改富文本编辑器参数显示

Merge in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit '00605f74f8592c000e0196767cb86f328ebaef0f':
  CHART-15947 修改富文本编辑器参数显示
feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
cc3bc62312
  1. 14
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  2. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.model.js

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

@ -107,6 +107,16 @@
_cleanHtml: function (value) { _cleanHtml: function (value) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var dimensionIds = this.options.dimensionIds;
var dataIdMap = {};
for (var i = 0, len = dimensionIds.length; i < len; i++) {
var dimensionId = dimensionIds[i];
var key = BI.keys(dimensionId)[0];
dataIdMap[key] = dimensionId[key];
}
var result = BI.replaceAll(value, "<p></p>", ""); var result = BI.replaceAll(value, "<p></p>", "");
// 去掉image的src属性,因为数据太大了 // 去掉image的src属性,因为数据太大了
result = value.replaceAll("<img.*?>", function (imageStr) { result = value.replaceAll("<img.*?>", function (imageStr) {
@ -117,6 +127,10 @@
return; return;
} }
str += " " + key + "=\"" + value + "\""; str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value]) {
str += " " + "data-id" + "=\"" + dataIdMap[value] + "\"";
}
}); });
return str + " />"; return str + " />";

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

@ -21,7 +21,7 @@
return { return {
type: "bi.design.chart.common.editor.search", type: "bi.design.chart.common.editor.search",
text: key, text: key,
value: dId[key] value: key
}; };
}); });
} }

Loading…
Cancel
Save