using Admin.NET.Core.Util.LowCode.Front.Model; using Furion.DatabaseAccessor; using Furion.Extras.Admin.NET.Util.LowCode.Front.Att; using Furion.Extras.Admin.NET.Util.LowCode.Front.Code; using Furion.Extras.Admin.NET.Util.LowCode.Front.Interface; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace Furion.Extras.Admin.NET.Util.LowCode.Front { [FrontType("selectInputList")] public class Front_SelectInputList : IFront, IFrontLayout { public string Key { get; set; } public string Label { get; set; } public string Type { get; set; } public string Model { get; set; } /// /// 选择输入列配置 /// public Front_SelectInputList_Options Options { get; set; } /// /// 选项 /// public List Columns { get; set; } public ViewDynamic Dynamic { get { return null; } } public IFront ConvertFront(JObject JData) { var columns_obj = JData["columns"].Values(); List columns = new List(); if (columns_obj != null) { foreach (var column_item in columns_obj) { columns.Add(new Front_SelectInputList_Column() { Label = column_item["label"].Value(), Value = column_item["value"].Value(), List = AutoCode_Front.ReadFront(column_item["list"].Values().ToList()) }); } } return new Front_SelectInputList() { Key = JData["key"].Value(), Label = JData["label"].Value(), Type = JData["type"].Value(), Options = JsonConvert.DeserializeObject(JData["options"].ToString()), Columns = columns }; } public void ReadFront(Action action) { this.Columns.SelectMany(x => x.List).ToList().ForEach(item => { if (item is IFrontLayout) { (item as IFrontLayout).ReadFront(action); } else { action(item); } }); } } public class Front_SelectInputList_Options { public bool disabled { get; set; } public bool multiple { get; set; } public bool hidden { get; set; } public bool showLabel { get; set; } public string width { get; set; } } public class Front_SelectInputList_Column { public string Value { get; set; } public string Label { get; set; } /// /// 组件集 /// public List List { get; set; } } }