250 lines
14 KiB
Plaintext
250 lines
14 KiB
Plaintext
|
|
<controls:MaterialWindow
|
|||
|
|
x:Class="Szmedi.RvKits.InfoManager.EAMTools.EAMCodingWin"
|
|||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|||
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
|
|||
|
|
xmlns:controls="clr-namespace:Szmedi.RvKits.Controls"
|
|||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|||
|
|
xmlns:local1="clr-namespace:Szmedi.RvKits.InfoManager.EAMTools"
|
|||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|||
|
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|||
|
|
Title="EAM设备表匹配"
|
|||
|
|
Width="1280"
|
|||
|
|
Height="700"
|
|||
|
|
d:DataContext="{d:DesignInstance Type=local1:EAMCodingViewModel}"
|
|||
|
|
|
|||
|
|
mc:Ignorable="d">
|
|||
|
|
<controls:MaterialWindow.Resources>
|
|||
|
|
<ResourceDictionary Source="pack://application:,,,/Szmedi.RvKits;component/WPFUI.xaml" />
|
|||
|
|
</controls:MaterialWindow.Resources>
|
|||
|
|
<md:DrawerHost x:Name="DrawerHost" OpenMode="Standard">
|
|||
|
|
<Grid>
|
|||
|
|
<Grid.ColumnDefinitions>
|
|||
|
|
<ColumnDefinition Width="*" />
|
|||
|
|
<ColumnDefinition Width="Auto" />
|
|||
|
|
<ColumnDefinition Width="*" />
|
|||
|
|
</Grid.ColumnDefinitions>
|
|||
|
|
<Grid.RowDefinitions>
|
|||
|
|
<RowDefinition Height="*" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
</Grid.RowDefinitions>
|
|||
|
|
<GroupBox Grid.Column="0" Header="族实例表">
|
|||
|
|
<Grid>
|
|||
|
|
<DataGrid
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
IsReadOnly="True"
|
|||
|
|
ItemsSource="{Binding Instances}"
|
|||
|
|
ToolTip="双击可定位构件">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="MouseDoubleClick">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding ShowFacilityCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
<DataGrid.Columns>
|
|||
|
|
<DataGridCheckBoxColumn Binding="{Binding IsMapped}" ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}" Header="是否匹配" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Id}" Header="元素Id" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding CategoryName}" Header="类别" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding FamilyName}" Header="族名称" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Name}" Header="实例名称" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding LevelName}" Header="标高" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Offset}" Header="偏移" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Floor}" Header="所属楼层" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Number}" Header="当前编码" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding EAMCode}" Header="EAM编码" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding MapErrorMessage}" Header="比对错误" />
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
<Button
|
|||
|
|
Margin="10"
|
|||
|
|
HorizontalAlignment="Right"
|
|||
|
|
VerticalAlignment="Bottom"
|
|||
|
|
Command="{Binding ExportComponentsCommand}"
|
|||
|
|
Style="{StaticResource MaterialDesignToolButton}">
|
|||
|
|
<md:PackIcon
|
|||
|
|
Width="30"
|
|||
|
|
Height="30"
|
|||
|
|
Kind="FileExcel"
|
|||
|
|
ToolTip="导出构件表" />
|
|||
|
|
</Button>
|
|||
|
|
</Grid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<GridSplitter
|
|||
|
|
Grid.Row="0"
|
|||
|
|
Grid.Column="1"
|
|||
|
|
Width="2"
|
|||
|
|
HorizontalAlignment="Stretch" />
|
|||
|
|
|
|||
|
|
<GroupBox Grid.Row="0" Grid.Column="2" Header="EAM设备表">
|
|||
|
|
<Grid>
|
|||
|
|
<DataGrid
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
IsReadOnly="True"
|
|||
|
|
ItemsSource="{Binding Facilities}">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="MouseDoubleClick">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding ShowFacilityCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
<DataGrid.Columns>
|
|||
|
|
<DataGridCheckBoxColumn Binding="{Binding IsMapped}" ElementStyle="{StaticResource MaterialDesignDataGridCheckBoxColumnStyle}" Header="是否匹配" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding FixedAssetsName}" Header="固定资产名称" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Story}" Header="楼层" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding FunctionLocation}" Header="功能位置" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding EAMCode}" Header="EAM编码" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding ErrorMessage}" Header="EAM编码错误" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding FacilityNumber}" Header="设备编号" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Instance.Id}" Header="匹配元素" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding MapErrorMessage}" Header="比对错误" />
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
|
|||
|
|
</Grid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
|
|||
|
|
<Grid.ColumnDefinitions>
|
|||
|
|
<ColumnDefinition Width="Auto" />
|
|||
|
|
<ColumnDefinition />
|
|||
|
|
<ColumnDefinition Width="Auto" />
|
|||
|
|
</Grid.ColumnDefinitions>
|
|||
|
|
<ToggleButton
|
|||
|
|
Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
|
|||
|
|
IsChecked="{Binding ElementName=DrawerHost, Path=IsLeftDrawerOpen}"
|
|||
|
|
Style="{StaticResource MaterialDesignHamburgerToggleButton}"
|
|||
|
|
ToolTip="类别选择">
|
|||
|
|
<!--<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="Click">
|
|||
|
|
<b:ChangePropertyAction PropertyName="IsLeftDrawerOpen" TargetObject="{Binding ElementName=DrawerHost}" Value="true" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>-->
|
|||
|
|
</ToggleButton>
|
|||
|
|
<UniformGrid
|
|||
|
|
Grid.Column="1"
|
|||
|
|
Margin="5"
|
|||
|
|
Cursor=""
|
|||
|
|
Rows="1">
|
|||
|
|
<md:Card>
|
|||
|
|
<Grid>
|
|||
|
|
<Grid.ColumnDefinitions>
|
|||
|
|
<ColumnDefinition Width="*" />
|
|||
|
|
<ColumnDefinition Width="Auto" />
|
|||
|
|
</Grid.ColumnDefinitions>
|
|||
|
|
<TextBox
|
|||
|
|
Grid.Column="0"
|
|||
|
|
md:HintAssist.Hint="EAM编码文件路径"
|
|||
|
|
BorderThickness="0"
|
|||
|
|
Cursor="IBeam"
|
|||
|
|
Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
|
|||
|
|
IsReadOnly="True"
|
|||
|
|
Text="{Binding ExcelPath, Mode=OneWay}" />
|
|||
|
|
<Button Grid.Column="1" Command="{Binding OpenEAMFileCommand}" Style="{StaticResource MaterialDesignToolButton}">
|
|||
|
|
<md:PackIcon Kind="MicrosoftExcel" Opacity=".56" ToolTip="打开EAM设备表的Excel文件 Excel必须包含序号、功能位置、设备系统代码、楼层的列" />
|
|||
|
|
</Button>
|
|||
|
|
</Grid>
|
|||
|
|
</md:Card>
|
|||
|
|
|
|||
|
|
<UniformGrid HorizontalAlignment="Center" Rows="1">
|
|||
|
|
<TextBlock Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Text="精确匹配" ToolTip="完全一样" />
|
|||
|
|
<ToggleButton IsChecked="{Binding IsFuzzyMatch}" Style="{StaticResource MaterialDesignSwitchToggleButton}" />
|
|||
|
|
<TextBlock Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Text="模糊匹配" ToolTip="包含即可" />
|
|||
|
|
</UniformGrid>
|
|||
|
|
<Button Command="{Binding MapModelEAMCodeCommand}" Content="模型-编码匹配" ToolTip="通过匹配族实例名称与EAM设备表的设备编号 族实例 标记 与EAM编码 族实例 ID-100-编号 与EAM设备表的设备编号" />
|
|||
|
|
<Button Command="{Binding WriteCodeToInstancesMappedCommand}" Content="EAM编码写入" ToolTip="把匹配的EAM编码写入构件" />
|
|||
|
|
<Button Command="{Binding ExportExcelCommand}" Content="Excel表格导出" ToolTip="导出Excel族实例表和EAM设备表" />
|
|||
|
|
<Button Command="{Binding QuickWriteEAMToInstancesCommand}" Content="EAM编码批量写入" ToolTip="通过Excel第一个表格批量将EAM编码写入构件标记属性 Excel需包含“元素ID”,“EAM编码”的首行表头" />
|
|||
|
|
|
|||
|
|
</UniformGrid>
|
|||
|
|
<ToggleButton
|
|||
|
|
Grid.Column="2"
|
|||
|
|
Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
|
|||
|
|
IsChecked="{Binding ElementName=DrawerHost, Path=IsRightDrawerOpen}"
|
|||
|
|
RenderTransformOrigin="0.5,0.5"
|
|||
|
|
Style="{DynamicResource MaterialDesignHamburgerToggleButton}"
|
|||
|
|
ToolTip="楼层的编码映射">
|
|||
|
|
<ToggleButton.RenderTransform>
|
|||
|
|
<ScaleTransform ScaleX="-1" />
|
|||
|
|
</ToggleButton.RenderTransform>
|
|||
|
|
<!--<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="Click">
|
|||
|
|
<b:ChangePropertyAction PropertyName="IsRightDrawerOpen" TargetObject="{Binding ElementName=DrawerHost}" Value="true" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>-->
|
|||
|
|
</ToggleButton>
|
|||
|
|
</Grid>
|
|||
|
|
|
|||
|
|
</Grid>
|
|||
|
|
<md:DrawerHost.LeftDrawerContent>
|
|||
|
|
<Grid>
|
|||
|
|
<Grid.RowDefinitions>
|
|||
|
|
<RowDefinition Height="*" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
</Grid.RowDefinitions>
|
|||
|
|
<GroupBox Header="族类别">
|
|||
|
|
<ListBox
|
|||
|
|
x:Name="LbCategories"
|
|||
|
|
Width="200"
|
|||
|
|
d:ItemsSource="{d:SampleData ItemCount=5}"
|
|||
|
|
DisplayMemberPath="Key"
|
|||
|
|
ItemsSource="{Binding Collection, Mode=OneWay}"
|
|||
|
|
SelectionMode="Multiple"
|
|||
|
|
Style="{StaticResource MaterialDesignFilterChipListBox}">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="SelectionChanged">
|
|||
|
|
<b:InvokeCommandAction Command="{Binding GetInstancesCommand}" CommandParameter="{Binding SelectedItems, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBox}}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
</ListBox>
|
|||
|
|
</GroupBox>
|
|||
|
|
<StackPanel Grid.Row="1">
|
|||
|
|
<CheckBox Content="全选" DockPanel.Dock="Left">
|
|||
|
|
<b:Interaction.Triggers>
|
|||
|
|
<b:EventTrigger EventName="Checked">
|
|||
|
|
<b:CallMethodAction MethodName="SelectAll" TargetObject="{Binding ElementName=LbCategories}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
<b:EventTrigger EventName="Unchecked">
|
|||
|
|
<b:CallMethodAction MethodName="UnselectAll" TargetObject="{Binding ElementName=LbCategories}" />
|
|||
|
|
</b:EventTrigger>
|
|||
|
|
</b:Interaction.Triggers>
|
|||
|
|
</CheckBox>
|
|||
|
|
<TextBox md:HintAssist.Hint="搜索族类别" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
|
|||
|
|
<!--<Button
|
|||
|
|
HorizontalAlignment="Center"
|
|||
|
|
Command="{x:Static md:DrawerHost.CloseDrawerCommand}"
|
|||
|
|
CommandParameter="{x:Static Dock.Left}"
|
|||
|
|
Content="关闭"
|
|||
|
|
Cursor="Hand" />-->
|
|||
|
|
</StackPanel>
|
|||
|
|
</Grid>
|
|||
|
|
</md:DrawerHost.LeftDrawerContent>
|
|||
|
|
<md:DrawerHost.RightDrawerContent>
|
|||
|
|
<Grid Margin="5">
|
|||
|
|
<Grid.RowDefinitions>
|
|||
|
|
<RowDefinition Height="*" />
|
|||
|
|
<RowDefinition Height="Auto" />
|
|||
|
|
</Grid.RowDefinitions>
|
|||
|
|
<GroupBox Header="楼层映射">
|
|||
|
|
<DataGrid
|
|||
|
|
Width="200"
|
|||
|
|
AutoGenerateColumns="False"
|
|||
|
|
CanUserAddRows="False"
|
|||
|
|
ItemsSource="{Binding StoryCodeMappers, Mode=TwoWay}">
|
|||
|
|
<DataGrid.Columns>
|
|||
|
|
<DataGridTextColumn Binding="{Binding Story}" Header="楼层" IsReadOnly="True" />
|
|||
|
|
<DataGridTextColumn Binding="{Binding Code, UpdateSourceTrigger=PropertyChanged}" Header="楼层代码" />
|
|||
|
|
</DataGrid.Columns>
|
|||
|
|
</DataGrid>
|
|||
|
|
</GroupBox>
|
|||
|
|
<Button Grid.Row="1" Command="{Binding ApplyMappersCommand}" Content="应用" />
|
|||
|
|
<!--<Button
|
|||
|
|
HorizontalAlignment="Center"
|
|||
|
|
Command="{x:Static md:DrawerHost.CloseDrawerCommand}"
|
|||
|
|
CommandParameter="{x:Static Dock.Right}"
|
|||
|
|
Content="关闭"
|
|||
|
|
Cursor="Hand" />-->
|
|||
|
|
</Grid>
|
|||
|
|
</md:DrawerHost.RightDrawerContent>
|
|||
|
|
</md:DrawerHost>
|
|||
|
|
|
|||
|
|
</controls:MaterialWindow>
|