Commit 42c6c754 by jlc

update:细节修改

parent 24f53b99
......@@ -173,7 +173,8 @@ function toggleDivs(value: boolean) {
function initDiagram() {
myDiagram = $(go.Diagram, "diagramDiv", {
"undoManager.isEnabled": true,
// 'grid.visible': true, // 画布上面是否出现网格
'grid.visible': true, // 画布上面是否出现网格
"grid.gridCellSize": new go.Size(5, 5), // 设置背景网格的大小
"toolManager.mouseWheelBehavior": go.WheelMode.Zoom,
// contentAlignment: go.Spot.Center, // 元素位置移动后始终处于在画布正中间
resizingTool: new ResizeMultipleTool(), // 自定义ResizeMultipleTool()方法来设置元素大小的缩放
......@@ -351,7 +352,8 @@ function initDiagram() {
segmentIndex: NaN,
segmentFraction: 0.5,
visible: true,
_isLinkLabel: true
_isLinkLabel: true,
layerName: 'Foreground'
},
new go.Binding("location", "loc"),
new go.Binding("desiredSize", "size", go.Size.parse).makeTwoWay(go.Size.stringify),
......@@ -473,7 +475,9 @@ function initDiagram() {
$(go.TextBlock,
{
stroke: 'black',
margin: 4
margin: 4,
width: 40,
textAlign: "center"
},
new go.Binding('text', 'name')
),
......@@ -482,7 +486,9 @@ function initDiagram() {
{
stroke: 'black',
column: 1,
margin: 4
margin: 4,
width: 40,
textAlign: "center"
},
new go.Binding('text', 'value')
),
......@@ -492,6 +498,8 @@ function initDiagram() {
stroke: 'black',
column: 2,
margin: 4,
width: 40,
textAlign: "center"
},
new go.Binding('text', 'unit')
),
......@@ -538,7 +546,7 @@ function initDiagram() {
$(go.TextBlock,
{
stroke: 'black',
margin: 4
margin: 4,
},
new go.Binding('text', 'damageName')
),
......@@ -547,7 +555,7 @@ function initDiagram() {
{
stroke: 'black',
column: 1,
margin: 4
margin: 4,
},
new go.Binding('text', 'damageValue')
),
......@@ -701,6 +709,8 @@ function initDiagram() {
}
});
// myDiagram.commit((d: any) => d.remove("add1"), "Remove Part");
const nodeDataArray = [
{ key: "add1", color: "lightyellow", loc: new go.Point(-150, 200), portArray: [{portId: "top0", portKey: "top"}, {portId: "left0", portKey: "left"}, {portId: "right0", portKey: "right"}, {portId: "bottom0", portKey: "bottom"}], markArray: [] },
{ key: "add2", color: "lightblue", loc: new go.Point(100, 50), category: "zhaChi", portArray: [{portId: "bottom0", portKey: "bottom"}], markArray: [] },
......
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