升级1.7.5,Slider新增背景条颜色,Spin参数修改,UploadDragger事件参数修改,Table支持树节点删除
This commit is contained in:
parent
aad4757c5e
commit
d7936ea813
@ -13,7 +13,7 @@
|
||||
<Copyright>Copyright © 2024 czz_y</Copyright>
|
||||
<FileVersion>$(Version)</FileVersion>
|
||||
<AssemblyVersion>$(Version)</AssemblyVersion>
|
||||
<Version>1.7.4</Version>
|
||||
<Version>1.7.5</Version>
|
||||
<Authors>czz_y</Authors>
|
||||
<Description>基于 Winform UI 框架 AntdUI 设计的 Demo</Description>
|
||||
<PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl>
|
||||
@ -30,7 +30,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AntdUI" Version="1.7.4" />
|
||||
<PackageReference Include="AntdUI" Version="1.7.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.3.3" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
<h1>AntdUI Demo</h1>
|
||||
|
||||
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.7.4`
|
||||
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.7.5`
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
1
Views/SliderDemo.Designer.cs
generated
1
Views/SliderDemo.Designer.cs
generated
@ -266,6 +266,7 @@
|
||||
this.slider2.Size = new System.Drawing.Size(200, 32);
|
||||
this.slider2.TabIndex = 1;
|
||||
this.slider2.Text = "slider2";
|
||||
this.slider2.TrackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(169)))), ((int)(((byte)(244)))));
|
||||
this.slider2.Value = 50;
|
||||
//
|
||||
// slider1
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AntdUI;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
@ -27,15 +28,20 @@ namespace AntdUIDemo.Views
|
||||
|
||||
private void Button_control_Click(object sender, EventArgs e)
|
||||
{
|
||||
AntdUI.Spin.open(label_spin, new AntdUI.Spin.Config()
|
||||
AntdUI.Spin.open(label_spin, new Spin.Config()
|
||||
{
|
||||
Back = Color.FromArgb(220, 147, 181, 207),
|
||||
Color = Color.White,
|
||||
Color = Style.Db.Primary,//转圈颜色
|
||||
Radius = 6,
|
||||
Font = new Font("Microsoft YaHei UI", 7f),//字体可以控制进度圈的大小
|
||||
|
||||
}, (config) =>
|
||||
{
|
||||
//耗时代码,处理数据
|
||||
Thread.Sleep(3000);
|
||||
}, () =>
|
||||
{
|
||||
//耗时代码,加载数据
|
||||
Thread.Sleep(1000);
|
||||
//结束时执行的代码
|
||||
});
|
||||
}
|
||||
|
||||
@ -44,12 +50,28 @@ namespace AntdUIDemo.Views
|
||||
AntdUI.Spin.open(window, new AntdUI.Spin.Config()
|
||||
{
|
||||
Back = Color.FromArgb(220, 147, 181, 207),
|
||||
Color = Color.White,
|
||||
Color = Style.Db.Primary,//转圈颜色
|
||||
Radius = 6,
|
||||
Fore = Color.Black,//字体颜色
|
||||
Font = new Font("Microsoft YaHei UI", 14f),//字体可以控制进度圈的大小
|
||||
}, (config) =>
|
||||
{
|
||||
//耗时代码,处理数据
|
||||
config.Text = "正在处理中,当前进度0%...";
|
||||
Thread.Sleep(1000);
|
||||
//value范围:0-1
|
||||
config.Value = 0.2f;
|
||||
config.Text = "正在处理中,当前进度20%...";
|
||||
Thread.Sleep(1000);
|
||||
config.Value = 0.5f;
|
||||
config.Text = "正在处理中,当前进度50%...";
|
||||
Thread.Sleep(1000);
|
||||
config.Value = 1.0f;
|
||||
config.Text = "处理完成!";
|
||||
Thread.Sleep(1000);
|
||||
}, () =>
|
||||
{
|
||||
//耗时代码,加载数据
|
||||
Thread.Sleep(1000);
|
||||
//结束时执行的代码
|
||||
});
|
||||
}
|
||||
|
||||
@ -58,27 +80,46 @@ namespace AntdUIDemo.Views
|
||||
AntdUI.Spin.open(this, new AntdUI.Spin.Config()
|
||||
{
|
||||
Back = Color.FromArgb(220, 147, 181, 207),
|
||||
Color = Color.White,
|
||||
Color = Style.Db.Primary,//转圈颜色
|
||||
Radius = 6,
|
||||
Fore = Color.Black,//字体颜色
|
||||
Font = new Font("Microsoft YaHei UI", 14f),//字体可以控制进度圈的大小
|
||||
}, (config) =>
|
||||
{
|
||||
//耗时代码,处理数据
|
||||
config.Text = "正在处理中,当前进度0%...";
|
||||
Thread.Sleep(1000);
|
||||
//value范围:0-1
|
||||
config.Value = 0.2f;
|
||||
config.Text = "正在处理中,当前进度20%...";
|
||||
Thread.Sleep(1000);
|
||||
config.Value = 0.5f;
|
||||
config.Text = "正在处理中,当前进度50%...";
|
||||
Thread.Sleep(1000);
|
||||
config.Value = 1.0f;
|
||||
config.Text = "处理完成!";
|
||||
Thread.Sleep(1000);
|
||||
}, () =>
|
||||
{
|
||||
//耗时代码,加载数据
|
||||
Thread.Sleep(1000);
|
||||
//结束时执行的代码
|
||||
});
|
||||
}
|
||||
|
||||
private void Button_base_Click(object sender, EventArgs e)
|
||||
{
|
||||
//匿名委托
|
||||
AntdUI.Spin.open(flowPanel1, new AntdUI.Spin.Config()
|
||||
{
|
||||
Back = Color.FromArgb(220, 147, 181, 207),
|
||||
Color = Color.White,
|
||||
Color = Style.Db.Primary,//转圈颜色
|
||||
Radius = 6,
|
||||
Font = new Font("Microsoft YaHei UI", 7f),//字体可以控制进度圈的大小
|
||||
}, (config) =>
|
||||
{
|
||||
//耗时代码,处理数据
|
||||
Thread.Sleep(3000);
|
||||
}, () =>
|
||||
{
|
||||
//耗时代码,加载数据
|
||||
Thread.Sleep(1000);
|
||||
//结束时执行的代码
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,6 +152,7 @@ namespace AntdUIDemo.Views
|
||||
//判断是否右键
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
if (antList.Count == 0) return;
|
||||
AntdUI.ContextMenuStrip.open(new AntdUI.ContextMenuStrip.Config(table_base,
|
||||
(item) =>
|
||||
{
|
||||
@ -183,21 +184,42 @@ namespace AntdUIDemo.Views
|
||||
var result = Modal.open(window, "删除警告!", "确认要删除选择的数据吗?", TType.Warn);
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
if (antList.Any(antitem => antitem.Selected = true))
|
||||
//父元素没有勾选或者子元素也没有勾选,则删除当前行
|
||||
bool delCurrent = !antList.Any(x => x.Selected || (x.Users?.Any(u => u.Selected) ?? false));
|
||||
|
||||
if (delCurrent)
|
||||
{
|
||||
//使用反转for循环删除
|
||||
for (int i = antList.Count - 1; i >= 0; i--)
|
||||
//删除当前行,先判断是否父元素,再判断是否子元素,只支持一层子元素,需实现嵌套查询
|
||||
for (int i = 0; i < antList.Count; i++)
|
||||
{
|
||||
if (antList[i].Selected)
|
||||
if (antList[i] == user)
|
||||
{
|
||||
antList.Remove(antList[i]);
|
||||
antList.RemoveAt(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
antList[i].Users = antList[i].Users?.Where(x => x != user).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
antList.Remove(user);
|
||||
// 使用反转for循环删除主列表中选中的项
|
||||
for (int i = antList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// 1.删除选中的主列表项
|
||||
if (antList[i].Selected)
|
||||
{
|
||||
antList.RemoveAt(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 删除子列表中选中的项
|
||||
antList[i].Users = antList[i].Users?.Where(childUser => !childUser.Selected).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -303,8 +325,6 @@ namespace AntdUIDemo.Views
|
||||
antList[i].Users = antList[i].Users?.Where(user => !user.Selected).ToArray();
|
||||
}
|
||||
}
|
||||
//BUG:删除树节点数据需要重新绑定才刷新
|
||||
table_base.Binding(antList);
|
||||
// 提示删除完成
|
||||
AntdUI.Message.success(window, "删除成功!", autoClose: 3);
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ namespace AntdUIDemo.Views
|
||||
}
|
||||
}
|
||||
|
||||
private void UploadDragger_DragChanged(object sender, AntdUI.UploadDragger.StringsEventArgs e)
|
||||
private void UploadDragger_DragChanged(object sender, AntdUI.StringsEventArgs e)
|
||||
{
|
||||
string[] filePaths = e.Value;
|
||||
foreach (string path in filePaths)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user