change - 界面及手动执行修改

dev
WenJY 1 day ago
parent 0264cea34b
commit ca4168b8d6

@ -21,7 +21,22 @@
"Bash(dotnet new *)",
"Bash(dotnet add *)",
"Bash(python3 *)",
"Bash(git restore *)"
"Bash(git restore *)",
"Bash(sort -t'\"' -k2 -n)",
"Bash(git checkout *)",
"Bash(sed -n '41,65p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '58,75p' Sln.Wcs.UI/Views/Task/TaskQueueListView.axaml)",
"Bash(sed -n '11,28p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '42,50p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '64,68p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '82,86p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '62,67p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -n '80,84p' Sln.Wcs.UI/Views/Base/StoreInfoListView.axaml)",
"Bash(sed -i '' 's|Grid\\\\.Column=\"1\" Text=\"{Binding SlidePanelTitle}\"|Grid.Column=\"0\" Text=\"{Binding SlidePanelTitle}\"|g' Sln.Wcs.UI/Views/Device/DeviceInfoListView.axaml)",
"Bash(sed -i '' 's|Grid\\\\.Column=\"2\" Content=\"新增\" Command=\"{Binding AddParamCommand}\"|Grid.Column=\"1\" Content=\"新增\" Command=\"{Binding AddParamCommand}\"|g' Sln.Wcs.UI/Views/Device/DeviceInfoListView.axaml)",
"Bash(sed -i '' 's|Grid\\\\.Column=\"3\" Content=\"✕\" Click=\"ClosePanel_Click\"|Grid.Column=\"2\" Content=\"✕\" Click=\"ClosePanel_Click\"|g' Sln.Wcs.UI/Views/Device/DeviceInfoListView.axaml)",
"Bash(sed -i '' 's|Grid\\\\.Column=\"1\" Text=\"{Binding SlidePanelTitle}\"|Grid.Column=\"0\" Text=\"{Binding SlidePanelTitle}\"|g' Sln.Wcs.UI/Views/Path/PathInfoListView.axaml)",
"Bash(sed -i '' 's|Grid\\\\.Column=\"2\" Content=\"新增\" Command=\"{Binding AddDetailCommand}\"|Grid.Column=\"1\" Content=\"新增\" Command=\"{Binding AddDetailCommand}\"|g' Sln.Wcs.UI/Views/Path/PathInfoListView.axaml)"
]
}
}

@ -103,9 +103,23 @@ api.MapGet("/task/status", (string taskCode) =>
return Results.Ok(new { time = DateTime.Now, status = "ok" , taskStatus = taskStatus });
});
//0524779AA0550094
// AGV 等待点
// api.MapPost("/robot/wait", (HikRoBotWaitRequest req) =>
// {
// return Results.Ok(new { time = DateTime.Now, status = "ok" , agvPosition = "0524779AA0550094" });
// });
api.MapGet("/health", () => Results.Ok(new { time = DateTime.Now, status = "ok" }));
log.Info("HikRoBotServer 就绪: http://localhost:5200/swagger");
app.Run();
record ReceiveTaskRequest(string TaskCode, string StartPoint, string EndPoint);
/// <summary>
/// 请求参数
/// </summary>
/// <param name="TaskCode">WCS 下发的任务编号:同 submit 接口</param>
/// <param name="HoistCode">提升机编号15 栋入库-1#Hoist 15栋出库-2#Hoist14 栋提升机-3#Host13 栋提升机-4#Hoist</param>
record HikRoBotWaitRequest(string TaskCode, string HoistCode);

@ -112,8 +112,32 @@ public class HoistDispatchHub
out string startLocation);
TryParsePointCode(liveTaskDetail.endPoint, out string endBuilding, out string endFloor,
out string endLocation);
int endPoint = Convert.ToInt32(deviceInfo.deviceSerialNo + startFloor + endFloor);
if (startBuilding.Contains("15") && endBuilding.Contains("15"))
{
if (startFloor == "1")
{
startFloor = deviceInfo.deviceSerialNo == 1 ? "13" : "12";
}
else
{
startFloor = $"0{startFloor}";
}
if (endFloor == "1")
{
endFloor = deviceInfo.deviceSerialNo == 1 ? "13" : "12";
}
else
{
endFloor = $"0{endFloor}";
}
}
int endPoint = Convert.ToInt32(deviceInfo.deviceSerialNo + startFloor + endFloor);
//调用适配层下发 提升机调度任务
SetHoistTaskResultDto res = _hoistAdapter.SetHoistTask(new SetHoistTaskDto()
{
@ -164,7 +188,7 @@ public class HoistDispatchHub
}
}
}
/// <summary>
/// 刷新设备参数:根据设备参数地址通过 PLC 获取参数值
/// hostCode为空时获取配置的所有参数值

@ -103,4 +103,7 @@ public class BaseDeviceHost
/// </summary>
[SugarColumn(ColumnName = "remark")]
public string remark { get; set; }
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}

@ -123,5 +123,16 @@ namespace Sln.Wcs.Model.Domain
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToMany, nameof(BaseDeviceParam.deviceCode), nameof(deviceCode))]
public List< BaseDeviceParam> deviceParams { get; set; }
[SugarColumn(IsIgnore = true)]
public string deviceTypeText
{
get { return deviceType switch { 0 => "输送线", 1 => "AGV", 2 => "提升机", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public string deviceStatusText
{
get { return deviceStatus switch { 0 => "正常", 1 => "在忙", 2 => "异常", _ => "--" }; }
}
}
}

@ -118,4 +118,7 @@ public class BaseDeviceParam
[SugarColumn(ColumnName = "remark")]
public string remark { get; set; }
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}

@ -98,5 +98,14 @@ namespace Sln.Wcs.Model.Domain
/// </summary>
[SugarColumn(ColumnName = "remark")]
public string remark { get; set; }
[SugarColumn(IsIgnore = true)]
public string deviceTypeText
{
get { return deviceType switch { 0 => "输送线", 1 => "AGV", 2 => "提升机", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}
}

@ -113,5 +113,8 @@ namespace Sln.Wcs.Model.Domain
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToMany, nameof(BasePathDetails.pathCode), nameof(pathCode))]
public List<BasePathDetails> pathDetails { get; set; }
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}
}

