Browse Source

修改运营投放页面的弹出层数据为多选框(广告主)

ying.rong 9 years ago
parent
commit
d3d8e793b2

+ 1 - 1
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/operatorPlaceWindow.ftl

@@ -10,7 +10,7 @@
 			<#if list ??>
 			<#list list as operatorPlace>
 			<div class="single_div">
-				<input class="single_div_radio" name="operatorPlace" type="radio" value="a${operatorPlace.id!}" title="${operatorPlace.operatorShowName!}">
+				<input class="single_div_radio" name="operatorPlace" type="checkbox" value="${operatorPlace.id!}" title="${operatorPlace.operatorShowName!}">
 				<span class="single_div_span" title="${operatorPlace.operatorShowName!}">${operatorPlace.operatorShowName!}</span>
 			</div>
 			</#list>

+ 2 - 2
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/operatorWindow.ftl

@@ -4,13 +4,13 @@
 </@override>	
 <@override name="body">
 <div id="dialog_content">
-	<form id="selectOperatorForm" action="${ctx}//advertiser/main/ad/target/ad-group-alloperator/chooseOperator" method="post">
+	<form id="selectOperatorForm" action="${ctx}/advertiser/main/ad/target/ad-group-alloperator/chooseOperator" method="post">
 		<input type="hidden" id="page" name="page" value="${pager.page}">
 		<div id="selectOperatorDiv" class="input-radiosDiv">
 			<#if operatorList ??>
 			<#list operatorList as operator>
 			<div class="single_div">
-				<input class="single_div_radio" name="operator" type="radio" id="${operator.id!}" value="${operator.id!}" title="${operator.companyName!}">
+				<input class="single_div_radio" name="operator" type="checkbox" id="${operator.id!}" value="${operator.id!}" title="${operator.companyName!}">
 				<span class="single_div_span" title="${operator.companyName!}">${operator.companyName!}</span>
 			</div>
 			</#list>

+ 1 - 1
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/placeClassWindow.ftl

@@ -10,7 +10,7 @@
 			<#if list ??>
 			<#list list as placeClass>
 			<div class="single_div">
-				<input class="single_div_radio" name="placeClass" type="radio" value="c${placeClass.id!}" title="${placeClass.name!}">
+				<input class="single_div_radio" name="placeClass" type="checkbox" value="${placeClass.id!}" title="${placeClass.name!}">
 				<span class="single_div_span" title="${placeClass.name!}">${placeClass.name!}</span>
 			</div>
 			</#list>

+ 1 - 1
src/main/webapp/WEB-INF/pages/advertiser/main/ad/target/ad-group-alloperator/placeWindow.ftl

@@ -10,7 +10,7 @@
 			<#if list ??>
 			<#list list as place>
 			<div class="single_div">
-				<input class="single_div_radio" name="place" type="radio" value="b${place.id!}" title="${place.name!}">
+				<input class="single_div_radio" name="place" type="checkbox" value="${place.id!}" title="${place.name!}">
 				<span class="single_div_span" title="${place.name!}">${place.name!}</span>
 			</div>
 			</#list>

+ 5 - 0
src/main/webapp/assets/css/common.css

@@ -1174,4 +1174,9 @@ table.tableApmac td,table.tableApmacOther td{
 	background-image:url(../images/tophover_bg.jpg);	
 	text-decoration: none;
 	z-index:9999;
+}
+
+.aChange{
+	background-color: #36aeea;
+	color:#ffffff;
 }

+ 33 - 27
src/main/webapp/assets/js/advertiser/operatoradAllGroup.js

