<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
 	<%@include file="../../../../frame/assets/header-all.jsp"%>
	<style>
	.form-line .text-content{
		width:120px;
	}
	</style>
</head>
<body class="easyui-layout">
 <form id="childform" class="easyui-form" data-options="novalidate:true">
	<%--<div id='westPanel' data-options="region:'west',split:true,collapsible:true,border:true," title="行政目录" style="width: 250px;">--%>
      	<%--<div id='detailtab' class="" data-options="fit:true" >--%>
				<%--<div id="tree" style='border:0px solid red;'></div>--%>
		<%--</div>--%>
	 <%--</div>--%>
	
	<div data-options="region:'center',split:false,border:false" class="easyui-layout">
		<iframe scrolling="no" id='sbtdspsrInfo' frameborder="0"  src="" style="width:100%;height:99%;"></iframe>
	</div>

</body>
</html>
<script type="text/javascript">
var winId	= $.getUrlParam("winId");
var data = top.$("#"+winId).panel("options").data;
var AllTree = null;
var nodeLimit = 20,nodeMore = "加载更多..";
$(function(){
	initTree();
	$("#sbtdspsrInfo").prop("src", '../sbtdspsr/sbtdspsr.jsp?channelsetid='+ data.channelsetid
	+'&detectortype='+data.detectortype);
});
function loadValue(){
	if(records){
		$("#channellistid").val(records.channellistid);
		$("#channelsetid").textbox("setValue",records.channelsetid);
		$("#videonum").textbox("setValue",records.videonum);
		$("#channelnum").numberbox("setValue",records.channelnum);
		$("#channelname").textbox("setValue",records.channelname);
		$("#videomodel").numberbox("setValue",records.videomodel);
		$("#recordxdays").numberbox("setValue",records.recordxdays);
		$("#recordmodel").numberbox("setValue",records.recordmodel);
		$("#createaccount").textbox("setValue",records.createaccount);
		$("#createtime").textbox("setValue",records.createtime);
		$("#modifyaccount").textbox("setValue",records.modifyaccount);
		$("#modifytime").textbox("setValue",records.modifytime);
		$("#remarks").textbox("setValue",records.remarks);
		$("#extend1").textbox("setValue",records.extend1);
		$("#extend2").textbox("setValue",records.extend2);
		$("#extend3").textbox("setValue",records.extend3);
		$("#extend4").textbox("setValue",records.extend4);

	}else{
		
	}
}
function initTree() {
	$.ajax({
		type: 'post',
		dataType: 'json',
		url: 'ptxzsAction!query_PtxzsTree.do',
		data: {
			order: " order by jdpx asc "
		},
		success: function (data) {
			alarmTree = $('#xzbh').comboTree({
				source: data,
				isMultiple: true,
				cascadeSelect: true,
				collapse: false
			});
		}
	});
}

// //选中行政节点
// function setchecked(data){
// 	var xzbh = "";
// 	if(data && data.xzbh!="-1"){
// 		xzbh = data.xzbh;
// 	}
// 	$("#sbtdspsrInfo").prop("src",'../sbtdspsr/sbtdspsr.jsp?xzbh='+xzbh+"&channelsetid="+channelsetid);
// }
function doSearch_group(node){
	if(node.treeType == 'xz'){
		loadXzChannelToTree(node);
	}
}

function loadXzChannelToTree(node , startIndex){
	if( node ) {
		startIndex = startIndex || 0;
		var param = {
				xzbh : node.treeId,
				sbtd_start: startIndex,
				sbtd_limit: nodeLimit
		};
		
		$.ajax({
			 type:'post',
			 async:false,
			 dataType : 'json',
			 data:param,
			 url:'menuConfigAction!getXzTreeChannelListFromSystem.do'
		 }).done(function(rs){
			 if(rs && rs.length){
					var onLineList = [];
					var unLineList = [];
					for(var i=0;i<rs.length;i++){
						/* var obj = VideoBlockUtil.showChannelIcon_xztree(rs[i]);
						rs[i].iconCls = obj.icon; */
						/*
						if(rs[i].sfzx == "1"){
							onLineList.push(rs[i]);
						}else{
							unLineList.push(rs[i]);
						}*/
					}
					//var list = onLineList.concat(unLineList);
					var list = rs;
					if(rs.length == nodeLimit){
						var mm = {};
						mm.id = node.id+"_more";
						mm.treeType = "xz";
						mm.pid	=	node.id;
						mm.name = nodeMore;
						list.push(mm);
					}
					AllTree.tree('append', {
						parent : AllTree.tree('find', node.id).target,
						data   : list
					});
					
				}
		})
		
	}
}

function doSearchMore(node,startIndex){
	var nodeMore = AllTree.tree('find', node.id+"_more");
	AllTree.tree('remove', nodeMore.target);
	loadXzChannelToTree(node,startIndex);
}
function checkChildren(data){
	if(data && data.children && data.children.length>0 ){
		for(var i=0;i<node.children.length;i++){
			if(node.children.children && node.children.children.length>0){
				return true;
			}
		}
	}
    for (var i in data) {
        if (data[i].name == name) {
            break;
        } else {
            getArray(data[i].children, name);
        }
    }
}


</script>