@ -161,6 +161,14 @@ public class LiveTaskDetail
[SugarColumn(ColumnName = "execution_mode")]
public int? executionMode { get; set; }
/// <summary>
/// Desc:执行设备编号
/// Default:
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "exec_device")]
public string execDevice { get; set; }
/// <summary>
/// Desc:备注
/// Default:
@ -168,4 +176,33 @@ public class LiveTaskDetail
/// </summary>
[SugarColumn(ColumnName = "remark")]
public string remark { get; set; }
[SugarColumn(IsIgnore = true)]
public string taskTypeText
{
get { return taskType switch { 1 => "入库", 2 => "出库", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public string taskCategoryText
{
get { return taskCategory switch { 1 => "包材", 2 => "成品", 3 => "托盘", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public string taskStatusText
{
get { return taskStatus switch { 1 => "待执行", 2 => "执行中", 3 => "已完成", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public string executionModeText
{
get { return executionMode switch { 0 => "自动", 1 => "手动", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public string deviceTypeText
{
get { return deviceType switch { 0 => "输送线", 1 => "AGV", 2 => "提升机", _ => "--" }; }
}
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}

@ -167,4 +167,40 @@ public class LiveTaskQueue
[SugarColumn(IsIgnore = true)]
[Navigate(NavigateType.OneToMany, nameof(LiveTaskDetail.taskCode), nameof(taskCode))]
public List<LiveTaskDetail> taskDetails { get; set; }
[SugarColumn(IsIgnore = true)]
public string taskTypeText
{
get
{
return taskType switch { 1 => "入库", 2 => "出库", _ => "--" };
}
}
[SugarColumn(IsIgnore = true)]
public string taskCategoryText
{
get
{
return taskCategory switch { 1 => "包材", 2 => "成品", 3 => "托盘", _ => "--" };
}
}
[SugarColumn(IsIgnore = true)]
public string taskStatusText
{
get
{
return taskStatus switch { 1 => "待执行", 2 => "执行中", 3 => "已完成", _ => "--" };
}
}
[SugarColumn(IsIgnore = true)]
public string executionModeText
{
get
{
return executionMode switch { 0 => "自动", 1 => "手动", _ => "--" };
}
}
[SugarColumn(IsIgnore = true)]
public int RowIndex { get; set; }
}

@ -1,6 +1,7 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Sln.Wcs.UI"
xmlns:conv="using:Sln.Wcs.UI.Converters"
x:Class="Sln.Wcs.UI.App"
RequestedThemeVariant="Dark">
<Application.DataTemplates>
@ -9,6 +10,7 @@
<Application.Resources>
<ResourceDictionary>
<conv:CodeToTextConverter x:Key="CodeToText" />
<ResourceDictionary.ThemeDictionaries>
<!-- ===== Dark Theme ===== -->
<ResourceDictionary x:Key="Dark">

@ -69,6 +69,11 @@ public abstract partial class CrudPageViewModel<T> : ObservableObject, ICrudPage
var exp = BuildSearchExpression(SearchText);
list = exp != null ? _service.Query(exp) : _service.Query();
}
for (int i = 0; i < list.Count; i++)
{
var rowProp = typeof(T).GetProperty("RowIndex");
rowProp?.SetValue(list[i], i + 1);
}
Items = new ObservableCollection<T>(list);
StatusText = $"共 {list.Count} 条记录";
}

@ -7,6 +7,13 @@ public class FieldConfig
public FieldType FieldType { get; set; } = FieldType.Text;
public bool IsReadOnly { get; set; }
public bool IsRequired { get; set; }
public List<ComboOption> Options { get; set; } = new();
}
public class ComboOption
{
public object? Value { get; set; }
public string Display { get; set; } = string.Empty;
}
public enum FieldType
@ -16,3 +23,61 @@ public enum FieldType
Combo,
CheckBox
}
public static class StandardOptions
{
public static readonly List<ComboOption> TaskType = new()
{
new() { Value = 1, Display = "1 - 入库" },
new() { Value = 2, Display = "2 - 出库" },
};
public static readonly List<ComboOption> TaskCategory = new()
{
new() { Value = 1, Display = "1 - 包材" },
new() { Value = 2, Display = "2 - 成品" },
new() { Value = 3, Display = "3 - 托盘" },
};
public static readonly List<ComboOption> TaskStatus = new()
{
new() { Value = 1, Display = "1 - 待执行" },
new() { Value = 2, Display = "2 - 执行中" },
new() { Value = 3, Display = "3 - 已完成" },
};
public static readonly List<ComboOption> ExecutionMode = new()
{
new() { Value = 0, Display = "0 - 自动" },
new() { Value = 1, Display = "1 - 手动" },
};
public static readonly List<ComboOption> DeviceType = new()
{
new() { Value = 0, Display = "0 - 输送线" },
new() { Value = 1, Display = "1 - AGV" },
new() { Value = 2, Display = "2 - 提升机" },
};
public static readonly List<ComboOption> DeviceStatus = new()
{
new() { Value = 0, Display = "0 - 正常" },
new() { Value = 1, Display = "1 - 在忙" },
new() { Value = 2, Display = "2 - 异常" },
};
public static readonly List<ComboOption> LocationStatus = new()
{
new() { Value = 0, Display = "0 - 未使用" },
new() { Value = 1, Display = "1 - 已使用" },
new() { Value = 2, Display = "2 - 锁库" },
new() { Value = 3, Display = "3 - 异常" },
};
public static readonly List<ComboOption> OperationType = new()
{
new() { Value = "0", Display = "0 - 默认读写" },
new() { Value = "1", Display = "1 - 只读" },
new() { Value = "2", Display = "2 - 只写" },
};
}

@ -26,7 +26,7 @@ public class LocationInfoViewModel : CrudPageViewModel<BaseLocationInfo>
new() { PropertyName = "materialCode", DisplayName = "物料编号" },
new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" },
new() { PropertyName = "stackCount", DisplayName = "库存数量" },
new() { PropertyName = "locationStatus", DisplayName = "库位状态", FieldType = FieldType.Number },
new() { PropertyName = "locationStatus", DisplayName = "库位状态", FieldType = FieldType.Combo, Options = StandardOptions.LocationStatus },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};

@ -1,15 +1,32 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Sln.Wcs.Model.Domain;
using Sln.Wcs.Repository.service;
using Sln.Wcs.UI.ViewModels.Base;
using Sln.Wcs.UI.Views.Base;
namespace Sln.Wcs.UI.ViewModels.Base;
public class StoreInfoViewModel : CrudPageViewModel<BaseStoreInfo>
public partial class StoreInfoViewModel : CrudPageViewModel<BaseStoreInfo>
{
public StoreInfoViewModel(IBaseStoreInfoService service) : base(service)
private readonly IBaseLocationInfoService _locationService;
private BaseStoreInfo? _currentStore;
[ObservableProperty]
private bool _isPanelOpen;
[ObservableProperty]
private ObservableCollection<BaseLocationInfo> _storeLocations = new();
[ObservableProperty]
private string _slidePanelTitle = string.Empty;
public StoreInfoViewModel(IBaseStoreInfoService service, IBaseLocationInfoService locationService) : base(service)
{
_locationService = locationService;
PageTitle = "仓库信息管理";
}
@ -26,4 +43,84 @@ public class StoreInfoViewModel : CrudPageViewModel<BaseStoreInfo>
=> x => x.storeCode.Contains(search) || (x.storeName != null && x.storeName.Contains(search));
public override Avalonia.Controls.Control CreateView() => new Sln.Wcs.UI.Views.Base.StoreInfoListView();
public void LoadLocationsData(BaseStoreInfo store)
{
_currentStore = store;
LoadLocations();
SlidePanelTitle = $"库位列表 - {store.storeCode}";
}
[RelayCommand]
public void ClosePanel()
{
IsPanelOpen = false;
}
[RelayCommand]
private async System.Threading.Tasks.Task AddLocation()
{
if (_currentStore is null) return;
var entity = new BaseLocationInfo { storeCode = _currentStore.storeCode };
var editor = new EntityEditWindow();
var result = await editor.ShowDialog(entity, LocationFieldConfigs, false, GetMainWindow());
if (result)
{
_locationService.Insert(entity);
LoadLocations();
}
}
public async System.Threading.Tasks.Task EditLocationAsync(BaseLocationInfo location)
{
var editor = new EntityEditWindow();
var result = await editor.ShowDialog(location, LocationFieldConfigs, true, GetMainWindow());
if (result)
{
_locationService.Update(location);
LoadLocations();
}
}
public async System.Threading.Tasks.Task DeleteLocationAsync(BaseLocationInfo location)
{
var dlg = new Sln.Wcs.UI.Views.Base.ConfirmDialog();
if (!await dlg.ShowDialog("确定要删除该库位吗?", GetMainWindow())) return;
_locationService.DeleteById(location.objId);
LoadLocations();
}
private void LoadLocations()
{
if (_currentStore is null) return;
var list = _locationService.Query(x => x.storeCode == _currentStore.storeCode);
for (int i = 0; i < list.Count; i++) list[i].RowIndex = i + 1;
StoreLocations = new ObservableCollection<BaseLocationInfo>(list);
}
public List<FieldConfig> LocationFieldConfigs => new()
{
new() { PropertyName = "locationCode", DisplayName = "库位编号", IsRequired = true },
new() { PropertyName = "storeCode", DisplayName = "仓库编号", IsRequired = true, IsReadOnly = true },
new() { PropertyName = "locationName", DisplayName = "库位名称" },
new() { PropertyName = "locationArea", DisplayName = "库位区域" },
new() { PropertyName = "locationRows", DisplayName = "排", FieldType = FieldType.Number },
new() { PropertyName = "locationColumns", DisplayName = "列", FieldType = FieldType.Number },
new() { PropertyName = "locationLayers", DisplayName = "层", FieldType = FieldType.Number },
new() { PropertyName = "locationStatus", DisplayName = "库位状态", FieldType = FieldType.Combo, Options = StandardOptions.LocationStatus },
new() { PropertyName = "agvPosition", DisplayName = "AGV定位" },
new() { PropertyName = "materialCode", DisplayName = "物料编号" },
new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" },
new() { PropertyName = "stackCount", DisplayName = "库存数量" },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};
private Avalonia.Controls.Window GetMainWindow()
{
return (Avalonia.Controls.Window)Avalonia.Application.Current!
.ApplicationLifetime!.GetType()
.GetProperty("MainWindow")!
.GetValue(Avalonia.Application.Current.ApplicationLifetime)!;
}
}

@ -36,8 +36,8 @@ public partial class DeviceInfoViewModel : CrudPageViewModel<BaseDeviceInfo>
new() { PropertyName = "deviceName", DisplayName = "设备名称" },
new() { PropertyName = "deviceAlias", DisplayName = "设备别名" },
new() { PropertyName = "deviceSerialNo", DisplayName = "设备序号", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "deviceStatus", DisplayName = "设备状态", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Combo, Options = StandardOptions.DeviceType },
new() { PropertyName = "deviceStatus", DisplayName = "设备状态", FieldType = FieldType.Combo, Options = StandardOptions.DeviceStatus },
new() { PropertyName = "hostCode", DisplayName = "主机编号", IsRequired = true },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
@ -98,6 +98,7 @@ public partial class DeviceInfoViewModel : CrudPageViewModel<BaseDeviceInfo>
{
if (_currentDevice is null) return;
var list = _paramService.Query(x => x.deviceCode == _currentDevice.deviceCode);
for (int i = 0; i < list.Count; i++) list[i].RowIndex = i + 1;
DeviceParams = new ObservableCollection<BaseDeviceParam>(list);
}
@ -109,7 +110,7 @@ public partial class DeviceInfoViewModel : CrudPageViewModel<BaseDeviceInfo>
new() { PropertyName = "paramAddress", DisplayName = "参数地址", IsRequired = true },
new() { PropertyName = "paramType", DisplayName = "参数类型" },
new() { PropertyName = "paramValue", DisplayName = "参数值", FieldType = FieldType.Number },
new() { PropertyName = "operationType", DisplayName = "操作类型" },
new() { PropertyName = "operationType", DisplayName = "操作类型", FieldType = FieldType.Combo, Options = StandardOptions.OperationType },
new() { PropertyName = "operationFrequency", DisplayName = "操作频率(ms)" },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },

@ -21,7 +21,7 @@ public class DeviceParamViewModel : CrudPageViewModel<BaseDeviceParam>
new() { PropertyName = "paramAddress", DisplayName = "参数地址" },
new() { PropertyName = "paramType", DisplayName = "参数类型" },
new() { PropertyName = "paramValue", DisplayName = "参数值", FieldType = FieldType.Number },
new() { PropertyName = "operationType", DisplayName = "操作类型" },
new() { PropertyName = "operationType", DisplayName = "操作类型", FieldType = FieldType.Combo, Options = StandardOptions.OperationType },
new() { PropertyName = "operationFrequency", DisplayName = "操作频率(ms)" },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },

@ -19,7 +19,7 @@ public class PathDetailsViewModel : CrudPageViewModel<BasePathDetails>
new() { PropertyName = "pathName", DisplayName = "路径名称" },
new() { PropertyName = "startPoint", DisplayName = "起点" },
new() { PropertyName = "endPoint", DisplayName = "终点" },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Combo, Options = StandardOptions.DeviceType },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};

@ -34,8 +34,8 @@ public partial class PathInfoViewModel : CrudPageViewModel<BasePathInfo>
{
new() { PropertyName = "pathCode", DisplayName = "路径编号" },
new() { PropertyName = "pathName", DisplayName = "路径名称" },
new() { PropertyName = "pathType", DisplayName = "路径类型", FieldType = FieldType.Number },
new() { PropertyName = "pathCategory", DisplayName = "路径类别", FieldType = FieldType.Number },
new() { PropertyName = "pathType", DisplayName = "路径类型", FieldType = FieldType.Combo, Options = StandardOptions.TaskType },
new() { PropertyName = "pathCategory", DisplayName = "路径类别", FieldType = FieldType.Combo, Options = StandardOptions.TaskCategory },
new() { PropertyName = "startPoint", DisplayName = "起点" },
new() { PropertyName = "endPoint", DisplayName = "终点" },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
@ -98,6 +98,7 @@ public partial class PathInfoViewModel : CrudPageViewModel<BasePathInfo>
{
if (_currentPath is null) return;
var list = _detailService.Query(x => x.pathCode == _currentPath.pathCode);
for (int i = 0; i < list.Count; i++) list[i].RowIndex = i + 1;
DetailItems = new ObservableCollection<BasePathDetails>(list);
}
@ -107,7 +108,7 @@ public partial class PathInfoViewModel : CrudPageViewModel<BasePathInfo>
new() { PropertyName = "pathName", DisplayName = "路径名称" },
new() { PropertyName = "startPoint", DisplayName = "起点", IsRequired = true },
new() { PropertyName = "endPoint", DisplayName = "终点", IsRequired = true },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Combo, Options = StandardOptions.DeviceType },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};

