新增表字段迁移并发布1.0.19
This commit is contained in:
@@ -16,8 +16,9 @@ namespace henlo_migration.ViewModels
|
||||
{
|
||||
public class MainViewModel : INotifyPropertyChanged
|
||||
{
|
||||
// 五个 Tab 的数据
|
||||
// 六个 Tab 的数据
|
||||
public TabServices TableTab { get; }
|
||||
public TabServices TableFieldTab { get; }
|
||||
public TabServices BosTab { get; }
|
||||
public TabServices BosFieldTab { get; }
|
||||
public TabServices PrcTab { get; }
|
||||
@@ -33,6 +34,7 @@ namespace henlo_migration.ViewModels
|
||||
_currentTab = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(TablesData));
|
||||
OnPropertyChanged(nameof(TableFieldsData));
|
||||
OnPropertyChanged(nameof(BosTablesData));
|
||||
OnPropertyChanged(nameof(BosFieldsData));
|
||||
OnPropertyChanged(nameof(StoredProcsData));
|
||||
@@ -51,14 +53,16 @@ namespace henlo_migration.ViewModels
|
||||
CurrentTab = value switch
|
||||
{
|
||||
0 => TableTab,
|
||||
1 => BosTab,
|
||||
2 => BosFieldTab,
|
||||
3 => PrcTab,
|
||||
4 => DataTab,
|
||||
1 => TableFieldTab,
|
||||
2 => BosTab,
|
||||
3 => BosFieldTab,
|
||||
4 => PrcTab,
|
||||
5 => DataTab,
|
||||
_ => TableTab
|
||||
};
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(TablesData));
|
||||
OnPropertyChanged(nameof(TableFieldsData));
|
||||
OnPropertyChanged(nameof(BosTablesData));
|
||||
OnPropertyChanged(nameof(BosFieldsData));
|
||||
OnPropertyChanged(nameof(StoredProcsData));
|
||||
@@ -68,8 +72,9 @@ namespace henlo_migration.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
// 五个Tab数据源别名(供DataGrid绑定)
|
||||
// 六个Tab数据源别名(供DataGrid绑定)
|
||||
public ObservableCollection<TableRowModel> TablesData => TableTab.List;
|
||||
public ObservableCollection<TableRowModel> TableFieldsData => TableFieldTab.List;
|
||||
public ObservableCollection<TableRowModel> BosTablesData => BosTab.List;
|
||||
public ObservableCollection<TableRowModel> BosFieldsData => BosFieldTab.List;
|
||||
public ObservableCollection<TableRowModel> StoredProcsData => PrcTab.List;
|
||||
@@ -78,10 +83,11 @@ namespace henlo_migration.ViewModels
|
||||
public string CurrentTabName => SelectedTabIndex switch
|
||||
{
|
||||
0 => "表配置",
|
||||
1 => "BOS配置",
|
||||
2 => "BOS字段配置",
|
||||
3 => "存储过程",
|
||||
4 => "表数据",
|
||||
1 => "表字段",
|
||||
2 => "BOS配置",
|
||||
3 => "BOS字段配置",
|
||||
4 => "存储过程",
|
||||
5 => "表数据",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
@@ -269,10 +275,13 @@ namespace henlo_migration.ViewModels
|
||||
DestUser = SysConfig.GetDestUser();
|
||||
DestPwd = SysConfig.GetDestPwd();
|
||||
|
||||
// 初始化五个 TabServices(索引文件在 from/,内容文件在 data/)
|
||||
// 初始化六个 TabServices(索引文件在 from/,内容文件在 data/)
|
||||
TableTab = new TabServices(new TabConfig(TabsEnum.表, CommonHelper.DataFromPath, CommonHelper.DataPath, "table.txt", CodeExt.creat,
|
||||
DbServices.GetTableSql, (p, c) => SqlCode = c));
|
||||
|
||||
TableFieldTab = new TabServices(new TabConfig(TabsEnum.表字段, CommonHelper.DataFromPath, CommonHelper.DataPath, "table_field.txt", CodeExt.table_field,
|
||||
DbServices.GetTableField, (p, c) => SqlCode = c));
|
||||
|
||||
BosTab = new TabServices(new TabConfig(TabsEnum.BOS表配置, CommonHelper.DataFromPath, CommonHelper.DataPath, "bos.txt", CodeExt.bos,
|
||||
DbServices.GetTableBos, (p, c) => SqlCode = c));
|
||||
|
||||
@@ -286,7 +295,7 @@ namespace henlo_migration.ViewModels
|
||||
DbServices.GetTableData, (p, c) => SqlCode = c));
|
||||
|
||||
// Tab行点击 -> 显示SQL
|
||||
foreach (var tab in new[] { TableTab, BosTab, BosFieldTab, PrcTab, DataTab })
|
||||
foreach (var tab in new[] { TableTab, TableFieldTab, BosTab, BosFieldTab, PrcTab, DataTab })
|
||||
{
|
||||
tab.RowClickEvent += (path, code) =>
|
||||
{
|
||||
@@ -380,11 +389,12 @@ namespace henlo_migration.ViewModels
|
||||
if (!string.IsNullOrWhiteSpace(InputText))
|
||||
{
|
||||
string itemName = InputText.Trim();
|
||||
if (CurrentTab == BosFieldTab)
|
||||
if (CurrentTab == TableFieldTab || CurrentTab == BosFieldTab)
|
||||
{
|
||||
if (!DbServices.TryParseBosFieldName(itemName, out string tableName, out string columnName))
|
||||
if (!DbServices.TryParseTableFieldName(itemName, out string tableName, out string columnName))
|
||||
{
|
||||
HandyControl.Controls.Growl.Warning("BOS 字段配置必须使用 TABLE.COLUMN 格式");
|
||||
string tabName = CurrentTab == TableFieldTab ? "表字段" : "BOS 字段配置";
|
||||
HandyControl.Controls.Growl.Warning($"{tabName}必须使用 TABLE.COLUMN 格式");
|
||||
return;
|
||||
}
|
||||
itemName = $"{tableName}.{columnName}";
|
||||
|
||||
Reference in New Issue
Block a user