using Admin.NET.Core.Util.LowCode.Front.Model; 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("tabs")] public class Front_Tabs : IFront, IFrontLayout { public string Key { get; set; } public string Label { get; set; } public string Type { get; set; } public string Model { get; set; } /// /// 表格配置 /// public Front_Tabs_Options Options { get; set; } /// /// Tab选项 /// 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_Tabs_Column() { Label = column_item["label"].Value(), Value = column_item["value"].Value(), List = AutoCode_Front.ReadFront(column_item["list"].Values().ToList()) }); } } return new Front_Tabs() { 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_Tabs_Options { /// /// 标签间距 /// public int? TabBarGutter { get; set; } /// /// 页签类型 /// public string Type { get; set; } /// /// 页签位置 /// public string TabPosition { get; set; } /// /// 大小 /// public string Size { get; set; } /// /// 动画切换 /// public bool Animated { get; set; } } public class Front_Tabs_Column { /// /// 页签ID /// public string Value { get; set; } /// /// 页签标签 /// public string Label { get; set; } /// /// 组件集 /// public List List { get; set; } } }