Browse Source

CHART-15947 修改富文本编辑器参数显示

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
1c9ead2a77
  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