namespace VberAdmin.Models { public class ColumnViewModel { /// /// 属性名称 /// public string Comment { get; set; } /// /// 属性的类型(string,int) /// public string AttrType { get; set; } /// /// 属性名 即字段名 /// public string ColumnName { get; set; } /// /// 属性名变成小驼峰 /// public string CamelColumnName => ColumnName.Substring(0, 1).ToLower() + ColumnName.Substring(1, ColumnName.Length - 1); /// /// 是否生成 /// public bool IsGenreated { get; set; } = true; /// /// 是否模态框 /// public bool IsModal { get; set; } = true; /// /// 是否是必填 /// public bool IsRequired { get; set; } = false; /// /// 是否是字符串 /// public bool IsVarchar => AttrType == "string"; /// /// 是否是Table显示字段 /// public bool IsTable { get; set; } = true; /// /// 是否是查询字段 /// public bool IsSearch { get; set; } = false; /// /// 最大长度 /// public string MaxLength => string.IsNullOrEmpty(MaxLengthStr) || MaxLengthStr.Contains(".") || int.TryParse(MaxLengthStr, out _) ? MaxLengthStr ?? "" : $".{MaxLengthStr}"; public string MaxLengthStr { get; set; } = ""; public void s() { } } }