Browse Source

指引图显示

pengjing 1 year ago
parent
commit
4c297461b6

+ 19 - 1
YLShipBuildLandMap.Entity/ViewModel/Build/RoomView.cs

@@ -4,11 +4,29 @@ using System.Text;
 
 namespace YLShipBuildLandMap.Entity.ViewModel.Build
 {
-    public class RoomView:BdBuildingFloorRoom
+    public class RoomView : BdBuildingFloorRoom
     {
         public string FloorName { get; set; }
         public int? FloorSort { get; set; }
         public string BuildingName { get; set; }
         public Guid? BuildingId { get; set; }
     }
+
+    public class RoomDepOrServiceView
+    {
+        public string BuildingName { get; set; }
+        public Guid? BuildingId { get; set; }
+        public Guid BuildingFloorRoomId { get; set; }
+        public string FloorName { get; set; }
+        public int? FloorSort { get; set; }
+        public Guid? BuildingFloorId { get; set; }
+        public string RoomName { get; set; }
+        public int? Sort { get; set; }
+        public string DepartmentOrServiceName { get; set; }
+        public Guid? DepartmentOrServicePointId { get; set; }
+        public string OpenTime { get; set; }
+        public string ContactType { get; set; }
+        public string Description { get; set; }
+    }
+
 }

+ 1 - 1
YLShipBuildLandMap.IServices/Build/IBuildingService.cs

@@ -12,7 +12,7 @@ namespace YLShipBuildLandMap.Services.Build
     {
         Task<List<BuildingView>> GetBuildingList();
 
-        Task<List<FloorView>> GetFloorList(Guid buildingId);
+        Task<List<FloorView>> GetFloorList(Guid? buildingId);
 
         Task<BuildingView> GetBuildingById(Guid? buildingId);
 

+ 2 - 0
YLShipBuildLandMap.IServices/Build/IRoomService.cs

@@ -16,5 +16,7 @@ namespace YLShipBuildLandMap.Services.Build
         Task<int> Save(RoomView data, Guid? userId);
 
         Task<int> Delete(List<Guid> roomIdList);
+
+        Task<List<RoomDepOrServiceView>> GetRoomDepOrServiceList();
     }
 }

+ 9 - 6
YLShipBuildLandMap.Services/Build/BuildingService.cs

@@ -62,21 +62,24 @@ namespace YLShipBuildLandMap.Services.Build
             return Task.FromResult(GetBuildingQuery(e => true).OrderBy(e => e.Name).ToList());
         }
 
-        public Task<List<FloorView>> GetFloorList(Guid buildingId)
+        public Task<List<FloorView>> GetFloorList(Guid? buildingId)
         {
-            var query = from f in DbContext.BdBuildingFloor
+            Expression<Func<BdBuildingFloor, bool>> exp = e => true;
+            exp = exp.AndIf(buildingId.HasValue, e => e.BuildingId == buildingId);
+
+            var query = from f in DbContext.BdBuildingFloor.Where(exp)
                         join b in DbContext.BdBuilding on f.BuildingId equals b.BuildingId
-                        where f.BuildingId == buildingId
                         select new FloorView
                         {
                             BuildingFloorId = f.BuildingFloorId,
                             Name = f.Name,
                             BuildingName = b.Name,
                             Sort = f.Sort,
-                            RecordStatus = f.RecordStatus
+                            RecordStatus = f.RecordStatus,
+                            BuildingId = f.BuildingId
                         };
 
-            return Task.FromResult(query.OrderBy(e => e.Sort).ToList());
+            return Task.FromResult(query.OrderBy(e => e.BuildingName).ThenBy(e => e.Sort).ThenBy(e => e.Name).ToList());
         }
 
         public Task<BuildingView> GetBuildingById(Guid? buildingId)
@@ -179,7 +182,7 @@ namespace YLShipBuildLandMap.Services.Build
 
             var query = from b in DbContext.BdBuilding.Where(exp)
                         join xy in DbContext.BdBuildingXyAxis on b.BuildingId equals xy.BuildingId
-                        select new BuildingXyAxisView 
+                        select new BuildingXyAxisView
                         {
                             BuildingId = b.BuildingId,
                             XyaxisId = xy.XyaxisId,

+ 0 - 1
YLShipBuildLandMap.Services/Build/DepOrServicePointService.cs

@@ -231,6 +231,5 @@ namespace YLShipBuildLandMap.Services.Build
             return Task.FromResult(query.OrderBy(e => e.BuildingName).ThenBy(e => e.FloorSort).ThenBy(e => e.Name).ToList());
         }
 
-
     }
 }

+ 28 - 0
YLShipBuildLandMap.Services/Build/RoomService.cs

@@ -115,5 +115,33 @@ namespace YLShipBuildLandMap.Services.Build
             return await this.DbContext.SaveChangesAsync();
         }
 
+        public Task<List<RoomDepOrServiceView>> GetRoomDepOrServiceList()
+        {
+            var query =
+                from b in DbContext.BdBuilding
+                join f in DbContext.BdBuildingFloor on b.BuildingId equals f.BuildingId
+                join r in DbContext.BdBuildingFloorRoom on f.BuildingFloorId equals r.BuildingFloorId
+                join rds in DbContext.BdDepartmentOrServicePointBmBuildingFloorRoom on r.BuildingFloorRoomId equals rds.BuildingFloorRoomId
+                join ds in DbContext.BdDepartmentOrServicePoint on rds.DepartmentOrServicePointId equals ds.DepartmentOrServicePointId
+                select new RoomDepOrServiceView
+                {
+                    BuildingId = b.BuildingId,
+                    BuildingName = b.Name,
+                    FloorName = f.Name,
+                    FloorSort = f.Sort,
+                    RoomName = r.Name,
+                    BuildingFloorId = r.BuildingFloorId,
+                    BuildingFloorRoomId = r.BuildingFloorRoomId,
+                    DepartmentOrServicePointId = ds.DepartmentOrServicePointId,
+                    DepartmentOrServiceName = ds.Name,
+                    Sort = r.Sort,
+                    OpenTime = ds.OpenTime,
+                    ContactType = ds.ContactType,
+                    Description = ds.Description
+                };
+
+            return Task.FromResult(query.OrderBy(e => e.BuildingName).ThenBy(e => e.FloorSort).ThenBy(e => e.FloorName).ThenBy(e => e.Sort).ThenBy(e => e.RoomName).ToList());
+        }
+
     }
 }

+ 2 - 1
YLShipBuildLandMap.Web/Controllers/Build/BuildingController.cs

@@ -30,7 +30,8 @@ namespace YLShipBuildLandMap.Web.Controllers.Build
         }
 
         [HttpGet]
-        public async Task<ResultMessage> GetFloorList(Guid buildingId)
+        [AllowAnonymous]
+        public async Task<ResultMessage> GetFloorList(Guid? buildingId)
         {
             return ResultMessage.Success(await BuildingService.GetFloorList(buildingId));
         }

+ 8 - 0
YLShipBuildLandMap.Web/Controllers/Build/RoomController.cs

@@ -50,5 +50,13 @@ namespace YLShipBuildLandMap.Web.Controllers.Build
 
             return ResultMessage.Success(await RoomService.Save(data, LoginUser.Current.UserID));
         }
+
+        [HttpGet]
+        [AllowAnonymous]
+        public async Task<ResultMessage> GetRoomDepOrServiceList()
+        {
+            return ResultMessage.Success(await RoomService.GetRoomDepOrServiceList());
+        }
+
     }
 }

BIN
YLShipBuildLandMap.Web/wwwroot/app/main/images/test.png


+ 262 - 28
YLShipBuildLandMap.Web/wwwroot/app/main/map-index.html

@@ -1,41 +1,131 @@
-<div style="display: flex; justify-content: center; width: 100%; background-color: white;">
+<div class="map_page">
     <div>
         <img id="mapimg" src="images/map_index.png" ng-click="mapImgClick($event)" />
     </div>
-    <div style="position:absolute;z-index:1000;top:50px;">
-        <div style="border: 1px solid #1692f6; border-radius: 20px; display: flex; justify-content: center; align-items: center; box-shadow: 0 0 10px #1692f6;">
-            <input type="text" style="width: 300px; height: 40px; border: none; margin-left: 20px; font-size: 16px; " ng-model="searchInput" />
-            <img src="images/search3.png" style="margin: 5px 15px;cursor:pointer;" ng-click="searchBuilding()" />
+    <div class="search_panel">
+        <div class="search_label">
+            <input type="text" style="" ng-model="searchInput" />
+            <img src="images/search3.png" ng-click="searchBuilding()" />
         </div>
     </div>
 </div>
-<div ng-if="isShowNow" style="position: absolute; z-index: 1000;border:3px dashed #f00;" ng-style="nowPositionStyle">
-    <div style="background-color:red;opacity:0.3;padding:3px;height:100%;width:100%;"></div>
+<div ng-if="isShowMark" id="nowPositionMask" class="nowPositionMask" ng-click="showModal()" ng-style="nowPositionStyle">
+    <div class="mask"></div>
 </div>
-<div ng-if="isShowNow" class="element" style="position: absolute; z-index: 1001;" ng-style="coordinateStyle">
+<div ng-if="isShowMark" id="nowPositionCoordinate" ng-click="showModal()" class="nowPositionCoordinate element" ng-style="coordinateStyle">
     <img src="images/coordinate.png" />
 </div>
-<div ng-show="isShowNow" class="card" style="position: absolute; z-index: 1001; height: 500px; width: 300px; background-color: white; box-shadow: 0 0 10px #1692f6;border-radius:10px; " ng-style="modalStyle">
+<div ng-show="isShowNowModal" class="card building_modal" ng-style="modalStyle">
     <div class="header" style="height:50px;">
-        <button type="button" class="close" ng-click="$hide()">&times;</button>
+        <button type="button" class="close" ng-click="isShowNowModal=false">&times;</button>
         <div style="white-space: nowrap; width: 250px; overflow: hidden; text-overflow: ellipsis;">
             <h4 class="modal-title">{{nowBuilding.BuildingName}}</h4>
         </div>
     </div>
-    <div class="body card-content" id="card-content" style="height: 440px; overflow-y: auto;">
-        <div style="display:flex;">
-            <div style="position: absolute; left: 15px;font-size:16px;">
-                <p ng-repeat="it in floorList" ng-click="floorClick(it,$index)" ng-class="it.checked?'floorChecked':''">
-                    {{it.FloorName}}
+    <div class="body card-content" id="card-content">
+        <div class="floor_content">
+            <div class="left_content">
+                <p ng-repeat="it in floorList" ng-click="floorClick(it,$index)" ng-class="it.checked?'floorChecked':''" style="padding:0 8px;">
+                    {{it.Name}}
                 </p>
             </div>
-            <div style="margin-left:60px;">
-                <p ng-repeat="it in roomList" style="height:30px;font-size:14px;">{{it.RoomName}}</p>
+            <div class="right_content">
+                <p ng-repeat="it in roomList" ng-click="showRoom(it)" style="height:30px;font-size:14px;cursor:pointer;" ng-style="{'padding-bottom':$index==(roomList.length-1)?(floorList.length*80+'px'):''}">
+                    {{it.RoomName}}&nbsp;&nbsp;{{it.DepartmentOrServiceName}}
+                </p>
+            </div>
+        </div>
+    </div>
+</div>
+<div ng-show="isShowNowModal && showModalType==2" class="card card_modal detail_modal" ng-class="showModalType==2?'enter-x-right':'back-x-right'" ng-style="modalStyle">
+    <div>
+        <button type="button" class="close bcak_btn" ng-click="coloseRoom()">返回</button>
+        <div class="top_img">
+            <img src="images/test.png" />
+        </div>
+        <div class="detail_content">
+            <div style="font-size:16px;font-weight:bold;">
+                {{roomModel.DepartmentOrServiceName}}
+            </div>
+            <hr />
+            <div>
+                <div class="row">
+                    <div class="col_label">楼层</div>
+                    <div class="col_value">{{roomModel.FloorName}}</div>
+                </div>
+                <div class="row">
+                    <div class="col_label">房间号/服务点</div>
+                    <div class="col_value">{{roomModel.RoomName}}</div>
+                </div>
+                <div class="row">
+                    <div class="col_label">开放时间</div>
+                    <div class="col_value">{{roomModel.OpenTime}}</div>
+                </div>
+                <div class="row">
+                    <div class="col_label">联系方式</div>
+                    <div class="col_value">{{roomModel.ContactType}}</div>
+                </div>
+                <div class="row">
+                    <div class="col_label">简介</div>
+                    <div class="col_value">{{roomModel.Description}}</div>
+                </div>
             </div>
         </div>
     </div>
 </div>
 <style type="text/css">
+    .map_page {
+        display: flex;
+        justify-content: center;
+        width: 100%;
+        background-color: white;
+    }
+
+        .map_page .search_panel {
+            position: absolute;
+            z-index: 1000;
+            top: 50px;
+        }
+            .map_page .search_panel .search_label {
+                border: 1px solid #1692f6;
+                border-radius: 20px;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                box-shadow: 0 0 10px #1692f6;
+            }
+
+                .map_page .search_panel .search_label input {
+                    width: 300px;
+                    height: 40px;
+                    border: none;
+                    margin-left: 20px;
+                    font-size: 16px;
+                }
+
+                .map_page .search_panel .search_label img {
+                    margin: 5px 15px;
+                    cursor: pointer;
+                }
+
+    .nowPositionMask {
+        position: absolute;
+        z-index: 1000;
+        border: 3px dashed #f00;
+    }
+
+        .nowPositionMask .mask {
+            background-color: red;
+            opacity: 0.3;
+            padding: 3px;
+            height: 100%;
+            width: 100%;
+        }
+
+    .nowPositionCoordinate {
+        position: absolute;
+        z-index: 1001;
+    }
     /* 定义动画 */
     @keyframes jump {
         0% {
@@ -57,23 +147,167 @@
         animation: jump 2s infinite; /* 无限重复播放动画,持续时间为2秒 */
     }
 
-
-    .card-content::-webkit-scrollbar, .tab-pane::-webkit-scrollbar, .fht-tbody::-webkit-scrollbar, .zero-source-table-div::-webkit-scrollbar, .dropdown-menu::-webkit-scrollbar, .dropdown-menu > .inner::-webkit-scrollbar { /*滚动条整体样式*/
-        width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
-        height: 8px;
+    .card_modal {
+        position: absolute;
+        z-index: 1001;
+        height: 500px;
+        width: 350px;
+        background-color: white;
+        box-shadow: 0 0 18px #1692f6;
+        border-radius: 10px;
     }
 
-    .card-content::-webkit-scrollbar-thumb, .tab-pane::-webkit-scrollbar-thumb, .menu::-webkit-scrollbar-thumb, .fht-tbody::-webkit-scrollbar-thumb, .zero-source-table-div::-webkit-scrollbar-thumb, .dropdown-menu::-webkit-scrollbar-thumb, .dropdown-menu > .inner::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
-        border-radius: 5px;
-        background: #8DC7ED;
+    .card-content {
+        height: 440px;
+        overflow-y: auto;
     }
 
-    .card-content::-webkit-scrollbar-track, .tab-pane::-webkit-scrollbar-track, .menu::-webkit-scrollbar-track, .fht-tbody::-webkit-scrollbar-track, .zero-source-table-div::-webkit-scrollbar-track, .dropdown-menu::-webkit-scrollbar-track, .dropdown-menu > .inner::-webkit-scrollbar-track { /*滚动条里面轨道*/
-        border-radius: 5px;
-        background: #F1F1F1;
-    }
+        .card-content::-webkit-scrollbar, .tab-pane::-webkit-scrollbar, .fht-tbody::-webkit-scrollbar, .zero-source-table-div::-webkit-scrollbar, .dropdown-menu::-webkit-scrollbar, .dropdown-menu > .inner::-webkit-scrollbar { /*滚动条整体样式*/
+            width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
+            height: 8px;
+        }
+
+        .card-content::-webkit-scrollbar-thumb, .tab-pane::-webkit-scrollbar-thumb, .menu::-webkit-scrollbar-thumb, .fht-tbody::-webkit-scrollbar-thumb, .zero-source-table-div::-webkit-scrollbar-thumb, .dropdown-menu::-webkit-scrollbar-thumb, .dropdown-menu > .inner::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
+            border-radius: 5px;
+            background: #8DC7ED;
+        }
+
+        .card-content::-webkit-scrollbar-track, .tab-pane::-webkit-scrollbar-track, .menu::-webkit-scrollbar-track, .fht-tbody::-webkit-scrollbar-track, .zero-source-table-div::-webkit-scrollbar-track, .dropdown-menu::-webkit-scrollbar-track, .dropdown-menu > .inner::-webkit-scrollbar-track { /*滚动条里面轨道*/
+            border-radius: 5px;
+            background: #F1F1F1;
+        }
 
     .floorChecked {
         color: #1692f6;
     }
+
+    .floor_content {
+        display: flex;
+    }
+
+    .left_content {
+        position: absolute;
+        left: 15px;
+        font-size: 14px;
+        margin-top: 20px;
+        border: 1px solid #ddd;
+        border-radius: 6px;
+        font-weight: bold;
+    }
+
+        .left_content p {
+            cursor: pointer;
+        }
+
+            .left_content p:first-child {
+                padding-top: 10px !important;
+            }
+
+    .right_content {
+        margin-left: 80px;
+    }
+
+    .row {
+        margin: 15px 0px;
+        display: flex;
+    }
+
+        .row .col_label {
+            width: 30%;
+        }
+
+        .row .col_value {
+            width: 70%;
+        }
+
+    @keyframes enter-x-right {
+        0% {
+            transform: translateX(100px);
+            opacity: 0;
+        }
+
+        25% {
+            transform: translateX(75px);
+            opacity: 0.5;
+        }
+
+        50% {
+            transform: translateX(50px);
+            opacity: 0.8;
+        }
+
+        100% {
+            transform: translateX(0px);
+            opacity: 1;
+        }
+    }
+
+    .enter-x-right {
+        animation: enter-x-right 0.5s linear;
+    }
+
+    @keyframes back-x-right {
+        0% {
+            transform: translateX(0px);
+            opacity: 1;
+        }
+
+        25% {
+            transform: translateX(80px);
+            opacity: 0.8;
+        }
+
+        50% {
+            transform: translateX(160px);
+            opacity: 0.6;
+        }
+
+        75% {
+            transform: translateX(220px);
+            opacity: 0.3;
+        }
+
+        100% {
+            transform: translateX(300px);
+            opacity: 0;
+        }
+    }
+
+    .back-x-right {
+        animation: back-x-right 0.5s linear;
+    }
+
+    .bcak_btn {
+        position: absolute;
+        top: 15px;
+        left: 15px;
+        font-size: 14px;
+        opacity: 1;
+        color: #5e5a5a;
+    }
+
+    .detail_modal .top_img {
+        height: 150px;
+    }
+
+        .detail_modal .top_img img {
+            height: 150px;
+            width: 100%;
+            object-fit: cover;
+            border-radius: 10px;
+        }
+
+    .detail_modal .detail_content {
+        margin: 20px;
+    }
+
+    .building_modal {
+        position: absolute;
+        z-index: 1001;
+        height: 500px;
+        width: 350px;
+        background-color: white;
+        box-shadow: 0 0 18px #1692f6;
+        border-radius: 10px;
+    }
 </style>

+ 76 - 43
YLShipBuildLandMap.Web/wwwroot/app/main/map-index.js

@@ -5,19 +5,21 @@
         $scope.nowPositionStyle = { "left": "0", "top": "0", "width": "0", "height": "0" };
         $scope.coordinateStyle = { "left": "0", "top": "0" };
         $scope.modalStyle = { "left": "0", "top": "0" };
-        $scope.isShowNow = false;
+        $scope.isShowMark = false;
+        $scope.isShowNowModal = false;
+        $scope.showModalType = 1;
         $scope.nowBuilding = {};
-        $scope.floorList = [{ FloorName: "一楼", checked: true }, { FloorName: "二楼", checked: false }, { FloorName: "三楼", checked: false }, { FloorName: "四楼", checked: false }, { FloorName: "五楼", checked: false }];
-        $scope.roomList = [{ FloorName: "一楼", RoomName: "101" }, { FloorName: "一楼", RoomName: "102" }, { FloorName: "一楼", RoomName: "103" }, { FloorName: "一楼", RoomName: "104" }, { FloorName: "一楼", RoomName: "105" },
-        { FloorName: "二楼", RoomName: "201" }, { FloorName: "二楼", RoomName: "202" }, { FloorName: "二楼", RoomName: "203" }, { FloorName: "二楼", RoomName: "204" }, { FloorName: "二楼", RoomName: "205" },
-        { FloorName: "三楼", RoomName: "301" }, { FloorName: "三楼", RoomName: "302" }, { FloorName: "三楼", RoomName: "303" }, { FloorName: "三楼", RoomName: "304" }, { FloorName: "三楼", RoomName: "305" },
-        { FloorName: "四楼", RoomName: "401" }, { FloorName: "四楼", RoomName: "402" }, { FloorName: "四楼", RoomName: "403" }, { FloorName: "四楼", RoomName: "404" }, { FloorName: "四楼", RoomName: "405" },
-        { FloorName: "五楼", RoomName: "501" }, { FloorName: "五楼", RoomName: "502" }, { FloorName: "五楼", RoomName: "503" }, { FloorName: "五楼", RoomName: "504" }, { FloorName: "五楼", RoomName: "505" }];
+        $scope.allFloorList = [];
+        $scope.allRoomList = [];
+        $scope.floorList = [];
+        $scope.roomList = [];
+        $scope.roomModel = [];
 
         $("#mapimg").css("height", $(window).height());
 
         $scope.mapImgClick = function (e) {
-            $scope.isShowNow = false;
+            $scope.isShowMark = false;
+            $scope.isShowNowModal = false;
 
             var buildingList = $scope.buildingXYAxisList.filter(x => e.offsetX >= x.MinXAxis && e.offsetX <= x.MaxXAxis && e.offsetY >= x.MinYAxis && e.offsetY <= x.MaxYAxis);
             if (buildingList.length > 0) {
@@ -26,11 +28,15 @@
         };
 
         $scope.searchBuilding = function () {
-            $scope.isShowNow = false;
+            $scope.isShowMark = false;
+            $scope.isShowNowModal = false;
 
-            var buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingName.indexOf($scope.searchInput) >= 0);
-            if (buildingList.length > 0) {
-                $scope.goBuilding(buildingList[0]);
+            if ($scope.searchInput) {
+
+                var buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingName.indexOf($scope.searchInput) >= 0);
+                if (buildingList.length > 0) {
+                    $scope.goBuilding(buildingList[0]);
+                }
             }
         };
 
@@ -49,9 +55,17 @@
             $scope.modalStyle.left = (img.offsetLeft + building.MaxXAxis) + "px";
             $scope.modalStyle.top = (img.offsetTop + building.MinYAxis) > 400 ? (img.offsetTop + building.MinYAxis - 420) : 20 + "px";
 
-            $scope.isShowNow = true;
+            $scope.isShowMark = true;
+            $scope.isShowNowModal = true;
+            $scope.showModalType = 1;
 
             $(".card-content").scrollTop(0);
+
+            $scope.floorList = $scope.allFloorList.filter(e => e.BuildingId == $scope.nowBuilding.BuildingId);
+            $scope.floorList.forEach((f, i) => {
+                f.checked = i == 0;
+            });
+            $scope.roomList = $scope.allRoomList.filter(e => e.BuildingId == $scope.nowBuilding.BuildingId);
         }
 
         $scope.floorClick = function (clickData) {
@@ -59,62 +73,52 @@
             var index = $scope.floorList.indexOf(clickData);
 
             $scope.floorList.forEach((f, i) => {
-                f.checked = clickData.FloorName == f.FloorName;
-                if (i <= index) {
-                    totalRoom += $scope.roomList.filter(e => e.FloorName == f.FloorName).length;
+                f.checked = clickData.Name == f.Name;
+                if (i < index) {
+                    totalRoom += $scope.roomList.filter(e => e.FloorName == f.Name).length;
                 }
 
             });
 
-            $(".card-content").scrollTop(index == 0 ? 0 : totalRoom * 30);
+            $(".card-content").scrollTop(index == 0 ? 0 : totalRoom * 40);
         };
 
-       
-
-        /*$(document).ready(function () {
-            $('#card-content').scroll(function () {
-                var scrollTop = $("#card-content").scrollTop();
-
-                var nowIndex = parseInt(scrollTop / 30);
-                console.log(nowIndex);
-                if (nowIndex < $scope.roomList.length) {
-                    var room = $scope.roomList[nowIndex];
-                    console.log(room);
-                    if (room) {
-                        $scope.floorList.forEach((f, i) => {
-                            f.checked = room.FloorName == f.FloorName;
-
-                        });
-                    }
-                }
-
-            });
-        });*/
-
         // 定义滚动事件的处理函数
         var scrollHandler = function () {
             var scrollTop = $("#card-content").scrollTop();
 
-            var nowIndex = parseInt(scrollTop / 30);
+            var nowIndex = parseInt(scrollTop / 40);
 
             if (nowIndex < $scope.roomList.length) {
                 var room = $scope.roomList[nowIndex];
 
                 if (room) {
                     $scope.floorList.forEach((f, i) => {
-                        f.checked = room.FloorName == f.FloorName;
+                        f.checked = room.FloorName == f.Name;
 
                     });
                 }
             }
 
-            console.log($scope.floorList);
+            $scope.$apply();
         };
 
         angular.element($("#card-content")).on('scroll', scrollHandler);
 
-        
+        $scope.showModal = function () {
+            $scope.isShowNowModal = true;
+            $scope.showModalType = 1;
+        };
 
+        $scope.showRoom = function (room) {
+            $scope.roomModel = room;
+            $scope.showModalType = 2;
+        };
+
+        $scope.coloseRoom = function () {
+            $scope.showModalType = 1;
+        };
+        
         //加载列表数据
         $scope.getBuildingXYAxisList = function () {
             $http
@@ -126,6 +130,35 @@
                 });
         };
 
+        $scope.getFloorList = function () {
+            $http({
+                method: "get",
+                url: "../../api/build/building/GetFloorList",
+                params: {
+                }
+            }).then(function (result) {
+                $scope.allFloorList = result.data.Data;
+
+            }, function (resp) {
+            });
+        };
+
+        $scope.getRoomDepOrServiceList = function () {
+            $http({
+                method: "get",
+                url: "../../api/build/room/GetRoomDepOrServiceList",
+                params: {
+                }
+            }).then(function (result) {
+                $scope.allRoomList = result.data.Data;
+
+            }, function (resp) {
+            });
+        };
+
         $scope.getBuildingXYAxisList();
+        $scope.getFloorList();
+        $scope.getRoomDepOrServiceList();
+
     });
 })(angular);