From 54da8a22c438e1495b9c5fbae75ca9d4b5ca7335 Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期一, 02 九月 2024 16:04:37 +0800
Subject: [PATCH] Merge branch 'master' into wxw
---
Admin.NET/WCS.Application/Entity/WcsPosition.cs | 8
Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs | 24 +
Admin.NET/WCS.Application/Enum/PLCEnum.cs | 17 +
Admin.NET/WCS.Application/Hub/TaskLogHub.cs | 66 ++--
Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs | 10
Web/src/api/wcs/wcsDevice.ts | 8
Admin.NET/WCS.Application/Hub/PlcHub.cs | 41 ++
Admin.NET/WCS.Application/Hub/IPlcHub.cs | 5
Web/src/views/wcs/wcsDevice/component/editDialog.vue | 9
Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionInput.cs | 5
Web/src/views/device/deviceInfo/index.vue | 130 +++++----
Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs | 49 ++-
Web/src/views/device/deviceMonitor/index.vue | 230 +++++++---------
Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionOutput.cs | 5
Web/src/views/device/alarmManage/index.vue | 62 +--
Web/src/views/wcs/wcsPosition/component/editDialog.vue | 5
Admin.NET/WCS.Application/Entity/WcsDevice.cs | 7
Web/src/views/wcs/wcsDevice/index.vue | 6
Web/src/views/wcs/wcsTask/signalR.ts | 2
Admin.NET/WCS.Application/PLC/PLCTaskAction.cs | 8
Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceDto.cs | 5
Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionDto.cs | 93 +++---
Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs | 14
Web/src/views/wcs/wcsPosition/index.vue | 1
24 files changed, 464 insertions(+), 346 deletions(-)
diff --git a/Admin.NET/WCS.Application/Entity/WcsDevice.cs b/Admin.NET/WCS.Application/Entity/WcsDevice.cs
index 4f521c7..c1675c9 100644
--- a/Admin.NET/WCS.Application/Entity/WcsDevice.cs
+++ b/Admin.NET/WCS.Application/Entity/WcsDevice.cs
@@ -15,6 +15,13 @@
public long PlcId { get; set; }
/// <summary>
+ /// 浜や簰绫诲瀷
+ /// </summary>
+ [Required]
+ [SugarColumn(ColumnName = "DeviceType", ColumnDescription = "浜や簰绫诲瀷")]
+ public DeviceTypeEnum DeviceType { get; set; }
+
+ /// <summary>
/// 璁惧绾у埆
/// </summary>
[Required]
diff --git a/Admin.NET/WCS.Application/Entity/WcsPosition.cs b/Admin.NET/WCS.Application/Entity/WcsPosition.cs
index e481678..6b2feef 100644
--- a/Admin.NET/WCS.Application/Entity/WcsPosition.cs
+++ b/Admin.NET/WCS.Application/Entity/WcsPosition.cs
@@ -34,7 +34,13 @@
[Required]
[SugarColumn(ColumnName = "PosType", ColumnDescription = "娴佺▼瀛楃被鍨�")]
public PLCDataTypeEnum PosType { get; set; }
-
+
+ /// <summary>
+ /// 瀛楃涓查暱搴�
+ /// </summary>
+ [SugarColumn(ColumnName = "StringLength", ColumnDescription = "瀛楃涓查暱搴�")]
+ public int? StringLength { get; set; }
+
/// <summary>
/// 鏄剧ず灞廼p鍦板潃
/// </summary>
diff --git a/Admin.NET/WCS.Application/Enum/PLCEnum.cs b/Admin.NET/WCS.Application/Enum/PLCEnum.cs
index 1bdfe6d..d0f45f7 100644
--- a/Admin.NET/WCS.Application/Enum/PLCEnum.cs
+++ b/Admin.NET/WCS.Application/Enum/PLCEnum.cs
@@ -138,4 +138,21 @@
//String
[Description("String")]
String = 11,
+}
+/// <summary>
+/// 浜や簰绫诲瀷
+/// </summary>
+[Description("浜や簰绫诲瀷")]
+public enum DeviceTypeEnum
+{
+ /// <summary>
+ /// 涓氬姟
+ /// </summary>
+ [Description("涓氬姟")]
+ Business = 1,
+ /// <summary>
+ /// 椤甸潰灞曠ず
+ /// </summary>
+ [Description("椤甸潰灞曠ず")]
+ Show = 2,
}
\ No newline at end of file
diff --git a/Admin.NET/WCS.Application/Hub/IPlcHub.cs b/Admin.NET/WCS.Application/Hub/IPlcHub.cs
index a026a67..e3a92ab 100644
--- a/Admin.NET/WCS.Application/Hub/IPlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/IPlcHub.cs
@@ -28,5 +28,10 @@
/// <param name="context"></param>
/// <returns></returns>
Task PublicAlarm(WcsAlarmInfoOutput context);
+ /// <summary>
+ /// 淇敼鏈嶅姟鐘舵��
+ /// </summary>
+ /// <param name="context"></param>
+ Task UpdateService(PLCServiceModel context);
}
}
diff --git a/Admin.NET/WCS.Application/Hub/PlcHub.cs b/Admin.NET/WCS.Application/Hub/PlcHub.cs
index 31d652c..ba57a75 100644
--- a/Admin.NET/WCS.Application/Hub/PlcHub.cs
+++ b/Admin.NET/WCS.Application/Hub/PlcHub.cs
@@ -4,7 +4,7 @@
namespace WCS.Application;
/// <summary>
-/// PLC闆嗙嚎鍣�
+/// 浠诲姟鏃ュ織闆嗙嚎鍣�
/// </summary>
[MapHub("/hubs/Plc")]
public class PlcHub : Hub<IPlcHub>
@@ -20,10 +20,10 @@
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
- //public async Task PublicPlcConn(WcsPlc context)
- //{
- // await _plcHubContext.Clients.All.PublicPlcConn(context);
- //}
+ public async Task PublicPlcConn(WcsPlc context)
+ {
+ await _plcHubContext.Clients.All.PublicPlcConn(context);
+ }
/// <summary>
/// 涓嬪彂宸ヤ綅鐘舵��
@@ -36,12 +36,29 @@
//}
/// <summary>
- /// 涓嬪彂鎶ヨ淇℃伅
+ /// 涓嬪彂鏈嶅姟鐘舵��
/// </summary>
- /// <param name="context"></param>
- /// <returns></returns>
- //public async Task PublicAlarm(WcsAlarmInfoOutput context)
- //{
- // await _plcHubContext.Clients.All.PublicAlarm(context);
- //}
+ public async Task UpdateService(PLCServiceModel context)
+ {
+ //杩愯鐘舵��
+ if (context.BoRunningState.HasValue)
+ PLCTaskAction.boRunningState = context.BoRunningState.Value;
+ //鑴辨満妯″紡
+ if (context.BoOffline.HasValue)
+ PLCTaskAction.boOffline = context.BoOffline.Value;
+ //鑷埛鏂�
+ if (context.BoRefresh.HasValue)
+ PLCTaskAction.boRefresh = context.BoRefresh.Value;
+ await _plcHubContext.Clients.All.UpdateService(context);
+ }
}
+public class PLCServiceModel
+{
+ public bool? BoRunningState { get; set; }
+
+
+ public bool? BoOffline { get; set; }
+
+
+ public bool? BoRefresh { get; set; }
+}
\ No newline at end of file
diff --git a/Admin.NET/WCS.Application/Hub/TaskLogHub.cs b/Admin.NET/WCS.Application/Hub/TaskLogHub.cs
index 141e246..b4d018c 100644
--- a/Admin.NET/WCS.Application/Hub/TaskLogHub.cs
+++ b/Admin.NET/WCS.Application/Hub/TaskLogHub.cs
@@ -16,41 +16,41 @@
_taskLogHubContext = taskLogHubContext;
}
- ///// <summary>
- ///// 杩炴帴
- ///// </summary>
- ///// <returns></returns>
- //public override async Task OnConnectedAsync()
- //{
- // await base.OnConnectedAsync();
- //}
+ /// <summary>
+ /// 杩炴帴
+ /// </summary>
+ /// <returns></returns>
+ public override async Task OnConnectedAsync()
+ {
+ await base.OnConnectedAsync();
+ }
- ///// <summary>
- ///// 鏂紑
- ///// </summary>
- ///// <param name="exception"></param>
- ///// <returns></returns>
- //public override async Task OnDisconnectedAsync(Exception exception)
- //{
- // await base.OnDisconnectedAsync(exception);
- //}
+ /// <summary>
+ /// 鏂紑
+ /// </summary>
+ /// <param name="exception"></param>
+ /// <returns></returns>
+ public override async Task OnDisconnectedAsync(Exception exception)
+ {
+ await base.OnDisconnectedAsync(exception);
+ }
- ///// <summary>
- ///// 涓嬪彂浠诲姟
- ///// </summary>
- ///// <returns></returns>
- //public async Task PublicTask(WcsTaskOutput context)
- //{
- // await _taskLogHubContext.Clients.All.PublicTask(context);
- //}
+ /// <summary>
+ /// 涓嬪彂浠诲姟
+ /// </summary>
+ /// <returns></returns>
+ public async Task PublicTask(WcsTaskOutput context)
+ {
+ await _taskLogHubContext.Clients.All.PublicTask(context);
+ }
- ///// <summary>
- ///// 涓嬪彂浠诲姟鏄庣粏
- ///// </summary>
- ///// <returns></returns>
- //public async Task PublicTaskMonitor(WcsTaskMonitorOutput context)
- //{
- // await _taskLogHubContext.Clients.All.PublicTaskMonitor(context);
- //}
+ /// <summary>
+ /// 涓嬪彂浠诲姟鏄庣粏
+ /// </summary>
+ /// <returns></returns>
+ public async Task PublicTaskMonitor(WcsTaskMonitorOutput context)
+ {
+ await _taskLogHubContext.Clients.All.PublicTaskMonitor(context);
+ }
}
diff --git a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
index 5907b0e..78a963c 100644
--- a/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCTaskAction.cs
@@ -22,7 +22,11 @@
private static List<PLCUtil> listPlcUtil = new List<PLCUtil>();
private static CancellationTokenSource cts;//鍙栨秷绾跨▼鏍囪瘑
-
+ //瀵瑰鍏竷杩炴帴鐘舵��
+ public static List<PLCUtil> listPlcConn
+ {
+ get { return listPlcUtil; }
+ }
public static event EventHandler DeviceValueChangeEvent;
static PLCTaskAction()
{
@@ -84,7 +88,7 @@
}
try
{
- var modPlcUtil = listPlcUtil.FirstOrDefault(s => s.PlcId == modPlc.Id);
+ var modPlcUtil = listPlcUtil.FirstOrDefault(s => s != null && s.PlcId == modPlc.Id);
if (modPlcUtil == null)
{
modPlcUtil = new PLCUtil(modPlc);
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
index 5860a85..09b5112 100644
--- a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
@@ -1,6 +1,4 @@
-锘縰sing Microsoft.AspNetCore.SignalR;
-
-namespace WCS.Application;
+锘縩amespace WCS.Application;
/// <summary>
/// 鎶ヨ淇℃伅琛ㄦ湇鍔�
@@ -9,12 +7,9 @@
public class WcsAlarmInfoService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<WcsAlarmInfo> _wcsAlarmInfoRep;
- private readonly IHubContext<PlcHub, IPlcHub> _plcHubContext;
-
- public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep, IHubContext<PlcHub, IPlcHub> plcHubContext)
+ public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep)
{
_wcsAlarmInfoRep = wcsAlarmInfoRep;
- _plcHubContext = plcHubContext;
}
/// <summary>
@@ -123,10 +118,7 @@
[DisplayName("澶嶄綅鎶ヨ")]
public async Task Reset()
{
- //娴嬭瘯鎺ㄦ暟鎹敤鐨�
- await _plcHubContext.Clients.All.PublicAlarm(new WcsAlarmInfoOutput() { Id = new Random().Next(), StationNum = "205", AlarmCode = "MB102", AlarmName = "鏈夌墿鍝侀伄鎸�", AlarmTime = DateTime.Now });
- //throw Oops.Bah("寮�鍙戜腑");
-
+ throw Oops.Bah("寮�鍙戜腑");
}
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceDto.cs b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceDto.cs
index 9a3c42d..7a568af 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceDto.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceDto.cs
@@ -12,6 +12,11 @@
public string PlcIdIP { get; set; }
/// <summary>
+ /// 浜や簰绫诲瀷
+ /// </summary>
+ public DeviceTypeEnum DeviceType { get; set; }
+
+ /// <summary>
/// 涓婚敭Id
/// </summary>
public long Id { get; set; }
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs
index a4b8c8a..c998258 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceInput.cs
@@ -20,6 +20,11 @@
public virtual long PlcId { get; set; }
/// <summary>
+ /// 浜や簰绫诲瀷
+ /// </summary>
+ public virtual DeviceTypeEnum DeviceType { get; set; }
+
+ /// <summary>
/// 璁惧绾у埆
/// </summary>
public virtual DeviceLevelEnum Level { get; set; }
@@ -138,6 +143,11 @@
/// </summary>
[Required(ErrorMessage = "PlcId涓嶈兘涓虹┖")]
public override long PlcId { get; set; }
+ /// <summary>
+ /// 浜や簰绫诲瀷
+ /// </summary>
+ [Required(ErrorMessage = "浜や簰绫诲瀷涓嶈兘涓虹┖")]
+ public override DeviceTypeEnum DeviceType { get; set; }
/// <summary>
/// 璁惧绾у埆
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
index e66ea48..21fbc14 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/Dto/WcsDeviceOutput.cs
@@ -12,6 +12,11 @@
public long Id { get; set; }
/// <summary>
+ /// 浜や簰绫诲瀷
+ /// </summary>
+ public DeviceTypeEnum DeviceType { get; set; }
+
+ /// <summary>
/// PlcId
/// </summary>
public long PlcId { get; set; }
@@ -20,6 +25,11 @@
/// PlcId 鎻忚堪
/// </summary>
public string PlcIdIP { get; set; }
+
+ /// <summary>
+ /// 璁惧绫诲瀷
+ /// </summary>
+ public PLCTypeEnum Type { get; set; }
/// <summary>
/// 璁惧绾у埆
@@ -106,6 +116,20 @@
/// </summary>
public bool IsDelete { get; set; }
+ /// <summary>
+ /// 浠诲姟鍙�
+ /// </summary>
+ public string TaskNo { get; set; }
+ /// <summary>
+ /// 浠诲姟绫诲瀷
+ /// </summary>
+ public TaskTypeEnum? TaskType { get; set; }
+ public string Plc { get; set; }
+ public string Wcs { get; set; }
+ /// <summary>
+ /// 杩炴帴鐘舵��
+ /// </summary>
+ public bool Status { get; set; }
}
diff --git a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
index b52d4b1..6dd80ee 100644
--- a/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
+++ b/Admin.NET/WCS.Application/Service/WcsDevice/WcsDeviceService.cs
@@ -1,4 +1,6 @@
锘�
+using Admin.NET.Core.Service;
+
namespace WCS.Application;
/// <summary>
@@ -8,9 +10,11 @@
public class WcsDeviceService : IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<WcsDevice> _wcsDeviceRep;
- public WcsDeviceService(SqlSugarRepository<WcsDevice> wcsDeviceRep)
+ private readonly SysCacheService _sysCacheService;
+ public WcsDeviceService(SqlSugarRepository<WcsDevice> wcsDeviceRep, SysCacheService sysCacheService)
{
_wcsDeviceRep = wcsDeviceRep;
+ _sysCacheService = sysCacheService;
}
/// <summary>
@@ -41,6 +45,7 @@
{
Id = u.Id,
PlcId = u.PlcId,
+ DeviceType = (DeviceTypeEnum)u.DeviceType,
PlcIdIP = plcid.IP,
Level = (DeviceLevelEnum)u.Level,
DbNumber = u.DbNumber,
@@ -121,19 +126,6 @@
}
/// <summary>
- /// 鑾峰彇璁惧淇℃伅鍒楄〃
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpGet]
- [ApiDescriptionSettings(Name = "List")]
- [DisplayName("鑾峰彇璁惧淇℃伅鍒楄〃")]
- public async Task<List<WcsDeviceOutput>> List([FromQuery] PageWcsDeviceInput input)
- {
- return await _wcsDeviceRep.AsQueryable().Select<WcsDeviceOutput>().ToListAsync();
- }
-
- /// <summary>
/// 鑾峰彇PlcId鍒楄〃
/// </summary>
/// <returns></returns>
@@ -199,5 +191,34 @@
await _wcsDeviceRep.Context.Insertable(listPosition).ExecuteCommandAsync();
}
+ /// <summary>
+ /// 鑾峰彇璁惧淇℃伅鍒楄〃
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpGet]
+ [ApiDescriptionSettings(Name = "List")]
+ [DisplayName("鑾峰彇璁惧淇℃伅鍒楄〃")]
+ public async Task<List<WcsDeviceOutput>> List([FromQuery] PageWcsDeviceInput input)
+ {
+ var list = await _wcsDeviceRep.AsQueryable()
+ .LeftJoin<WcsPlc>((a, b) => a.PlcId == b.Id)
+ .Select<WcsDeviceOutput>((a, b) => new WcsDeviceOutput() { Type = b.Type }, true)
+ .ToListAsync();
+ //鑾峰彇璺烘満鐨勭姸鎬�
+ foreach (var modDevice in list)
+ {
+ if (_sysCacheService.ExistKey("PlcConn" + modDevice.PlcId))
+ {
+ var cachePlc = _sysCacheService.Get<WcsPlc>("PlcConn" + modDevice.PlcId);
+ modDevice.Status = cachePlc.IsConn;
+ }
+ else
+ {
+ modDevice.Status = false;
+ }
+ }
+ return list;
+ }
}
diff --git a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionDto.cs b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionDto.cs
index f32161c..a328c25 100644
--- a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionDto.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionDto.cs
@@ -1,49 +1,54 @@
锘�
namespace WCS.Application;
+/// <summary>
+/// 璁惧宸ヤ綅杈撳嚭鍙傛暟
+/// </summary>
+public class WcsPositionDto
+{
/// <summary>
- /// 璁惧宸ヤ綅杈撳嚭鍙傛暟
+ /// 璁惧ID
/// </summary>
- public class WcsPositionDto
- {
- /// <summary>
- /// 璁惧ID
- /// </summary>
- public string? DeviceIdText { get; set; }
-
- /// <summary>
- /// 涓婚敭Id
- /// </summary>
- public long Id { get; set; }
-
- /// <summary>
- /// 璁惧ID
- /// </summary>
- public long DeviceId { get; set; }
-
- /// <summary>
- /// 宸ヤ綅鍙�
- /// </summary>
- public string? StationNum { get; set; }
-
- /// <summary>
- /// 鍋忕Щ閲�
- /// </summary>
- public string? PlcPos { get; set; }
-
- /// <summary>
- /// 娴佺▼瀛楃被鍨�
- /// </summary>
- public PLCDataTypeEnum? PosType { get; set; }
-
- /// <summary>
- /// 鏄剧ず灞廼p鍦板潃
- /// </summary>
- public string? LedIP { get; set; }
-
- /// <summary>
- /// 鎻忚堪
- /// </summary>
- public string? Text { get; set; }
-
- }
+ public string? DeviceIdText { get; set; }
+
+ /// <summary>
+ /// 涓婚敭Id
+ /// </summary>
+ public long Id { get; set; }
+
+ /// <summary>
+ /// 璁惧ID
+ /// </summary>
+ public long DeviceId { get; set; }
+
+ /// <summary>
+ /// 宸ヤ綅鍙�
+ /// </summary>
+ public string? StationNum { get; set; }
+
+ /// <summary>
+ /// 鍋忕Щ閲�
+ /// </summary>
+ public string? PlcPos { get; set; }
+
+ /// <summary>
+ /// 娴佺▼瀛楃被鍨�
+ /// </summary>
+ public PLCDataTypeEnum? PosType { get; set; }
+
+ /// <summary>
+ /// 瀛楃涓查暱搴�
+ /// </summary>
+ public int? StringLength { get; set; }
+
+ /// <summary>
+ /// 鏄剧ず灞廼p鍦板潃
+ /// </summary>
+ public string? LedIP { get; set; }
+
+ /// <summary>
+ /// 鎻忚堪
+ /// </summary>
+ public string? Text { get; set; }
+
+}
diff --git a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionInput.cs b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionInput.cs
index 03bcb70..5cd2b4b 100644
--- a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionInput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionInput.cs
@@ -27,6 +27,11 @@
public virtual PLCDataTypeEnum PosType { get; set; }
/// <summary>
+ /// 瀛楃涓查暱搴�
+ /// </summary>
+ public virtual int? StringLength { get; set; }
+
+ /// <summary>
/// 鏄剧ず灞廼p鍦板潃
/// </summary>
public virtual string? LedIP { get; set; }
diff --git a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionOutput.cs b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionOutput.cs
index 9144a43..507bfb0 100644
--- a/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionOutput.cs
+++ b/Admin.NET/WCS.Application/Service/WcsPosition/Dto/WcsPositionOutput.cs
@@ -37,6 +37,11 @@
public PLCDataTypeEnum? PosType { get; set; }
/// <summary>
+ /// 瀛楃涓查暱搴�
+ /// </summary>
+ public int? StringLength { get; set; }
+
+ /// <summary>
/// 鏄剧ず灞廼p鍦板潃
/// </summary>
public string? LedIP { get; set; }
diff --git a/Web/src/api/wcs/wcsDevice.ts b/Web/src/api/wcs/wcsDevice.ts
index 8bd165a..f531fe1 100644
--- a/Web/src/api/wcs/wcsDevice.ts
+++ b/Web/src/api/wcs/wcsDevice.ts
@@ -7,6 +7,7 @@
DetailWcsDevice = '/api/wcsDevice/detail',
GetWcsPlcPlcIdDropdown = '/api/wcsDevice/WcsPlcPlcIdDropdown',
GeneratePos = '/api/wcsDevice/GeneratePos',
+ ListWcsDevice = '/api/wcsDevice/list',
}
// 澧炲姞璁惧淇℃伅
@@ -61,4 +62,9 @@
method: 'post',
data: params
});
-
\ No newline at end of file
+
+export const listWcsDevice = () =>
+ request({
+ url: Api.ListWcsDevice,
+ method: 'get'
+ });
\ No newline at end of file
diff --git a/Web/src/views/device/alarmManage/index.vue b/Web/src/views/device/alarmManage/index.vue
index b063f04..6235e26 100644
--- a/Web/src/views/device/alarmManage/index.vue
+++ b/Web/src/views/device/alarmManage/index.vue
@@ -5,16 +5,13 @@
<el-row style="display: flex;text-align: center;justify-content: center;height: 40px;">
<el-button type="warning" style="width: 95%;height: 30px;" @click="reset">鎶ヨ澶嶄綅</el-button>
</el-row>
- <el-table :data="paginatedData" border style="width: 100%" v-loading="loading"
+ <el-table :data="tableData" border style="width: 100%" v-loading="loading"
:default-sort="{ prop: 'date', order: 'descending' }">
<el-table-column prop="alarmCode" label="鍙橀噺" align="center"></el-table-column>
<el-table-column prop="alarmName" label="鎻忚堪" align="center"></el-table-column>
<el-table-column prop="stationNum" label="浣嶇疆" align="center"></el-table-column>
<el-table-column prop="alarmTime" label="鏃堕棿" align="center"></el-table-column>
</el-table>
- <el-pagination v-model:currentPage="tableParams.page" v-model:page-size="tableParams.pageSize"
- :total="tableParams.total" :page-sizes="[10, 20, 50, 100, 200, 500]" size="small" background=""
- @size-change="handleSizeChange" @current-change="handleCurrentChange" layout="prev, pager, next" />
</el-col>
<el-col :span="19">
<div class="card-page">
@@ -52,11 +49,29 @@
</template>
<script lang="ts" setup>
-import { ref, reactive, onMounted, computed } from 'vue';
+import { ref, reactive,onMounted } from 'vue';
+import { Splitpanes, Pane } from 'splitpanes';
import 'splitpanes/dist/splitpanes.css';
+import { Vue2 } from 'vue-demi';
import { listWcsAlarmInfo, resetWcsAlarmInfo } from '/@/api/wcs/wcsAlarmInfo';
import { signalR } from './signalR';
-
+//杩炴帴signalR 鐩戝惉鍙樻洿
+onMounted(async () => {
+ signalR.off('PublicAlarm');
+ signalR.on('PublicAlarm', (data: any) => {
+ console.log(data)
+ var listAlarm = tableData.value.filter(t => t.id == data.id);
+ if (listAlarm.length == 0) {
+ tableData.value.unshift(data)
+ tableParams.value.total = tableData.value.length;
+ }
+ else {
+ //濡傛灉宸茬粡瀛樺湪灏辨洿鏂版暟鎹�
+ const index = tableData.value.findIndex(t => t.id == data.id);
+ tableData.value.splice(index, 1, data);
+ }
+ });
+});
//鍫嗗灈鏈烘暟鎹�
const cellsDataLine = [
{ Id: 1, Code: '001', LineCode: '', EndLocat: '', IsShow: 1, IsUse: 0, BoxHeight: 10 },
@@ -1905,41 +1920,8 @@
//澶嶄綅鎶ヨ
const reset = async () => {
await resetWcsAlarmInfo();
+ await handleQuery();
}
-//杩炴帴signalR 鐩戝惉鍙樻洿
-onMounted(async () => {
- signalR.off('PublicAlarm');
- signalR.on('PublicAlarm', (data: any) => {
- console.log(data)
- var listAlarm = tableData.value.filter(t => t.id == data.id);
- if (listAlarm.length == 0) {
- tableData.value.unshift(data)
- tableParams.value.total = tableData.value.length;
- }
- else {
- //濡傛灉宸茬粡瀛樺湪灏辨洿鏂版暟鎹�
- const index = tableData.value.findIndex(t => t.id == data.id);
- tableData.value.splice(index, 1, data);
- }
- });
-});
-
-// 鏀瑰彉椤甸潰瀹归噺
-const handleSizeChange = (val: number) => {
- tableParams.value.pageSize = val;
-};
-
-// 鏀瑰彉椤电爜搴忓彿
-const handleCurrentChange = (val: number) => {
- tableParams.value.page = val;
-};
-//琛ㄦ牸鏄剧ず鏁版嵁
-const paginatedData = computed(() => {
- const start = (tableParams.value.page - 1) * tableParams.value.pageSize
- const end = start + tableParams.value.pageSize
- return tableData.value.slice(start, end)
-})
-
const isPlain1 = ref(false);//涓�灞�
diff --git a/Web/src/views/device/deviceInfo/index.vue b/Web/src/views/device/deviceInfo/index.vue
index d5088bf..3d13bff 100644
--- a/Web/src/views/device/deviceInfo/index.vue
+++ b/Web/src/views/device/deviceInfo/index.vue
@@ -5,27 +5,32 @@
<el-collapse v-model="activeName">
<el-collapse-item title="璁惧鎺у埗" name="1">
<el-card class="box-card" shadow="hover">
- <el-switch v-model="state.boRunningState" active-text="" inactive-text="绋嬪簭鏈嶅姟"></el-switch>
+ <el-switch v-model="state.boRunningState" active-text="" inactive-text="绋嬪簭鏈嶅姟"
+ @change="handleSwitchChange('boRunningState', $event)"></el-switch>
</el-card>
<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
- <el-switch v-model="state.boOffline" active-text="" inactive-text="鑴辨満妯″紡"></el-switch>
+ <el-switch v-model="state.boOffline" active-text="" inactive-text="鑴辨満妯″紡"
+ @change="handleSwitchChange('boOffline', $event)"></el-switch>
</el-card>
<el-card class="box-card" shadow="hover" style="margin-top: 3px;">
- <el-switch v-model="state.boRefresh" active-text="" inactive-text="鑷埛鏂�"></el-switch>
+ <el-switch v-model="state.boRefresh" active-text="" inactive-text="鑷埛鏂�"
+ @change="handleSwitchChange('boRefresh', $event)"></el-switch>
</el-card>
</el-collapse-item>
<el-collapse-item title="鍫嗗灈鏈�" name="2">
<div style="overflow-x: auto;white-space: nowrap;">
<el-card v-for="(stacker, index) in stackers" :key="index" class="box-card" shadow="hover">
- <el-switch disabled v-model="stacker.isConn" :inactive-text="`${stacker.text}`"></el-switch>
+ <el-switch v-model="stacker.isConn" :inactive-text="`${stacker.text}`"
+ disabled></el-switch>
</el-card>
</div>
</el-collapse-item>
<el-collapse-item title="杈撻�佺嚎" name="3">
<el-card v-for="(conveyor, index) in conveyors" :key="index" class="box-card" shadow="hover">
- <el-switch disabled v-model="conveyor.isConn" :inactive-text="`${conveyor.text}`"></el-switch>
+ <el-switch v-model="conveyor.isConn" :inactive-text="`${conveyor.text}`"
+ disabled></el-switch>
</el-card>
</el-collapse-item>
</el-collapse>
@@ -69,7 +74,6 @@
import { listStatus } from '/@/api/wcs/wcsPlc';
import { signalR } from './signalR';
-
const state = ref<any>({});
const stackers = ref<any>({});
const conveyors = ref<any>({});
@@ -102,7 +106,15 @@
}
console.log(stackers.value[0].isConn)
});
+ signalR.off('UpdateService');
+ signalR.on('UpdateService', (data: any) => {
+ state.value = data;
+ });
});
+const handleSwitchChange = (field: string, value: boolean) => {
+ signalR.invoke('UpdateService',state.value);
+};
+
const activeName = ['1', '2', '3'];
const value1 = ref(false);
@@ -1600,56 +1612,56 @@
{ Id: 202, Code: '', IsShow: 0, IsUse: 2 },
{ Id: 203, Code: '', IsShow: 1, IsUse: 0 },
{ Id: 204, Code: '', IsShow: 0, IsUse: 2 },
- { Id:205 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:206 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:207 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:208 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:209 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:210 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:211 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:212 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:213 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:214 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:215 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:216 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:217 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:218 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:219 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:220 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:221 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:222 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:223 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:224 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:225 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:226 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:227 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:228 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:229 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:230 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:231 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:232 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:233 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:234 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:235 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:236 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:237 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:238 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:239 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:240 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:241 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:242 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:243 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:244 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:245 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:246 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:247 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:248 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:249 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:250 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:251 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:252 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:253 , Code: '', IsShow: 0, IsUse: 3 },
- { Id:254 , Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 205, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 206, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 207, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 208, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 209, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 210, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 211, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 212, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 213, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 214, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 215, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 216, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 217, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 218, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 219, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 220, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 221, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 222, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 223, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 224, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 225, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 226, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 227, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 228, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 229, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 230, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 231, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 232, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 233, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 234, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 235, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 236, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 237, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 238, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 239, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 240, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 241, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 242, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 243, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 244, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 245, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 246, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 247, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 248, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 249, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 250, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 251, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 252, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 253, Code: '', IsShow: 0, IsUse: 3 },
+ { Id: 254, Code: '', IsShow: 0, IsUse: 3 },
{ Id: 255, Code: '', IsShow: 0, IsUse: 3 },
{ Id: 256, Code: '', IsShow: 1, IsUse: 0 },
{ Id: 257, Code: '', IsShow: 1, IsUse: 0 },
@@ -1910,7 +1922,7 @@
//杈撻�佺嚎鏁版嵁
-let cellsData = ref(cellsDataOne);;
+let cellsData = ref(cellsDataOne);
const isPlain1 = ref(false);//涓�灞�
const isPlain2 = ref(true);//浜屽眰
@@ -2077,10 +2089,12 @@
.active2>div {
display: none;
}
+
.active3 {
background-color: #fff;
- border:1px solid red;
+ border: 1px solid red;
}
+
.active3>div {
display: none;
}
diff --git a/Web/src/views/device/deviceMonitor/index.vue b/Web/src/views/device/deviceMonitor/index.vue
index fa6d26f..6f2883e 100644
--- a/Web/src/views/device/deviceMonitor/index.vue
+++ b/Web/src/views/device/deviceMonitor/index.vue
@@ -1,6 +1,6 @@
<template>
<el-container>
- <el-aside style="width: auto;height: auto;">
+ <el-aside style="width: auto; height: auto;">
<el-card class="box-card">
<div slot="header" class="linefix">
<span>杈撻�佺嚎</span>
@@ -9,17 +9,15 @@
<div class="choosefix">
<el-select v-model="lineValue" placeholder="璇烽�夋嫨">
<el-option v-for="item in lineOptions" :key="item.value" :label="item.label"
- :value="item.value">
- </el-option>
+ :value="item.value"></el-option>
</el-select>
<el-select v-model="stationValue" placeholder="璇烽�夋嫨" style="margin-top: 10px;">
- <el-option v-for="item in stationOptions" :key="item.value" :label="item.label"
- :value="item.value">
- </el-option>
+ <el-option v-for="item in stations" :key="item.id" :label="item.stationNum"
+ :value="item.id"></el-option>
</el-select>
</div>
<div class="lineValuefix">
- <el-form label-position="left" label-width="60px">
+ <el-form label-position="left" label-width="80px">
<el-form-item label="浠诲姟鍙�">
<el-input></el-input>
</el-form-item>
@@ -35,13 +33,19 @@
<el-form-item label="鎵樼洏鐮�">
<el-input></el-input>
</el-form-item>
+ <el-form-item label="PLC">
+ <el-input></el-input>
+ </el-form-item>
+ <el-form-item label="WCS">
+ <el-input></el-input>
+ </el-form-item>
<el-form-item label="鐘舵��">
<el-input></el-input>
</el-form-item>
</el-form>
</div>
<div class="lineButtonfix">
- <el-form label-position="left" label-width="60px">
+ <el-form label-position="left" label-width="80px">
<el-form-item>
<el-button>鍐欏叆</el-button>
<el-button>璁剧疆</el-button>
@@ -52,29 +56,32 @@
</el-aside>
<el-main style="padding: 0 0 0 5px;">
<div class="card-container">
- <el-card class="other-box-card" v-for="deviceInfo in deviceList" :key="deviceInfo.id">
+ <el-card class="other-box-card" v-for="deviceInfo in listStackingMachineData" :key="deviceInfo.id">
<div slot="header" class="linefix">
- <span>{{ deviceInfo.name }}</span>
+ <span>{{ deviceInfo.text }}</span>
<div
- :class="['lineStatus', { 'device-status-0': deviceInfo.status === 0 }, { 'device-status-1': deviceInfo.status === 1 }]">
+ :class="['lineStatus', { 'device-status-0': deviceInfo.status === true }, { 'device-status-1': deviceInfo.status === false }]">
</div>
</div>
<div class="otherValuefix">
- <el-form label-position="left" label-width="60px">
+ <el-form label-position="left" label-width="80px">
<el-form-item label="浠诲姟鍙�">
- <el-input v-model="deviceInfo.taskNumber"></el-input>
+ <el-input v-model="deviceInfo.taskNo"></el-input>
</el-form-item>
<el-form-item label="浠诲姟绫诲瀷">
- <el-input></el-input>
+ <el-select clearable="" v-model="deviceInfo.taskType" placeholder="璇烽�夋嫨鐘舵��">
+ <el-option v-for="(item, index) in dl('TaskTypeEnum')" :key="index"
+ :value="Number(item.value)" :label="`${item.name} (${item.code}) [${item.value}] `" />
+ </el-select>
</el-form-item>
<el-form-item label="PLC">
- <el-input></el-input>
+ <el-input v-model="deviceInfo.plc"></el-input>
</el-form-item>
<el-form-item label="WCS">
- <el-input></el-input>
+ <el-input v-model="deviceInfo.wcs"></el-input>
</el-form-item>
<el-form-item label="鐘舵��">
- <el-input></el-input>
+ <el-input :value="deviceInfo.status ? '鍦ㄧ嚎' : '绂荤嚎'" readonly></el-input>
</el-form-item>
</el-form>
</div>
@@ -94,101 +101,63 @@
<script lang="ts" setup>
import { ref, reactive } from 'vue';
+import { listWcsDevice } from '/@/api/wcs/wcsDevice';
+import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
+import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
-const lineOptions = [{
- value: '001',
- label: '涓�妤艰緭閫佺嚎'
-}, {
- value: '002',
- label: '浜屾ゼ杈撻�佺嚎'
-}, {
- value: '003',
- label: '涓夋ゼ杈撻�佺嚎'
-}];
-const lineValue = '001';
+const stations = ref<any>([]);
+const listStackingMachineData = ref<any>([]);
-const stationOptions = [{
- value: '200',
- label: '200'
-}, {
- value: '202',
- label: '202'
-}, {
- value: '300',
- label: '300'
-}];
-const stationValue = '200';
+const lineValue = ref('1');
+const stationValue = ref();
-
-const deviceList = [
- {
- id: 1,
- name: '1鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: 'T000001',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- },
- {
- id: 2,
- name: '2鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 1
- },
- {
- id: 3,
- name: '3鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- }, {
- id: 4,
- name: '4鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 1
- }, {
- id: 5,
- name: '5鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- }, {
- id: 6,
- name: '6鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
- }, {
- id: 7,
- name: '7鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: ''
- }, {
- id: 8,
- name: '8鍙风爜鍨涙満鍣ㄤ汉',
- taskNumber: '',
- taskType: '',
- plc: '',
- wcs: '',
- status: 0
+// 鏌ヨ鎿嶄綔
+const handleQuery = async () => {
+ var res = await listWcsDevice();
+ listStackingMachineData.value = res.data.result.filter(s => s.type == 0);
+ const listConveyorLineData = res.data.result.filter(s => s.type == 1 || s.type == 4);
+ stations.value = {
+ '1': listConveyorLineData.filter(s => s.text = '1灞傛墭鐩樿緭閫佺嚎'),
+ '2': listConveyorLineData.filter(s => s.text = '2灞傛墭鐩樿緭閫佺嚎'),
+ '3': listConveyorLineData.filter(s => s.text = '3灞傛墭鐩樿緭閫佺嚎')
}
-]
+ if (stations.value.length > 0)
+ stationValue.value = stations.value[0][0].id;
+ debugger;
+};
+handleQuery();
+
+
+const lineOptions = [
+ { value: '1', label: '涓�妤艰緭閫佺嚎' },
+ { value: '2', label: '浜屾ゼ杈撻�佺嚎' },
+ { value: '3', label: '涓夋ゼ杈撻�佺嚎' }
+];
+
+const deviceList = reactive([
+ { id: 1, name: '1鍙风爜鍨涙満鍣ㄤ汉', taskNumber: 'T000001', taskType: '', plc: '', wcs: '', status: 0 },
+ { id: 2, name: '2鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 1 },
+ { id: 3, name: '3鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
+ { id: 4, name: '4鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 1 },
+ { id: 5, name: '5鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
+ { id: 6, name: '6鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 },
+ { id: 7, name: '7鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: '' },
+ { id: 8, name: '8鍙风爜鍨涙満鍣ㄤ汉', taskNumber: '', taskType: '', plc: '', wcs: '', status: 0 }
+]);
+
+const deviceTypeText = (taskType: number) => {
+ switch (taskType) {
+ case 0:
+ return '鍏ュ簱浠诲姟'
+ case 1:
+ return '鍑哄簱浠诲姟'
+ case 2:
+ return '绉诲簱浠诲姟'
+ case 3:
+ return 'PLC鐢宠鍏ュ簱'
+ }
+ return ''
+};
</script>
<style scoped>
@@ -204,69 +173,80 @@
border-bottom: 1px solid rgb(197, 195, 195);
display: flex;
align-items: center;
- height: 40px;
+ height: 30px;
position: relative;
}
.lineStatus {
position: absolute;
right: 0;
- float: right;
height: 20px;
width: 20px;
- border-radius: 20px;
+ border-radius: 50%;
background-color: #67C23A;
}
.choosefix {
width: 100%;
- height: auto;
padding: 10px;
border-bottom: 1px solid rgb(197, 195, 195);
}
.box-card {
- width: 280px;
+ width: 100%;
+ max-width: 280px;
+ background: linear-gradient(135deg, #66ccff, #3399ff);
+ border-radius: 10px;
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
+ color: #fff;
}
.lineValuefix {
width: 100%;
- height: 500px;
padding: 10px;
border-bottom: 1px solid rgb(197, 195, 195);
}
.lineButtonfix {
width: 100%;
- height: 50px;
display: flex;
- align-items: center;
+ justify-content: space-between;
+ padding: 10px;
}
.otherValuefix {
width: 100%;
- height: 220px;
padding: 10px;
border-bottom: 1px solid rgb(197, 195, 195);
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ /* Optional, for spacing between form items */
}
.card-container {
display: grid;
- grid-template-columns: repeat(4, 1fr);
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 10px;
}
.other-box-card {
box-sizing: border-box;
+ background: linear-gradient(135deg, #66ccff, #3399ff);
+ border-radius: 10px;
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
+ color: #fff;
+ display: flex;
+ flex-direction: column;
+ height: auto;
+ /* Ensure card height adjusts based on content */
}
.otherButtonfix {
width: 100%;
- height: 50px;
display: flex;
- align-items: center;
justify-content: center;
- padding: 0;
+ padding: 10px;
}
.device-status-0 {
@@ -275,14 +255,6 @@
.device-status-1 {
background-color: red;
-}
-
-.box-card,
-.other-box-card {
- background: linear-gradient(135deg, #66ccff, #3399ff);
- border-radius: 10px;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- color: #fff;
}
.linefix span {
diff --git a/Web/src/views/wcs/wcsDevice/component/editDialog.vue b/Web/src/views/wcs/wcsDevice/component/editDialog.vue
index 0eed749..da9d95d 100644
--- a/Web/src/views/wcs/wcsDevice/component/editDialog.vue
+++ b/Web/src/views/wcs/wcsDevice/component/editDialog.vue
@@ -24,6 +24,15 @@
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+ <el-form-item label="浜や簰绫诲瀷" prop="deviceType">
+ <el-select clearable v-model="ruleForm.deviceType" placeholder="璇烽�夋嫨浜や簰绫诲瀷">
+ <el-option v-for="(item, index) in dl('DeviceTypeEnum')" :key="index"
+ :value="Number(item.value)"
+ :label="`${item.name} (${item.code}) [${item.value}]`"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="璁惧绾у埆" prop="level">
<el-select clearable v-model="ruleForm.level" placeholder="璇烽�夋嫨璁惧绾у埆">
<el-option v-for="(item, index) in dl('DeviceLevelEnum')" :key="index"
diff --git a/Web/src/views/wcs/wcsDevice/index.vue b/Web/src/views/wcs/wcsDevice/index.vue
index bb543eb..cabac56 100644
--- a/Web/src/views/wcs/wcsDevice/index.vue
+++ b/Web/src/views/wcs/wcsDevice/index.vue
@@ -55,6 +55,12 @@
</template>
</el-table-column>
+ <el-table-column prop="deviceType" label="浜や簰绫诲瀷" show-overflow-tooltip="">
+ <template #default="scope">
+ <el-tag :type="dv('DeviceTypeEnum', scope.row.deviceType)?.tagType"> {{ dv('DeviceTypeEnum',
+ scope.row.deviceType)?.name }}</el-tag>
+ </template>
+ </el-table-column>
<el-table-column prop="level" label="璁惧绾у埆" show-overflow-tooltip="">
<template #default="scope">
<el-tag :type="dv('DeviceLevelEnum', scope.row.level)?.tagType"> {{ dv('DeviceLevelEnum',
diff --git a/Web/src/views/wcs/wcsPosition/component/editDialog.vue b/Web/src/views/wcs/wcsPosition/component/editDialog.vue
index c9f7574..28c7352 100644
--- a/Web/src/views/wcs/wcsPosition/component/editDialog.vue
+++ b/Web/src/views/wcs/wcsPosition/component/editDialog.vue
@@ -47,6 +47,11 @@
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+ <el-form-item label="瀛楃涓查暱搴�" prop="stringLength">
+ <el-input v-model="ruleForm.stringLength" placeholder="璇疯緭鍏ュ瓧绗︿覆闀垮害閲�" maxlength="32" show-word-limit clearable />
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="鏄剧ず灞廼p鍦板潃" prop="ledIP">
<el-input v-model="ruleForm.ledIP" placeholder="璇疯緭鍏ユ樉绀哄睆ip鍦板潃" maxlength="50" show-word-limit clearable />
diff --git a/Web/src/views/wcs/wcsPosition/index.vue b/Web/src/views/wcs/wcsPosition/index.vue
index 343d80a..a589b8c 100644
--- a/Web/src/views/wcs/wcsPosition/index.vue
+++ b/Web/src/views/wcs/wcsPosition/index.vue
@@ -64,6 +64,7 @@
scope.row.posType)?.name}}</el-tag>
</template>
</el-table-column>
+ <el-table-column prop="stringLength" label="瀛楃涓查暱搴�" show-overflow-tooltip="" />
<el-table-column prop="ledIP" label="鏄剧ず灞廼p鍦板潃" show-overflow-tooltip="" />
<el-table-column prop="text" label="鎻忚堪" show-overflow-tooltip="" />
<el-table-column label="淇敼璁板綍" width="80" align="center" show-overflow-tooltip>
diff --git a/Web/src/views/wcs/wcsTask/signalR.ts b/Web/src/views/wcs/wcsTask/signalR.ts
index 6e9eed8..42c93f8 100644
--- a/Web/src/views/wcs/wcsTask/signalR.ts
+++ b/Web/src/views/wcs/wcsTask/signalR.ts
@@ -32,6 +32,6 @@
console.log('閲嶈繛鎴愬姛task');
});
-// connection.on('PublicTask', () => {});
+connection.on('PublicTask', () => {});
export { connection as signalR };
--
Gitblit v1.8.0