This commit is contained in:
艾竹
2023-03-10 12:09:13 +08:00
parent e4f6335224
commit b3c7e1efec
20 changed files with 442 additions and 255 deletions

View File

@@ -357,22 +357,22 @@ namespace AIStudio.Wpf.Flowchart
switch (status)
{
case 100:
flowNode.Color = Colors.Green.ToString();
flowNode.StatusColor = Colors.Green.ToString();
break;
case 0:
flowNode.Color = Colors.Yellow.ToString();
flowNode.StatusColor = Colors.Yellow.ToString();
break;
case 1:
flowNode.Color = Colors.Orange.ToString();
flowNode.StatusColor = Colors.Orange.ToString();
break;
case 2:
flowNode.Color = Colors.Red.ToString();
flowNode.StatusColor = Colors.Red.ToString();
break;
case 3:
flowNode.Color = Colors.Red.ToString();
flowNode.StatusColor = Colors.Red.ToString();
break;
case 4:
flowNode.Color = Colors.Red.ToString();
flowNode.StatusColor = Colors.Red.ToString();
break;
}
}

View File

@@ -25,7 +25,7 @@ namespace AIStudio.Wpf.Flowchart.Models
RoleIds = middleFlow.RoleIds;
ActType = middleFlow.ActType;
}
Color = item.Color;
Color = item.StatusColor;
Kind = item.Kind;
StateImage = item.StateImage;
}

View File

@@ -58,6 +58,17 @@ namespace AIStudio.Wpf.Flowchart.Models
get; set;
}
/// <summary>
/// Gets or sets the color.
/// </summary>
/// <value>
/// The color.
/// </value>
public string StatusColor
{
get; set;
}
public override DiagramItemViewModel ToNodel(IDiagramViewModel diagramViewModel)
{
FlowNode flowNode = null;
@@ -108,7 +119,7 @@ namespace AIStudio.Wpf.Flowchart.Models
}
flowNode.Name = Name;
flowNode.Color = Color;
flowNode.StatusColor = StatusColor;
flowNode.Kind = Kind;
return flowNode;

View File

@@ -9,7 +9,7 @@
<Grid>
<Border BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
</Grid>
@@ -19,7 +19,7 @@
<Grid>
<Border CornerRadius="3" BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" CornerRadius="3,0,0,3" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" CornerRadius="3,0,0,3" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
</Grid>
@@ -29,7 +29,7 @@
<Grid>
<Border CornerRadius="3" BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" CornerRadius="3,0,0,3" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" CornerRadius="3,0,0,3" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
</Grid>
@@ -39,7 +39,7 @@
<Grid>
<Border BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
@@ -62,7 +62,7 @@
<Grid>
<Border BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
</Grid>
@@ -72,7 +72,7 @@
<Grid>
<Border BorderThickness="1" BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}">
<Grid>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding Color}"/>
<Border HorizontalAlignment="Left" Width="3" Background="{Binding StatusColor}"/>
</Grid>
</Border>
</Grid>

View File

@@ -57,7 +57,7 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
if (designerbase is FlowNodeDesignerItem designer)
{
this.Color = designer.Color;
this.StatusColor = designer.Color;
this.Kind = designer.Kind;
this.StateImage = designer.StateImage;
@@ -75,7 +75,7 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
var flowchartNode = new FlowchartNode();
flowchartNode.Name = Name;
flowchartNode.Color = Color;
flowchartNode.StatusColor = StatusColor;
flowchartNode.Kind = Kind;
if (this is MiddleFlowNode middleflowNode)
{
@@ -88,7 +88,7 @@ namespace AIStudio.Wpf.Flowchart.ViewModels
private string _color = "#1890ff";
[Browsable(false)]
public string Color
public string StatusColor
{
get { return _color; }
set