layui upload 传入动态参数代码如下所示:
//导入
var uploadInst = upload.render({
elem: '#importExcel'
, exts: '|xls|xlsx'
, url: '/Upload'
, before: function (obj) {
this.data = {
quarter: $("#selExport").val()
}
$(".layui-progress").show();
element.progress('upload_progress', '0%'); //进度条复位
layer.msg('上传中', { icon: 16, time: 0 });
}
, done: function (res) {
if (res.status == 1) {
$('#searchBtn').click();
layer.msg(res.info);
} else {
layer.msg(res.info);
}
element.progress('upload_progress', '0%');
$(".layui-progress").hide();
}
//进度条
, progress: function (n, elem, e) {
element.progress('upload_progress', n + '%');
}
});