diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml index d98c006..29a108d 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/MainWindow.xaml @@ -189,7 +189,7 @@ CanUserAddRows="False" CanUserDeleteRows="False" ClipboardCopyMode="IncludeHeader" - EnableColumnVirtualization="True" + EnableColumnVirtualization="False" EnableRowVirtualization="True" ItemsSource="{Binding StuffedData, IsAsync=True}" ScrollViewer.CanContentScroll="True" @@ -200,6 +200,7 @@ + + /// 更新列 + /// + /// + /// public void UpdateDataGridColumnsByType(List columns, DataGridType type) { try @@ -101,12 +105,11 @@ public partial class MainWindow : Window LoadingMask.Visibility = Visibility.Collapsed; } - //private void GetDataBtn_Click(object sender, RoutedEventArgs e) - //{ - // var result = ExcelHelper.GetWireTerminalMappingTable(); - - //} - + /// + /// 生成模板数据 + /// + /// + /// private void GenTemplateBtn_Click(object sender, RoutedEventArgs e) { try @@ -133,6 +136,12 @@ public partial class MainWindow : Window } } + /// + /// 异步加载数据 + /// + /// + /// + /// public async Task LoadDataAsync(IEnumerable reportData, List columns) { @@ -167,6 +176,11 @@ public partial class MainWindow : Window }); }); } + /// + /// 导出报表数据 + /// + /// + /// private void ExportDataBtn_Click(object sender, RoutedEventArgs e) { try @@ -198,7 +212,11 @@ public partial class MainWindow : Window FlexMessageBox.Error($"{ex}"); } } - + /// + /// 忽略异常 + /// + /// + /// private void IgnoreSelectedError_Click(object sender, RoutedEventArgs e) { if (ModelGenDataGrid.SelectedItems != null) @@ -242,4 +260,24 @@ public partial class MainWindow : Window } e.Handled = true; } + /// + /// 取消忽略异常 + /// + /// + /// + private void UnIgnoreSelectedError_Click(object sender, RoutedEventArgs e) + { + + if (ModelGenDataGrid.SelectedItems != null) + { + var selectedRows = ModelGenDataGrid.SelectedItems; + foreach (var item in selectedRows) + { + if (item is StuffedDataModel model) + { + model.IsIgnore = false; + } + } + } + } } \ No newline at end of file diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj index df05f32..79a639d 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj @@ -113,6 +113,7 @@ + diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs index 98bce55..3704c75 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs @@ -342,7 +342,6 @@ public partial class MainViewModel : INotifyPropertyChanged } else { - colorCode = displayColor switch { "红色" => "RD", @@ -362,53 +361,11 @@ public partial class MainViewModel : INotifyPropertyChanged } return colorCode; } - /// - /// 获取号码管规格 - /// - //public string GetNumberTubeSpecification(string crossSection, string colorCode) - //{ - // if (crossSection == "16") - // { - // if (colorCode == "YE") return "黄色热缩管φ12/定制"; - // if (colorCode == "GN") return "绿色热缩管φ12/定制"; - // if (colorCode == "RD") return "红色热缩管φ12/定制"; - // if (colorCode == "BU") return "蓝色热缩管φ12/定制"; - // if (colorCode == "GNYE") return "黄绿色热缩管φ12/定制"; - // } - // else if (crossSection == "0.3" || crossSection == "0.5" || crossSection == "0.75" || crossSection == "1") - // { - // return "白色号码管φ2.5/定制"; - // } - // else if (crossSection == "1.5") - // { - // return "白色号码管φ3/定制"; - // } - // else if (crossSection == "2.5") - // { - // return "白色号码管φ4/定制"; - // } - // else if (crossSection == "4") - // { - // return "白色号码管φ5/定制"; - // } - // else if (crossSection == "6") - // { - // return "白色号码管φ6/定制"; - // } - // else if (crossSection == "10") - // { - // return "白色号码管φ8/定制"; - // } - - // return string.Empty; - //} public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - //new StudioSettings().Plugins. - } @@ -430,7 +387,6 @@ public partial class MainViewModel : INotifyPropertyChanged var nowDateStr = DateTime.Now.ToString("yyyy-MM-dd"); //foreach (var stuffedDataModel in StuffedData) StuffedData.AsParallel().WithDegreeOfParallelism(1).ForAll(stuffedDataModel => - { //var numberTubeSpec = GetNumberTubeSpecification(stuffedDataModel.CrossSection, stuffedDataModel.WireColor); var exportModel = new ExportModel