|
@@ -14,6 +14,8 @@
|
|
|
$scope.floorList = [];
|
|
|
$scope.roomList = [];
|
|
|
$scope.roomModel = [];
|
|
|
+ $scope.searchList = [];
|
|
|
+ $scope.isShowSearchList = false;
|
|
|
|
|
|
$("#mapimg").css("height", $(window).height());
|
|
|
|
|
@@ -41,14 +43,14 @@
|
|
|
|
|
|
if ($scope.searchInput) {
|
|
|
|
|
|
- var buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingName.indexOf($scope.searchInput) >= 0);
|
|
|
+ /*var buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingName.indexOf($scope.searchInput) >= 0);
|
|
|
if (buildingList.length > 0) {
|
|
|
$scope.goBuilding(buildingList[0]);
|
|
|
return;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
var searchRoomList = $scope.allRoomList.filter(x => x.DepartmentOrServiceName.indexOf($scope.searchInput) >= 0);
|
|
|
- if (searchRoomList.length > 0) {
|
|
|
+ /*if (searchRoomList.length > 0) {
|
|
|
var searchRoom = searchRoomList[0];
|
|
|
buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingId == searchRoom.BuildingId);
|
|
|
if (buildingList.length > 0) {
|
|
@@ -60,7 +62,31 @@
|
|
|
$scope.floorClick(searchFloor[0]);
|
|
|
}, 500);
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ $scope.searchList = [];
|
|
|
+
|
|
|
+ searchRoomList.forEach(r => {
|
|
|
+ var building = $scope.buildingXYAxisList.filter(e => e.BuildingId == r.BuildingId);
|
|
|
+ $scope.searchList.push({ BuildingFloorId: r.BuildingFloorId, BuildingId: r.BuildingId, RoomName: r.RoomName, DepartmentOrServiceName: r.DepartmentOrServiceName, FloorName: r.FloorName, BuildingName: building.length > 0 ? building[0].BuildingName:"" });
|
|
|
+ });
|
|
|
+
|
|
|
+ $scope.isShowSearchList = $scope.searchList.length > 0;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.clickSearchRoom = function (room) {
|
|
|
+ $scope.isShowSearchList = false;
|
|
|
+ var buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingId == room.BuildingId);
|
|
|
+
|
|
|
+ if (buildingList.length > 0) {
|
|
|
+ $scope.goBuilding(buildingList[0]);
|
|
|
+
|
|
|
+ var searchFloor = $scope.floorList.filter(x => x.BuildingFloorId == room.BuildingFloorId);
|
|
|
+
|
|
|
+ $timeout(function () {
|
|
|
+ $scope.floorClick(searchFloor[0]);
|
|
|
+ }, 500);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -155,6 +181,18 @@
|
|
|
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));
|
|
|
};
|
|
|
|
|
|
+ $(document).on('touchstart', function (e) {
|
|
|
+ // touch start event handler code here
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on('touchmove', function (e) {
|
|
|
+ // touch move event handler code here
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on('touchend', function (e) {
|
|
|
+ // touch end event handler code here
|
|
|
+ });
|
|
|
+
|
|
|
//加载列表数据
|
|
|
$scope.getBuildingXYAxisList = function () {
|
|
|
$http
|