浏览代码

git-svn-id: https://192.168.57.71/svn/qt@76 12fe181a-e57f-b044-8676-16dc139aa63e

ld_zhoutl 8 年之前
父节点
当前提交
571bf0f663

+ 10 - 8
jdc/jdcweb/trunk/src/main/webapp/WEB-INF/view/sys/railway.jsp

@@ -26,7 +26,7 @@
 	<script type="text/javascript" src="${ctx}/static/layer/layer.js"></script>
     <link rel="stylesheet" type="text/css" href="${ctx}/static/xt/css/main.css">
 	<script src="assets/semantic.min.js"></script>
-	<!-- <script src="assets/common.js"></script> -->
+	<script src="${ctx}/static/common/common.js"></script>
 	<script src="${ctx}/static/xt/js/sys/common_railway.js"></script>
 	<script src="${ctx}/static/xt/js/sys/basic_info.js"></script>
 	<script src="assets/libs/SuperMap.Include.js"></script>
@@ -39,6 +39,8 @@
 		<input id="srchContent" type="text" class="srchtext" value=""><a 
 			href="javascript:void(0)" id="srchIcon" class="searchicon" onclick="searchRailway();"></a>
 	</div>
+	<div id="divcheck" class="divRailwaycheck">
+	</div>
 	<div id="divSmall" class="arrowdiv">
 		<a href="javascript:void(0)" class="arrowright" onclick="showRightDiv();"></a>
 	</div>
@@ -51,26 +53,26 @@
         <div style="width:100%;height:90px;padding-top:10px;border:1px solid #ccc; border-left:none;border-top:none;border-right:none;">
         	<div class="lefticondiv" onclick="changeLeftIcon('1');">
             	<img src="${ctx}/static/xt/images/main/lal-tl.png"/><br>
-            	<div id="xxFontDiv" style="color:#659ACC">铁路</div>
+            	<div id="xxFontDiv" style="color:#659ACC">站点</div>
         	</div>
-        	<div class="lefticondiv" onclick="changeLeftIcon('2');">
+        	<%-- <div class="lefticondiv" onclick="changeLeftIcon('2');">
             	<img src="${ctx}/static/xt/images/main/lal-tc.png"/><br>
             	<div id="tcFontDiv" style="color:#212121">图层</div>
-        	</div>
+        	</div> --%>
         </div>
         <div id="xxInfo" style="margin-top:5px;width:209px;display:block;">
-        	<div style="margin-bottom:3px;">
+        	<!-- <div style="margin-bottom:3px;">
 				<input id="srchRailName" name="srchRailName" type="text" class="srchtasktext">
 			    <a href="javascript:void(0)" class="searchtaskicon" onclick="showRailList();"></a>
-		    </div>
+		    </div> -->
         	<div id="rail_items" class="ui middle aligned selection list" 
         		style="margin-top: 0px;overflow-y:auto;overflow-x:hidden;">
             </div>
         </div>
-        <div id="tcInfo" style="margin-top:5px;width:209px;display:block;overflow:auto;display:none;">
+        <!-- <div id="tcInfo" style="margin-top:5px;width:209px;display:block;overflow:auto;display:none;">
 			<div id="layer_items" class="ui middle aligned selection list">
 			</div>
-        </div>
+        </div> -->
 	</div>
 </body>
 </html>

+ 10 - 0
jdc/jdcweb/trunk/src/main/webapp/static/common/common.js

