浏览代码

查询优化

pengjing 1 年之前
父节点
当前提交
58cf2ba2ca
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      YLShipBuildLandMap.Web/wwwroot/app/main/map-index.js

+ 10 - 0
YLShipBuildLandMap.Web/wwwroot/app/main/map-index.js

@@ -36,6 +36,16 @@
                 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) {
+                    buildingList = $scope.buildingXYAxisList.filter(x => x.BuildingId == searchRoomList[0].BuildingId);
+                    if (buildingList.length > 0) {
+                        $scope.goBuilding(buildingList[0]);
+                        return;
+                    }
                 }
             }
         };