v10.10.2024.0701 使用IJsonHost改进Json序列化
大石头 编写于 2024-07-01 08:36:34 大石头 提交于 2024-07-01 08:48:33
X
@using NewLife;
@using XCode;
@using XCode.Configuration;
@{
    var pair = Model as Pair;
    var entity = pair.First as IEntity;
    var item = pair.Second as FieldItem;

    var bs = this.Bootstrap();

    var isInt = item.Type == typeof(Int32);
    var w = isInt ? 4 : 8;

    var w_md = bs.LabelWidth;
    if (bs.MaxColumn > 1 && item.Type == typeof(String) && item.Length > 100)
    {
        w_md /= 2;
    }
}
<label class="control-label col-xs-2 col-sm-2 col-md-2 col-lg-2">@item.DisplayName</label>
<div class="input-group col-xs-5 col-sm-5 col-md-5 col-lg-5">
    @Html.ForEditor(item, entity)
    <span class="hidden-xs">@Html.ForDescription(item)</span>
    @{
        ModelState st = null;
    }
    @if (ViewData.ModelState.TryGetValue(item.Name, out st) && st != null && st.Errors.Count > 0)
    {
        <span class="alert alert-danger">
            @Html.ValidationMessage(item.Name)
        </span>
    }
</div>