@ -1,3 +1,4 @@
using System.Collections.ObjectModel;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
@ -24,11 +25,41 @@ public partial class CreateTaskViewModel : ObservableObject
[ObservableProperty] private string _endLocation = "01";
// ---- 任务属性 ----
[ObservableProperty] private int _taskType = 1; // 1-入库 2-出库
[ObservableProperty] private int _taskCategory = 1; // 1-包材 2-成品 3-托盘
[ObservableProperty] private int _taskType = 1;
[ObservableProperty] private int _taskCategory = 1;
[ObservableProperty] private string _palletBarcode = string.Empty;
[ObservableProperty] private string _materialCode = string.Empty;
// ---- 下拉选项 ----
public ObservableCollection<TaskAttributeOption> TaskTypeOptions { get; } = new()
{
new() { Value = 1, Display = "1 - 入库" },
new() { Value = 2, Display = "2 - 出库" },
};
public ObservableCollection<TaskAttributeOption> TaskCategoryOptions { get; } = new()
{
new() { Value = 1, Display = "1 - 包材" },
new() { Value = 2, Display = "2 - 成品" },
new() { Value = 3, Display = "3 - 托盘" },
};
[ObservableProperty]
private TaskAttributeOption _selectedTaskType;
[ObservableProperty]
private TaskAttributeOption _selectedTaskCategory;
partial void OnSelectedTaskTypeChanged(TaskAttributeOption? value)
{
if (value is not null) TaskType = value.Value;
}
partial void OnSelectedTaskCategoryChanged(TaskAttributeOption? value)
{
if (value is not null) TaskCategory = value.Value;
}
// ---- 手动操作选项 ----
[ObservableProperty] private bool _manualPutIn;
[ObservableProperty] private bool _manualTakeOut;
@ -41,6 +72,8 @@ public partial class CreateTaskViewModel : ObservableObject
{
_taskCreateService = taskCreateService;
_taskQueueService = taskQueueService;
_selectedTaskType = TaskTypeOptions[0];
_selectedTaskCategory = TaskCategoryOptions[0];
}
public Avalonia.Controls.Control CreateView() => new Views.Task.CreateTaskView();
@ -85,3 +118,9 @@ public partial class CreateTaskViewModel : ObservableObject
}
}
}
public class TaskAttributeOption
{
public int Value { get; set; }
public string Display { get; set; } = string.Empty;
}

