Merge branch 'feature/优化Recipe对比功能' into develop

This commit is contained in:
hanqiangqiang 2023-10-26 14:59:32 +08:00
commit 6a62465bca
7 changed files with 38 additions and 33 deletions

View File

@ -78,7 +78,7 @@
<DoubleAnimation
From="0"
To="-370"
Duration="0:0:1" />
Duration="0:0:0.6" />
</Storyboard>
</UserControl.Resources>
@ -245,12 +245,12 @@
</Border>
<Button
Width="70"
Width="80"
Height="35"
Margin="10"
HorizontalAlignment="Right"
micro:Message.Attach="ComperSelectRecipe()"
Content="Compar"
Content="Compare"
FontSize="13"
IsEnabled="{Binding IsSelectButtonEnable}">
<Button.Triggers>

View File

@ -364,8 +364,8 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
//recipe1step[j].Highlight();//不同部分高亮
//recipe2step[j].Highlight();
recipe1step[j].SetBackground(Colors.LightSalmon);
recipe2step[j].SetBackground(Colors.LightSalmon);
recipe1step[j].CompareDifferent();
recipe2step[j].CompareDifferent();
}
}
}
@ -375,7 +375,7 @@ namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
{
for (int j = 0; j < recipeDataExcess.Steps[i].Count; j++)
{
recipeDataExcess.Steps[i][j].SetBackground(Colors.LightSalmon);
recipeDataExcess.Steps[i][j].CompareDifferent();
}
}
}

View File

@ -317,7 +317,7 @@
<Compile Include="RecipeEditorLib\Converters\ParamValueDisplayConverter.cs" />
<Compile Include="RecipeEditorLib\Converters\RecipeErrorsCountToBadgeConverter.cs" />
<Compile Include="RecipeEditorLib\Converters\SelectedRecipeStepsToListConverter.cs" />
<Compile Include="RecipeEditorLib\Converters\SetBackgroundBrushConvent.cs" />
<Compile Include="RecipeEditorLib\Converters\IsCompareDifferentBrushConvent.cs" />
<Compile Include="RecipeEditorLib\Converters\StepNoToCxtMenuTitleConverter.cs" />
<Compile Include="CenterViews\Editors\RecipeConfig\RecipeConfigView.xaml.cs">
<DependentUpon>RecipeConfigView.xaml</DependentUpon>

View File

@ -5,11 +5,16 @@ using System.Windows.Media;
namespace MECF.Framework.UI.Client.RecipeEditorLib.Converters
{
public class SetBackgroundBrushConvent : IValueConverter
public class IsCompareDifferentBrushConvent : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return new SolidColorBrush((Color)value);
if (value is bool isHighlighted)
return isHighlighted
? new SolidColorBrush(Colors.LightSalmon)
: new SolidColorBrush(Colors.Transparent);
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View File

@ -22,7 +22,7 @@
<converters:BoolCollapsedConverter x:Key="BoolCollapsedConverter" />
<cv:ParamToCellTooltipConverter x:Key="CellTooltipConverter" />
<cv:IsHighlightedToBorderThickness x:Key="IsHighlightedToBorderThickness" />
<cv:SetBackgroundBrushConvent x:Key="SetBackgroundBrushConvent" />
<cv:IsCompareDifferentBrushConvent x:Key="IsCompareDifferentBrushConvent" />
<cv:IsHighlightedToBorderBrush x:Key="IsHighlightedToBorderBrush" />
<cv:ParamValueDisplayConverter x:Key="ParamValueDisplayConverter" />
<cv:PermissionToIsEnabledConverter x:Key="PermissionToIsEnabledConverter" />
@ -174,7 +174,7 @@
</Style.Triggers>
</Style>
</Border.Style>
<Border Margin="1" Background="{Binding Background, Mode=OneWay, Converter={StaticResource SetBackgroundBrushConvent}}">
<Border Margin="1" Background="{Binding IsCompareDifferent, Mode=OneWay, Converter={StaticResource IsCompareDifferentBrushConvent}}">
<TextBlock
Padding="5,3"
HorizontalAlignment="Center"
@ -185,8 +185,8 @@
<MultiBinding Converter="{StaticResource ParamValueDisplayConverter}">
<Binding Path="Value" />
<Binding Path="Permission" />
<Binding Path="IsHideValue"/>
<Binding Path="HiddenValueMasking"/>
<Binding Path="IsHideValue" />
<Binding Path="HiddenValueMasking" />
</MultiBinding>
</TextBlock.Text>
<TextBlock.Style>

View File

@ -108,7 +108,7 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
/// 返回是否高亮显示当前参数。
/// </summary>
bool IsHighlighted { get; }
#endregion
#region Methods
@ -129,17 +129,11 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
/// </summary>
void Save();
/// <summary>
/// 设置单元格背景色
/// </summary>
/// <param name="brush"></param>
void SetBackground(Color brush);
/// <summary>
/// 高亮显示当前参数。
/// </summary>
void Highlight();
/// <summary>
/// 取消高亮显示。
/// </summary>

View File

@ -30,8 +30,8 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
protected bool _isValid;
protected string _validationError;
protected bool _isEqualsToPrevious;
protected Color _background;
protected bool _isHighlighted;
protected bool _isCompareDifferent;
#endregion
@ -166,12 +166,6 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
protected set => Set(ref _validationError, value);
}
public Color Background
{
get => _background;
set=> Set(ref _background, value);
}
/// <inheritdoc />
public bool IsHighlighted
{
@ -179,6 +173,15 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
private set => Set(ref _isHighlighted, value);
}
/// <summary>
/// Recipe对比的不同参数部分属性标志,未添加到IParam接口中
/// </summary>
public bool IsCompareDifferent
{
get => _isCompareDifferent;
private set =>Set(ref _isCompareDifferent, value);
}
public bool IsColumnSelected
{
get => _isColumnSelected;
@ -199,11 +202,6 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
#region Methods
public void SetBackground(Color brush)
{
Background = brush;
}
/// <summary>
/// 高亮显示当前参数。
/// </summary>
@ -212,6 +210,14 @@ namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
IsHighlighted = true;
}
/// <summary>
/// 高亮背景色显示Recipe对比的不同参数部分。未添加到IParam接口中IsCompareDifferent属性是参数对比标志位
/// </summary>
public void CompareDifferent()
{
IsCompareDifferent = true;
}
/// <summary>
/// 取消高亮显示。
/// </summary>