提交整体修改
This commit is contained in:
@ -173,6 +173,51 @@ namespace DHSoftware.Views
|
||||
currControl = control;
|
||||
}
|
||||
break;
|
||||
case "其他设置":
|
||||
foreach (var tab in tabs1.Pages)
|
||||
{
|
||||
if (tab is AntdUI.TabPage existingTab && existingTab.Text == $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}")
|
||||
{
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = existingTab; // 直接跳转到已存在的 TabPage
|
||||
isUpdatingTabs = false;
|
||||
currControl = existingTab.Controls.Count > 0 ? existingTab.Controls[0] as UserControl : null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (clickedItem.Text == "全局设置")
|
||||
{
|
||||
//先获取是否存在该名称的配置
|
||||
//如果没有新建项
|
||||
GlobalConfig? global = ConfigModel
|
||||
.GlobalList.FirstOrDefault() ;
|
||||
if (global == null)
|
||||
{
|
||||
global = new GlobalConfig();
|
||||
}
|
||||
|
||||
UserControl control3 = null;
|
||||
control = new GlobalControl(this, global);
|
||||
if (control != null)
|
||||
{
|
||||
//容器添加控件,需要调整dpi
|
||||
control.Dock = DockStyle.Fill;
|
||||
AutoDpi(control);
|
||||
AntdUI.TabPage tabPage = new AntdUI.TabPage()
|
||||
{
|
||||
Text = $"{clickedItem.PARENTITEM.Text}-{clickedItem.Text}",
|
||||
ReadOnly = false,
|
||||
};
|
||||
tabPage.Controls.Add(control);
|
||||
tabs1.Pages.Add(tabPage);
|
||||
isUpdatingTabs = true;
|
||||
tabs1.SelectedTab = tabPage;
|
||||
isUpdatingTabs = false;
|
||||
currControl = control;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -186,7 +231,6 @@ namespace DHSoftware.Views
|
||||
btnAdd.Items.Add("相机设置");
|
||||
btnAdd.Items.Add("工位设置");
|
||||
btnAdd.Items.Add("运控设置");
|
||||
|
||||
x = Width;
|
||||
y = Height;
|
||||
AdaptiveHelper.setTag(this);
|
||||
@ -237,6 +281,12 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ConfigModel.GlobalList?.Count <= 0)
|
||||
{
|
||||
GlobalConfig globalConfig = new GlobalConfig();
|
||||
ConfigModel.GlobalList.Add(globalConfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void BtnSave_Click(object? sender, EventArgs e)
|
||||
@ -652,6 +702,8 @@ namespace DHSoftware.Views
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user