@ -19,11 +19,6 @@ public partial class ManualTaskViewModel : ObservableObject
private readonly ILiveTaskDetailService _taskDetailService;
private readonly HttpClient _http;
private readonly SerilogHelper _logger;
private FreeHoistResponse? _allocatedHoist;
private Dictionary<string,FreeHoistResponse> hoistDic = new Dictionary<string,FreeHoistResponse>();
public string PageTitle => "手动执行任务";
[ObservableProperty]
@ -35,6 +30,9 @@ public partial class ManualTaskViewModel : ObservableObject
[ObservableProperty]
private ObservableCollection<LiveTaskDetail> _details = new();
[ObservableProperty]
private LiveTaskDetail? _selectedDetail;
[ObservableProperty]
private string _statusText = string.Empty;
@ -53,6 +51,17 @@ public partial class ManualTaskViewModel : ObservableObject
[ObservableProperty]
private string _dockingPoint = "--";
public ObservableCollection<HostOption> HostOptions { get; } = new()
{
new() { Name = "15栋入库提升机", Code = "1#Host" },
new() { Name = "15栋出库提升机", Code = "2#Host" },
new() { Name = "14栋提升机", Code = "3#Host" },
new() { Name = "13栋提升机", Code = "4#Host" }
};
[ObservableProperty]
private HostOption _selectedHostOption;
public ManualTaskViewModel(
ILiveTaskQueueService taskQueueService,
ILiveTaskDetailService taskDetailService,
@ -62,6 +71,7 @@ public partial class ManualTaskViewModel : ObservableObject
_taskDetailService = taskDetailService;
_http = new HttpClient { Timeout = System.TimeSpan.FromSeconds(5) };
_logger = logger;
_selectedHostOption = HostOptions[0];
}
public Avalonia.Controls.Control CreateView() => new Views.Task.ManualTaskView();
@ -75,6 +85,7 @@ public partial class ManualTaskViewModel : ObservableObject
private void RefreshTaskList()
{
List<LiveTaskQueue> list = _taskQueueService.getLiveTaskQueues(x=>x.executionMode == 1 && x.isFlag == 1);
for (int i = 0; i < list.Count; i++) list[i].RowIndex = i + 1;
Tasks = new ObservableCollection<LiveTaskQueue>(list);
StatusText = list.Count > 0
? $"查询到 {list.Count} 条待执行手动任务"
@ -84,18 +95,35 @@ public partial class ManualTaskViewModel : ObservableObject
partial void OnSelectedTaskChanged(LiveTaskQueue? value)
{
TaskExecuted = false;
_allocatedHoist = null;
SelectedDetail = null;
HoistInfo = "--";
DockingPoint = "--";
if (value is not null)
LoadDetails(value.taskCode);
}
partial void OnSelectedDetailChanged(LiveTaskDetail? value)
{
if (value is not null && !string.IsNullOrWhiteSpace(value.execDevice))
{
var parts = value.execDevice.Split('_');
if (parts.Length == 2)
{
HoistInfo = parts[0];
DockingPoint = parts[1];
return;
}
}
HoistInfo = "--";
DockingPoint = "--";
}
private void LoadDetails(string taskCode)
{
var detailList = _taskDetailService.Query(x => x.taskCode == taskCode)
.OrderBy(d => d.objId)
.ToList();
for (int i = 0; i < detailList.Count; i++) detailList[i].RowIndex = i + 1;
Details = new ObservableCollection<LiveTaskDetail>(detailList);
//StatusText = $"任务 {taskCode},共 {detailList.Count} 条明细";
}
@ -118,10 +146,16 @@ public partial class ManualTaskViewModel : ObservableObject
return;
}
var hoistDetail = Details.FirstOrDefault(d => d.deviceType == 2);
if (hoistDetail is null)
if (SelectedDetail is null)
{
StatusText = "当前任务未包含提升机步骤,无需手动执行";
StatusText = "请先在明细列表中选择一条提升机明细";
return;
}
var hoistDetail = SelectedDetail;
if (hoistDetail.deviceType != 2)
{
StatusText = "所选明细不是提升机步骤,请选择设备类型为提升机的明细";
return;
}
@ -130,8 +164,26 @@ public partial class ManualTaskViewModel : ObservableObject
try
{
// 1. 获取空闲提升机
string hostCode = "1#Host";
string hostCode = SelectedHostOption?.Code ?? "1#Host";
if (hoistDetail.taskType == 2 && hoistDetail.taskCategory == 2 && hoistDetail.startPoint.Contains("15#"))
{
hostCode = "2#Host";
}
else
{
if (hoistDetail.startPoint.Contains("13#"))
{
hostCode = "4#Host";
}else if (hoistDetail.startPoint.Contains("14#"))
{
hostCode = "3#Host";
}else if (hoistDetail.startPoint.Contains("15#"))
{
hostCode = "1#Host";
}
}
var freeUrl = $"{HoistBaseUrl}/api/hoist/free?hostCode={Uri.EscapeDataString(hostCode)}";
var freeRes = await _http.GetFromJsonAsync<FreeHoistResponse>(freeUrl);
@ -143,12 +195,8 @@ public partial class ManualTaskViewModel : ObservableObject
return;
}
_allocatedHoist = freeRes;
HoistInfo = $"{freeRes.deviceName ?? freeRes.deviceCode} (空闲)";
DockingPoint = $"{freeRes.deviceSerialNo}" ?? "--";
StatusText = $"已获取空闲提升机 {freeRes.deviceName ?? freeRes.deviceCode},正在下发任务...";
hoistDic.Add(SelectedTask.taskCode,freeRes);
// 2. 下发提升机调度任务
var dispatchBody = new
{
@ -176,7 +224,11 @@ public partial class ManualTaskViewModel : ObservableObject
_taskQueueService.Update(SelectedTask);
hoistDetail.taskStatus = 2;
hoistDetail.execDevice = $"{freeRes.hostCode}_{freeRes.deviceSerialNo}";
_taskDetailService.Update(hoistDetail);
HoistInfo = freeRes.hostCode.ToString(); // HoistInfo = freeRes.hostCode;
DockingPoint = freeRes.deviceSerialNo.ToString();
});
TaskExecuted = true;
@ -188,7 +240,6 @@ public partial class ManualTaskViewModel : ObservableObject
catch (HttpRequestException ex)
{
TaskExecuted = false;
_allocatedHoist = null;
HoistInfo = "--";
StatusText = $"与提升机调度中心通信失败: {ex.Message}";
_logger.Error($"HoistServer 通信失败: {ex.Message}");
@ -196,7 +247,6 @@ public partial class ManualTaskViewModel : ObservableObject
catch (Exception ex)
{
TaskExecuted = false;
_allocatedHoist = null;
HoistInfo = "--";
StatusText = $"任务执行失败: {ex.Message}";
_logger.Error($"手动任务执行失败: {ex.Message}");
@ -219,18 +269,29 @@ public partial class ManualTaskViewModel : ObservableObject
return;
}
hoistDic.TryGetValue(SelectedTask.taskCode, out _allocatedHoist);
if (_allocatedHoist is null)
if (SelectedDetail is null)
{
StatusText = "请先执行任务获取空闲提升机,再确认物料到位";
StatusText = "请先在明细列表中选择一条明细";
return;
}
var hoistDetail = Details.FirstOrDefault(d => d.deviceType == 2);
if (hoistDetail is null)
var hoistDetail = SelectedDetail;
if (hoistDetail.deviceType != 2)
{
StatusText = "未找到提升机任务明细";
StatusText = "所选明细不是提升机步骤,请选择设备类型为提升机的明细";
return;
}
if (SelectedTask.taskStatus != 2)
{
StatusText = "当前任务未在执行中,请先执行任务";
return;
}
if (string.IsNullOrWhiteSpace(hoistDetail.execDevice))
{
StatusText = "当前任务未分配执行设备,请先执行任务";
return;
}
@ -239,10 +300,14 @@ public partial class ManualTaskViewModel : ObservableObject
try
{
var execParts = hoistDetail.execDevice!.Split('_');
var execHostCode = execParts[0];
var execSerialNo = int.Parse(execParts[1]);
var body = new
{
hostCode = _allocatedHoist.hostCode,
serialNo = _allocatedHoist.deviceSerialNo,
hostCode = execHostCode,
serialNo = execSerialNo,
taskCode = hoistDetail.taskCode,
palletBarcode = hoistDetail.palletBarcode ?? "",
startPoint = hoistDetail.startPoint,
@ -302,4 +367,10 @@ public partial class ManualTaskViewModel : ObservableObject
public bool success { get; set; }
public string? msg { get; set; }
}
public class HostOption
{
public string Name { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
}
}

@ -21,13 +21,14 @@ public class TaskDetailViewModel : CrudPageViewModel<LiveTaskDetail>
new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" },
new() { PropertyName = "materialBarcode", DisplayName = "物料条码" },
new() { PropertyName = "materialCount", DisplayName = "物料数量", FieldType = FieldType.Number },
new() { PropertyName = "taskType", DisplayName = "任务类型", FieldType = FieldType.Number },
new() { PropertyName = "taskCategory", DisplayName = "任务类别", FieldType = FieldType.Number },
new() { PropertyName = "taskType", DisplayName = "任务类型", FieldType = FieldType.Combo, Options = StandardOptions.TaskType },
new() { PropertyName = "taskCategory", DisplayName = "任务类别", FieldType = FieldType.Combo, Options = StandardOptions.TaskCategory },
new() { PropertyName = "startPoint", DisplayName = "起始位置" },
new() { PropertyName = "endPoint", DisplayName = "结束位置" },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Combo, Options = StandardOptions.DeviceType },
new() { PropertyName = "execDevice", DisplayName = "执行设备" },
new() { PropertyName = "isValidate", DisplayName = "校验物料", FieldType = FieldType.CheckBox },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Number },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Combo, Options = StandardOptions.TaskStatus },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};

@ -37,12 +37,12 @@ public partial class TaskQueueViewModel : CrudPageViewModel<LiveTaskQueue>
new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" },
new() { PropertyName = "materialBarcode", DisplayName = "物料条码" },
new() { PropertyName = "materialCount", DisplayName = "物料数量", FieldType = FieldType.Number },
new() { PropertyName = "taskType", DisplayName = "任务类型", FieldType = FieldType.Number },
new() { PropertyName = "taskCategory", DisplayName = "任务类别", FieldType = FieldType.Number },
new() { PropertyName = "taskType", DisplayName = "任务类型", FieldType = FieldType.Combo, Options = StandardOptions.TaskType },
new() { PropertyName = "taskCategory", DisplayName = "任务类别", FieldType = FieldType.Combo, Options = StandardOptions.TaskCategory },
new() { PropertyName = "startPoint", DisplayName = "起始位置" },
new() { PropertyName = "endPoint", DisplayName = "结束位置" },
new() { PropertyName = "pathCode", DisplayName = "路径编号" },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Number },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Combo, Options = StandardOptions.TaskStatus },
new() { PropertyName = "taskSteps", DisplayName = "任务步骤", FieldType = FieldType.Number },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
@ -104,6 +104,7 @@ public partial class TaskQueueViewModel : CrudPageViewModel<LiveTaskQueue>
{
if (_currentTask is null) return;
var list = _detailService.Query(x => x.taskCode == _currentTask.taskCode);
for (int i = 0; i < list.Count; i++) list[i].RowIndex = i + 1;
DetailItems = new ObservableCollection<LiveTaskDetail>(list);
}
@ -114,9 +115,10 @@ public partial class TaskQueueViewModel : CrudPageViewModel<LiveTaskQueue>
new() { PropertyName = "materialCode", DisplayName = "物料编号" },
new() { PropertyName = "startPoint", DisplayName = "起始位置" },
new() { PropertyName = "endPoint", DisplayName = "结束位置" },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Combo, Options = StandardOptions.DeviceType },
new() { PropertyName = "execDevice", DisplayName = "执行设备" },
new() { PropertyName = "isValidate", DisplayName = "校验物料", FieldType = FieldType.CheckBox },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Number },
new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Combo, Options = StandardOptions.TaskStatus },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data;
using Avalonia.Layout;
using Avalonia.Media;
using Avalonia.Styling;
@ -88,6 +89,42 @@ public partial class EntityEditWindow : Window
prop.SetValue(_entity, cb.IsChecked == true ? 1 : 0);
input = cb;
}
else if (field.FieldType == FieldType.Combo)
{
var combo = new ComboBox
{
ItemsSource = field.Options,
DisplayMemberBinding = new Binding("Display"),
IsEnabled = !field.IsReadOnly,
Background = tbBg,
Foreground = tbFg,
BorderBrush = tbBorder,
BorderThickness = new Thickness(1),
CornerRadius = new CornerRadius(3),
Padding = new Thickness(8, 5),
FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Stretch,
};
// 选中当前值对应的选项
ComboOption? selected = null;
foreach (ComboOption opt in field.Options)
{
if (Equals(opt.Value, value))
{
selected = opt;
break;
}
}
combo.SelectedItem = selected;
combo.SelectionChanged += (_, _) =>
{
if (combo.SelectedItem is ComboOption opt)
prop.SetValue(_entity, opt.Value);
};
input = combo;
}
else
{
var tb = new TextBox

@ -8,38 +8,40 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1*,0.8*,0.7*,0.7*,0.5*,0.5*,0.5*,0.8*,1*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="库位编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="库位名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="区域" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="仓库" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="排" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="列" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="层" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="AGV定位" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1*,0.8*,0.7*,0.7*,0.5*,0.5*,0.5*,0.8*,1*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="库位编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="库位名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="区域" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="仓库" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="排" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="列" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="层" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="AGV定位" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="12" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1*,0.8*,0.7*,0.7*,0.5*,0.5*,0.5*,0.8*,1*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding locationCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding locationName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding locationArea}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding storeCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding locationRows}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding locationColumns}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding locationLayers}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding agvPosition}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding locationStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="11" Orientation="Horizontal" Spacing="6">
<Grid ColumnDefinitions="0.4*,1*,0.8*,0.7*,0.7*,0.5*,0.5*,0.5*,0.8*,1*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding locationCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding locationName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding locationArea}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding storeCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding locationRows}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding locationColumns}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding locationLayers}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding agvPosition}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding locationStatus, Converter={StaticResource CodeToText}, ConverterParameter=LocationStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="11" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="12" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
</StackPanel>

