Commit ac1a3ef4 by jlc

update:编辑模式和预览模式的切换

parent c26a011f
......@@ -73,7 +73,6 @@ function initDiagram() {
"draggingTool.guidelineWidth": 1, // 设置辅助对齐的线条的粗细
// 旋转节点
rotatingTool: new RotateMultipleTool(),
"relinkingTool.isUnconnectedLinkValid": false,
});
myDiagram.toolManager.mouseMoveTools.insertAt(0, new PortShiftingTool()); // 设置端口移动
......@@ -113,7 +112,6 @@ function initDiagram() {
),
},
new go.Binding('portId', 'portId'),
new go.Binding('visible', 'visible'),
new go.Binding('alignment', 'portKey', (portKey: string) => {
switch(portKey) {
case "top": return go.Spot.Top;
......@@ -146,6 +144,7 @@ function initDiagram() {
strokeWidth: 1,
desiredSize: new go.Size(6, 6),
},
new go.Binding('visible', 'visible'),
)
),
},
......@@ -270,7 +269,6 @@ function initDiagram() {
),
},
new go.Binding('portId', 'portId'),
new go.Binding('visible', 'visible'),
new go.Binding('alignment', 'portKey', (portKey: string) => {
switch(portKey) {
case "top": return go.Spot.Top;
......@@ -303,6 +301,7 @@ function initDiagram() {
strokeWidth: 1,
desiredSize: new go.Size(6, 6),
},
new go.Binding('visible', 'visible'),
)
),
},
......@@ -396,13 +395,12 @@ function initDiagram() {
myDiagram.linkTemplate =
$(go.Link,
{
routing:go.Routing.AvoidsNodes,
routing: go.Routing.Orthogonal,
curve: go.Curve.JumpGap,
corner: 5,
corner: 10,
adjusting: go.LinkAdjusting.Stretch,
reshapable: false // 设置连接线的形态是否可以被修改
reshapable: true // 设置连接线的形态是否可以被修改
},
new go.Binding("points").makeTwoWay(),
$(go.Shape, // 链接线的样式
{
strokeWidth: 1.5
......@@ -519,7 +517,7 @@ function initDiagram() {
{ key: "add2", color: "lightblue", loc: new go.Point(100, 50), category: "zhaChi", portArray: [{portId: "bottom0", portKey: "bottom"}], markArray: [{markId: "mark0"}] },
];
const linkDataArray = [
{ from: "add1", fromPort: "top0", to: "add2", toPort: "bottom0", text: "1->2", "points":[-96.5,200,-96.5,190,-96.5,166.4,191.45,166.4,191.45,142.8,191.45,132.8]},
{ from: "add1", fromPort: "top0", to: "add2", toPort: "bottom0", text: "1->2" },
];
myDiagram.model =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment