CommonBtn.cshtml 2.67 KB
@using Hh.Mes.POJO.ViewModel
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
    Layout = "~/Views/Shared/_LayoutSys.cshtml";
    int areaIndex = 1;
    int btnIndex = 1;
}
@model List<AreaBtnModel>
@section header {
    <link rel="stylesheet" href="/layui/font/fonteditor/icon.css" />
    <link rel="stylesheet" href="/layui/font/fonteditor/page.css" />
    <style type="text/css">
        .model-title {
            position: absolute;
            right: 10px;
            top: 10px;
            font-weight: bold;
        }
        .layui-form-item .layui-form-checkbox[lay-skin="primary"] {
            margin-top: 20px;
            margin-bottom: 20px;
        }
        .footer {
            position: relative;
            top: 40px;
            width: 500px;
            text-align: right;
        }

        .footer-btn {
            margin-right: 40px;
        }
    </style>
}
    
<div class="layui-row div-relative">
    <H4 class="model-title">@ViewBag.Name</H4>
    <form class="layui-form" method="post" asp-action="SaveChanageCommonBtn">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                @foreach (var item in Model)
                {
                    <li @(areaIndex == 1 ? "class=layui-this" : null)>区域 @item.Area</li>
                    areaIndex++;
                }
            </ul>
            <div class="layui-tab-content" style="height: 100px;">
                @foreach (var item in Model)
                {
                    <div class="layui-tab-item @(btnIndex == 1 ? "layui-show" : null)">
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                @foreach (var btn in item.CheckBoxItems)
                                {
                                    <input  lay-skin="primary" type="checkbox" id="@btn.Id" name="@($"area{item.Area}")" title="@btn.Text" value="@btn.Value" asp-for="@btn.Checked" />
                                }
                            </div>
                        </div>
                    </div>
                    btnIndex++;
                }
            </div>
        </div>
        <input name="moduleId" value="@ViewBag.ModuleId" style="display: none;" />

        <div class="layui-form-item footer">
            <div class="layui-input-block footer-btn">
                <button class="layui-btn layui-btn-normal" style="margin-top: 10px;" type="submit">保存</button>
            </div>
        </div>
       
    </form>
</div>
@section Scripts{
    <script type="text/javascript" src="/productjs/base/sysmodule.js" asp-append-version="true"></script>
}