<%@ page import="com.jeeplus.modules.sys.utils.UserUtils" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>物品目录</title>
	<meta name="decorator" content="default"/>


	<style>
		.widthClass{
			display: inline-block;
		}
		.shows .input-group{
			width: 48%!important;
		}
	</style>
	<style>
		body{
			background-color:transparent;
			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
			color:#ffffff;
			background-color:rgba(255,255,255,0);
			height:100%;
		}
	</style>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row">
		<div class="full-width fl">
			<div class="contentShadow layui-row" id="queryDiv">
				<form:form id="searchForm" modelAttribute="sysModularField" action="${url}" method="post" class="form-inline">
					<input type="hidden" name="url" value="${url}"/>
					<input type="hidden" name="tableName" value="${tableName}"/>
					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
					<%--<div class="commonQuery ">
						<div class="layui-item query athird">
							<label class="layui-form-label">属性名称:</label>
							<div class="layui-input-block">
								<input id="notes" name="notes" type="text"  maxlength="64" class=" form-control  layui-input " value="${sysModularField.notes}" />
								</input>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">column:</label>
							<div class="layui-input-block">
								<input id="field" name="field" type="text"  maxlength="64" class=" form-control  layui-input " value="${sysModularField.field}" />
								</input>
							</div>
						</div>
						<div class="layui-item athird">
							<div class="input-group">
								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
							</div>
						</div>
						<div style="    clear:both;"></div>
					</div>--%>
					<div id="moresees" style="clear:both;display:none;">
						<div style="clear:both;"></div>
					</div>
				</form:form>
			</div>
		</div>

		<div class="full-width fl">
			<div class="layui-item layui-col-xs12 form-table-container" >
				<table class="oa-table layui-table" id="contentTable">
					<thead>
					<tr>
						<th width="20" style="text-align: center"><input type="checkbox" class="i-checks"></th>
						<th width="50px">序号</th>
						<th width="300px">属性名称</th>
						<th width="200px">column</th>
						<th width="200px">字段类型</th>
						<th width="200px">是否允许为空</th>
					</tr>
					</thead>
					<tbody>
					<c:forEach items="${list}" var="sysModularField" varStatus="index">
						<tr id="t${index.index}">
							<td style="text-align:center;"> <input type="checkbox" id="${sysModularField.id}" class="i-checks"></td>
							<td class="codelabe0" >${sysModularField.no}</td>
							<td class="codelabel">${sysModularField.notes}</td>
							<td class="codelabe2">${sysModularField.field}</td>
							<td class="codelabe3">${sysModularField.fieldType}</td>
							<td class="codelabe4">${sysModularField. isEmpty}</td>
						</tr>
					</c:forEach>

					</tbody>
				</table>
				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
	<div id="changewidth"></div>
</div>

<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
            $('#contentTable tbody tr td input.i-checks').iCheck('check');
        });
        $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
            $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
        });
        $("#cus_name").show();
        $("#cus_name").siblings().hide();
        //搜索框收放
        $('#moresee').click(function(){
            if($('#moresees').is(':visible'))
            {
                $('#moresees').slideUp(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
            }else{
                $('#moresees').slideDown(0,resizeListWindow1);
                $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
            }
        });
    });
    function switchInput(obj){
        $("#"+obj).show();
        $("#"+obj).siblings().hide();
    }
    function getSelectedItem(){
        var size = $("#contentTable tbody tr td input.i-checks:checked").size();
        if(size == 0 ){
            top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
            return "-1";
        }
            var arr=new Array();
            $("#contentTable tbody tr td input.i-checks:checked").each(function () {
                var id =  $(this).attr("id");
                var notes = $(this).parent().parent().parent().find(".codelabel").html();
                var field = $(this).parent().parent().parent().find(".codelabe2").html();
                var fieldType = $(this).parent().parent().parent().find(".codelabe3").html();
                var data = {'id':id,'notes':notes,'field':field,'fieldType':fieldType};
                arr.push(data);
            })
            return arr;
    }
</script>
</body>
</html>