@@ -561,3 +561,13 @@ function removeOnclick(id){
 function resetOnclick(){
 	$_id.attr("onclick",onclickEvent);
 }
+
+/**
+ * 判断是否为汉字
+ */
+function isChineseChar(str){
+    if(/^[\u4e00-\u9fa5]+$/.test(str)){
+        return true;
+    }
+    return false;
+}

+ 7 - 0
jdc/jdcweb/trunk/src/main/webapp/static/xt/css/main.css

@@ -68,6 +68,13 @@ body {
 	margin: 12px 12px 3px 0px;position: absolute; z-index: 1260;
 }
 
+.divRailwaycheck {
+    background: #F0F0F0;
+    border: 1px solid #b7b7b7;
+	top: 0px;right: 0px;width: 120px;height: 66px;
+	margin: 60px 12px 3px 0px;position: absolute; z-index: 1260;
+}
+
 .divchangemap {
 	top: 55px;right: 0px;width: 49px;height: 51px;margin: 15px 10px 3px 0px;position: absolute; z-index: 1258;
 }

+ 56 - 7
jdc/jdcweb/trunk/src/main/webapp/static/xt/js/sys/common_railway.js

@@ -15,7 +15,7 @@ $(function () {
     showRailList();
     // 调整左边栏显示高度和宽度
     var height = $(document).height() - headerHeight;
-    $("#rail_items").css("height", height - 38);
+    $("#rail_items").css("height", height);
     // 增加图例
     addTuliDiv("railway");
 });
@@ -48,6 +48,39 @@ function getRailLayerItems() {
     initRailData();
 }
 
+
+/**
+ * 添加地图图层列表
+ * @param type  表示: 铁 水 公 空
+ */
+function getMapCheckItems() {
+    mapBasicType = [
+                 {"id": "jtsn", "type": "railway", label: "交通枢纽", layer: jtsnMarkerlayer},
+                 {"id": "ptzd", "type": "railway", label: "普通站点", layer: ptzdMarkerlayer}
+             ];
+    var htmltemplate = '<div class="field"><div class="layer ui checkbox" style="padding: 5px"><input id="{0}" type="checkbox" name="{1}"><label>{2}</label></div></div>';
+    var htmlDiv = "";
+    for (var i = 0; i < mapBasicType.length; i++) {
+        htmlDiv += $.formatString(htmltemplate, mapBasicType[i].id, mapBasicType[i].id, mapBasicType[i].label);
+    }
+    $("#divcheck").html(htmlDiv);
+    $('.layer.ui.checkbox').checkbox({
+        onChecked: function () {
+            initRailBasicInfoEvent(this.name);
+        },
+        onUnchecked: function () {
+            //关闭当前对应图层弹出的左下角信息框
+            closeUncheckTc(this.name);
+            var targetlayer = $.getBasicLayer(this.name, basicType);
+            targetlayer.clearMarkers();
+        }
+    });
+    // 默认选中机场图层
+    $("#jtsn").attr("checked", true);
+    // 图层初始化
+    initRailData();
+}
+
 /**
  * 初始化基础数据
  * 
@@ -168,7 +201,9 @@ function initRail() {
         {"id": tc_ptzd, "type": "railway", label: "普通站点", layer: ptzdMarkerlayer}
     ];
     // 设置图层选中事件
-    getRailLayerItems();
+    //getRailLayerItems();
+    // 添加地图上图层列表(两项)
+    getMapCheckItems();
 }
 
 
@@ -241,7 +276,7 @@ function showRailList() {
         onUnchecked: function () {
         }
     });*/
-    var name = $("#srchRailName").val();
+    var name = $.trim($("#srchContent").val());
     $.get(basePath + "/basicInfo", {type: tc_rail_js, "name":name}, function (result) {
         var len = result.length;
         var htmltemplate = '<div style="float:left;text-algin:center;width:209px;height:30px;cursor:pointer;" onclick="showStaCenter({0});">' +
@@ -407,11 +442,25 @@ function railwaySearch() {
 
 //铁路
 function searchRailway() {
-    setSearchStyle();
     var sid = "#srchContent";
-    var content = $(sid).val();
-    if("" != $.trim(content)) {
-        showTrainTimes('',content);
+    var content = $.trim($(sid).val());
+    var displayFlg = false;
+    if($(sid).css("display") == "inline-block") {
+        displayFlg = true;
+    }
+    setSearchStyle();
+    // 判断是否为汉子,如果是则查询车站
+    var cFlg = isChineseChar(content);
+    if(cFlg) {
+        showRailList();
+    } else {
+        if("" != content) {
+            showTrainTimes('',content);
+        } else {
+            if(displayFlg == true) {
+                showRailList(); 
+            }
+        } 
     }
 };