Exemplo n.º 1
0
 public static string VueFieldRadio(TableInfo tableInfo)
 {
     return("field.radio.template");
 }
Exemplo n.º 2
0
 public static string VueFieldSelect(TableInfo tableInfo)
 {
     return("field.select.template");
 }
Exemplo n.º 3
0
 public static string VueFieldCheckbox(TableInfo tableInfo)
 {
     return("field.checkbox.template");
 }
Exemplo n.º 4
0
 public static string VueFieldDate(TableInfo tableInfo)
 {
     return("field.date.template");
 }
Exemplo n.º 5
0
 public static string VueTbodyDate(TableInfo tableInfo)
 {
     return("tbody.string.template");
 }
Exemplo n.º 6
0
 public override void DefineTemplateByTableInfo(Context config, TableInfo tableInfo)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 public static string VueFilterComponent(TableInfo tableInfo)
 {
     return("filter.vue.template");
 }
Exemplo n.º 8
0
 public static string VueTheadId(TableInfo tableInfo)
 {
     return("thead.Id.template");
 }
Exemplo n.º 9
0
 public static string VueCreateFormComponent(TableInfo tableInfo)
 {
     return("create-form.vue.template");
 }
Exemplo n.º 10
0
 public static string VueEditFormComponent(TableInfo tableInfo)
 {
     return("edit-form.vue.template");
 }
Exemplo n.º 11
0
 public static string VueIndexComponent(TableInfo tableInfo)
 {
     return("index.vue.template");
 }
Exemplo n.º 12
0
 public static string VueTbodyNumber(TableInfo tableInfo)
 {
     return("tbody.number.template");
 }
        public override void DefineTemplateByTableInfoFields(Context config, TableInfo tableInfo, UniqueListInfo infos)
        {
            foreach (var item in infos)
            {
                var order       = TypeConvertCSharp.OrderByType(item.Type);
                var orderFilter = TypeConvertCSharp.OrderByType(item.Type);

                var group               = default(Group);
                var groupComponents     = default(List <GroupComponent>);
                var ShowFieldIsKey      = false;
                var CameCasingManual    = "";
                var RelationOneToOne    = false;
                var dateTimeComparation = config.DateTimeComparation;
                var htmlComponent       = "";

                if (tableInfo.FieldsConfig.IsAny())
                {
                    var dateTimeComparationConfig = tableInfo.FieldsConfig
                                                    .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                                    .SingleOrDefault();

                    if (dateTimeComparationConfig.IsNotNull() && dateTimeComparationConfig.DateTimeComparation.IsSent())
                    {
                        dateTimeComparation = dateTimeComparationConfig.DateTimeComparation;
                    }


                    var orderConfig = tableInfo.FieldsConfig
                                      .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                      .SingleOrDefault();

                    if (orderConfig.IsNotNull() && orderConfig.Order.IsSent())
                    {
                        order = orderConfig.Order;
                    }


                    if (orderConfig.IsNotNull() && orderConfig.OrderFilter.IsSent())
                    {
                        orderFilter = orderConfig.OrderFilter;
                    }
                    else
                    {
                        orderFilter = int.MaxValue;
                    }

                    var groupConfig = tableInfo.FieldsConfig
                                      .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                      .SingleOrDefault();

                    if (groupConfig.IsNotNull() && groupConfig.Group.IsNotNull())
                    {
                        group = groupConfig.Group;
                    }


                    var groupComponentConfig = tableInfo.FieldsConfig
                                               .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                               .SingleOrDefault();

                    if (groupComponentConfig.IsNotNull() && groupComponentConfig.GroupComponents.IsAny())
                    {
                        groupComponents = groupConfig.GroupComponents;
                    }


                    var ShowFieldIsKeyConfig = tableInfo.FieldsConfig
                                               .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                               .SingleOrDefault();

                    if (ShowFieldIsKeyConfig.IsNotNull() && ShowFieldIsKeyConfig.ShowFieldIsKey.IsSent())
                    {
                        ShowFieldIsKey = groupConfig.ShowFieldIsKey;
                    }

                    var RelationOneToOneConfig = tableInfo.FieldsConfig
                                                 .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                                 .SingleOrDefault();

                    if (RelationOneToOneConfig.IsNotNull() && RelationOneToOneConfig.RelationOneToOne.IsSent())
                    {
                        RelationOneToOne = groupConfig.RelationOneToOne;
                    }


                    var CameCasingManualConfig = tableInfo.FieldsConfig
                                                 .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                                 .SingleOrDefault();

                    if (CameCasingManualConfig.IsNotNull() && CameCasingManualConfig.CameCasingManual.IsSent())
                    {
                        CameCasingManual = groupConfig.CameCasingManual;
                    }

                    var textEditor = tableInfo.FieldsConfig
                                     .Where(_ => _.Name.ToLower() == item.PropertyName.ToString().ToLower())
                                     .SingleOrDefault();

                    if (textEditor.IsNotNull() && textEditor.TextEditor.IsSent())
                    {
                        htmlComponent = "TextEditor";
                    }

                    if (textEditor.IsNotNull() && textEditor.Upload.IsSent())
                    {
                        htmlComponent = "Upload";
                    }
                }


                item.Order               = order;
                item.HtmlComponent       = htmlComponent;
                item.OrderFilter         = orderFilter;
                item.DateTimeComparation = dateTimeComparation;
                item.Group               = group;
                item.GroupComponents     = groupComponents;
                item.ShowFieldIsKey      = ShowFieldIsKey;
                item.CameCasingManual    = CameCasingManual;
                item.RelationOneToOne    = RelationOneToOne;
            }

            base.CastOrdenabledToUniqueListInfo(infos);
        }
Exemplo n.º 14
0
 public static string VueFieldHidden(TableInfo tableInfo)
 {
     return("field.hidden.template");
 }
Exemplo n.º 15
0
 public static string VueRouterComponent(TableInfo tableInfo)
 {
     return("router.js.template");
 }
Exemplo n.º 16
0
 public static string VueTheadFields(TableInfo tableInfo)
 {
     return("thead.fields.template");
 }
Exemplo n.º 17
0
 public static string VueFieldInput(TableInfo tableInfo)
 {
     return("field.input.template");
 }
Exemplo n.º 18
0
 public static string VueTbodyBoolean(TableInfo tableInfo)
 {
     return("tbody.boolean.template");
 }
Exemplo n.º 19
0
 public static string VueRequired(TableInfo tableInfo)
 {
     return("required.template");
 }
Exemplo n.º 20
0
 public override void DefineTemplateByTableInfo(Context config, TableInfo tableInfo)
 {
 }
Exemplo n.º 21
0
 public override void DefineTemplateByTableInfoFields(Context config, TableInfo tableInfo, UniqueListInfo infos)
 {
     throw new NotImplementedException();
 }