1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
-
- @if (shapeTrees != null)
- {
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="@ChartWidth" height="@ChartHeight">
- <defs>
- <marker id="idArrow"
- viewBox="0 0 20 20" refX="0" refY="10"
- markerUnits="strokeWidth" markerWidth="5" markerHeight="10"
- orient="auto">
- <path d="M 0 0 L 20 10 L 0 20 z" fill="black" stroke="black" />
- </marker>
- </defs>
- <text x="@(ChartWidth/2)" y="@(TitleHeight/2)" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="30" font-weight="800">@workflow.Name</text>
- <line x1="@startNode.x" y1="@(startNode.y + startNode.width / 2) " x2="@(InitShape.x)" y2="@(InitShape.y - InitShape.height / 2)" stroke="black" stroke-width="2" marker-end="url(#idArrow)" />
- @for (int iLevel = 0; iLevel < LevelNodes.Count; iLevel++)
- {
- @foreach (var node in LevelNodes[iLevel])
- {
- if (node.Type == 0)
- {
- <circle cx="@(node.x)" cy="@node.y" r="@(node.width / 2) " stroke="black" stroke-width="2" fill="white" />
- <a @onclick="() => ClickNode(node)">
- <text x="@(node.x)" y="@node.y" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="16">
- @if (node == startNode)
- {
- @("开始")
- }
- else
- {
- if (node == endNode)
- {
- @("结束")
- }
- else
- {
- if (node.NodeObject is entity.workflowDefine.Step)
- {
- @(((entity.workflowDefine.Step)node.NodeObject).Name)
- }
- }
- }
- </text>
- </a>
- }
- if (node.Type == 1)
- {
- <rect x="@(node.x - node.width / 2)" y="@(node.y - node.height / 2)" rx="10" ry="10" width="@node.width" height="@node.height" style="fill:green;stroke:black;stroke-width:3;opacity:0.5" />
- <a @onclick="() => ClickNode(node)">
- <text x="@node.x" y="@node.y" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="@rectFontSize" font-weight="700">
- @if (node.NodeObject is entity.workflowDefine.Action)
- {
- @((workflow.InitAction == null || string.IsNullOrEmpty(workflow.InitAction.Name)) ? $"启动{workflow.Name}" : workflow.InitAction.Name)
- }
- else
- {
- @(((entity.workflowDefine.Step)node.NodeObject).Name)
- }
- </text>
- </a>
- }
- }
- }
- @foreach (var t in Transfers)
- {
- dynamic ret = GetLineParater(t);
- <line x1="@ret.x1" y1="@ret.y1" x2="@ret.x2" y2="@ret.y2" stroke="black" stroke-width="2" marker-end="url(#idArrow)" />
- <circle cx="@((ret.x1 + ret.x2) / 2)" cy="@((ret.y1 + ret.y2) / 2)" r="7" stroke="black" stroke-width="1.5" fill="white" />
- <a @onclick="() => ClickTrasfer(t)">
- <text x="@((ret.x1 + ret.x2) / 2)" y="@((ret.y1 + ret.y2) / 2)" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="12">c</text>
- </a>
- }
- @{
- dynamic endLine = GetEndStepLine();
- <line x1="@endLine.x1" y1="@endLine.y1" x2="@endLine.x2" y2="@endLine.y2" stroke="black" stroke-width="2" marker-end="url(#idArrow)"/>
- }
- @*<circle cx="@(endNode.x)" cy="@endNode.y" r="@(endNode.width/2) " stroke="black" stroke-width="2" fill="gray" />
- <a>
- <text x="@(endNode.x)" y="@endNode.y" fill="black" alignment-baseline="middle" text-anchor="middle" font-size="5">结束</text>
- </a>*@
- </svg>
- }
- else
- {
- <Spin />
- }
-
|