若依excel前端导入方法:
<a class="btn btn-info" onclick="$.table.importExcel()" ><!--shiro:hasPermission="system:mgtuser:import"-->
<i class="fa fa-upload"></i> 批量导入
</a>
可以看到importExcel方法参数 为空,该方法引用js中ry-ui.js下面部分:
// 导入数据
importExcel: function(formId, width, height) {
table.set();
var currentId = $.common.isEmpty(formId) ? 'importTpl' : formId;
var _width = $.common.isEmpty(width) ? "400" : width;
var _height = $.common.isEmpty(height) ? "230" : height;
top.layer.open({
type: 1,
area: [_width + 'px', _height + 'px'],
..... //此处省略部分代码
}
可以看到,如果不带参数直接调用,就会使用默认值,默认值中包括表单id,窗口的宽高。明白这个道理,只需在调用的地方,指定宽高即可,
onclick="$.table.importExcel('importTpl',500,400)"
按格式写足3个参数,分别代表导入窗口的id,宽度和高度,即可将导入窗口设置成自己想要的大小。