@@ -543,41 +543,47 @@ $(document).ready(function(){
 	
 	/******  媒体场景  *****/
 	$("#btn-selectOperatorPlace").click(function(){
-		layer.open({
-		    type: 2,
-			title: '选择媒体场景',
-			shadeClose: false,
-			shade: 0.6,
-			fix:false,
-			area: ['680px','430px'],
-			content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/chooseOperatorPlace', 'no']
-		}); 
+		if($("#selectPlaceId").val() == "" || $("#selectPlaceId").val().indexOf("a") != -1){
+			layer.open({
+			    type: 2,
+				title: '选择媒体场景',
+				shadeClose: false,
+				shade: 0.6,
+				fix:false,
+				area: ['680px','430px'],
+				content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/chooseOperatorPlace', 'no']
+			}); 
+		}
 	});
 	
 	/******  小场景  *****/
 	$("#btn-selectPlace").click(function(){
-		layer.open({
-		    type: 2,
-			title: '选择小场景',
-			shadeClose: false,
-			shade: 0.6,
-			fix:false,
-			area: ['680px','430px'],
-			content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/choosePlace', 'no']
-		}); 
+		if($("#selectPlaceId").val() == "" || $("#selectPlaceId").val().indexOf("b") != -1){
+			layer.open({
+			    type: 2,
+				title: '选择小场景',
+				shadeClose: false,
+				shade: 0.6,
+				fix:false,
+				area: ['680px','430px'],
+				content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/choosePlace', 'no']
+			}); 
+		}
 	});
 	
 	/******  数聚场景  *****/
 	$("#btn-selectPlaceClass").click(function(){
-		layer.open({
-		    type: 2,
-			title: '选择数聚场景',
-			shadeClose: false,
-			shade: 0.6,
-			fix:false,
-			area: ['680px','430px'],
-			content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/choosePlaceClass', 'no']
-		}); 
+		if($("#selectPlaceId").val() == "" || $("#selectPlaceId").val().indexOf("c") != -1){
+			layer.open({
+			    type: 2,
+				title: '选择数聚场景',
+				shadeClose: false,
+				shade: 0.6,
+				fix:false,
+				area: ['680px','430px'],
+				content: [ctx+'/advertiser/main/ad/target/ad-group-alloperator/choosePlaceClass', 'no']
+			}); 
+		}
 	});
 	
 	/******  选择终端  *****/

+ 79 - 38
src/main/webapp/assets/js/advertiser/operatoradAllGroup_dialog.js

@@ -4,19 +4,24 @@ $(document).ready(function(){
 	/***************************    选择媒体    ***************************/
 	
 	$(".selectOperator_save").click(function(){
-		var operatorId = $("#selectOperatorDiv input[type='radio']:checked").val();
-		if(operatorId == undefined){
-			alert("请选择媒体,在进行操作!");
-			return false;
-		}
-		parent.$("#input_selectOperator").val(operatorId);//父层的元素
+		var checkboxs = $("#selectOperatorDiv input[type='checkbox']:checked");
+		var operatorIds = [];
+		checkboxs.each(function(){
+			var id = parseInt($(this).val());
+			operatorIds.push(id);
+		});
+		parent.$("#input_selectOperator").val(operatorIds);//父层的元素
 		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
 		parent.layer.close(index);//再执行关闭
 	});
 	
-	$("#selectOperatorDiv input[type='radio']").each(function(){
-		if($(this).val() == parent.$("#input_selectOperator").val()){
-			$(this).attr('checked',true);
+	$("#selectOperatorDiv input[type='checkbox']").each(function(){
+		var obj = $(this);
+		var ids = parent.$("#input_selectOperator").val().split(",");
+		for(var i = 0,l=ids.length;i<l;i++){
+			if(obj.attr("id") == ids[i]){
+				obj.attr('checked',true);
+			}
 		}
 	});
 	
@@ -30,19 +35,35 @@ $(document).ready(function(){
 /***************************    选择媒体场景    ***************************/
 	
 	$(".selectOperatorPlace_save").click(function(){
-		var placeId = $("#selectOperatorPlaceDiv input[type='radio']:checked").val();
-		if(placeId == undefined){
-			alert("请选择媒体场景,在进行操作!");
-			return false;
+		var checkboxs = $("#selectOperatorPlaceDiv input[type='checkbox']:checked");
+		var placeId = "a";
+		var placeName= "";
+		if(checkboxs.length > 0){
+			checkboxs.each(function(){
+				var id = parseInt($(this).val());
+				placeId += ","+id;
+				placeName += $(this).attr("title")+",";
+			});
+			parent.$("#btn-selectPlace").addClass("aChange");
+			parent.$("#btn-selectPlaceClass").addClass("aChange");
+		}else{
+			placeId = "";
+			parent.$("#btn-selectPlace").removeClass("aChange");
+			parent.$("#btn-selectPlaceClass").removeClass("aChange");
 		}
-		parent.$("#placeId").val(placeId);//父层的元素
+		parent.$("#selectPlaceId").val(placeId);//父层的元素
+		parent.$("#selectPlaceName").val(placeName);//父层的元素
 		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
 		parent.layer.close(index);//再执行关闭
 	});
 	
-	$("#selectOperatorPlaceDiv input[type='radio'],#selectPlaceDiv input[type='radio'],#selectPlaceClassDiv input[type='radio']").each(function(){
-		if($(this).val() == parent.$("#placeId").val()){
-			$(this).attr('checked',true);
+	$("#selectOperatorPlaceDiv input[type='checkbox'],#selectPlaceDiv input[type='checkbox'],#selectPlaceClassDiv input[type='checkbox']").each(function(){
+		var obj = $(this);
+		var ids = parent.$("#selectPlaceId").val().split(",");
+		for(var i = 1,l=ids.length;i<l;i++){
+			if(obj.val() == ids[i]){
+				obj.attr('checked',true);
+			}
 		}
 	});
 	
@@ -56,12 +77,24 @@ $(document).ready(function(){
 /***************************    选择小场景    ***************************/
 	
 	$(".selectPlace_save").click(function(){
-		var placeId = $("#selectPlaceDiv input[type='radio']:checked").val();
-		if(placeId == undefined){
-			alert("请选择小场景,在进行操作!");
-			return false;
+		var checkboxs = $("#selectPlaceDiv input[type='checkbox']:checked");
+		var placeId = "b";
+		var placeName= "";
+		if(checkboxs.length > 0){
+			checkboxs.each(function(){
+				var id = parseInt($(this).val());
+				placeId += ","+id;
+				placeName += $(this).attr("title")+",";
+			});
+			parent.$("#btn-selectOperatorPlace").addClass("aChange");
+			parent.$("#btn-selectPlaceClass").addClass("aChange");
+		}else{
+			placeId = "";
+			parent.$("#btn-selectOperatorPlace").removeClass("aChange");
+			parent.$("#btn-selectPlaceClass").removeClass("aChange");
 		}
-		parent.$("#placeId").val(placeId);//父层的元素
+		parent.$("#selectPlaceId").val(placeId);//父层的元素
+		parent.$("#selectPlaceName").val(placeName);//父层的元素
 		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
 		parent.layer.close(index);//再执行关闭
 	});
@@ -76,12 +109,24 @@ $(document).ready(function(){
 /***************************    选择数聚场景    ***************************/
 	
 	$(".selectPlaceClass_save").click(function(){
-		var placeId = $("#selectPlaceClassDiv input[type='radio']:checked").val();
-		if(placeId == undefined){
-			alert("请选择数聚场景,在进行操作!");
-			return false;
+		var checkboxs = $("#selectPlaceClassDiv input[type='checkbox']:checked");
+		var placeId = "c";
+		var placeName= "";
+		if(checkboxs.length > 0){
+			checkboxs.each(function(){
+				var id = parseInt($(this).val());
+				placeId += ","+id;
+				placeName += $(this).attr("title")+",";
+			});
+			parent.$("#btn-selectPlace").addClass("aChange");
+			parent.$("#btn-selectOperatorPlace").addClass("aChange");
+		}else{
+			placeId = "";
+			parent.$("#btn-selectPlace").removeClass("aChange");
+			parent.$("#btn-selectOperatorPlace").removeClass("aChange");
 		}
-		parent.$("#placeId").val(placeId);//父层的元素
+		parent.$("#selectPlaceId").val(placeId);//父层的元素
+		parent.$("#selectPlaceName").val(placeName);//父层的元素
 		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
 		parent.layer.close(index);//再执行关闭
 	});
@@ -98,17 +143,13 @@ $(document).ready(function(){
 	$(".selectWifi_save").click(function(){
 		var checkboxs = $("table tbody .checkboxStyle_change");
 		var ids = [];
-		if(checkboxs.length > 0){
-			checkboxs.each(function(){
-				var id = parseInt($(this).attr("id"));
-				ids.push(id);
-			});
-			parent.$("#selectWifi").val(ids);//父层的元素
-			var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
-			parent.layer.close(index);//再执行关闭
-		}else{
-			alert("请选择wifi信息,在进行操作!");
-		}
+		checkboxs.each(function(){
+			var id = parseInt($(this).attr("id"));
+			ids.push(id);
+		});
+		parent.$("#selectWifi").val(ids);//父层的元素
+		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
+		parent.layer.close(index);//再执行关闭
 	});
 	
 	// 分页中超链接跳转