var pageCurr; layui.use(['table','laydate', 'form'], function(){ var table = layui.table; var $ = layui.jquery; var layer = layui.layer; var layDate = layui.laydate; var form = layui.form; // 数据渲染 tableIns = table.render({ elem: '#basDevp', headers: {token: localStorage.getItem('token')}, url: baseUrl+'/basDevp/list/auth', page: true, limit: 16, limits: [16, 30, 50, 100, 200, 500], even: true, toolbar: '#toolbar', cellMinWidth: 50, cols: [[ {type: 'checkbox', fixed: 'left'} // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} ,{field: 'devNo', align: 'center',sort:true,title: '编号'} // ,{field: 'decDesc', align: 'center',title: '设备描述'} // ,{field: 'devMk', align: 'center',title: '备注'} ,{field: 'inEnable', align: 'center',title: '可入', templet:function(row){ var html = "= 0; $(this).prop('checked', checked); if (checked) { $(this).attr('checked', 'checked'); } else { $(this).removeAttr('checked'); } }); } function getAreaValues() { var values = []; $('#areaBox input[type="checkbox"][name="areaOption"]').each(function () { if (this.checked && values.indexOf(this.value) < 0) { values.push(this.value); } }); return values; } function getAreaSubmitValue() { var values = getAreaValues(); $('#area').val(values.join(',')); return values.join(','); } function clearFormVal(el) { $(':input', el).each(function () { if (this.type === 'checkbox' || this.type === 'radio') { $(this).prop('checked', false).removeAttr('checked'); return; } if (this.tagName === 'SELECT' && this.multiple) { $(this).val([]).find('option').prop('selected', false); return; } $(this).val(''); }); } function detailScreen(index) { var detail = layer.getChildFrame('#data-detail', index); var height = detail.height()+60; if (height > ($(window).height()*0.9)) { height = ($(window).height()*0.8); } layer.style(index, { // top: (($(window).height()-height)/3)+"px", height: height+'px' }); } $('body').keydown(function () { if (event.keyCode === 13) { $("#search").click(); } });