<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>
<div class="list main_auto">
	<table class="table table-bordered YpTable">
		<thead>
			<tr class="info Filter Sortable">
				<th width="40px">操作</th>
				<th width="100px">主组</th>
				<th width="100px">子组</th>
				<th width="100px">配件分类名称</th>
				<th width="200px">关键字</th>
				<th width="200px">参数</th>
			</tr>
			<tr>
				<td><input type="checkbox" name="checkAll"></td>
				<td><input type="text" class="FilterTxt form-control"/></td>
				<td><input type="text" class="FilterTxt form-control"/></td>
				<td><input type="text" class="FilterTxt form-control"/></td>
				<td><input type="text" class="FilterTxt form-control"/></td>
				<td><input type="text" class="FilterTxt form-control"/></td>
			</tr>
		</thead>
		<tbody>
			<?php if(count($treeData)){?>
			<!--一级-->
			<?php foreach($treeData as $level1){?>

			<?php if(count($level1['children'])){?>
			<!--二级-->
			<?php foreach($level1['children'] as $level2){?>
			<!--三级-->
			<?php if(count($level2['children'])){?>

			<?php foreach($level2['children'] as $level3){?>
			<tr>
				<?php if($level3['part_is_end']>0){?>
				<td><input type="checkbox" name="partId[]" value="<?php echo $level3['pt_part_id'];?>"></td>
				<?php }else{?>
				<td></td>
				<?php }?>
				<td><?php echo $level1['part_name'];?></td>
				<td><?php echo $level2['part_name'];?></td>
				<td><?php echo $level3['part_name'];?></td>
				<td><?php echo $level3['part_keyword'];?></td>
				<td><?php if(!empty($labelArr[$level3['pt_part_id']])){echo implode(',',$labelArr[$level3['pt_part_id']]);}?></td>
			</tr>
			<?php }?>

			<?php }else{?>
			<!--二级-->
			<tr>
				<?php if($level2['part_is_end']>0){?>
				<td><input type="checkbox" name="partId[]" value="<?php echo $level2['pt_part_id'];?>"></td>
				<?php }else{?>
				<td></td>
				<?php }?>
				<td><?php echo $level1['part_name'];?></td>
				<td><?php echo $level2['part_name'];?></td>
				<td></td>
				<td><?php echo $level2['part_keyword'];?></td>
				<td><?php if(!empty($labelArr[$level2['pt_part_id']])){echo implode(',',$labelArr[$level2['pt_part_id']]);}?></td>
			</tr>
			<?php }?>
			<?php }?>

			<?php }else{?>
			<!--一级-->
			<tr>
				<?php if($level1['part_is_end']>0){?>
				<td><input type="checkbox" name="partId[]" value="<?php echo $level1['pt_part_id'];?>"></td>
				<?php }else{?>
				<td></td>
				<?php }?>
				<td><?php echo $level1['part_name'];?></td>
				<td></td>
				<td></td>
				<td><?php echo $level1['part_keyword'];?></td>
				<td><?php if(!empty($labelArr[$level1['pt_part_id']])){echo implode(',',$labelArr[$level1['pt_part_id']]);}?></td>
			</tr>
			<?php }?>

			<?php }?>

			<?php }?>
		</tbody>
	</table>
	<nav class="navbar fixed-right hidden" >
		<div class="" id="change-part-box">
			<form class="change-part-form" action="<?php echo mvc::$cfg['ADMIN_URI'];?>part/changePart" method="post">
				<div class="row">
					<div class="col-md-12">已选分类：
						<div class="check-box">
							<ul class="change-part clearfix">
							</ul>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12">转移分类：
					<br>
						<select class="form-control label-list w250" name="target" >
							<option value="0">选择目标分类</option>
						</select>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 text-center">
						<button type="button" class="btn btn-primary save-btn">保存</button>
					</div>
				</div>
			</form>
		</div>
	</nav>
</div>
<script type="text/javascript" src="<?php echo mvc::$cfg['ADMIN_URL'];?>static/js/part.js?ver=1.0.0"></script>
<script type="text/javascript">
	var list=<?php echo json_encode($list);?>;
	$(document).ready(function(){
		changePart.init();
	})
</script>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>