WinMaintainerInfo.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <fw:NChildWindow x:Class="Com.FirmLib.UI.Maintainer.WinMaintainerInfo"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:fw="http://schemas.FWind/xaml"
  7. xmlns:wpf="clr-namespace:FWindSoft.Wpf;assembly=FWindSoft.Wpf"
  8. xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
  9. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  10. xmlns:behaviors="clr-namespace:FWindSoft.Wpf.Behaviors;assembly=FWindSoft.Wpf"
  11. xmlns:bllCommon="clr-namespace:Com.FirmLib.UI.BllCommon"
  12. mc:Ignorable="d" Title="维修商信息"
  13. d:DesignHeight="300" d:DesignWidth="500" Name="this" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
  14. Width="{Binding Width,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" >
  15. <fw:NChildWindow.Resources>
  16. <wpf:BindingProxy x:Key="DATA" Data="{Binding}"></wpf:BindingProxy>
  17. </fw:NChildWindow.Resources>
  18. <fw:NChildWindow.AttachElement>
  19. <StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal" VerticalAlignment="Center">
  20. <Button Command="{Binding Data.Commands.SaveCommand,Source={StaticResource ResourceKey=DATA}}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" BorderThickness="0" FontFamily="{DynamicResource ResourceKey={x:Static wpf:FontsUtil.AwesomeKey}}">
  21. <Button.Content>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="{wpf:FontIcon Icon=Save}" Width="30" FontSize="20"></TextBlock>
  24. <TextBlock Text="保存" VerticalAlignment="Center" Margin="-5,0,0,0"></TextBlock>
  25. </StackPanel>
  26. </Button.Content>
  27. </Button>
  28. </StackPanel>
  29. </fw:NChildWindow.AttachElement>
  30. <Grid Margin="5">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="Auto"></RowDefinition>
  33. <RowDefinition MinHeight="150" MaxHeight="300"></RowDefinition>
  34. <RowDefinition></RowDefinition>
  35. </Grid.RowDefinitions>
  36. <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical"
  37. VerticalAlignment="Center" HorizontalAlignment="Left" Width="200">
  38. <fw:TextBoxEditor Text="{Binding Name,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5"
  39. Command="{x:Static bllCommon:EditCommands.SingleUpdate}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Name"></fw:TextBoxEditor>
  40. <fw:TextBoxEditor Text="{Binding Url,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="5"
  41. Command="{x:Static bllCommon:EditCommands.SingleUpdate}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" Tag="Url"></fw:TextBoxEditor>
  42. </StackPanel>
  43. <TabControl Grid.Row="1" Grid.Column="0" IsEnabled="True">
  44. <TabItem Header="维护产品目录">
  45. <Grid>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto"></RowDefinition>
  48. <RowDefinition ></RowDefinition>
  49. </Grid.RowDefinitions>
  50. <Grid Grid.Row="0">
  51. <Grid.ColumnDefinitions>
  52. <ColumnDefinition></ColumnDefinition>
  53. <ColumnDefinition Width="Auto"></ColumnDefinition>
  54. </Grid.ColumnDefinitions>
  55. <ListBox Grid.Row="0" Grid.Column="0" BorderThickness="0" VerticalAlignment="Center" ItemsSource="{Binding Root.Items}" SelectedItem="{Binding Root.CurrentItem,Mode=TwoWay}" >
  56. <ListBox.ItemsPanel >
  57. <ItemsPanelTemplate>
  58. <StackPanel Orientation="Horizontal" Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
  59. </ItemsPanelTemplate>
  60. </ListBox.ItemsPanel>
  61. <ListBox.ItemContainerStyle>
  62. <Style TargetType="{x:Type ListBoxItem}">
  63. <Setter Property="Template">
  64. <Setter.Value>
  65. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  66. <StackPanel Orientation="Horizontal">
  67. <TextBlock Text="|" x:Name="Txt"></TextBlock>
  68. <TextBlock Margin="5,0,5,0" x:Name="TXTN" Text="{Binding RefItem.Name}" Foreground="Blue" TextDecorations="Underline">
  69. </TextBlock>
  70. </StackPanel>
  71. <ControlTemplate.Triggers>
  72. <DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}"
  73. Value="{x:Null}">
  74. <Setter TargetName="Txt" Property="Visibility" Value="Collapsed"></Setter>
  75. </DataTrigger>
  76. <Trigger Property="IsSelected" Value="True">
  77. <Setter TargetName="TXTN" Property="Foreground" Value="Black"></Setter>
  78. </Trigger>
  79. </ControlTemplate.Triggers>
  80. </ControlTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. </Style>
  84. </ListBox.ItemContainerStyle>
  85. </ListBox>
  86. <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
  87. <Button IsEnabled="False" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="5" Content="管理设备族常见问题"/>
  88. <Button Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Command="{Binding Commands.AddProductTypeCommand}" Height="23" Margin="5" Content="添加维修型号" />
  89. </StackPanel>
  90. </Grid>
  91. <DataGrid Grid.Row="1" Grid.Column="0" AutoGenerateColumns="False" SelectionMode="Single" FrozenColumnCount="1" ItemsSource="{Binding Root.CurrentItem.Nodes}"
  92. CanUserAddRows="False"
  93. CanUserDeleteRows="False"
  94. VerticalScrollBarVisibility="Auto"
  95. HorizontalScrollBarVisibility="Auto"
  96. SelectionUnit="FullRow"
  97. HeadersVisibility="Column"
  98. CanUserSortColumns="True"
  99. CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
  100. AlternationCount="2"
  101. >
  102. <DataGrid.RowStyle>
  103. <Style TargetType="DataGridRow">
  104. <Setter Property="ContextMenu">
  105. <Setter.Value>
  106. <ContextMenu>
  107. <MenuItem Header="删除所有型号" Command="{Binding Data.Commands.DeleteCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding }"></MenuItem>
  108. </ContextMenu>
  109. </Setter.Value>
  110. </Setter>
  111. <Setter Property="Height" Value="30"></Setter>
  112. <Style.Triggers>
  113. <Trigger Property="ItemsControl.AlternationIndex"
  114. Value="0">
  115. <Setter Property="Background" Value="White" />
  116. </Trigger>
  117. <Trigger Property="ItemsControl.AlternationIndex"
  118. Value="1">
  119. <Setter Property="Background" Value="#FFE6E3DD" />
  120. </Trigger>
  121. </Style.Triggers>
  122. </Style>
  123. </DataGrid.RowStyle>
  124. <DataGrid.Columns>
  125. <DataGridTemplateColumn Header="操作" Width="100" IsReadOnly="True" >
  126. <DataGridTemplateColumn.CellTemplate>
  127. <DataTemplate>
  128. <StackPanel Orientation="Horizontal">
  129. <Button Command="{Binding Data.Commands.ScanProductTypeCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Content="查看" HorizontalAlignment="Left" Padding="5,0,5,0"/>
  130. <Button Command="{Binding Data.Commands.EditProductTypeCommand,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Content="编辑型号" HorizontalAlignment="Left" Padding="5,0,5,0"/>
  131. </StackPanel>
  132. </DataTemplate>
  133. </DataGridTemplateColumn.CellTemplate>
  134. </DataGridTemplateColumn>
  135. <fw:TDataGridTextColumn Header="品牌" Width="100" IsReadOnly="True" Binding="{Binding Path=RefItem.BrandName}"></fw:TDataGridTextColumn>
  136. <fw:TDataGridTextColumn Header="产品名" Width="*" IsReadOnly="True" Binding="{Binding Path=RefItem.Products,Converter={x:Static wpf:ConverterFactory.ItemsToString}}"></fw:TDataGridTextColumn>
  137. <fw:TDataGridTextColumn Header="型号" Width="*" IsReadOnly="True" Binding="{Binding Path=RefItem.ProductTypes,Converter={x:Static wpf:ConverterFactory.ItemsToString}}"></fw:TDataGridTextColumn>
  138. </DataGrid.Columns>
  139. </DataGrid>
  140. </Grid>
  141. </TabItem>
  142. </TabControl>
  143. <GroupBox Grid.Row="2" Grid.Column="0" Margin="-5,0,-5,0" Header="该厂家提供维修服务的所有项目" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.GroupBoxKey}}" >
  144. <Grid>
  145. <Grid.RowDefinitions>
  146. <RowDefinition Height="Auto"></RowDefinition>
  147. <RowDefinition ></RowDefinition>
  148. </Grid.RowDefinitions>
  149. <StackPanel HorizontalAlignment="Right">
  150. <Button Command="{Binding Commands.AddProjectAsset}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}" Height="23" Margin="10" Content="新项目添加维护设备" />
  151. </StackPanel>
  152. <ListBox Grid.Row="1" ItemsSource="{Binding ProjectAssetItems}" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  153. <ListBox.ItemsPanel >
  154. <ItemsPanelTemplate>
  155. <WrapPanel Orientation="Horizontal" Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
  156. </ItemsPanelTemplate>
  157. </ListBox.ItemsPanel>
  158. <ListBox.ItemContainerStyle>
  159. <Style TargetType="{x:Type ListBoxItem}">
  160. <Setter Property="Template">
  161. <Setter.Value>
  162. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  163. <Border BorderThickness="1" BorderBrush="Black" Margin="5" Padding="5" fw:MaskOptions.IsManualHide="true" fw:MaskOptions.IsShow="{Binding IsLoading}">
  164. <fw:MaskOptions.MaskTemplate>
  165. <ControlTemplate>
  166. <Border Background="Gray" Opacity="0.5">
  167. <ProgressBar VerticalAlignment="Center" Margin="5" IsIndeterminate="True"></ProgressBar>
  168. </Border>
  169. </ControlTemplate>
  170. </fw:MaskOptions.MaskTemplate>
  171. <Grid Width="170" Height="80" >
  172. <Grid.RowDefinitions>
  173. <RowDefinition></RowDefinition>
  174. <RowDefinition Height="Auto"></RowDefinition>
  175. </Grid.RowDefinitions>
  176. <StackPanel Orientation="Vertical" Grid.Row="0">
  177. <Grid>
  178. <TextBlock Margin="5,0,5,0" Name="TxtName" FontSize="20" Text="{Binding ProjectLocalName}"></TextBlock>
  179. <Button HorizontalAlignment="Right" VerticalAlignment="Center" Content="刷新" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Command="{Binding Data.Commands.RefreshCommand,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding}" ></Button>
  180. </Grid>
  181. <StackPanel Orientation="Horizontal">
  182. <TextBlock Margin="5,0,5,0" Text="维护合同有效期内的资产:" />
  183. <TextBlock Margin="5,0,5,0" x:Name="TXTN" Text="{Binding ValidityAssetCount}" TextDecorations="Underline"/>
  184. <TextBlock Margin="5,0,5,0" Text="个" />
  185. </StackPanel>
  186. <StackPanel Orientation="Horizontal">
  187. <TextBlock Margin="5,0,5,0" Text="即将超出维保时间的资产:" />
  188. <TextBlock Margin="5,0,5,0" Text="{Binding NearOutDateAssetCount}" TextDecorations="Underline"/>
  189. <TextBlock Margin="5,0,5,0" Text="个" />
  190. </StackPanel>
  191. </StackPanel>
  192. <Button Grid.Row="1" Grid.Column="0" x:Name="BTNU" HorizontalAlignment="Right" Content="进入项目" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" Command="{Binding Data.Commands.GoToProject,Source={StaticResource ResourceKey=DATA}}" CommandParameter="{Binding}" ></Button>
  193. </Grid>
  194. </Border>
  195. </ControlTemplate>
  196. </Setter.Value>
  197. </Setter>
  198. </Style>
  199. </ListBox.ItemContainerStyle>
  200. </ListBox>
  201. </Grid>
  202. </GroupBox>
  203. </Grid>
  204. </fw:NChildWindow>