@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@*@using Models;*@
@*@model List<TBL_HOTEL_GROUP_INFO> ;*@
@{
    ViewData["ROOT"] = "0";
    Layout = null;
}
@*<div class="row">
    <div class="col-md-8 col-6 border">

    </div>
    <div class="col-md-4 col-6 border">
    @await Html.PartialAsync("~/Views/Shared/_Index.cshtml",Model,ViewData)
    </div>
    </div>*@


@*以上部分已经注释*@
@{
    @using Models
    @model List<HotelDataItem>;


}
<style>
    .hiddtext {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1; /*规定最多显示两行*/
    }
</style>
<div class="row">

    <div class="col-12">
        <div class="input-group m-1 ">
            <input autocomplete="off" type="hidden" value='@ViewData["search"]' id="searchtext" class="form-control">
            <div class="input-group-append" id="search">
                <span class="input-group-text"><i class="fas fa-search"></i></span>
            </div>
        </div>
    </div>
    <ul style=" display:none;list-style:none; position:absolute;z-index:99999;background:#fff; margin-top:42px;" class="p-1 text-center col-10 history_list">
    </ul>
    <div class="col-12">
        <div class="row">
            <div id="seltext" class='text-left col-10 '>
                @if (ViewData["HotelGroup"] != null)
                {
                    @((ViewData["HotelGroup"] as HotelDataItem).HotelGroupsName)
                }
                else
                {
                    @("全部")
                }
            </div>
            <div class='col-2 text-right'>
                <span id="qdbtn" class='bg-danger btn  btn-xs '>确定</span>
            </div>
            @* <div class="input-group-append"  id="search">
                <span class="input-group-text">确定</span>
                </div>*@
        </div>
    </div>

    <div class="col-md-6 col-12 border mb-1 mt-1">
        <div class="row">
            <div class='bg-info col-12'>
                酒店组
            </div>
            <div data-id=0 class=' groupinfo col-4 col-md-3'>
                <span style="width:100%;margin:5px auto;" class="hiddtext btn  @(ViewData["HotelGroup"] ==null?"btn-primary":"btn-info") btn-sm  text-left "> 全部</span>
            </div>
            @foreach (var item in Model)
            {
                <div data-id=@item.HotelGroupsId class=' groupinfo col-4 col-md-3'>
                    <span style="width:100%;margin:5px auto;" class="hiddtext btn  @(ViewData["HotelGroup"] != null &&item.HotelGroupsId.ToString()  == ((ViewData["HotelGroup"] as HotelDataItem).HotelGroupsId).ToString()?"btn-primary":"btn-info") btn-sm  text-left "> @item.HotelGroupsName</span>
                </div>
            }
        </div>
    </div>
    <div class="col-md-6 col-xs-0 border mb-1 mt-1">
        <div class="row ">
            <div class='bg-success   col-12'>
                酒店
            </div>
            <div class="col-12 row" style=" align-items:baseline !important;">

                @if (ViewData["HotelGroup"] != null)
                {
                    @foreach (HotelsItem item in (ViewData["HotelGroup"] as HotelDataItem).Hotels)
                    {
                        if ((ViewData["search"].ToString() != string.Empty && item.HotelName.IndexOf(ViewData["search"].ToString()) < 0)) { continue; }
                        <div data-group='@((ViewData["HotelGroup"] as HotelDataItem).HotelGroupsName)' data-id=@item.HotelId data-name='@item.HotelName' class='  Hotel_hover  col-4'>
                            <span style="width:100%;margin:5px auto;" class="hiddtext btn  @(item.HotelId.ToString() == ((ViewData["Hotel"]??"").ToString()) || (ViewData["search"].ToString() != string.Empty && item.HotelName.IndexOf(ViewData["search"].ToString())>=0)?"btn-primary":"btn-success")  btn-sm text-left">  @item.HotelName </span>

                        </div>
                    }
                }
                else
                {
                    @foreach (var tump in Model)
                    {
                        @foreach (HotelsItem item in tump.Hotels)
                        {
                            if ((ViewData["search"].ToString() != string.Empty && item.HotelName.IndexOf(ViewData["search"].ToString()) < 0)) { continue; }
                            <div data-group='@(tump.HotelGroupsName)' data-id=@item.HotelId data-name='@item.HotelName' class='  Hotel_hover  col-4'>
                                <span style="width:100%;margin:5px auto;" class="hiddtext btn  @(item.HotelId.ToString() == ((ViewData["Hotel"]??"").ToString()) || (ViewData["search"].ToString() != string.Empty && item.HotelName.IndexOf(ViewData["search"].ToString())>=0)?"btn-primary":"btn-success")  btn-sm text-left">  @item.HotelName </span>
                            </div>
                        }
                    }
                }
            </div>
        </div>
    </div>
</div>
