Commit 4172071b by liuyong

修改代码

1 parent 98ae7bbf
...@@ -24,13 +24,25 @@ const setIcon = function (itemIcon, dicys, color) { ...@@ -24,13 +24,25 @@ const setIcon = function (itemIcon, dicys, color) {
const rectTag = svgDocument.getElementsByTagName('rect')[0]; const rectTag = svgDocument.getElementsByTagName('rect')[0];
const pathTag = svgDocument.getElementsByTagName('path')[0]; const pathTag = svgDocument.getElementsByTagName('path')[0];
const ellipseTag = svgDocument.getElementsByTagName('ellipse')[0];
if(rectTag) { if(rectTag) {
rectTag.setAttribute('fill', color) if(color) {
rectTag.setAttribute('fill', color)
}
} }
if(pathTag) { if(pathTag) {
pathTag.setAttribute('fill', color) if(color) {
pathTag.setAttribute('fill', color)
}
} }
// svgTag.setAttribute('a_23a=', '测试'); if(ellipseTag) {
if(color) {
ellipseTag.setAttribute('fill', color)
}
}
svgTag.style.backgroundColor = 'transparent';
// svgTag.setAttribute('a_123', 'a_123'); // svgTag.setAttribute('a_123', 'a_123');
if(dicys && dicys.length > 0) { if(dicys && dicys.length > 0) {
...@@ -114,6 +126,12 @@ const leftCustomGraph = function(that) {//左侧自定义图形 ...@@ -114,6 +126,12 @@ const leftCustomGraph = function(that) {//左侧自定义图形
} }
} }
}) })
// const icons = result.data[1].eleDtos[2].icon;
// const item_icon = icons.split("base64,")[1];
// const decode_item_icon = (window.atob) ? atob(item_icon) : Base64.decode(item_icon);//svg解码,为字符串
// const svgDocument = new DOMParser().parseFromString(decode_item_icon, 'text/xml');//svg字符串转标签
// console.log(svgDocument)
}, },
error: function(error) { error: function(error) {
...@@ -137,6 +155,11 @@ const setGraphDefault = function(that) { ...@@ -137,6 +155,11 @@ const setGraphDefault = function(that) {
//设置画布只能预览 //设置画布只能预览
const setGraphOnlyView = function(graph) { const setGraphOnlyView = function(graph) {
graph.setEnabled(false); graph.setEnabled(false);
graph.setCellsEditable(false);
graph.setTooltips(false);
graph.setCellsSelectable(false);
graph.setConnectable(false);
graph.setCellsMovable(false);
graph.getCursorForCell = function(cell){//预览时鼠标悬浮到节点时,改变鼠标样式 graph.getCursorForCell = function(cell){//预览时鼠标悬浮到节点时,改变鼠标样式
if (cell != null && cell.value != null && cell.vertex ==1 ) if (cell != null && cell.value != null && cell.vertex ==1 )
{ {
......
...@@ -189,14 +189,8 @@ App = function(editor, container, lightbox) ...@@ -189,14 +189,8 @@ App = function(editor, container, lightbox)
leftCustomGraph(that); leftCustomGraph(that);
// var graph = this.editor.graph; // var graph = this.editor.graph;
// console.log(graph.setEnabled) // setGraphOnlyView(graph)
// graph.setEnabled(true);//设置画布只能预览
// graph.getCursorForCell = function(cell){//预览时鼠标悬浮到节点时,改变鼠标样式
// if (cell != null && cell.value != null && cell.vertex ==1 )
// {
// return 'pointer';
// }
// };
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!