<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>主要工料价格及消耗量指标</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {
            //搜索框收放
            $('#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 changeInfo(id) {
            $("#dictId").val(id);
            search();
        }
	</script>
	<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="workExample" action="${ctx}/workexample/workExample/example" method="post" class="form-inline">
					<%--<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->--%>
					<input id="dictId" name="dictId" type="hidden" value="${workExample.dictId}"/>
					<div class="commonQuery lw8">
						<div class="layui-item query athird">
							<label class="layui-form-label">工程指标：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="exampleType" name="exampleType" value="${workExample.exampleType}" labelName="exampleTypeName" labelValue="${workExample.exampleTypeName}"
												title="工程指标类型" url="/workexample/workExampleIndices/treeDataExampleSelect" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">工程地点：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="area" name="area.id" value="${workExample.area.id}" labelName="area.name" labelValue="${workExample.area.name}"
												title="区域" url="/sys/area/treeData" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="false"/>
							</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>
				</form:form>
			</div>
		</div>
		<div class="full-width fl">
			<div class="contentShadow layui-form contentDetails">
				<div class="nav-btns">
					<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
					<div style="clear: both;"></div>
				</div>
				<table class="oa-table layui-table" id="contentTable"></table>
				<!-- 分页代码 -->
				<%--<table:page page="${page}"></table:page>--%>
				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
	<div id="changewidth"></div>
</div>
<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
<script>
    layui.use('table', function(){
        layui.table.render({
            limit:${ exampleExpendList.size() }
            ,elem: '#contentTable'
            ,page: false
            ,cols: [[
                // {checkbox: true, fixed: true},
                {field:'name',align:'center', title: '工料名称',minWidth:120,templet:function(d){
                        return "<span title='"+ d.name +"'>" + d.name + "</span>";
                    }}
                ,{field:'name2',align:'center', title: '单位',minWidth:120,templet:function(d){
                        return "<span title='"+ d.name2 +"'>" + d.name2 + "</span>";
                    }}
                ,{field:'counts',align:'center', title: '样本量',minWidth:120,templet:function(d){
                        return "<span title='"+ d.counts +"'>" + d.counts + "</span>";
                    }}
                ,{field:'sums',align:'center', title: '总数量',minWidth:120,templet:function(d){
                        return "<span title='"+ d.sums +"'>" + d.sums + "</span>";
                    }}
                ,{field:'maxs',align:'center', title: '最大单位指标(每100m2)',minWidth:120,templet:function(d){
                        return "<span title='"+ d.maxs +"'>" + d.maxs + "</span>";
                    }}
                ,{field:'mins', align:'center',title: '最小单位指标(每100m2)',minWidth:120,templet:function(d){
                        return "<span title='"+ d.mins +"'>" + d.mins + "</span>";
                    }}
                ,{field:'avgs', align:'center',title: '平均单位指标(每100m2)',minWidth:120,templet:function(d){
                        return "<span title='"+ d.avgs +"'>" + d.avgs + "</span>";
                    }}
            ]]
            ,data: [
                <c:if test="${ not empty exampleExpendList}">
                <c:forEach items="${exampleExpendList}" var="exampleExpend" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "id":"${exampleExpend.id}"
                    ,"name":"${exampleExpend.name}"
                    ,"name2":"${exampleExpend.name}"
                    ,"counts":"${exampleExpend.counts}"
                    ,"sums":"${exampleExpend.sums}"
                    ,"maxs":"<fmt:formatNumber value="${exampleExpend.maxs}" pattern="#,#0.00"/>"
                    ,"mins":"<fmt:formatNumber value="${exampleExpend.mins}" pattern="#,#0.00"/>"
                    ,"avgs":"<fmt:formatNumber value="${exampleExpend.avgs}" pattern="#,#0.00"/>"
                }
                </c:forEach>
                </c:if>
            ]
        });

    })

    resizeListTable();
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
</body>
</html>