Эх сурвалжийг харах

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

ld_zhoutl 9 жил өмнө
parent
commit
ea2d8f6065

+ 2 - 0
jdc/jdcweb/trunk/src/main/webapp/WEB-INF/view/sys/road.jsp

@@ -38,6 +38,8 @@
 	<div id="divSearch" class="divsearch">
 		<input id="srchContent" type="text" class="srchtext" value=""><a href="javascript:void(0)" id="srchIcon" class="searchicon" onclick="showSearch();"></a>
 	</div>
+	<div id="divcheck" class="divcheck">
+	</div>
 	<div id="divSmall" class="arrowdiv">
 		<a href="javascript:void(0)" class="arrowright" onclick="showRightDiv();"></a>
 	</div>

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

@@ -61,6 +61,13 @@ body {
 	top: 0px;right: 0px;width: 240px;height: 36px;margin: 18px 3px 3px 0px;position: absolute; z-index: 1255;
 }
 
+.divcheck {
+    background: #F0F0F0;
+    border: 1px solid #b7b7b7;
+	top: 0px;right: 0px;width: 120px;height: 140px;
+	margin: 12px 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;
 }

+ 70 - 1
jdc/jdcweb/trunk/src/main/webapp/static/xt/js/sys/common_road.js

@@ -36,8 +36,10 @@ $(function () {
         {"id": tc_shoufeizhan, "type": "road", label: "收费站", layer: sfzMarkerlayer},
         {"id": tc_camera, "type": "camera", label: "公路摄像头", layer: cameraMarkerlayer}
     ];
-
+    // 添加左边栏图层列表(五项)
     getRoadLayerItems(basicType);
+    // 添加地图上图层列表(五项)
+    getMapCheckItems();
     getEventItems();
 
     // 调整左边栏显示高度和宽度
@@ -196,9 +198,13 @@ function getRoadLayerItems(basicType) {
 
     $('.layer.ui.checkbox').checkbox({
         onChecked: function () {
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(this.name, true);
             initRoadBasicInfoEvent(this.name, basicType);
         },
         onUnchecked: function () {
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(this.name, false);
             var targetlayer = $.getBasicLayer(this.name, basicType);
             targetlayer.clearMarkers();
             //关闭当前对应图层弹出的左下角信息框
@@ -208,6 +214,65 @@ function getRoadLayerItems(basicType) {
     });
 }
 
+/**
+ * 添加地图图层列表
+ * @param type  表示: 铁 水 公 空
+ */
+function getMapCheckItems() {
+    mapBasicType = [
+                 {"id": "map_navi_fwq", "type": "road", label: "服务区", layer: fwqMarkerlayer},
+                 {"id": "map_navi_shoufeizhan", "type": "road", label: "收费站", layer: sfzMarkerlayer},
+                 {"id": "map_navi_camera", "type": "camera", label: "公路摄像头", layer: cameraMarkerlayer},
+                 {"id": "map_tfsjchk", "type": "map", label: "突发事件", icon: "assets/images/tfsj.png"},
+                 {"id": "map_yhsgchk", "type": "map", label: "养护施工", icon: "assets/images/yhsg.png"}
+             ];
+    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 () {
+        	var actName = this.name.replace("map_","");
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(actName, true);
+        	if (actName == tc_tfsjchk || actName == tc_yhsgchk) {
+        		initEventInfoEvent(actName);
+            } else {
+                initRoadBasicInfoEvent(actName, basicType);
+            }
+        },
+        onUnchecked: function () {
+        	var actName = this.name.replace("map_","");
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(actName, false);
+            if (actName == tc_tfsjchk) {
+                tfsjMarkerlayer.clearMarkers();
+            } else if (actName == tc_yhsgchk) {
+                glyhMarkerlayer.clearMarkers();
+            } else {
+                var targetlayer = $.getBasicLayer(actName, basicType);
+                targetlayer.clearMarkers();
+                //关闭当前对应图层弹出的左下角信息框
+                closeUncheckTc(actName);
+            }
+        }
+    });
+}
+
+/**
+ * 设置左边栏check和地图栏check相关联
+ */
+function setCheckRel(name, flg) {
+	if(flg == true) {
+    	$("#"+name).prop('checked',true);
+    	$("#map_"+name).prop('checked',true);
+	} else {
+    	$("#"+name).prop('checked',false);
+    	$("#map_"+name).prop('checked',false);
+	}
+}
 
 /**
  *初始化基础数据复选框监听
@@ -516,9 +581,13 @@ function getEventItems() {
 
     $('.event.ui.checkbox').checkbox({
         onChecked: function () {
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(this.name, true);
             initEventInfoEvent(this.name);
         },
         onUnchecked: function () {
+        	// 设置左边栏check和地图栏check相关联
+            setCheckRel(this.name, false);
             if (this.name == tc_tfsjchk) {
                 tfsjMarkerlayer.clearMarkers();
             } else {