From d6d0a3b309814d58d20052e1fea34248dbfcc889 Mon Sep 17 00:00:00 2001 From: Zhang-Hong-Lin <a3219986988@163.com> Date: 星期一, 03 三月 2025 22:11:16 +0800 Subject: [PATCH] 前端 --- 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" index 1dad356..55f8ee0 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/System/Sys_DictionaryController.cs" @@ -23,6 +23,7 @@ using WIDESEAWCS_QuartzJob.DeviceEnum; using WIDESEAWCS_Core.Enums; using WIDESEAWCS_Common.LocationEnum; +using WIDESEAWCS_Common.StockEnum; namespace WIDESEAWCS_WCSServer.Controllers.System { @@ -196,6 +197,30 @@ result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; } break; + case "stock": + { + List<object> data = new List<object>(); + Type type = typeof(stockEnum); + List<int> enums = Enum.GetValues(type).Cast<int>().ToList(); + int index = 0; + foreach (var item in enums) + { + FieldInfo? fieldInfo = type.GetField(((stockEnum)item).ToString()); + DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); + if (description != null) + { + data.Add(new { key = item.ToString(), value = description.Description }); + } + else + { + data.Add(new { key = item.ToString(), value = item.ToString() }); + } + index++; + } + + result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; + } + break; case "taskType": { List<object> data = new List<object>(); -- Gitblit v1.9.3