From f3884069ffbd45ac8048aa63b9756ea049c45ba2 Mon Sep 17 00:00:00 2001
From: hwh <332078369@qq.com>
Date: 星期五, 16 八月 2024 11:09:55 +0800
Subject: [PATCH] `
---
Web/src/views/wcs/wcsAlarmLog/index.vue | 210 +++++-----
Admin.NET/WCS.Application/Configuration/Database.json | 2
Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoInput.cs | 165 ++++++++
Web/src/views/wcs/wcsAlarmInfo/index.vue | 194 ++++++++++
Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs | 106 +++++
Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs | 119 ++++++
Web/src/views/wcs/wcsAlarmInfo/component/editDialog.vue | 153 ++++++++
Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoDto.cs | 104 +++++
Web/src/api/wcs/wcsAlarmInfo.ts | 50 ++
9 files changed, 991 insertions(+), 112 deletions(-)
diff --git a/Admin.NET/WCS.Application/Configuration/Database.json b/Admin.NET/WCS.Application/Configuration/Database.json
index 66f3e07..7f1fb9f 100644
--- a/Admin.NET/WCS.Application/Configuration/Database.json
+++ b/Admin.NET/WCS.Application/Configuration/Database.json
@@ -11,7 +11,7 @@
//"ConnectionString": "PORT=5432;DATABASE=xxx;HOST=localhost;PASSWORD=xxx;USER ID=xxx", // PostgreSQL 搴撹繛鎺ュ瓧绗︿覆
//"ConnectionString": "Server=localhost;Database=xxx;Uid=xxx;Pwd=xxx;SslMode=None;", // MySql 搴撹繛鎺ュ瓧绗︿覆",
//"ConnectionString": "User Id=xxx; Password=xxx; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))", // Oracle 搴撹繛鎺ュ瓧绗︿覆
- "ConnectionString": "Server=.\\MSSQLSERVER2019;Database=WCS_JC26;User Id=sa;Password=admin2023@;", // SqlServer 搴撹繛鎺ュ瓧绗︿覆
+ "ConnectionString": "Server=localhost;Database=WCS_JC26;User Id=sa;Password=******;", // SqlServer 搴撹繛鎺ュ瓧绗︿覆
//"SlaveConnectionConfigs": [ // 璇诲啓鍒嗙/涓讳粠
// {
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoDto.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoDto.cs
new file mode 100644
index 0000000..b3551b2
--- /dev/null
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoDto.cs
@@ -0,0 +1,104 @@
+锘�// Admin.NET 椤圭洰鐨勭増鏉冦�佸晢鏍囥�佷笓鍒╁拰鍏朵粬鐩稿叧鏉冨埄鍧囧彈鐩稿簲娉曞緥娉曡鐨勪繚鎶ゃ�備娇鐢ㄦ湰椤圭洰搴旈伒瀹堢浉鍏虫硶寰嬫硶瑙勫拰璁稿彲璇佺殑瑕佹眰銆�
+//
+// 鏈」鐩富瑕侀伒寰� MIT 璁稿彲璇佸拰 Apache 璁稿彲璇侊紙鐗堟湰 2.0锛夎繘琛屽垎鍙戝拰浣跨敤銆傝鍙瘉浣嶄簬婧愪唬鐮佹爲鏍圭洰褰曚腑鐨� LICENSE-MIT 鍜� LICENSE-APACHE 鏂囦欢銆�
+//
+// 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
+
+namespace WCS.Application;
+
+ /// <summary>
+ /// 鎶ヨ淇℃伅琛ㄨ緭鍑哄弬鏁�
+ /// </summary>
+ public class WcsAlarmInfoDto
+ {
+ /// <summary>
+ /// 涓婚敭Id
+ /// </summary>
+ public long Id { get; set; }
+
+ /// <summary>
+ /// PLCIP鍦板潃
+ /// </summary>
+ public string? PlcIP { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ缂栧彿
+ /// </summary>
+ public string? AlarmCode { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鎻忚堪
+ /// </summary>
+ public string? AlarmName { get; set; }
+
+ /// <summary>
+ /// 鏄剧ず灞廼p鍦板潃
+ /// </summary>
+ public string? LedIP { get; set; }
+
+ /// <summary>
+ /// 鐘舵��
+ /// </summary>
+ public YesNoEnum Status { get; set; }
+
+ /// <summary>
+ /// 璁惧绫诲瀷
+ /// </summary>
+ public string? Type { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鏃ユ湡
+ /// </summary>
+ public DateTime? AlarmTime { get; set; }
+
+ /// <summary>
+ /// LED鐘舵��
+ /// </summary>
+ public YesNoEnum LedStatus { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ /// </summary>
+ public DateTime? CreateTime { get; set; }
+
+ /// <summary>
+ /// 鏇存柊鏃堕棿
+ /// </summary>
+ public DateTime? UpdateTime { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰匢d
+ /// </summary>
+ public long? CreateUserId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呭鍚�
+ /// </summary>
+ public string? CreateUserName { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰匢d
+ /// </summary>
+ public long? UpdateUserId { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰呭鍚�
+ /// </summary>
+ public string? UpdateUserName { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂↖d
+ /// </summary>
+ public long? CreateOrgId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂ㄥ悕绉�
+ /// </summary>
+ public string? CreateOrgName { get; set; }
+
+ /// <summary>
+ /// 杞垹闄�
+ /// </summary>
+ public bool IsDelete { get; set; }
+
+ }
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoInput.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoInput.cs
new file mode 100644
index 0000000..2cf82fb
--- /dev/null
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoInput.cs
@@ -0,0 +1,165 @@
+锘�// Admin.NET 椤圭洰鐨勭増鏉冦�佸晢鏍囥�佷笓鍒╁拰鍏朵粬鐩稿叧鏉冨埄鍧囧彈鐩稿簲娉曞緥娉曡鐨勪繚鎶ゃ�備娇鐢ㄦ湰椤圭洰搴旈伒瀹堢浉鍏虫硶寰嬫硶瑙勫拰璁稿彲璇佺殑瑕佹眰銆�
+//
+// 鏈」鐩富瑕侀伒寰� MIT 璁稿彲璇佸拰 Apache 璁稿彲璇侊紙鐗堟湰 2.0锛夎繘琛屽垎鍙戝拰浣跨敤銆傝鍙瘉浣嶄簬婧愪唬鐮佹爲鏍圭洰褰曚腑鐨� LICENSE-MIT 鍜� LICENSE-APACHE 鏂囦欢銆�
+//
+// 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
+
+using Admin.NET.Core;
+using System.ComponentModel.DataAnnotations;
+
+namespace WCS.Application;
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄥ熀纭�杈撳叆鍙傛暟
+/// </summary>
+public class WcsAlarmInfoBaseInput
+{
+ /// <summary>
+ /// PLCIP鍦板潃
+ /// </summary>
+ public virtual string? PlcIP { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ缂栧彿
+ /// </summary>
+ public virtual string? AlarmCode { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鎻忚堪
+ /// </summary>
+ public virtual string? AlarmName { get; set; }
+
+ /// <summary>
+ /// 鏄剧ず灞廼p鍦板潃
+ /// </summary>
+ public virtual string? LedIP { get; set; }
+
+ /// <summary>
+ /// 鐘舵��
+ /// </summary>
+ public virtual YesNoEnum Status { get; set; } = YesNoEnum.N;
+
+ /// <summary>
+ /// 璁惧绫诲瀷
+ /// </summary>
+ public virtual string? Type { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鏃ユ湡
+ /// </summary>
+ public virtual DateTime? AlarmTime { get; set; }
+
+ /// <summary>
+ /// LED鐘舵��
+ /// </summary>
+ public virtual YesNoEnum LedStatus { get; set; } = YesNoEnum.N;
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ /// </summary>
+ public virtual DateTime? CreateTime { get; set; }
+
+ /// <summary>
+ /// 鏇存柊鏃堕棿
+ /// </summary>
+ public virtual DateTime? UpdateTime { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰匢d
+ /// </summary>
+ public virtual long? CreateUserId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呭鍚�
+ /// </summary>
+ public virtual string? CreateUserName { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰匢d
+ /// </summary>
+ public virtual long? UpdateUserId { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰呭鍚�
+ /// </summary>
+ public virtual string? UpdateUserName { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂↖d
+ /// </summary>
+ public virtual long? CreateOrgId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂ㄥ悕绉�
+ /// </summary>
+ public virtual string? CreateOrgName { get; set; }
+
+ /// <summary>
+ /// 杞垹闄�
+ /// </summary>
+ public virtual bool IsDelete { get; set; }
+
+}
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄥ垎椤垫煡璇㈣緭鍏ュ弬鏁�
+/// </summary>
+public class PageWcsAlarmInfoInput : BasePageInput
+{
+ /// <summary>
+ /// 鍏抽敭瀛楁煡璇�
+ /// </summary>
+ public string? SearchKey { get; set; }
+
+ /// <summary>
+ /// PLCIP鍦板潃
+ /// </summary>
+ public string? PlcIP { get; set; }
+
+ /// <summary>
+ /// 璁惧绫诲瀷
+ /// </summary>
+ public string? Type { get; set; }
+
+}
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄥ鍔犺緭鍏ュ弬鏁�
+/// </summary>
+public class AddWcsAlarmInfoInput : WcsAlarmInfoBaseInput
+{
+ /// <summary>
+ /// 杞垹闄�
+ /// </summary>
+ [Required(ErrorMessage = "杞垹闄や笉鑳戒负绌�")]
+ public override bool IsDelete { get; set; }
+
+}
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄥ垹闄よ緭鍏ュ弬鏁�
+/// </summary>
+public class DeleteWcsAlarmInfoInput : BaseIdInput
+{
+}
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄦ洿鏂拌緭鍏ュ弬鏁�
+/// </summary>
+public class UpdateWcsAlarmInfoInput : WcsAlarmInfoBaseInput
+{
+ /// <summary>
+ /// 涓婚敭Id
+ /// </summary>
+ [Required(ErrorMessage = "涓婚敭Id涓嶈兘涓虹┖")]
+ public long Id { get; set; }
+
+}
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄤ富閿煡璇㈣緭鍏ュ弬鏁�
+/// </summary>
+public class QueryByIdWcsAlarmInfoInput : DeleteWcsAlarmInfoInput
+{
+
+}
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs
new file mode 100644
index 0000000..d933188
--- /dev/null
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/Dto/WcsAlarmInfoOutput.cs
@@ -0,0 +1,106 @@
+锘�// Admin.NET 椤圭洰鐨勭増鏉冦�佸晢鏍囥�佷笓鍒╁拰鍏朵粬鐩稿叧鏉冨埄鍧囧彈鐩稿簲娉曞緥娉曡鐨勪繚鎶ゃ�備娇鐢ㄦ湰椤圭洰搴旈伒瀹堢浉鍏虫硶寰嬫硶瑙勫拰璁稿彲璇佺殑瑕佹眰銆�
+//
+// 鏈」鐩富瑕侀伒寰� MIT 璁稿彲璇佸拰 Apache 璁稿彲璇侊紙鐗堟湰 2.0锛夎繘琛屽垎鍙戝拰浣跨敤銆傝鍙瘉浣嶄簬婧愪唬鐮佹爲鏍圭洰褰曚腑鐨� LICENSE-MIT 鍜� LICENSE-APACHE 鏂囦欢銆�
+//
+// 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
+
+namespace WCS.Application;
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄨ緭鍑哄弬鏁�
+/// </summary>
+public class WcsAlarmInfoOutput
+{
+ /// <summary>
+ /// 涓婚敭Id
+ /// </summary>
+ public long Id { get; set; }
+
+ /// <summary>
+ /// PLCIP鍦板潃
+ /// </summary>
+ public string? PlcIP { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ缂栧彿
+ /// </summary>
+ public string? AlarmCode { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鎻忚堪
+ /// </summary>
+ public string? AlarmName { get; set; }
+
+ /// <summary>
+ /// 鏄剧ず灞廼p鍦板潃
+ /// </summary>
+ public string? LedIP { get; set; }
+
+ /// <summary>
+ /// 鐘舵��
+ /// </summary>
+ public YesNoEnum Status { get; set; }
+
+ /// <summary>
+ /// 璁惧绫诲瀷
+ /// </summary>
+ public string? Type { get; set; }
+
+ /// <summary>
+ /// 鎶ヨ鏃ユ湡
+ /// </summary>
+ public DateTime? AlarmTime { get; set; }
+
+ /// <summary>
+ /// LED鐘舵��
+ /// </summary>
+ public YesNoEnum LedStatus { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鏃堕棿
+ /// </summary>
+ public DateTime? CreateTime { get; set; }
+
+ /// <summary>
+ /// 鏇存柊鏃堕棿
+ /// </summary>
+ public DateTime? UpdateTime { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰匢d
+ /// </summary>
+ public long? CreateUserId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呭鍚�
+ /// </summary>
+ public string? CreateUserName { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰匢d
+ /// </summary>
+ public long? UpdateUserId { get; set; }
+
+ /// <summary>
+ /// 淇敼鑰呭鍚�
+ /// </summary>
+ public string? UpdateUserName { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂↖d
+ /// </summary>
+ public long? CreateOrgId { get; set; }
+
+ /// <summary>
+ /// 鍒涘缓鑰呴儴闂ㄥ悕绉�
+ /// </summary>
+ public string? CreateOrgName { get; set; }
+
+ /// <summary>
+ /// 杞垹闄�
+ /// </summary>
+ public bool IsDelete { get; set; }
+
+ }
+
+
diff --git a/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
new file mode 100644
index 0000000..aba81e5
--- /dev/null
+++ b/Admin.NET/WCS.Application/Service/WcsAlarmInfo/WcsAlarmInfoService.cs
@@ -0,0 +1,119 @@
+锘�// Admin.NET 椤圭洰鐨勭増鏉冦�佸晢鏍囥�佷笓鍒╁拰鍏朵粬鐩稿叧鏉冨埄鍧囧彈鐩稿簲娉曞緥娉曡鐨勪繚鎶ゃ�備娇鐢ㄦ湰椤圭洰搴旈伒瀹堢浉鍏虫硶寰嬫硶瑙勫拰璁稿彲璇佺殑瑕佹眰銆�
+//
+// 鏈」鐩富瑕侀伒寰� MIT 璁稿彲璇佸拰 Apache 璁稿彲璇侊紙鐗堟湰 2.0锛夎繘琛屽垎鍙戝拰浣跨敤銆傝鍙瘉浣嶄簬婧愪唬鐮佹爲鏍圭洰褰曚腑鐨� LICENSE-MIT 鍜� LICENSE-APACHE 鏂囦欢銆�
+//
+// 涓嶅緱鍒╃敤鏈」鐩粠浜嬪嵄瀹冲浗瀹跺畨鍏ㄣ�佹壈涔辩ぞ浼氱З搴忋�佷镜鐘粬浜哄悎娉曟潈鐩婄瓑娉曞緥娉曡绂佹鐨勬椿鍔紒浠讳綍鍩轰簬鏈」鐩簩娆″紑鍙戣�屼骇鐢熺殑涓�鍒囨硶寰嬬籂绾峰拰璐d换锛屾垜浠笉鎵挎媴浠讳綍璐d换锛�
+
+using Admin.NET.Core.Service;
+using Microsoft.AspNetCore.Http;
+namespace WCS.Application;
+
+/// <summary>
+/// 鎶ヨ淇℃伅琛ㄦ湇鍔�
+/// </summary>
+[ApiDescriptionSettings(ApplicationConst.GroupName, Order = 100)]
+public class WcsAlarmInfoService : IDynamicApiController, ITransient
+{
+ private readonly SqlSugarRepository<WcsAlarmInfo> _wcsAlarmInfoRep;
+ public WcsAlarmInfoService(SqlSugarRepository<WcsAlarmInfo> wcsAlarmInfoRep)
+ {
+ _wcsAlarmInfoRep = wcsAlarmInfoRep;
+ }
+
+ /// <summary>
+ /// 鍒嗛〉鏌ヨ鎶ヨ淇℃伅琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ApiDescriptionSettings(Name = "Page")]
+ [DisplayName("鍒嗛〉鏌ヨ鎶ヨ淇℃伅琛�")]
+ public async Task<SqlSugarPagedList<WcsAlarmInfoOutput>> Page(PageWcsAlarmInfoInput input)
+ {
+ input.SearchKey = input.SearchKey?.Trim();
+ var query = _wcsAlarmInfoRep.AsQueryable()
+ .WhereIF(!string.IsNullOrEmpty(input.SearchKey), u =>
+ u.PlcIP.Contains(input.SearchKey)
+ || u.Type.Contains(input.SearchKey)
+ )
+ .WhereIF(!string.IsNullOrWhiteSpace(input.PlcIP), u => u.PlcIP.Contains(input.PlcIP.Trim()))
+ .WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type.Contains(input.Type.Trim()))
+ .Select<WcsAlarmInfoOutput>();
+ return await query.OrderBuilder(input).ToPagedListAsync(input.Page, input.PageSize);
+ }
+
+ /// <summary>
+ /// 澧炲姞鎶ヨ淇℃伅琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ApiDescriptionSettings(Name = "Add")]
+ [DisplayName("澧炲姞鎶ヨ淇℃伅琛�")]
+ public async Task<long> Add(AddWcsAlarmInfoInput input)
+ {
+ var entity = input.Adapt<WcsAlarmInfo>();
+ await _wcsAlarmInfoRep.InsertAsync(entity);
+ return entity.Id;
+ }
+
+ /// <summary>
+ /// 鍒犻櫎鎶ヨ淇℃伅琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ApiDescriptionSettings(Name = "Delete")]
+ [DisplayName("鍒犻櫎鎶ヨ淇℃伅琛�")]
+ public async Task Delete(DeleteWcsAlarmInfoInput input)
+ {
+ var entity = await _wcsAlarmInfoRep.GetFirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002);
+ await _wcsAlarmInfoRep.FakeDeleteAsync(entity); //鍋囧垹闄�
+ //await _wcsAlarmInfoRep.DeleteAsync(entity); //鐪熷垹闄�
+ }
+
+ /// <summary>
+ /// 鏇存柊鎶ヨ淇℃伅琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpPost]
+ [ApiDescriptionSettings(Name = "Update")]
+ [DisplayName("鏇存柊鎶ヨ淇℃伅琛�")]
+ public async Task Update(UpdateWcsAlarmInfoInput input)
+ {
+ var entity = input.Adapt<WcsAlarmInfo>();
+ await _wcsAlarmInfoRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎶ヨ淇℃伅琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpGet]
+ [ApiDescriptionSettings(Name = "Detail")]
+ [DisplayName("鑾峰彇鎶ヨ淇℃伅琛�")]
+ public async Task<WcsAlarmInfo> Detail([FromQuery] QueryByIdWcsAlarmInfoInput input)
+ {
+ return await _wcsAlarmInfoRep.GetFirstAsync(u => u.Id == input.Id);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎶ヨ淇℃伅琛ㄥ垪琛�
+ /// </summary>
+ /// <param name="input"></param>
+ /// <returns></returns>
+ [HttpGet]
+ [ApiDescriptionSettings(Name = "List")]
+ [DisplayName("鑾峰彇鎶ヨ淇℃伅琛ㄥ垪琛�")]
+ public async Task<List<WcsAlarmInfoOutput>> List([FromQuery] PageWcsAlarmInfoInput input)
+ {
+ return await _wcsAlarmInfoRep.AsQueryable().Select<WcsAlarmInfoOutput>().ToListAsync();
+ }
+
+
+
+
+
+}
diff --git a/Web/src/api/wcs/wcsAlarmInfo.ts b/Web/src/api/wcs/wcsAlarmInfo.ts
new file mode 100644
index 0000000..c2772d1
--- /dev/null
+++ b/Web/src/api/wcs/wcsAlarmInfo.ts
@@ -0,0 +1,50 @@
+锘縤mport request from '/@/utils/request';
+enum Api {
+ AddWcsAlarmInfo = '/api/wcsAlarmInfo/add',
+ DeleteWcsAlarmInfo = '/api/wcsAlarmInfo/delete',
+ UpdateWcsAlarmInfo = '/api/wcsAlarmInfo/update',
+ PageWcsAlarmInfo = '/api/wcsAlarmInfo/page',
+ DetailWcsAlarmInfo = '/api/wcsAlarmInfo/detail',
+}
+
+// 澧炲姞鎶ヨ淇℃伅琛�
+export const addWcsAlarmInfo = (params?: any) =>
+ request({
+ url: Api.AddWcsAlarmInfo,
+ method: 'post',
+ data: params,
+ });
+
+// 鍒犻櫎鎶ヨ淇℃伅琛�
+export const deleteWcsAlarmInfo = (params?: any) =>
+ request({
+ url: Api.DeleteWcsAlarmInfo,
+ method: 'post',
+ data: params,
+ });
+
+// 缂栬緫鎶ヨ淇℃伅琛�
+export const updateWcsAlarmInfo = (params?: any) =>
+ request({
+ url: Api.UpdateWcsAlarmInfo,
+ method: 'post',
+ data: params,
+ });
+
+// 鍒嗛〉鏌ヨ鎶ヨ淇℃伅琛�
+export const pageWcsAlarmInfo = (params?: any) =>
+ request({
+ url: Api.PageWcsAlarmInfo,
+ method: 'post',
+ data: params,
+ });
+
+// 璇︽儏鎶ヨ淇℃伅琛�
+export const detailWcsAlarmInfo = (id: any) =>
+ request({
+ url: Api.DetailWcsAlarmInfo,
+ method: 'get',
+ data: { id },
+ });
+
+
diff --git a/Web/src/views/wcs/wcsAlarmInfo/component/editDialog.vue b/Web/src/views/wcs/wcsAlarmInfo/component/editDialog.vue
new file mode 100644
index 0000000..7ab3eef
--- /dev/null
+++ b/Web/src/views/wcs/wcsAlarmInfo/component/editDialog.vue
@@ -0,0 +1,153 @@
+锘�<template>
+ <div class="wcsAlarmInfo-container">
+ <el-dialog v-model="isShowDialog" :width="800" draggable="" :close-on-click-modal="false">
+ <template #header>
+ <div style="color: #fff">
+ <!--<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>-->
+ <span>{{ props.title }}</span>
+ </div>
+ </template>
+ <el-form :model="ruleForm" ref="ruleFormRef" label-width="auto" :rules="rules">
+ <el-row :gutter="35">
+ <el-form-item v-show="false">
+ <el-input v-model="ruleForm.id" />
+ </el-form-item>
+ <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
+ <el-form-item label="PLCIP鍦板潃" prop="plcIP">
+ <el-input v-model="ruleForm.plcIP" placeholder="璇疯緭鍏LCIP鍦板潃" maxlength="20" 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="鎶ヨ缂栧彿" prop="alarmCode">
+ <el-input v-model="ruleForm.alarmCode" placeholder="璇疯緭鍏ユ姤璀︾紪鍙�" maxlength="20" 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="鎶ヨ鎻忚堪" prop="alarmName">
+ <el-input v-model="ruleForm.alarmName" placeholder="璇疯緭鍏ユ姤璀︽弿杩�" maxlength="100" 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="20" 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="璁惧绫诲瀷" prop="type">
+ <el-input v-model="ruleForm.type" placeholder="璇疯緭鍏ヨ澶囩被鍨�" maxlength="20" show-word-limit clearable />
+
+ </el-form-item>
+
+ </el-col>
+ </el-row>
+ </el-form>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submit">纭� 瀹�</el-button>
+ </span>
+ </template>
+ </el-dialog>
+ </div>
+</template>
+<style lang="scss" scoped>
+:deep(.el-select),
+:deep(.el-input-number) {
+ width: 100%;
+}
+</style>
+<script lang="ts" setup>
+ import { ref,onMounted } from "vue";
+ import { ElMessage } from "element-plus";
+ import type { FormRules } from "element-plus";
+ import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
+ import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
+ import { formatDate } from '/@/utils/formatTime';
+ import { addWcsAlarmInfo, updateWcsAlarmInfo, detailWcsAlarmInfo } from "/@/api/wcs/wcsAlarmInfo";
+ import { getAPI } from '/@/utils/axios-utils';
+ import { SysEnumApi } from '/@/api-services/api';
+
+ //鐖剁骇浼犻�掓潵鐨勫弬鏁�
+ var props = defineProps({
+ title: {
+ type: String,
+ default: "",
+ },
+ });
+ //鐖剁骇浼犻�掓潵鐨勫嚱鏁帮紝鐢ㄤ簬鍥炶皟
+ const emit = defineEmits(["reloadTable"]);
+ const ruleFormRef = ref();
+ const isShowDialog = ref(false);
+ const ruleForm = ref<any>({});
+ //鑷娣诲姞鍏朵粬瑙勫垯
+ const rules = ref<FormRules>({
+ });
+
+ // 椤甸潰鍔犺浇鏃�
+ onMounted(() => {
+
+ });
+
+ // 鎵撳紑寮圭獥
+ const openDialog = async (row: any) => {
+ // ruleForm.value = JSON.parse(JSON.stringify(row));
+ // 鏀圭敤detail鑾峰彇鏈�鏂版暟鎹潵缂栬緫
+ let rowData = JSON.parse(JSON.stringify(row));
+ if (rowData.id)
+ ruleForm.value = (await detailWcsAlarmInfo(rowData.id)).data.result;
+ else
+ ruleForm.value = rowData;
+ isShowDialog.value = true;
+ };
+
+ // 鍏抽棴寮圭獥
+ const closeDialog = () => {
+ emit("reloadTable");
+ isShowDialog.value = false;
+ };
+
+ // 鍙栨秷
+ const cancel = () => {
+ isShowDialog.value = false;
+ };
+
+ // 鎻愪氦
+ const submit = async () => {
+ ruleFormRef.value.validate(async (isValid: boolean, fields?: any) => {
+ if (isValid) {
+ let values = ruleForm.value;
+ if (ruleForm.value.id == undefined || ruleForm.value.id == null || ruleForm.value.id == "" || ruleForm.value.id == 0) {
+ await addWcsAlarmInfo(values);
+ } else {
+ await updateWcsAlarmInfo(values);
+ }
+ closeDialog();
+ } else {
+ ElMessage({
+ message: `琛ㄥ崟鏈�${Object.keys(fields).length}澶勯獙璇佸け璐ワ紝璇蜂慨鏀瑰悗鍐嶆彁浜,
+ type: "error",
+ });
+ }
+ });
+ };
+
+
+
+
+
+
+ //灏嗗睘鎬ф垨鑰呭嚱鏁版毚闇茬粰鐖剁粍浠�
+ defineExpose({ openDialog });
+</script>
+
+
+
+
diff --git a/Web/src/views/wcs/wcsAlarmInfo/index.vue b/Web/src/views/wcs/wcsAlarmInfo/index.vue
new file mode 100644
index 0000000..1b582da
--- /dev/null
+++ b/Web/src/views/wcs/wcsAlarmInfo/index.vue
@@ -0,0 +1,194 @@
+锘�<template>
+ <div class="wcsAlarmInfo-container">
+ <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
+ <el-form :model="queryParams" ref="queryForm" labelWidth="90">
+ <el-row>
+ <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
+ <el-form-item label="鍏抽敭瀛�">
+ <el-input v-model="queryParams.searchKey" clearable="" placeholder="璇疯緭鍏ユā绯婃煡璇㈠叧閿瓧" />
+
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
+ <el-form-item label="PLCIP鍦板潃">
+ <el-input v-model="queryParams.plcIP" clearable="" placeholder="璇疯緭鍏LCIP鍦板潃" />
+
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
+ <el-form-item label="璁惧绫诲瀷">
+ <el-input v-model="queryParams.type" clearable="" placeholder="璇疯緭鍏ヨ澶囩被鍨�" />
+
+ </el-form-item>
+ </el-col>
+ <el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
+ <el-form-item>
+ <el-button-group style="display: flex; align-items: center;">
+ <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'wcsAlarmInfo:page'"> 鏌ヨ
+ </el-button>
+ <el-button icon="ele-Refresh" @click="() => queryParams = {}"> 閲嶇疆 </el-button>
+ <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI"
+ style="margin-left:5px;"> 楂樼骇鏌ヨ </el-button>
+ <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI"
+ style="margin-left:5px;"> 闅愯棌 </el-button>
+ <el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWcsAlarmInfo"
+ v-auth="'wcsAlarmInfo:add'"> 鏂板 </el-button>
+
+ </el-button-group>
+ </el-form-item>
+
+ </el-col>
+ </el-row>
+ </el-form>
+ </el-card>
+ <el-card class="full-table" shadow="hover" style="margin-top: 5px">
+ <el-table :data="tableData" style="width: 100%" v-loading="loading" tooltip-effect="light" row-key="id"
+ @sort-change="sortChange" border="">
+ <el-table-column type="index" label="搴忓彿" width="55" align="center" />
+ <el-table-column prop="plcIP" label="PLCIP鍦板潃" show-overflow-tooltip="" />
+ <el-table-column prop="alarmCode" label="鎶ヨ缂栧彿" show-overflow-tooltip="" />
+ <el-table-column prop="alarmName" label="鎶ヨ鎻忚堪" show-overflow-tooltip="" />
+ <el-table-column prop="ledIP" label="鏄剧ず灞廼p鍦板潃" show-overflow-tooltip="" />
+ <el-table-column prop="status" label="鎶ヨ鐘舵��" show-overflow-tooltip="">
+ <template #default="scope">
+ <el-tag :type="dv('YesNoEnum', scope.row.status)?.tagType"> {{ dv('YesNoEnum',
+ scope.row.status)?.name }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column prop="type" label="璁惧绫诲瀷" show-overflow-tooltip="" />
+ <el-table-column prop="alarmTime" label="鎶ヨ鏃ユ湡" show-overflow-tooltip="" />
+ <el-table-column prop="ledStatus" label="LED鏄剧ず鐘舵��" show-overflow-tooltip="">
+ <template #default="scope">
+ <el-tag :type="dv('YesNoEnum', scope.row.ledStatus)?.tagType"> {{ dv('YesNoEnum',
+ scope.row.ledStatus)?.name }}</el-tag>
+ </template>
+ </el-table-column>
+ <el-table-column label="淇敼璁板綍" width="80" align="center" show-overflow-tooltip>
+ <template #default="scope">
+ <ModifyRecord :data="scope.row" />
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" width="140" align="center" fixed="right" show-overflow-tooltip=""
+ v-if="auth('wcsAlarmInfo:update') || auth('wcsAlarmInfo:delete')">
+ <template #default="scope">
+ <el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWcsAlarmInfo(scope.row)"
+ v-auth="'wcsAlarmInfo:update'"> 缂栬緫 </el-button>
+ <el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWcsAlarmInfo(scope.row)"
+ v-auth="'wcsAlarmInfo:delete'"> 鍒犻櫎 </el-button>
+ </template>
+ </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="total, sizes, prev, pager, next, jumper" />
+ <printDialog ref="printDialogRef" :title="printWcsAlarmInfoTitle" @reloadTable="handleQuery" />
+ <editDialog ref="editDialogRef" :title="editWcsAlarmInfoTitle" @reloadTable="handleQuery" />
+ </el-card>
+ </div>
+</template>
+
+<script lang="ts" setup="" name="wcsAlarmInfo">
+import { ref } from "vue";
+import { ElMessageBox, ElMessage } from "element-plus";
+import { auth } from '/@/utils/authFunction';
+
+import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
+import { getDictLabelByVal as dv } from '/@/utils/dict-utils';
+import { formatDate } from '/@/utils/formatTime';
+
+import ModifyRecord from '/@/components/table/modifyRecord.vue';
+
+import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
+import editDialog from '/@/views/wcs/wcsAlarmInfo/component/editDialog.vue'
+import { pageWcsAlarmInfo, deleteWcsAlarmInfo } from '/@/api/wcs/wcsAlarmInfo';
+
+const showAdvanceQueryUI = ref(false);
+const printDialogRef = ref();
+const editDialogRef = ref();
+const loading = ref(false);
+const tableData = ref<any>([]);
+const queryParams = ref<any>({});
+const tableParams = ref({
+ page: 1,
+ pageSize: 10,
+ total: 0,
+});
+
+const printWcsAlarmInfoTitle = ref("");
+const editWcsAlarmInfoTitle = ref("");
+
+// 鏀瑰彉楂樼骇鏌ヨ鐨勬帶浠舵樉绀虹姸鎬�
+const changeAdvanceQueryUI = () => {
+ showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
+}
+
+// 鏌ヨ鎿嶄綔
+const handleQuery = async () => {
+ loading.value = true;
+ var res = await pageWcsAlarmInfo(Object.assign(queryParams.value, tableParams.value));
+ tableData.value = res.data.result?.items ?? [];
+ tableParams.value.total = res.data.result?.total;
+ loading.value = false;
+};
+
+// 鍒楁帓搴�
+const sortChange = async (column: any) => {
+ queryParams.value.field = column.prop;
+ queryParams.value.order = column.order;
+ await handleQuery();
+};
+
+// 鎵撳紑鏂板椤甸潰
+const openAddWcsAlarmInfo = () => {
+ editWcsAlarmInfoTitle.value = '娣诲姞鎶ヨ淇℃伅琛�';
+ editDialogRef.value.openDialog({});
+};
+
+// 鎵撳紑鎵撳嵃椤甸潰
+const openPrintWcsAlarmInfo = async (row: any) => {
+ printWcsAlarmInfoTitle.value = '鎵撳嵃鎶ヨ淇℃伅琛�';
+}
+
+// 鎵撳紑缂栬緫椤甸潰
+const openEditWcsAlarmInfo = (row: any) => {
+ editWcsAlarmInfoTitle.value = '缂栬緫鎶ヨ淇℃伅琛�';
+ editDialogRef.value.openDialog(row);
+};
+
+// 鍒犻櫎
+const delWcsAlarmInfo = (row: any) => {
+ ElMessageBox.confirm(`纭畾瑕佸垹闄ゅ悧?`, "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(async () => {
+ await deleteWcsAlarmInfo(row);
+ handleQuery();
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => { });
+};
+
+// 鏀瑰彉椤甸潰瀹归噺
+const handleSizeChange = (val: number) => {
+ tableParams.value.pageSize = val;
+ handleQuery();
+};
+
+// 鏀瑰彉椤电爜搴忓彿
+const handleCurrentChange = (val: number) => {
+ tableParams.value.page = val;
+ handleQuery();
+};
+
+handleQuery();
+</script>
+<style scoped>
+:deep(.el-input),
+:deep(.el-select),
+:deep(.el-input-number) {
+ width: 100%;
+}
+</style>
diff --git a/Web/src/views/wcs/wcsAlarmLog/index.vue b/Web/src/views/wcs/wcsAlarmLog/index.vue
index 5964458..c9d21db 100644
--- a/Web/src/views/wcs/wcsAlarmLog/index.vue
+++ b/Web/src/views/wcs/wcsAlarmLog/index.vue
@@ -1,171 +1,159 @@
锘�<template>
<div class="wcsAlarmLog-container">
- <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
+ <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="queryParams" ref="queryForm" labelWidth="90">
<el-row>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
<el-form-item label="鍏抽敭瀛�">
- <el-input v-model="queryParams.searchKey" clearable="" placeholder="璇疯緭鍏ユā绯婃煡璇㈠叧閿瓧"/>
-
+ <el-input v-model="queryParams.searchKey" clearable="" placeholder="璇疯緭鍏ユā绯婃煡璇㈠叧閿瓧" />
+
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="PLCIP鍦板潃">
- <el-input v-model="queryParams.plcIP" clearable="" placeholder="璇疯緭鍏LCIP鍦板潃"/>
-
+ <el-input v-model="queryParams.plcIP" clearable="" placeholder="璇疯緭鍏LCIP鍦板潃" />
+
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="鎶ヨ缂栧彿">
- <el-input v-model="queryParams.alarmCode" clearable="" placeholder="璇疯緭鍏ユ姤璀︾紪鍙�"/>
-
+ <el-input v-model="queryParams.alarmCode" clearable="" placeholder="璇疯緭鍏ユ姤璀︾紪鍙�" />
+
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="璁惧绫诲瀷">
- <el-input v-model="queryParams.type" clearable="" placeholder="璇疯緭鍏ヨ澶囩被鍨�"/>
-
+ <el-input v-model="queryParams.type" clearable="" placeholder="璇疯緭鍏ヨ澶囩被鍨�" />
+
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUI">
<el-form-item label="鎶ヨ鏃ユ湡">
- <el-date-picker type="daterange" v-model="queryParams.alarmTimeRange" value-format="YYYY-MM-DD HH:mm:ss" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
-
+ <el-date-picker type="daterange" v-model="queryParams.alarmTimeRange" value-format="YYYY-MM-DD HH:mm:ss"
+ start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" />
+
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
- <el-form-item >
+ <el-form-item>
<el-button-group style="display: flex; align-items: center;">
- <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'wcsAlarmLog:page'"> 鏌ヨ </el-button>
- <el-button icon="ele-Refresh" @click="() => queryParams = {}"> 閲嶇疆 </el-button>
- <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI" style="margin-left:5px;"> 楂樼骇鏌ヨ </el-button>
- <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI" style="margin-left:5px;"> 闅愯棌 </el-button>
+ <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'wcsAlarmLog:page'"> 鏌ヨ
+ </el-button>
+ <el-button icon="ele-Refresh" @click="() => queryParams = {}"> 閲嶇疆 </el-button>
+ <el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUI" v-if="!showAdvanceQueryUI"
+ style="margin-left:5px;"> 楂樼骇鏌ヨ </el-button>
+ <el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUI" v-if="showAdvanceQueryUI"
+ style="margin-left:5px;"> 闅愯棌 </el-button>
</el-button-group>
</el-form-item>
-
+
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
- <el-table
- :data="tableData"
- style="width: 100%"
- v-loading="loading"
- tooltip-effect="light"
- row-key="id"
- @sort-change="sortChange"
- border="">
- <el-table-column type="index" label="搴忓彿" width="55" align="center"/>
- <el-table-column prop="plcIP" label="PLCIP鍦板潃" show-overflow-tooltip="" />
- <el-table-column prop="alarmCode" label="鎶ヨ缂栧彿" show-overflow-tooltip="" />
- <el-table-column prop="alarmName" label="鎶ヨ鎻忚堪" show-overflow-tooltip="" />
- <el-table-column prop="type" label="璁惧绫诲瀷" show-overflow-tooltip="" />
- <el-table-column prop="alarmTime" label="鎶ヨ鏃ユ湡" show-overflow-tooltip="" />
+ <el-table :data="tableData" style="width: 100%" v-loading="loading" tooltip-effect="light" row-key="id"
+ @sort-change="sortChange" border="">
+ <el-table-column type="index" label="搴忓彿" width="55" align="center" />
+ <el-table-column prop="plcIP" label="PLCIP鍦板潃" show-overflow-tooltip="" />
+ <el-table-column prop="alarmCode" label="鎶ヨ缂栧彿" show-overflow-tooltip="" />
+ <el-table-column prop="alarmName" label="鎶ヨ鎻忚堪" show-overflow-tooltip="" />
+ <el-table-column prop="type" label="璁惧绫诲瀷" show-overflow-tooltip="" />
+ <el-table-column prop="alarmTime" label="鎶ヨ鏃ユ湡" show-overflow-tooltip="" />
<el-table-column label="淇敼璁板綍" width="80" align="center" show-overflow-tooltip>
- <template #default="scope">
- <ModifyRecord :data="scope.row" />
- </template>
- </el-table-column>
+ <template #default="scope">
+ <ModifyRecord :data="scope.row" />
+ </template>
+ </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="total, sizes, prev, pager, next, jumper"
- />
- <printDialog
- ref="printDialogRef"
- :title="printWcsAlarmLogTitle"
- @reloadTable="handleQuery" />
+ <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="total, sizes, prev, pager, next, jumper" />
+ <printDialog ref="printDialogRef" :title="printWcsAlarmLogTitle" @reloadTable="handleQuery" />
</el-card>
</div>
</template>
<script lang="ts" setup="" name="wcsAlarmLog">
- import { ref } from "vue";
- import { ElMessageBox, ElMessage } from "element-plus";
- import { auth } from '/@/utils/authFunction';
+import { ref } from "vue";
+import { ElMessageBox, ElMessage } from "element-plus";
+import { auth } from '/@/utils/authFunction';
- import ModifyRecord from '/@/components/table/modifyRecord.vue';
- import { formatDate } from '/@/utils/formatTime';
+import ModifyRecord from '/@/components/table/modifyRecord.vue';
+import { formatDate } from '/@/utils/formatTime';
- import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
- import { pageWcsAlarmLog, deleteWcsAlarmLog } from '/@/api/log/wcsAlarmLog';
+import printDialog from '/@/views/system/print/component/hiprint/preview.vue'
+import { pageWcsAlarmLog, deleteWcsAlarmLog } from '/@/api/log/wcsAlarmLog';
- const showAdvanceQueryUI = ref(false);
- const printDialogRef = ref();
- const editDialogRef = ref();
- const loading = ref(false);
- const tableData = ref<any>([]);
- const queryParams = ref<any>({});
- const tableParams = ref({
- page: 1,
- pageSize: 10,
- total: 0,
- });
+const showAdvanceQueryUI = ref(false);
+const printDialogRef = ref();
+const editDialogRef = ref();
+const loading = ref(false);
+const tableData = ref<any>([]);
+const queryParams = ref<any>({});
+const tableParams = ref({
+ page: 1,
+ pageSize: 10,
+ total: 0,
+});
- const printWcsAlarmLogTitle = ref("");
- const editWcsAlarmLogTitle = ref("");
+const printWcsAlarmLogTitle = ref("");
+const editWcsAlarmLogTitle = ref("");
- // 鏀瑰彉楂樼骇鏌ヨ鐨勬帶浠舵樉绀虹姸鎬�
- const changeAdvanceQueryUI = () => {
- showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
- }
+// 鏀瑰彉楂樼骇鏌ヨ鐨勬帶浠舵樉绀虹姸鎬�
+const changeAdvanceQueryUI = () => {
+ showAdvanceQueryUI.value = !showAdvanceQueryUI.value;
+}
- // 鏌ヨ鎿嶄綔
- const handleQuery = async () => {
- loading.value = true;
- var res = await pageWcsAlarmLog(Object.assign(queryParams.value, tableParams.value));
- tableData.value = res.data.result?.items ?? [];
- tableParams.value.total = res.data.result?.total;
- loading.value = false;
- };
+// 鏌ヨ鎿嶄綔
+const handleQuery = async () => {
+ loading.value = true;
+ var res = await pageWcsAlarmLog(Object.assign(queryParams.value, tableParams.value));
+ tableData.value = res.data.result?.items ?? [];
+ tableParams.value.total = res.data.result?.total;
+ loading.value = false;
+};
- // 鍒楁帓搴�
- const sortChange = async (column: any) => {
- queryParams.value.field = column.prop;
- queryParams.value.order = column.order;
- await handleQuery();
- };
+// 鍒楁帓搴�
+const sortChange = async (column: any) => {
+ queryParams.value.field = column.prop;
+ queryParams.value.order = column.order;
+ await handleQuery();
+};
- // 鎵撳紑鏂板椤甸潰
- const openAddWcsAlarmLog = () => {
- editWcsAlarmLogTitle.value = '娣诲姞鎶ヨ鏃ュ織';
- editDialogRef.value.openDialog({});
- };
+// 鎵撳紑鏂板椤甸潰
+const openAddWcsAlarmLog = () => {
+ editWcsAlarmLogTitle.value = '娣诲姞鎶ヨ鏃ュ織';
+ editDialogRef.value.openDialog({});
+};
- // 鎵撳紑鎵撳嵃椤甸潰
- const openPrintWcsAlarmLog = async (row: any) => {
- printWcsAlarmLogTitle.value = '鎵撳嵃鎶ヨ鏃ュ織';
- }
-
+// 鎵撳紑鎵撳嵃椤甸潰
+const openPrintWcsAlarmLog = async (row: any) => {
+ printWcsAlarmLogTitle.value = '鎵撳嵃鎶ヨ鏃ュ織';
+}
- // 鏀瑰彉椤甸潰瀹归噺
- const handleSizeChange = (val: number) => {
- tableParams.value.pageSize = val;
- handleQuery();
- };
- // 鏀瑰彉椤电爜搴忓彿
- const handleCurrentChange = (val: number) => {
- tableParams.value.page = val;
- handleQuery();
- };
-
+// 鏀瑰彉椤甸潰瀹归噺
+const handleSizeChange = (val: number) => {
+ tableParams.value.pageSize = val;
handleQuery();
+};
+
+// 鏀瑰彉椤电爜搴忓彿
+const handleCurrentChange = (val: number) => {
+ tableParams.value.page = val;
+ handleQuery();
+};
+
+handleQuery();
</script>
<style scoped>
:deep(.el-input),
:deep(.el-select),
:deep(.el-input-number) {
- width: 100%;
+ width: 100%;
}
</style>
-
--
Gitblit v1.8.0