Commit a80f8c69 by liuyong

修改架构图

1 parent 7aea9674
......@@ -54,7 +54,7 @@ const setIcon = function (itemIcon, dicys, color) {
svgTag.setAttribute('attr_'+item2.fieldName, 'attr_'+Base64.encode(item2.chineseName));
})
}
console.log(svgTag)
const svgToString = new XMLSerializer().serializeToString(svgDocument);//svg标签转化为字符串
const encode_item_icon = (window.btoa)? btoa(svgToString) : Base64.encode(svgToString);//base64编码
......
......@@ -58,7 +58,7 @@ const initAttributePanel = function(that) {
currentNode = obj;//文字节点转化为 object标签,属性label值为文字
}
var clone_currentNode = currentNode.cloneNode(false);
// console.log(currentNode)
console.log(currentNode)
const attr_name_array = Array.from($(".attrName"));
const attr_value_array = Array.from($(".attrValue"));
......@@ -91,6 +91,8 @@ const initAttributePanel = function(that) {
clone_currentNode.setAttribute(item.attrName, item.attrValue);
})
}
console.log(unique_attr_name_value)
graph.getModel().setValue(cell, clone_currentNode);//更新图形界面
});
......
......@@ -554,24 +554,26 @@ export default {
this.pager.size = result.data.size;
if(result.data.records.length > 0) {
result.data.records.map(item => {
const item_icon = item.icon.split("base64,")[1];
const decode_item_icon = window.atob(item_icon);//svg解码,为字符串
const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签
const path = svgDocument.getElementsByTagName('path')[0];
const rect = svgDocument.getElementsByTagName('rect')[0];
const ellipse = svgDocument.getElementsByTagName('ellipse')[0];
if(path) {
path.setAttribute('fill', item.color);
if(item.icon.includes("svg+xml")) {
const item_icon = item.icon.split("base64,")[1];
const decode_item_icon = window.atob(item_icon);//svg解码,为字符串
const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签
const path = svgDocument.getElementsByTagName('path')[0];
const rect = svgDocument.getElementsByTagName('rect')[0];
const ellipse = svgDocument.getElementsByTagName('ellipse')[0];
if(path) {
path.setAttribute('fill', item.color);
}
if(rect) {
rect.setAttribute('fill', item.color);
}
if(ellipse) {
ellipse.setAttribute('fill', item.color);
}
const svgToString = new XMLSerializer().serializeToString(svgDocument);//svg标签转化为字符串
const encode_item_icon = window.btoa(svgToString);//base64编码
item.icon = 'data:image/svg+xml;base64,'+ encode_item_icon;
}
if(rect) {
rect.setAttribute('fill', item.color);
}
if(ellipse) {
ellipse.setAttribute('fill', item.color);
}
const svgToString = new XMLSerializer().serializeToString(svgDocument);//svg标签转化为字符串
const encode_item_icon = window.btoa(svgToString);//base64编码
item.icon = 'data:image/svg+xml;base64,'+ encode_item_icon;
})
Promise.all([ this.get_dialog_select1(), this.get_dialog_select2() ]).then(res2 => {
this.dialog_select1 = res2[0];
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!