用户确认导入导出策略:1) 配置冲突按 ConfigName + CANLINInfo 判重,CAN/LIN/CANFD 可同名;2) 增量导入对同名配置自动重命名(_import_时间戳);3) JSON 字段尽量与数据库模型一致,可不加注释;4) LogicRule 也需随配置导入导出,规则同名冲突采用覆盖更新;5) 导入后需同步刷新 CAN/CANFD/LIN 以及 ZLG 对应界面;6) 入口按现有系统菜单弹窗(ComDialogEvent + DialogService)接入。
This commit is contained in:
83
CapMachine.Wpf/Views/DialogCanLinConfigImExportView.xaml
Normal file
83
CapMachine.Wpf/Views/DialogCanLinConfigImExportView.xaml
Normal file
@@ -0,0 +1,83 @@
|
||||
<UserControl
|
||||
x:Class="CapMachine.Wpf.Views.DialogCanLinConfigImExportView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:CapMachine.Wpf.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Width="800"
|
||||
Height="450">
|
||||
<Grid Margin="15">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
FontSize="18"
|
||||
FontWeight="Bold"
|
||||
Text="CAN/CANFD/LIN 配置导入导出" />
|
||||
|
||||
<Grid Grid.Row="1" Margin="0,12,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
Margin="0,0,8,0"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ImportFilePath, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Padding="16,4"
|
||||
Command="{Binding BrowseImportFileCmd}"
|
||||
Content="选择导入文件" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,12,0,0"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="导入模式:" />
|
||||
<ComboBox
|
||||
Width="320"
|
||||
Margin="8,0,0,0"
|
||||
DisplayMemberPath="Text"
|
||||
ItemsSource="{Binding ImportModes}"
|
||||
SelectedItem="{Binding SelectedImportMode}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Margin="0,12,0,0"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding ResultMessage}"
|
||||
VerticalScrollBarVisibility="Auto" />
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="4"
|
||||
Margin="0,12,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="0,0,8,0"
|
||||
Padding="16,4"
|
||||
Command="{Binding ExportCmd}"
|
||||
Content="导出" />
|
||||
<Button
|
||||
Margin="0,0,8,0"
|
||||
Padding="16,4"
|
||||
Command="{Binding ImportCmd}"
|
||||
Content="导入" />
|
||||
<Button
|
||||
Padding="16,4"
|
||||
Command="{Binding CloseCmd}"
|
||||
Content="关闭" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
CapMachine.Wpf/Views/DialogCanLinConfigImExportView.xaml.cs
Normal file
28
CapMachine.Wpf/Views/DialogCanLinConfigImExportView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace CapMachine.Wpf.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// DialogCanLinConfigImExport.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class DialogCanLinConfigImExportView : UserControl
|
||||
{
|
||||
public DialogCanLinConfigImExportView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user