@ -8,30 +8,32 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,1.3*,0.9*,1.2*,1*,1*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="物料名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="物料条码" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="最短存放" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="最长存放" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,0.9*,1.2*,1*,1*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="物料名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="物料条码" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="最短存放" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="最长存放" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,1.3*,0.9*,1.2*,1*,1*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding materialName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding materialType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding materialBarcode}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding minStorageCycle}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding maxStorageCycle}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="6">
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,0.9*,1.2*,1*,1*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding materialName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding materialType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding materialBarcode}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding minStorageCycle}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding maxStorageCycle}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
</StackPanel>

@ -1,38 +1,108 @@
<UserControl x:CompileBindings="False" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Sln.Wcs.UI.Views.Base.StoreInfoListView">
<Grid RowDefinitions="Auto,Auto,*" Margin="20,14,20,14" VerticalAlignment="Stretch">
<Grid RowDefinitions="Auto,Auto,*" Margin="20,14,20,14" VerticalAlignment="Stretch" ClipToBounds="True">
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,Auto" Margin="0,0,0,8">
<TextBox Grid.Column="0" Watermark="搜索仓库编号/名称..." Text="{Binding SearchText}" Width="220" Background="{DynamicResource CardBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" />
<Button Grid.Column="1" Content="搜索" Command="{Binding SearchCommand}" Background="{DynamicResource PrimaryBgBrush}" Foreground="{DynamicResource SecondaryTextBrush}" Padding="14,6" Margin="12,0,6,0" />
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,1.5*,1*,1*,1*">
<TextBlock Grid.Column="0" Text="仓库编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="仓库名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="仓库类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1.5*,1*,1*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="仓库编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="仓库名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="仓库类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,1.5*,1*,1*,1*">
<TextBlock Grid.Column="0" Text="{Binding storeCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding storeName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding storeType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="4" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Grid ColumnDefinitions="0.4*,1.2*,1.5*,1*,1*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding storeCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding storeName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding storeType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="5" Orientation="Horizontal" Spacing="4">
<Button Content="库位" Tag="{Binding}" Click="Locations_Click" Background="{DynamicResource TealBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Slide-out overlay panel -->
<Panel Grid.Row="0" Grid.RowSpan="3" IsVisible="{Binding IsPanelOpen}" ZIndex="10">
<Grid ColumnDefinitions="0.6*,1.4*">
<Border Grid.Column="0" x:Name="Backdrop" Background="{DynamicResource OverlayBgBrush}" Opacity="0" PointerPressed="Backdrop_Pressed" />
<Border Grid.Column="1" x:Name="SlideContent"
Background="{DynamicResource CardBgBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1,0,0,0">
<Border.RenderTransform>
<TranslateTransform X="3000" />
</Border.RenderTransform>
<Grid RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="{DynamicResource PrimaryBgBrush}" Padding="14,10" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="*,Auto,Auto">
<TextBlock Grid.Column="0" Text="{Binding SlidePanelTitle}" FontSize="14" FontWeight="SemiBold" Foreground="{DynamicResource PrimaryTextBrush}" VerticalAlignment="Center" />
<Button Grid.Column="1" Content="新增" Command="{Binding AddLocationCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" FontSize="12" Padding="12,5" Margin="0,0,10,0" />
<Button Grid.Column="2" Content="✕" Click="ClosePanel_Click" Background="Transparent" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="14" Padding="6,2" />
</Grid>
</Border>
<Grid Grid.Row="1" RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="{DynamicResource CardBgBrush}" Padding="10,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.4*,0.8*,0.5*,0.7*,0.4*,0.4*,0.4*,0.7*,1*,0.7*,0.5*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="库位编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="库位名称" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="区域" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="排" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="列" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="层" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="AGV定位" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="物料编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="状态" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="1" ItemsSource="{Binding StoreLocations}" Background="Transparent" Foreground="{DynamicResource PrimaryTextBrush}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="10,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.4*,0.8*,0.5*,0.7*,0.4*,0.4*,0.4*,0.7*,1*,0.7*,0.5*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding locationCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding locationName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding locationArea}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding locationRows}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding locationColumns}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding locationLayers}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding agvPosition}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding materialCode}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding locationStatus, Converter={StaticResource CodeToText}, ConverterParameter=LocationStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding isFlag, Converter={StaticResource CodeToText}, ConverterParameter=IsFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="11" Orientation="Horizontal" Spacing="4">
<Button Content="编辑" Tag="{Binding}" Click="LocationEdit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="LocationDelete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Border>
</Grid>
</Panel>
</Grid>
</UserControl>

@ -1,5 +1,7 @@
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Media;
using Sln.Wcs.UI.ViewModels.Base;
namespace Sln.Wcs.UI.Views.Base;
@ -28,4 +30,99 @@ public partial class StoreInfoListView : UserControl
(vm.GetType().GetProperty("DeleteCommand")?.GetValue(vm) as System.Windows.Input.ICommand)?.Execute(null);
}
}
private async void Locations_Click(object? sender, RoutedEventArgs e)
{
if (sender is Button btn && btn.Tag is Sln.Wcs.Model.Domain.BaseStoreInfo store && DataContext is StoreInfoViewModel vm)
{
vm.LoadLocationsData(store);
Backdrop.Opacity = 0;
if (SlideContent.RenderTransform is TranslateTransform transform)
transform.X = 3000;
vm.IsPanelOpen = true;
await AnimateSlideIn();
}
}
private async void ClosePanel_Click(object? sender, RoutedEventArgs e)
{
await AnimateSlideOut();
if (DataContext is StoreInfoViewModel vm)
vm.ClosePanel();
}
private async void Backdrop_Pressed(object? sender, PointerPressedEventArgs e)
{
await AnimateSlideOut();
if (DataContext is StoreInfoViewModel vm)
vm.ClosePanel();
}
private async void LocationEdit_Click(object? sender, RoutedEventArgs e)
{
if (sender is Button btn && btn.Tag is Sln.Wcs.Model.Domain.BaseLocationInfo location && DataContext is StoreInfoViewModel vm)
await vm.EditLocationAsync(location);
}
private async void LocationDelete_Click(object? sender, RoutedEventArgs e)
{
if (sender is Button btn && btn.Tag is Sln.Wcs.Model.Domain.BaseLocationInfo location && DataContext is StoreInfoViewModel vm)
await vm.DeleteLocationAsync(location);
}
private async System.Threading.Tasks.Task AnimateSlideIn()
{
var transform = SlideContent.RenderTransform as TranslateTransform;
if (transform is null) return;
double slideFrom = transform.X;
int steps = 16;
int delay = 16;
for (int i = 1; i <= steps; i++)
{
double t = (double)i / steps;
double eased = 1.0 - System.Math.Pow(1.0 - t, 3.0);
transform.X = slideFrom + (0 - slideFrom) * eased;
await System.Threading.Tasks.Task.Delay(delay);
}
transform.X = 0;
int fadeSteps = 10;
int fadeDelay = 15;
for (int i = 1; i <= fadeSteps; i++)
{
Backdrop.Opacity = (double)i / fadeSteps;
await System.Threading.Tasks.Task.Delay(fadeDelay);
}
Backdrop.Opacity = 1;
}
private async System.Threading.Tasks.Task AnimateSlideOut()
{
var transform = SlideContent.RenderTransform as TranslateTransform;
if (transform is null) return;
int fadeSteps = 8;
int fadeDelay = 12;
for (int i = fadeSteps; i >= 0; i--)
{
Backdrop.Opacity = (double)i / fadeSteps;
await System.Threading.Tasks.Task.Delay(fadeDelay);
}
Backdrop.Opacity = 0;
double slideFrom = transform.X;
int slideSteps = 16;
int slideDelay = 14;
for (int i = 1; i <= slideSteps; i++)
{
double t = (double)i / slideSteps;
double eased = t * t * t;
transform.X = slideFrom + (3000 - slideFrom) * eased;
await System.Threading.Tasks.Task.Delay(slideDelay);
}
transform.X = 3000;
}
}

