|
@@ -17,11 +17,19 @@
|
|
|
|
|
|
$("#mapimg").css("height", $(window).height());
|
|
|
|
|
|
+ $("#searchInput").focus(function () {
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
$scope.mapImgClick = function (e) {
|
|
|
+ console.log(e.offsetX, e.offsetY);
|
|
|
$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);
|
|
|
+ var img = $("#mapimg")[0];
|
|
|
+
|
|
|
+ var buildingList = $scope.buildingXYAxisList.filter(x => e.offsetX >= x.MinXAxis * img.width && e.offsetX <= x.MaxXAxis * img.width && e.offsetY >= x.MinYAxis * img.height && e.offsetY <= x.MaxYAxis * img.height);
|
|
|
if (buildingList.length > 0) {
|
|
|
$scope.goBuilding(buildingList[0]);
|
|
|
}
|
|
@@ -47,10 +55,10 @@
|
|
|
$scope.goBuilding(buildingList[0]);
|
|
|
|
|
|
var searchFloor = $scope.floorList.filter(x => x.BuildingFloorId == searchRoom.BuildingFloorId);
|
|
|
-
|
|
|
+
|
|
|
$timeout(function () {
|
|
|
$scope.floorClick(searchFloor[0]);
|
|
|
- }, 100);
|
|
|
+ }, 500);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -63,22 +71,22 @@
|
|
|
|
|
|
var img = $("#mapimg")[0];
|
|
|
|
|
|
- $scope.nowPositionStyle.left = (img.offsetLeft + building.MinXAxis) + "px";
|
|
|
- $scope.nowPositionStyle.top = (img.offsetTop + building.MinYAxis) + "px";
|
|
|
- $scope.nowPositionStyle.width = (building.MaxXAxis - building.MinXAxis) + "px";
|
|
|
- $scope.nowPositionStyle.height = (building.MaxYAxis - building.MinYAxis) + "px";
|
|
|
+ $scope.nowPositionStyle.left = (img.offsetLeft + building.MinXAxis * img.width) + "px";
|
|
|
+ $scope.nowPositionStyle.top = (img.offsetTop + building.MinYAxis * img.height) + "px";
|
|
|
+ $scope.nowPositionStyle.width = (building.MaxXAxis * img.width - building.MinXAxis * img.width) + "px";
|
|
|
+ $scope.nowPositionStyle.height = (building.MaxYAxis * img.height - building.MinYAxis * img.height) + "px";
|
|
|
|
|
|
- $scope.coordinateStyle.left = (img.offsetLeft + building.XCenter - 22) + "px";
|
|
|
- $scope.coordinateStyle.top = (img.offsetTop + building.YCenter - 73) + "px";
|
|
|
+ $scope.coordinateStyle.left = (img.offsetLeft + building.XCenter * img.width - 22) + "px";
|
|
|
+ $scope.coordinateStyle.top = (img.offsetTop + building.YCenter * img.height - 73) + "px";
|
|
|
$scope.isShowMark = true;
|
|
|
-
|
|
|
+
|
|
|
$scope.showModalType = 1;
|
|
|
|
|
|
$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.modalStyle.left = (img.offsetLeft + building.MaxXAxis * img.width) + "px";
|
|
|
+ $scope.modalStyle.top = (img.offsetTop + building.MinYAxis * img.height) > 400 ? (img.offsetTop + building.MinYAxis * img.height - 420) : 20 + "px";
|
|
|
$scope.isShowNowModal = true;
|
|
|
-
|
|
|
+
|
|
|
}, 300);
|
|
|
|
|
|
$timeout(function () {
|
|
@@ -87,6 +95,7 @@
|
|
|
}
|
|
|
|
|
|
$scope.floorClick = function (clickData) {
|
|
|
+ var top = 10;
|
|
|
var totalRoom = 0;
|
|
|
var index = $.map($filter('filter')($scope.floorList, {}), function (x) { return x.BuildingFloorId; }).indexOf(clickData.BuildingFloorId);
|
|
|
|
|
@@ -98,24 +107,29 @@
|
|
|
|
|
|
});
|
|
|
|
|
|
- $("#card-content").scrollTop(index == 0 ? 0 : totalRoom * 40);
|
|
|
+ $("#card-content").scrollTop(index == 0 ? 0 : (top + index * 20 + totalRoom * 40));
|
|
|
};
|
|
|
|
|
|
// 定义滚动事件的处理函数
|
|
|
var scrollHandler = function () {
|
|
|
var scrollTop = $("#card-content").scrollTop();
|
|
|
|
|
|
- var nowIndex = parseInt(scrollTop / 40);
|
|
|
+ var top = 10;
|
|
|
+ var totalRoom = 0;
|
|
|
+ $scope.floorList.forEach((f, i) => {
|
|
|
+ $scope.roomList.filter(e => e.BuildingFloorId == f.BuildingFloorId).forEach((r, k) => {
|
|
|
+ r.scrollTop = (i == 0 && k == 0) ? top : (top + i * 20 + totalRoom * 40);
|
|
|
+ totalRoom += 1;
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- if (nowIndex < $scope.roomList.length) {
|
|
|
- var room = $scope.roomList[nowIndex];
|
|
|
+ var scrollRoom = $scope.roomList.filter(e => e.scrollTop >= scrollTop);
|
|
|
|
|
|
- if (room) {
|
|
|
- $scope.floorList.forEach((f, i) => {
|
|
|
- f.checked = room.FloorName == f.Name;
|
|
|
+ if (scrollRoom.length > 0) {
|
|
|
+ $scope.floorList.forEach((f, i) => {
|
|
|
+ f.checked = scrollRoom[0].BuildingFloorId == f.BuildingFloorId;
|
|
|
|
|
|
- });
|
|
|
- }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
$scope.$apply();
|
|
@@ -136,7 +150,11 @@
|
|
|
$scope.coloseRoom = function () {
|
|
|
$scope.showModalType = 1;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
+ $scope.isHightlight = function (room) {
|
|
|
+ return $scope.searchInput != '' && ((room.RoomName != null && room.RoomName != '' && room.RoomName.indexOf($scope.searchInput) >= 0) || (room.DepartmentOrServiceName != null && room.DepartmentOrServiceName != '' && room.DepartmentOrServiceName.indexOf($scope.searchInput) >= 0));
|
|
|
+ };
|
|
|
+
|
|
|
//加载列表数据
|
|
|
$scope.getBuildingXYAxisList = function () {
|
|
|
$http
|