@model IEnumerable<Waste.Domain.W_Menu>
<div class="layui-side layui-side-menu">
    <div class="layui-side-scroll">
        <div class="layui-logo" lay-href="Home/Main">
            @*<img src="~/Content/img/logo.png" class="logoimg" style="max-height:50px;">*@
            <h3>@Furion.App.Configuration["CustomSetting:SoftName"]</h3>
        </div>
        <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
            <li class="layui-nav-item layui-this">
                <a href="javascript:;" lay-href="/Home/Main" lay-tips="首页" lay-direction="2"><i class="seraph custom-icon custom-icon-icon-home"></i><cite style="margin-left:5px">首页</cite></a>
            </li>
            @foreach (var item in Model.Where(x => x.ParentId ==Guid.Empty).ToList())
            {
                <li class="layui-nav-item ">
                    @{
                        var aitem = Model.Where(x => x.ParentId == item.Id);
                    }
                    @if (aitem.Count() == 0)
                    {
                        <a href="javascript:;" lay-href="@item.UrlAddress" lay-tips="@item.Name" lay-direction="2"><i class="seraph custom-icon @item.Icon"></i><cite style="margin-left:5px">@item.Name</cite></a>
                    }
                    else
                    {
                        <a href="javascript:;"><i class="seraph custom-icon @item.Icon" data-icon=""></i><cite style="margin-left:5px">@item.Name</cite></a>
                        <dl class="layui-nav-child">
                            @foreach (var bitem in aitem)
                            {
                                <dd>

                                    @{
                                        var citem = Model.Where(x => x.ParentId == bitem.Id);
                                    }
                                    @if (citem.Count() == 0)
                                    {
                                        <a href="javascript:;" lay-href="@bitem.UrlAddress">
                                            <i class="seraph custom-icon @bitem.Icon"></i><cite style="margin-left:5px">
                                                @bitem.Name
                                            </cite>
                                        </a>
                                    }
                                    else
                                    {
                                        <a href="javascript:;"><i class="seraph custom-icon @bitem.Icon" data-icon=""></i><cite style="margin-left:5px">@bitem.Name</cite></a>
                                        <dl class="layui-nav-child">
                                            @foreach (var ditem in citem)
                                            {
                                                <dd>
                                                    <a href="javascript:;" lay-href="@ditem.UrlAddress"><i class="seraph custom-icon @ditem.Icon" data-icon=""></i><cite style="margin-left:5px">@ditem.Name</cite></a>
                                                </dd>
                                            }
                                        </dl>
                                    }
                                </dd>
                            }
                        </dl>
                    }
                </li>
            }
        </ul>
    </div>
</div>