@ -9,15 +9,16 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.5*,1.5*,0.8*,1.2*,0.8*,1.2*,1*,1.2*">
<TextBlock Grid.Column="0" Text="主机编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="主机名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="主机IP" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="端口" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="路径" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.5*,1.5*,0.8*,1.2*,0.8*,1.2*,1*,1.2*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="主机编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="主机名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="主机IP" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="端口" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="路径" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
@ -26,15 +27,16 @@
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.5*,1.5*,0.8*,1.2*,0.8*,1.2*,1*,1.2*">
<TextBlock Grid.Column="0" Text="{Binding hostCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding hostName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding hostType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding hostIP}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding hostPort}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding hostPath}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="6">
<Grid ColumnDefinitions="0.4*,1.5*,1.5*,0.8*,1.2*,0.8*,1.2*,1*,1.2*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding hostCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding hostName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding hostType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding hostIP}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding hostPort}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding hostPath}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click"
Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click"

@ -3,24 +3,25 @@
x:Class="Sln.Wcs.UI.Views.Device.DeviceInfoListView">
<Grid RowDefinitions="Auto,Auto,*" Margin="20,14,20,14" VerticalAlignment="Stretch" ClipToBounds="True">
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,Auto" Margin="0,0,0,8">
<TextBox Grid.Column="0" Watermark="搜索设备编号/名称..." Text="{Binding SearchText}" Width="220"
<TextBox Grid.Column="1" Watermark="搜索设备编号/名称..." Text="{Binding SearchText}" Width="220"
Background="{DynamicResource CardBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" />
<Button Grid.Column="1" Content="搜索" Command="{Binding SearchCommand}"
<Button Grid.Column="2" Content="搜索" Command="{Binding SearchCommand}"
Background="{DynamicResource PrimaryBgBrush}" Foreground="{DynamicResource SecondaryTextBrush}" Padding="14,6" Margin="12,0,6,0" />
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}"
<Button Grid.Column="3" Content="新增" Command="{Binding AddCommand}"
Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.1*,1.1*,0.7*,0.6*,0.6*,0.9*,0.6*,0.6*,1*">
<TextBlock Grid.Column="0" Text="设备编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="设备名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="别名" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="主机编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.1*,1.1*,0.7*,0.6*,0.6*,0.9*,0.6*,0.6*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="设备编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="设备名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="别名" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="主机编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
@ -29,16 +30,17 @@
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.1*,1.1*,0.7*,0.6*,0.6*,0.9*,0.6*,0.6*,1*">
<TextBlock Grid.Column="0" Text="{Binding deviceCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding deviceName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding deviceAlias}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding deviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding deviceStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding hostCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding deviceSerialNo}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="4">
<Grid ColumnDefinitions="0.4*,1.1*,1.1*,0.7*,0.6*,0.6*,0.9*,0.6*,0.6*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding deviceCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding deviceName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding deviceAlias}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding deviceStatus, Converter={StaticResource CodeToText}, ConverterParameter=DeviceStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding hostCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding deviceSerialNo}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="9" Orientation="Horizontal" Spacing="4">
<Button Content="参数" Tag="{Binding}" Click="Params_Click" Background="{DynamicResource TealBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
@ -52,8 +54,8 @@
<!-- Slide-out overlay panel -->
<Panel Grid.Row="0" Grid.RowSpan="3" IsVisible="{Binding IsPanelOpen}" ZIndex="10">
<Grid ColumnDefinitions="0.6*,1.4*">
<Border Grid.Column="0" x:Name="Backdrop" Background="{DynamicResource OverlayBgBrush}" Opacity="0" PointerPressed="Backdrop_Pressed" />
<Border Grid.Column="1" x:Name="SlideContent"
<Border Grid.Column="1" x:Name="Backdrop" Background="{DynamicResource OverlayBgBrush}" Opacity="0" PointerPressed="Backdrop_Pressed" />
<Border Grid.Column="2" x:Name="SlideContent"
Background="{DynamicResource CardBgBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1,0,0,0">
@ -70,30 +72,32 @@
</Border>
<Grid Grid.Row="1" RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="{DynamicResource CardBgBrush}" Padding="10,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.6*,1.5*,1.2*,0.8*,0.5*,0.7*,0.6*,1*">
<TextBlock Grid.Column="0" Text="参数编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="参数名称" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="参数地址" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="参数类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="值" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="操作类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,0.6*,1.5*,1.2*,0.8*,0.5*,0.7*,0.6*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="参数编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="参数名称" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="参数地址" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="参数类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="值" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="操作类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="1" ItemsSource="{Binding DeviceParams}" Background="Transparent" Foreground="{DynamicResource PrimaryTextBrush}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="10,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.6*,1.5*,1.2*,0.8*,0.5*,0.7*,0.6*,1*">
<TextBlock Grid.Column="0" Text="{Binding paramCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding paramName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding paramAddress}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding paramType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding paramValue}" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding operationType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding isFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="4">
<Grid ColumnDefinitions="0.4*,0.6*,1.5*,1.2*,0.8*,0.5*,0.7*,0.6*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding paramCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding paramName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding paramAddress}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding paramType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding paramValue}" Foreground="{DynamicResource MutedTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding operationType, Converter={StaticResource CodeToText}, ConverterParameter=OperationType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding isFlag, Converter={StaticResource CodeToText}, ConverterParameter=IsFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="4">
<Button Content="编辑" Tag="{Binding}" Click="ParamEdit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="ParamDelete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
</StackPanel>

@ -8,34 +8,36 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1*,1*,1.2*,1*,0.7*,0.6*,0.7*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="参数编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="设备编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="参数名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="参数地址" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="值" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="频率" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1*,1*,1.2*,1*,0.7*,0.6*,0.7*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="参数编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="设备编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="参数名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="参数地址" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="值" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="频率" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1*,1*,1.2*,1*,0.7*,0.6*,0.7*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding paramCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding deviceCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding paramName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding paramAddress}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding paramType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding paramValue}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding operationType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding operationFrequency}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="9" Orientation="Horizontal" Spacing="6">
<Grid ColumnDefinitions="0.4*,1*,1*,1.2*,1*,0.7*,0.6*,0.7*,0.7*,0.7*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding paramCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding deviceCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding paramName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding paramAddress}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding paramType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding paramValue}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding operationType, Converter={StaticResource CodeToText}, ConverterParameter=OperationType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding operationFrequency}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="10" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
</StackPanel>

@ -8,28 +8,30 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,1.3*,1.2*,1.2*,0.8*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="路径编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="起点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="终点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="设备类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,1.2*,1.2*,0.8*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="路径名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="起点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="终点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="设备类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,1.3*,1.2*,1.2*,0.8*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding deviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="6" Orientation="Horizontal" Spacing="6">
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,1.2*,1.2*,0.8*,0.8*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
</StackPanel>

