From c74a686824bb0cb629aa9633a786d6219c60cb77 Mon Sep 17 00:00:00 2001 From: liuwf Date: Mon, 11 Nov 2024 18:19:08 +0800 Subject: [PATCH] =?UTF-8?q?add-=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B7=BB=E5=8A=A0=E8=BF=87=E9=81=93=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.WPF/Page/LocationPage.xaml.cs | 133 +++++++++++++++++++++++- 1 file changed, 130 insertions(+), 3 deletions(-) diff --git a/SlnMesnac.WPF/Page/LocationPage.xaml.cs b/SlnMesnac.WPF/Page/LocationPage.xaml.cs index 5a155d8..6eb1170 100644 --- a/SlnMesnac.WPF/Page/LocationPage.xaml.cs +++ b/SlnMesnac.WPF/Page/LocationPage.xaml.cs @@ -122,12 +122,114 @@ namespace SlnMesnac.WPF.Page List locations = wmsBaseLocations.Where(t => t.WarehouseId == list[i]).ToList(); var row = locations.Max(t => t.LocRow); column = locations.Max(t => t.LocColumn); + + if (list[0] == 231 && i == 0) { grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + + for(int h=0; h < 25; h++) + { + var button2 = new Button() + { + Content = "过道", + Name = "road1", + Width = 40, + Height = 25, + FontSize = 15, + Margin = new Thickness(0), + Background = new SolidColorBrush(Colors.Transparent), + Foreground = new SolidColorBrush(Colors.White), + }; + + var button3 = new Button() + { + Content = "过道", + Name = "road2", + Width = 40, + Height = 25, + FontSize = 15, + Margin = new Thickness(0), + Background = new SolidColorBrush(Colors.Transparent), + Foreground = new SolidColorBrush(Colors.White), + }; + + Grid.SetColumn(button2, h ); + Grid.SetRow(button2, 2); + Grid.SetColumnSpan(button2, 2); + grid.Children.Add(button2); + + + Grid.SetColumn(button3, h); + Grid.SetRow(button3, 5); + Grid.SetColumnSpan(button3, 2); + grid.Children.Add(button3); + } + }else if(list[0] == 311 && i == 0) + { + grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); + + for(int h=0; h < 25; h++) + { + var button2 = new Button() + { + Content = "过道", + Name = "road1", + Width = 40, + Height = 25, + FontSize = 15, + Margin = new Thickness(0), + Background = new SolidColorBrush(Colors.Transparent), + Foreground = new SolidColorBrush(Colors.White), + }; + + var button3 = new Button() + { + Content = "过道", + Name = "road2", + Width = 40, + Height = 25, + FontSize = 15, + Margin = new Thickness(0), + Background = new SolidColorBrush(Colors.Transparent), + Foreground = new SolidColorBrush(Colors.White), + }; + + var button4 = new Button() + { + Content = "过道", + Name = "road2", + Width = 40, + Height = 25, + FontSize = 15, + Margin = new Thickness(0), + Background = new SolidColorBrush(Colors.Transparent), + Foreground = new SolidColorBrush(Colors.White), + }; + + Grid.SetColumn(button2, h ); + Grid.SetRow(button2, 2); + Grid.SetColumnSpan(button2, 2); + grid.Children.Add(button2); + + + Grid.SetColumn(button3, h); + Grid.SetRow(button3, 6); + Grid.SetColumnSpan(button3, 2); + grid.Children.Add(button3); + + Grid.SetColumn(button4, h); + Grid.SetRow(button4, 7); + Grid.SetColumnSpan(button4, 2); + grid.Children.Add(button4); + } } - for (var j = 0; j < row; j++) + for (var j = 0; j < row+1; j++) { grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1.0, GridUnitType.Star) }); } @@ -151,7 +253,17 @@ namespace SlnMesnac.WPF.Page Grid.SetColumn(button, location.LocColumn.Value - 1); if (list[0] == 231) { - Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 2); + if(location.LocRow.Value <= 2) + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 4); + } + else + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value) + 3); + } + + + for (var k = 0; k < 8; k++) { var button2 = new Button() @@ -172,7 +284,22 @@ namespace SlnMesnac.WPF.Page } else { - Grid.SetRow(button, -(location.LocRow.Value - row.Value)); + if(location.LocRow.Value <= 2) + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value)+3); + }else if(location.LocRow.Value <= 4 && location.LocRow.Value > 2) + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value) +2); + }else if(location.LocRow.Value<=6 && location.LocRow.Value > 4) + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value)+1); + } + else + { + Grid.SetRow(button, -(location.LocRow.Value - row.Value)); + } + + if (list[0] == 311) { for (var k = 0; k < 3; k++)