Commit 8937b9ce by liuyong

修改画布

1 parent db42011a
......@@ -41,6 +41,8 @@
{
const leftGraph = JSON.parse(localStorage.getItem('leftGraph'));
this.sidebarTitles = true;//勾选标签
leftGraph.forEach(item => {
let fns = [];
item.eleDtos.forEach(item2 => {
......
......@@ -186,9 +186,6 @@ App = function(editor, container, lightbox)
const that = this;
setGraphDefault(that);
// leftCustomGraph(that);
// var graph = this.editor.graph;
// setGraphOnlyView(graph)
};
......@@ -3736,6 +3733,9 @@ App.prototype.showSplash = function(force)
const that = this;
initDrawioGraph(that);
var graph = this.editor.graph;
setGraphOnlyView(graph);
}else if (!mxClient.IS_CHROMEAPP && (this.mode == null || force))
{
var rowLimit = (serviceCount == 4) ? 2 : 3;
......@@ -5144,6 +5144,7 @@ App.prototype.fileCreated = function(file, libs, replace, done, clibs, success)
*/
App.prototype.loadFile = function(id, sameWindow, file, success, force)
{
if (urlParams['openInSameWin'] == '1' || navigator.standalone)
{
sameWindow = true;
......@@ -5524,7 +5525,7 @@ App.prototype.loadFile = function(id, sameWindow, file, success, force)
});
var currentFile = this.getCurrentFile();
var fn = mxUtils.bind(this, function()
{
if (force || currentFile == null || !currentFile.isModified())
......@@ -7300,7 +7301,9 @@ App.prototype.updateHeader = function()
}), 0);
}
}
const that = this;
exToolbar(this.toolbarContainer);
backGraph(that, this.toolbarContainer)
}
};
......
......@@ -10569,6 +10569,9 @@
this.addMenuItems(menu, ['-', 'addToScratchpad'], null, evt);
}
const that = this;
lookCurrentDetailsMenu(that, graph, menu, evt);
if (graph.isSelectionEmpty() && Editor.currentTheme == 'simple')
{
this.addMenuItems(menu, ['-', 'exitGroup', 'home'], null, evt);
......
......@@ -3309,6 +3309,8 @@
}
});
lookCurrentDetailsMenuAction(editorUi, graph);
editorUi.actions.addAction('accounts...', function()
{
editorUi.toggleUserPanel();
......
......@@ -557,9 +557,9 @@ Actions.prototype.init = function()
}));
this.addAction('selectVertices', function() { graph.selectVertices(null, true); }, null, null, Editor.ctrlKey + '+Shift+I');
this.addAction('selectEdges', function() { graph.selectEdges(); }, null, null, Editor.ctrlKey + '+Shift+E');
this.addAction('selectAll', function() { graph.selectAll(null, true); }, null, null, Editor.ctrlKey + '+A');
this.addAction('selectAll', function() { graph.selectAll(null, true); }, null, null, Editor.ctrlKey + '+A');//解释,选择所有图形
this.addAction('selectNone', function() { graph.clearSelection(); }, null, null, Editor.ctrlKey + '+Shift+A');
this.addAction('lockUnlock', function()
this.addAction('lockUnlock', function()//解释,图形的锁定
{
if (!graph.isSelectionEmpty())
{
......
......@@ -2230,7 +2230,7 @@ EditorUi.prototype.createShapePicker = function(x, y, source, callback, directio
/**
* Creates a temporary graph instance for rendering off-screen content.
*/
EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)
EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)//解释,画布空白处双击或者移动到图形边缘出现图形提示的弹框
{
var graph = this.editor.graph;
......@@ -2313,7 +2313,76 @@ EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)
return cells;
};
EditorUi.prototype.getCellsForShapePicker = function(cell, hovering, showEdges)//二次开发,重写画布空白处双击或者移动到图形边缘出现图形提示的弹框
{
var graph = this.editor.graph;
var createVertex = mxUtils.bind(this, function(style, w, h, value)
{
return graph.createVertex(null, null, value || '', 0, 0, w || 120, h || 60, style, false);
});
var createEdge = mxUtils.bind(this, function(style, y, value)
{
var cell = new mxCell(value || '', new mxGeometry(0, 0, graph.defaultEdgeLength + 20, 0), style);
cell.geometry.setTerminalPoint(new mxPoint(0, 0), true);
cell.geometry.setTerminalPoint(new mxPoint(cell.geometry.width, (y != null) ? y : 0), false);
cell.geometry.points = (y != null) ? [new mxPoint(cell.geometry.width / 2, y)] : [];
cell.geometry.relative = true;
cell.edge = true;
return cell;
});
if (cell != null)
{
try
{
cell = graph.cloneCell(cell);
if (graph.model.isVertex(cell) && cell.geometry != null)
{
cell.geometry.x = 0;
cell.geometry.y = 0;
}
}
catch (e)
{
cell = null;
}
}
var cells = [cell, createVertex('whiteSpace=wrap;html=1;'),
createVertex('ellipse;whiteSpace=wrap;html=1;', 80, 80),
createVertex('rhombus;whiteSpace=wrap;html=1;', 80, 80),
createVertex('rounded=1;whiteSpace=wrap;html=1;'),
createVertex('shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fixedSize=1;'),
createVertex('shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;fixedSize=1;', 120, 60),
createVertex('shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;fixedSize=1;', 120, 80),
createVertex('shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;fixedSize=1;', 120, 80),
createVertex('shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;'),
createVertex('triangle;whiteSpace=wrap;html=1;', 60, 80),
createVertex('shape=document;whiteSpace=wrap;html=1;boundedLbl=1;', 120, 80),
createVertex('shape=tape;whiteSpace=wrap;html=1;', 120, 100),
createVertex('ellipse;shape=cloud;whiteSpace=wrap;html=1;', 120, 80),
createVertex('shape=singleArrow;whiteSpace=wrap;html=1;arrowWidth=0.4;arrowSize=0.4;', 80, 60),
createVertex('shape=waypoint;sketch=0;size=6;pointerEvents=1;points=[];fillColor=none;resizable=0;' +
'rotatable=0;perimeter=centerPerimeter;snapToPoint=1;', 20, 20)];
if (showEdges)
{
cells = cells.concat([
createEdge('edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;'),
createEdge('edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;endArrow=classic;startArrow=classic;endSize=8;startSize=8;'),
createEdge('edgeStyle=none;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;rounded=1;startSize=8;endSize=8;'),
createEdge('edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;curved=0;rounded=0;endSize=8;startSize=8;sourcePerimeterSpacing=0;targetPerimeterSpacing=0;',
this.editor.graph.defaultEdgeLength / 2)
]);
}
if (cell == null)
{
cells = [];
}
return cells;
};
/**
* Creates a temporary graph instance for rendering off-screen content.
*/
......
......@@ -484,6 +484,7 @@ link=Link
links=Links
loading=Loading
lockUnlock=Lock/Unlock
lookCurrentDetails=lookCurrentDetails
loggedOut=Logged Out
logIn=log in
loveIt=I love {1}
......
......@@ -484,6 +484,7 @@ link=连接
links=连接
loading=加载中
lockUnlock=锁定 / 解锁
lookCurrentDetails=下钻数据
loggedOut=注销
logIn=登录
loveIt=我爱 {1}
......
......@@ -554,7 +554,7 @@ export default {
}
}
.card_item{
width: 350px;
width: 345px;
height: 240px;
margin: 15px;
background-color: #F2FFFE;
......
......@@ -28,9 +28,9 @@
<i class="el-icon-location"></i>
{{ item.verName }}&nbsp;&nbsp;&nbsp;{{ item.version }}
</div>
<div class="card_icon" @click.stop="deleteItem(item)">
<!-- <div class="card_icon" @click.stop="deleteItem(item)">
<i class="el-icon-delete"></i>
</div>
</div> -->
</div>
</el-card>
</div>
......@@ -436,7 +436,7 @@ export default {
}
.card_item{
display: inline-block;
width: 350px;
width: 328px;
height: 240px;
margin: 15px;
background-color: #F2FFFE;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!