@ -3,23 +3,24 @@
x:Class="Sln.Wcs.UI.Views.Path.PathInfoListView">
<Grid RowDefinitions="Auto,Auto,*" Margin="20,14,20,14" VerticalAlignment="Stretch" ClipToBounds="True">
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,Auto" Margin="0,0,0,8">
<TextBox Grid.Column="0" Watermark="搜索路径编号/名称..." Text="{Binding SearchText}" Width="220"
<TextBox Grid.Column="1" Watermark="搜索路径编号/名称..." Text="{Binding SearchText}" Width="220"
Background="{DynamicResource CardBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" />
<Button Grid.Column="1" Content="搜索" Command="{Binding SearchCommand}"
<Button Grid.Column="2" Content="搜索" Command="{Binding SearchCommand}"
Background="{DynamicResource PrimaryBgBrush}" Foreground="{DynamicResource SecondaryTextBrush}" Padding="14,6" Margin="12,0,6,0" />
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}"
<Button Grid.Column="3" Content="新增" Command="{Binding AddCommand}"
Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,1.3*,0.8*,0.8*,1.2*,1.2*,0.8*,1*">
<TextBlock Grid.Column="0" Text="路径编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="路径类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="路径类别" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="起点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="终点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,0.8*,0.8*,1.2*,1.2*,0.8*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="路径名称" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="路径类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="路径类别" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="起点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="终点" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
@ -28,15 +29,16 @@
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,1.3*,0.8*,0.8*,1.2*,1.2*,0.8*,1*">
<TextBlock Grid.Column="0" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding pathType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding pathCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="4">
<Grid ColumnDefinitions="0.4*,1.2*,1.3*,0.8*,0.8*,1.2*,1.2*,0.8*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding pathType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding pathCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="4">
<Button Content="明细" Tag="{Binding}" Click="Details_Click" Background="{DynamicResource TealBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
@ -50,8 +52,8 @@
<!-- Slide-out overlay panel -->
<Panel Grid.Row="0" Grid.RowSpan="3" IsVisible="{Binding IsPanelOpen}" ZIndex="10">
<Grid ColumnDefinitions="0.6*,1.4*">
<Border Grid.Column="0" x:Name="Backdrop" Background="{DynamicResource OverlayBgBrush}" Opacity="0" PointerPressed="Backdrop_Pressed" />
<Border Grid.Column="1" x:Name="SlideContent"
<Border Grid.Column="1" x:Name="Backdrop" Background="{DynamicResource OverlayBgBrush}" Opacity="0" PointerPressed="Backdrop_Pressed" />
<Border Grid.Column="2" x:Name="SlideContent"
Background="{DynamicResource CardBgBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1,0,0,0">
@ -68,28 +70,30 @@
</Border>
<Grid Grid.Row="1" RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="{DynamicResource CardBgBrush}" Padding="10,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.7*,1*,0.9*,0.9*,0.7*,0.5*,0.8*">
<TextBlock Grid.Column="0" Text="路径编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径名称" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="起点" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="终点" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="设备类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,0.7*,1*,0.9*,0.9*,0.7*,0.5*,0.8*">
<TextBlock Grid.Column="0" Text="序号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="路径名称" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="起点" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="终点" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="设备类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="1" ItemsSource="{Binding DetailItems}" Background="Transparent" Foreground="{DynamicResource PrimaryTextBrush}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="10,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.7*,1*,0.9*,0.9*,0.7*,0.5*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding deviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding isFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="6" Orientation="Horizontal" Spacing="4">
<Grid ColumnDefinitions="0.4*,0.7*,1*,0.9*,0.9*,0.7*,0.5*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding pathName}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding isFlag, Converter={StaticResource CodeToText}, ConverterParameter=IsFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="4">
<Button Content="编辑" Tag="{Binding}" Click="DetailEdit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="DetailDelete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
</StackPanel>

@ -1,6 +1,23 @@
<UserControl x:CompileBindings="False" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Sln.Wcs.UI.Views.Task.CreateTaskView">
<UserControl.Styles>
<Style Selector="TextBox">
<Setter Property="Background" Value="{DynamicResource PrimaryBgBrush}" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="CaretBrush" Value="{DynamicResource AccentTextBrush}" />
<Setter Property="SelectionBrush" Value="{DynamicResource SelectionBgBrush}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource SelectionFgBrush}" />
</Style>
<Style Selector="ComboBox">
<Setter Property="Background" Value="{DynamicResource PrimaryBgBrush}" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
</Style>
</UserControl.Styles>
<ScrollViewer Margin="20,14,20,14">
<StackPanel Spacing="14" MaxWidth="600">
@ -66,13 +83,17 @@
<WrapPanel>
<StackPanel Spacing="4" Margin="0,0,20,8">
<TextBlock Text="任务类型" FontSize="11" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Text="1-入库 2-出库" FontSize="9" Foreground="{DynamicResource MutedTextBrush}" Margin="0,2,0,4" />
<TextBox Text="{Binding TaskType}" Width="200" />
<ComboBox ItemsSource="{Binding TaskTypeOptions}"
SelectedItem="{Binding SelectedTaskType, Mode=TwoWay}"
DisplayMemberBinding="{Binding Display}"
Width="200" FontSize="12" />
</StackPanel>
<StackPanel Spacing="4" Margin="0,0,20,8">
<TextBlock Text="任务类别" FontSize="11" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Text="1-包材 2-成品 3-托盘" FontSize="9" Foreground="{DynamicResource MutedTextBrush}" Margin="0,2,0,4" />
<TextBox Text="{Binding TaskCategory}" Width="200" />
<ComboBox ItemsSource="{Binding TaskCategoryOptions}"
SelectedItem="{Binding SelectedTaskCategory, Mode=TwoWay}"
DisplayMemberBinding="{Binding Display}"
Width="200" FontSize="12" />
</StackPanel>
</WrapPanel>
<!-- 手动操作 -->

@ -10,30 +10,44 @@
<Border Grid.Column="0" CornerRadius="8" Padding="14" Background="{DynamicResource CardBgBrush}"
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="0,0,8,0">
<Grid RowDefinitions="Auto,Auto,*">
<StackPanel Grid.Row="0" Orientation="Horizontal" Spacing="8" Margin="0,0,0,10">
<Rectangle Width="3" Height="18" Fill="#4FC3F7" RadiusX="2" RadiusY="2" />
<TextBlock Text="手动任务列表" FontSize="14" FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryTextBrush}" />
<Button Content="刷新" Command="{Binding LoadCommand}"
<Grid Grid.Row="0" ColumnDefinitions="Auto,Auto,*,Auto" Margin="0,0,0,10">
<StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="8">
<Rectangle Width="3" Height="18" Fill="#4FC3F7" RadiusX="2" RadiusY="2" />
<TextBlock Text="手动任务列表" FontSize="14" FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryTextBrush}" />
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="6" Margin="20,0,0,0">
<TextBlock Text="提升机选择:" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" VerticalAlignment="Center" />
<ComboBox ItemsSource="{Binding HostOptions}"
SelectedItem="{Binding SelectedHostOption, Mode=TwoWay}"
DisplayMemberBinding="{Binding Name}"
MinWidth="145" FontSize="11"
Foreground="{DynamicResource PrimaryTextBrush}"
BorderBrush="{DynamicResource BorderBrush}" />
</StackPanel>
<Button Grid.Column="3" Content="刷新" Command="{Binding LoadCommand}"
Background="{DynamicResource TealBtnBrush}" Foreground="White"
FontSize="11" Padding="10,4" HorizontalAlignment="Right" />
</StackPanel>
FontSize="11" Padding="10,4" />
</Grid>
<!-- 列表头 -->
<Border Grid.Row="1" Background="{DynamicResource PrimaryBgBrush}" Padding="8,6"
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.4*,0.8*,0.8*,1.2*,1.2*,0.8*">
<TextBlock Grid.Column="0" Text="任务编号" FontSize="11" FontWeight="SemiBold"
<Grid ColumnDefinitions="0.4*,1.4*,0.8*,0.8*,1.2*,1.2*,0.8*">
<TextBlock Grid.Column="0" Text="号" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="类型" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="1" Text="任务编号" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="类" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="2" Text="类" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="起始位置" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="3" Text="类别" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="结束位置" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="4" Text="起始位置" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="步骤" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="5" Text="结束位置" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="步骤" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
@ -44,18 +58,20 @@
<DataTemplate>
<Border Padding="8,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1"
Background="Transparent">
<Grid ColumnDefinitions="1.4*,0.8*,0.8*,1.2*,1.2*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding taskCode}"
<Grid ColumnDefinitions="0.4*,1.4*,0.8*,0.8*,1.2*,1.2*,0.8*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding taskCode}"
Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding taskType}"
<TextBlock Grid.Column="2" Text="{Binding taskType, Converter={StaticResource CodeToText}, ConverterParameter=TaskType}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding taskCategory}"
<TextBlock Grid.Column="3" Text="{Binding taskCategory, Converter={StaticResource CodeToText}, ConverterParameter=TaskCategory}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding startPoint}"
<TextBlock Grid.Column="4" Text="{Binding startPoint}"
Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding endPoint}"
<TextBlock Grid.Column="5" Text="{Binding endPoint}"
Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskSteps}"
<TextBlock Grid.Column="6" Text="{Binding taskSteps}"
Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
</Grid>
</Border>
@ -78,7 +94,7 @@
<!-- 明细表头 -->
<Border Grid.Row="1" Background="{DynamicResource PrimaryBgBrush}" Padding="8,6"
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.5*,1.2*,1.2*,0.7*,0.7*,0.7*">
<Grid ColumnDefinitions="0.5*,1.2*,1.2*,0.7*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="序号" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="起始位置" FontSize="11" FontWeight="SemiBold"
@ -87,30 +103,35 @@
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="设备" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="状态" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="4" Text="执行设备" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="执行方式" FontSize="11" FontWeight="SemiBold"
<TextBlock Grid.Column="5" Text="状态" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="执行方式" FontSize="11" FontWeight="SemiBold"
Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Details}"
SelectedItem="{Binding SelectedDetail, Mode=TwoWay}"
Background="Transparent" Foreground="{DynamicResource PrimaryTextBrush}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.5*,1.2*,1.2*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="{Binding objId}"
<Grid ColumnDefinitions="0.5*,1.2*,1.2*,0.7*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding startPoint}"
Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding endPoint}"
Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding deviceType}"
<TextBlock Grid.Column="3" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding taskStatus}"
<TextBlock Grid.Column="4" Text="{Binding execDevice}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding executionMode}"
<TextBlock Grid.Column="5" Text="{Binding taskStatus, Converter={StaticResource CodeToText}, ConverterParameter=TaskStatus}"
Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding executionMode, Converter={StaticResource CodeToText}, ConverterParameter=ExecutionMode}"
Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
</Grid>
</Border>

