待上传加全选
parent
e743a4333c
commit
06c6bbc288
|
|
@ -37,12 +37,16 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
<!--<TextBlock Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
FontWeight="Bold" Text="选择" />
|
FontWeight="Bold" Text="选择" />-->
|
||||||
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Text="文件名称" />
|
<!-- 全选复选框 -->
|
||||||
<TextBlock Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Text="文件大小" />
|
<CheckBox Grid.Column="0"
|
||||||
<TextBlock Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Text="文件路径" />
|
HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
<TextBlock Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Text="上次上传时间" />
|
IsChecked="{Binding IsAllSelected, Mode=TwoWay}"/>
|
||||||
|
<TextBlock Grid.Column="1" HorizontalAlignment="left" VerticalAlignment="Center" FontWeight="Bold" Text="文件名称" />
|
||||||
|
<TextBlock Grid.Column="2" HorizontalAlignment="left" VerticalAlignment="Center" FontWeight="Bold" Text="文件大小" />
|
||||||
|
<TextBlock Grid.Column="3" HorizontalAlignment="left" VerticalAlignment="Center" FontWeight="Bold" Text="文件路径" />
|
||||||
|
<TextBlock Grid.Column="4" HorizontalAlignment="left" VerticalAlignment="Center" FontWeight="Bold" Text="上次上传时间" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ListBox h:Cattach.ItemHeight="Auto" Style="{DynamicResource {x:Static h:ListBoxKeys.Single}}"
|
<ListBox h:Cattach.ItemHeight="Auto" Style="{DynamicResource {x:Static h:ListBoxKeys.Single}}"
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,6 @@ namespace HeBianGu.App.Disk
|
||||||
//待上传文件
|
//待上传文件
|
||||||
private ObservableCollection<UpLoadItems> _waitUpLoadItems = new ObservableCollection<UpLoadItems>();
|
private ObservableCollection<UpLoadItems> _waitUpLoadItems = new ObservableCollection<UpLoadItems>();
|
||||||
|
|
||||||
|
|
||||||
/// <summary> 说明 </summary>
|
/// <summary> 说明 </summary>
|
||||||
public ObservableCollection<UpLoadItems> WaitUpLoadItems
|
public ObservableCollection<UpLoadItems> WaitUpLoadItems
|
||||||
{
|
{
|
||||||
|
|
@ -150,6 +149,24 @@ namespace HeBianGu.App.Disk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool? _isAllSelected;
|
||||||
|
public bool? IsAllSelected
|
||||||
|
{
|
||||||
|
get => _isAllSelected;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_isAllSelected = value;
|
||||||
|
// 全选/取消全选逻辑
|
||||||
|
if (value.HasValue)
|
||||||
|
{
|
||||||
|
foreach (var item in WaitUpLoadItems)
|
||||||
|
{
|
||||||
|
item.Bool1 = value.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 只读属性,返回过滤后的集合(动态计算)
|
// 只读属性,返回过滤后的集合(动态计算)
|
||||||
private ObservableCollection<UpLoadItems> _uploadingItems = new ObservableCollection<UpLoadItems>();
|
private ObservableCollection<UpLoadItems> _uploadingItems = new ObservableCollection<UpLoadItems>();
|
||||||
|
|
||||||
|
|
@ -292,6 +309,7 @@ namespace HeBianGu.App.Disk
|
||||||
if (flag == true)
|
if (flag == true)
|
||||||
{
|
{
|
||||||
MessageBox.Show($"已成功删除 {items.Count} 个项目");
|
MessageBox.Show($"已成功删除 {items.Count} 个项目");
|
||||||
|
IsAllSelected = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -338,6 +356,7 @@ namespace HeBianGu.App.Disk
|
||||||
CompleteCount = CompleteItems.Count;
|
CompleteCount = CompleteItems.Count;
|
||||||
MessageBox.Show("正在上传列表中可查看进度");
|
MessageBox.Show("正在上传列表中可查看进度");
|
||||||
WaitUpLoadItems.RemoveAll(r => r.Bool1 == true);
|
WaitUpLoadItems.RemoveAll(r => r.Bool1 == true);
|
||||||
|
IsAllSelected = false;
|
||||||
WaitCount = WaitUpLoadItems.Count;
|
WaitCount = WaitUpLoadItems.Count;
|
||||||
// 如果没有上传任务在运行,则启动上传
|
// 如果没有上传任务在运行,则启动上传
|
||||||
if (!_isUploading)
|
if (!_isUploading)
|
||||||
|
|
@ -584,7 +603,7 @@ namespace HeBianGu.App.Disk
|
||||||
IMinioClient client = new MinioClient()
|
IMinioClient client = new MinioClient()
|
||||||
.WithEndpoint(config["Minio:Endpoint"])
|
.WithEndpoint(config["Minio:Endpoint"])
|
||||||
.WithCredentials(config["Minio:AccessKey"], config["Minio:SecretKey"])
|
.WithCredentials(config["Minio:AccessKey"], config["Minio:SecretKey"])
|
||||||
//.WithHttpClient(new HttpClient(handler) { Timeout = Timeout.InfiniteTimeSpan })
|
.WithHttpClient(new HttpClient() {Timeout = TimeSpan.FromMinutes(30) })
|
||||||
.Build();
|
.Build();
|
||||||
string bucketName = GetCurrentBucket();
|
string bucketName = GetCurrentBucket();
|
||||||
// 确保桶存在
|
// 确保桶存在
|
||||||
|
|
@ -647,7 +666,6 @@ namespace HeBianGu.App.Disk
|
||||||
.WithObject(ut.Value6)
|
.WithObject(ut.Value6)
|
||||||
.WithFileName(ut.Value5)
|
.WithFileName(ut.Value5)
|
||||||
.WithProgress(progress)
|
.WithProgress(progress)
|
||||||
|
|
||||||
.WithObjectSize(5 * 1024 * 1024);
|
.WithObjectSize(5 * 1024 * 1024);
|
||||||
|
|
||||||
var uploadTask = client.PutObjectAsync(putObjectArgs);
|
var uploadTask = client.PutObjectAsync(putObjectArgs);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue