|
@@ -1,5 +1,5 @@
|
|
|
(function ($app) {
|
|
|
- $app.module('ylmis').controller('mapIndexCtrl', function ($scope, $http, $filter, $modal, $ocLazyLoad, $alert, $loading, $state, excelPopup, $bsRouterState, popupReport) {
|
|
|
+ $app.module('ylmis').controller('mapIndexCtrl', function ($scope, $http, $filter, $modal, $ocLazyLoad, $alert, $loading, $state, excelPopup, $bsRouterState, popupReport, $timeout) {
|
|
|
$scope.buildingXYAxisList = [];
|
|
|
$scope.searchInput = "";
|
|
|
$scope.nowPositionStyle = { "left": "0", "top": "0", "width": "0", "height": "0" };
|
|
@@ -41,10 +41,16 @@
|
|
|
|
|
|
var searchRoomList = $scope.allRoomList.filter(x => x.DepartmentOrServiceName.indexOf($scope.searchInput) >= 0);
|
|
|
if (searchRoomList.length > 0) {
|
|
|
- buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingId == searchRoomList[0].BuildingId);
|
|
|
+ var searchRoom = searchRoomList[0];
|
|
|
+ buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingId == searchRoom.BuildingId);
|
|
|
if (buildingList.length > 0) {
|
|
|
$scope.goBuilding(buildingList[0]);
|
|
|
- return;
|
|
|
+
|
|
|
+ var searchFloor = $scope.floorList.filter(x => x.BuildingFloorId == searchRoom.BuildingFloorId);
|
|
|
+
|
|
|
+ $timeout(function () {
|
|
|
+ $scope.floorClick(searchFloor[0]);
|
|
|
+ }, 100);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -52,6 +58,9 @@
|
|
|
|
|
|
$scope.goBuilding = function (building) {
|
|
|
$scope.nowBuilding = building;
|
|
|
+ $scope.floorList = $scope.allFloorList.filter(e => e.BuildingId == $scope.nowBuilding.BuildingId);
|
|
|
+ $scope.roomList = $scope.allRoomList.filter(e => e.BuildingId == $scope.nowBuilding.BuildingId);
|
|
|
+
|
|
|
var img = $("#mapimg")[0];
|
|
|
|
|
|
$scope.nowPositionStyle.left = (img.offsetLeft + building.MinXAxis) + "px";
|
|
@@ -61,26 +70,25 @@
|
|
|
|
|
|
$scope.coordinateStyle.left = (img.offsetLeft + building.XCenter - 22) + "px";
|
|
|
$scope.coordinateStyle.top = (img.offsetTop + building.YCenter - 73) + "px";
|
|
|
-
|
|
|
- $scope.modalStyle.left = (img.offsetLeft + building.MaxXAxis) + "px";
|
|
|
- $scope.modalStyle.top = (img.offsetTop + building.MinYAxis) > 400 ? (img.offsetTop + building.MinYAxis - 420) : 20 + "px";
|
|
|
-
|
|
|
$scope.isShowMark = true;
|
|
|
- $scope.isShowNowModal = true;
|
|
|
+
|
|
|
$scope.showModalType = 1;
|
|
|
|
|
|
- $(".card-content").scrollTop(0);
|
|
|
+ $timeout(function () {
|
|
|
+ $scope.modalStyle.left = (img.offsetLeft + building.MaxXAxis) + "px";
|
|
|
+ $scope.modalStyle.top = (img.offsetTop + building.MinYAxis) > 400 ? (img.offsetTop + building.MinYAxis - 420) : 20 + "px";
|
|
|
+ $scope.isShowNowModal = true;
|
|
|
+
|
|
|
+ }, 300);
|
|
|
|
|
|
- $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);
|
|
|
+ $timeout(function () {
|
|
|
+ $scope.floorClick($scope.floorList[0]);
|
|
|
+ }, 500);
|
|
|
}
|
|
|
|
|
|
$scope.floorClick = function (clickData) {
|
|
|
var totalRoom = 0;
|
|
|
- var index = $scope.floorList.indexOf(clickData);
|
|
|
+ var index = $.map($filter('filter')($scope.floorList, {}), function (x) { return x.BuildingFloorId; }).indexOf(clickData.BuildingFloorId);
|
|
|
|
|
|
$scope.floorList.forEach((f, i) => {
|
|
|
f.checked = clickData.Name == f.Name;
|
|
@@ -90,7 +98,7 @@
|
|
|
|
|
|
});
|
|
|
|
|
|
- $(".card-content").scrollTop(index == 0 ? 0 : totalRoom * 40);
|
|
|
+ $("#card-content").scrollTop(index == 0 ? 0 : totalRoom * 40);
|
|
|
};
|
|
|
|
|
|
// 定义滚动事件的处理函数
|