@ -8,9 +8,9 @@
<Button Grid.Column="2" Content="新增" Command="{Binding AddCommand}" Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,0.9*,1*,1.1*,0.6*,0.6*,0.6*,0.9*,0.9*,0.7*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="任务编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="路径编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1*,1.1*,0.6*,0.6*,0.6*,0.9*,0.9*,0.7*,0.6*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="任务编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="托盘条码" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="数量" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
@ -19,29 +19,31 @@
<TextBlock Grid.Column="7" Text="起始位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="结束位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="设备" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="12" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="执行设备" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="12" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="13" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" Background="{DynamicResource SurfaceBgBrush}" Foreground="{DynamicResource PrimaryTextBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,0.9*,1*,1.1*,0.6*,0.6*,0.6*,0.9*,0.9*,0.7*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="{Binding taskCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<Grid ColumnDefinitions="0.4*,1.2*,1*,1.1*,0.6*,0.6*,0.6*,0.9*,0.9*,0.7*,0.6*,0.7*,0.7*,0.7*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding taskCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding palletBarcode}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding materialCount}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding taskCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskType, Converter={StaticResource CodeToText}, ConverterParameter=TaskType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding taskCategory, Converter={StaticResource CodeToText}, ConverterParameter=TaskCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding deviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding taskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="11" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="12" Orientation="Horizontal" Spacing="6">
<TextBlock Grid.Column="9" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding execDevice}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="11" Text="{Binding taskStatus, Converter={StaticResource CodeToText}, ConverterParameter=TaskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="12" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="13" Orientation="Horizontal" Spacing="6">
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="8,3" />
</StackPanel>

@ -11,19 +11,20 @@
Background="{DynamicResource PrimaryBtnBrush}" Foreground="White" Padding="14,6" Margin="12,0,6,0" />
</Grid>
<Border Grid.Row="1" Background="{DynamicResource CardBgBrush}" Padding="8,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1">
<Grid ColumnDefinitions="1.2*,1*,1.2*,0.6*,0.6*,0.6*,1*,1*,0.6*,0.6*,0.7*,1*">
<TextBlock Grid.Column="0" Text="任务编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="托盘条码" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="数量" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="类别" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="起始位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="结束位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="步骤" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1.2*,1*,1.2*,0.6*,0.6*,0.6*,1*,1*,0.6*,0.6*,0.7*,1*">
<TextBlock Grid.Column="0" Text="序号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="任务编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="物料编号" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="托盘条码" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="数量" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="类型" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="类别" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="起始位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="结束位置" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="9" Text="状态" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="10" Text="步骤" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="11" Text="备注" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="12" Text="操作" FontSize="12" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="2" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
@ -32,19 +33,20 @@
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="8,4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="1.2*,1*,1.2*,0.6*,0.6*,0.6*,1*,1*,0.6*,0.6*,0.7*,1*">
<TextBlock Grid.Column="0" Text="{Binding taskCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding palletBarcode}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding materialCount}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding taskType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding taskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding taskSteps}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="11" Orientation="Horizontal" Spacing="4">
<Grid ColumnDefinitions="0.4*,1.2*,1*,1.2*,0.6*,0.6*,0.6*,1*,1*,0.6*,0.6*,0.7*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding taskCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding palletBarcode}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding materialCount}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskType, Converter={StaticResource CodeToText}, ConverterParameter=TaskType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding taskCategory, Converter={StaticResource CodeToText}, ConverterParameter=TaskCategory}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="8" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="9" Text="{Binding taskStatus, Converter={StaticResource CodeToText}, ConverterParameter=TaskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="10" Text="{Binding taskSteps}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="12" VerticalAlignment="Center" />
<TextBlock Grid.Column="11" Text="{Binding remark}" Foreground="{DynamicResource MutedTextBrush}" FontSize="12" VerticalAlignment="Center" />
<StackPanel Grid.Column="12" Orientation="Horizontal" Spacing="4">
<Button Content="明细" Tag="{Binding}" Click="Details_Click" Background="{DynamicResource TealBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="编辑" Tag="{Binding}" Click="Edit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="Delete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
@ -76,30 +78,32 @@
</Border>
<Grid Grid.Row="1" RowDefinitions="Auto,*">
<Border Grid.Row="0" Background="{DynamicResource CardBgBrush}" Padding="10,6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.8*,1*,1.2*,1.2*,0.8*,0.7*,0.7*,1*">
<TextBlock Grid.Column="0" Text="路径编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<Grid ColumnDefinitions="0.4*,1*,1.2*,1.2*,0.8*,0.6*,0.7*,0.7*,1*">
<TextBlock Grid.Column="0" Text="号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="1" Text="物料编号" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="2" Text="起始位置" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="3" Text="结束位置" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="4" Text="设备类型" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="状态" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="5" Text="执行设备" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="6" Text="状态" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="7" Text="启用" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
<TextBlock Grid.Column="8" Text="操作" FontSize="11" FontWeight="SemiBold" Foreground="{DynamicResource SecondaryTextBrush}" />
</Grid>
</Border>
<ListBox Grid.Row="1" ItemsSource="{Binding DetailItems}" Background="Transparent" Foreground="{DynamicResource PrimaryTextBrush}" BorderThickness="0">
<ListBox.ItemTemplate>
<DataTemplate>
<Border Padding="10,5" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,0,0,1">
<Grid ColumnDefinitions="0.8*,1*,1.2*,1.2*,0.8*,0.7*,0.7*,1*">
<TextBlock Grid.Column="0" Text="{Binding pathCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<Grid ColumnDefinitions="0.4*,1*,1.2*,1.2*,0.8*,0.6*,0.7*,0.7*,1*">
<TextBlock Grid.Column="0" Text="{Binding RowIndex}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="1" Text="{Binding materialCode}" Foreground="{DynamicResource PrimaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="2" Text="{Binding startPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="3" Text="{Binding endPoint}" Foreground="{DynamicResource AccentTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="4" Text="{Binding deviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding taskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding isFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="7" Orientation="Horizontal" Spacing="4">
<TextBlock Grid.Column="4" Text="{Binding deviceType, Converter={StaticResource CodeToText}, ConverterParameter=DeviceType}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="5" Text="{Binding execDevice}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="6" Text="{Binding taskStatus, Converter={StaticResource CodeToText}, ConverterParameter=TaskStatus}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<TextBlock Grid.Column="7" Text="{Binding isFlag, Converter={StaticResource CodeToText}, ConverterParameter=IsFlag}" Foreground="{DynamicResource SecondaryTextBrush}" FontSize="11" VerticalAlignment="Center" />
<StackPanel Grid.Column="8" Orientation="Horizontal" Spacing="4">
<Button Content="编辑" Tag="{Binding}" Click="DetailEdit_Click" Background="{DynamicResource InfoBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
<Button Content="删除" Tag="{Binding}" Click="DetailDelete_Click" Background="{DynamicResource DangerBtnBrush}" Foreground="White" FontSize="11" Padding="6,3" />
</StackPanel>

@ -39,15 +39,15 @@ public class HoistDispatchHubTest
public async void Run()
{
BaseDeviceInfo info = await _hub.GetFreeHoistAsync("1#Host");
BaseDeviceInfo info = await _hub.GetFreeHoistAsync("2#Host");
_hub.TaskDispatch(info,new LiveTaskDetail()
{
deviceType = 2,
startPoint = "15#_L2_HOIST",
endPoint = "15#_L1_HOIST",
materialBarcode = "202606180001",
taskCode = "202606180001",
startPoint = "15#_L1_HOIST",
endPoint = "15#_L2_HOIST",
materialBarcode = "202606210001",
taskCode = "202606210001",
taskType = 1
});

@ -12,12 +12,17 @@
## 待完成
### 1.调度逻辑修改
- [ ] 任务明细与操作设备关联:提升机-获取到空闲设备后将确定分配任务的提升机编号存入
- [ ] HoistDispatcher、HikRoBotDispatcher任务下发后需要监控任务执行情况任务执行完成后才可以返回ok给Strategy
- [ ] AGV 任务下发后开始获取任务状态(调用/task/status只有状态为FINISHED/MANUALED完成或手动完成时才可以进行后序任务CANCELLED时终端调度任务后序也不执行
等待步骤执行WAIT => 筛选提升机、下发提升机任务
等待步骤执行WAIT => 筛选提升机、下发提升机任务“参考手动任务执行界面的任务执行事件逻辑”
FINISHED/MANUALED => 完成/手动完成,可以进行后序任务
CANCELLED => 任务取消,终止调度任务
- [ ] Strategy执行到提升机任务时判断接驳位状态如果接驳位状态占用则说明有物料进行读取托盘条码验证物料并下发提升机启动信号
- [ ] Strategy执行到提升机任务时调用提升机调度中心的接收物料接口“receive-pallet”验证物料并下发提升机启动信号
### 任务创建修改
- [ ] 添加手动放、手动取操作,如果是手动放,任务从提升机开始,手动取也是以提升机结束

Loading…
Cancel
Save