function PlanHtml(){}
PlanHtml.init = function (){
	PlanHtml();
	PlanHtml.tmpNum = 1;
}
PlanHtml.loadPlanDivNewTop = function(data,num){
	var tmpmsg = new Array();
	if(data.linkageDeviceName){
		if(data.linkageDeviceName.length>3){
			data.linkageDeviceNameN = data.linkageDeviceName.substring(0,2);
		}else{
			data.linkageDeviceNameN = data.linkageDeviceName;
		}
	}
	console.log(data);
	if(num=="1"){
		tmpmsg.push('<span class="planYuan-first1 planYuan_height monmonitoringList" style="color: black;" id="plan_exec_jd_'+data.linkageID+'" >');
		tmpmsg.push('	<span>'+data.linkageDeviceNameN+'</span>');
		tmpmsg.push('</span>');
	}else{
		tmpmsg.push('<span >');
		tmpmsg.push('	<img id="plan_exec_tp_'+data.linkageID+'" src="../../../../../../bigscreen/bigpage2/resource/img/jian2.png" />');
		tmpmsg.push('</span>');	
		if(data.linkageID=="99"){
			tmpmsg.push('<span class="planYuan-first1 planYuan_height monmonitoringList" style="color: black;" id="plan_exec_jd_'+data.linkageID+'" onclick="PlanExec.planStop()">');
		}else{
			tmpmsg.push('<span class="planYuan-first1 planYuan_height monmonitoringList" style="color: black;" id="plan_exec_jd_'+data.linkageID+'" >');
		}
		tmpmsg.push('	<span >'+data.linkageDeviceNameN+'</span>');
		tmpmsg.push('</span>');
	}
	return tmpmsg.join("");
}
PlanHtml.loadPlanStepNewStep = function(data,num){
	var tmpmsg = new Array();
	if(num==PlanExec.planExecRecord.length){
		tmpmsg.push('<div class="planXx marginB10 " id="block'+ num +'" >');
		tmpmsg.push('	<div class="planXxList leftRight textAligncM ">');
		tmpmsg.push('		<div>');
		tmpmsg.push('			<span class="padding7"> '+num+' </span>');
		tmpmsg.push('			<span class="padding7"  > '+data.linkageDeviceName+'-<span id="plan_exec_zt_'+data.linkageID+'">等待执行</span></span>');
		tmpmsg.push('			<span class="padding7"> '+data.execModelNameAll+' </span>');
		tmpmsg.push('		</div>');
		tmpmsg.push('		<div style="">');
		tmpmsg.push('			<span id="btn_manual_step_'+num+'" class="padding7 planTitlesBorder" onclick="planExecClose('+num+')"  >结束预案</span>');
		tmpmsg.push('		</div>');
		tmpmsg.push('	</div>');
		tmpmsg.push('</div>');
	}else{
		var delayTime ="";
		var execModel = ""
		if(data.execModel=="0"){
			execModel = "hidden";
		}
		if(data.execModel=="1"){
			execModel = "";
		}
		if(data.execModel=="2"){
			//delayTime = '('+data.delayTime+')';
			execModel = "hidden";
		}
		tmpmsg.push('<div class="planXx marginB10 " id="block'+ num +'" >');
		tmpmsg.push('	<div class="planXxList leftRight textAligncM ">');
		tmpmsg.push('		<div>');
		tmpmsg.push('			<span class="padding7"> '+num+' </span>');
		tmpmsg.push('			<span class="padding7"  > '+data.linkageDeviceName+'-<span id="plan_exec_zt_'+data.linkageID+'">等待执行</span></span>');
		tmpmsg.push('			<span class="padding7"> '+data.execModelNameAll+' <span id="plan_step_delay_'+data.linkageID+'">'+delayTime+'</span><span style="display:none;" id="plan_step_delayrun_'+data.linkageID+'"></span></span>');
		tmpmsg.push('		</div>');
		tmpmsg.push('		<div style="">');
		
		tmpmsg.push('			<span id="btn_again_step_'+num+'" class="padding7 planTitlesBorder hidden" onclick="PlanRun.planExecRunType('+num+','+data.linkageDeviceType+',0)" >重新执行 </span>');
		tmpmsg.push('			<span id="btn_confirm_step_'+num+'" class="padding7 planTitlesBorder hidden" onclick="PlanRun.planExecRunType('+num+','+data.linkageDeviceType+',1)" >立即执行 </span>');
		tmpmsg.push('			<span id="btn_manual_step_'+num+'" class="padding7 planTitlesBorder '+execModel+'" onclick="PlanRun.handRun('+num+','+data.linkageDeviceType+',4)" >手动执行</span>');
		tmpmsg.push('			<span id="btn_skip_step_'+num+'" class="padding7 planTitlesBorder hidden" onclick="PlanRun.planExecRunType('+num+','+data.linkageDeviceType+',2)" >跳过执行 </span>');
		tmpmsg.push('			<span id="btn_advance_step_'+num+'" class="padding7 planTitlesBorder hidden" onclick="PlanRun.planExecRunType('+num+','+data.linkageDeviceType+',3)" >提前执行 </span>');
		
		tmpmsg.push('			<span class="padding7 font14 planIocn" onclick=changeShowDevice(\"'+data.linkageID+'\") > v </span>');
		tmpmsg.push('		</div>');
		tmpmsg.push('	</div>');
		tmpmsg.push('	<div class="plan_device_div" id="plan_device_div_'+data.linkageID+'"></div>');
		tmpmsg.push('</div>');
	}
	return tmpmsg.join("");
}

PlanHtml.loadPlanDeviceDivNew = function(data,x){
	data = PlanExec.changeExecModel(data);
	var tmpkey = "_"+data.linkageID+"_"+data.planType+"_"+data.execOrder;
	var tmpmsg = new Array();	
	tmpmsg.push('<div class="plamFb contenRight" id="plan_linkage_li_'+tmpkey+'">');
	tmpmsg.push('	<p class="planHint">');
	tmpmsg.push('		<span class=" displayIB">'+data.execOrder+'</span>');
	tmpmsg.push('		<span class=" displayIB">'+data.linkageDeviceName+data.messageContent+'</span>');
	tmpmsg.push('		<span class=" displayIB">1</span>');
	tmpmsg.push('		<span class=" displayIB">2</span>');
	tmpmsg.push('		<span class="contenRight displayIB">编辑</span>');
	tmpmsg.push('		<span class="plan_linkage_device_'+data.linkageID+' state-wait" id="plan_linkage_statu_'+tmpkey+'"></span>');
	tmpmsg.push('	</p>');
	tmpmsg.push('</div>');
	return tmpmsg.join("");
}


