level 1
,uploadListIns = upload.render({
elem: '#testList'
,url: "" //改成您自己的上传接口
,accept: 'file'
,multiple: true
,auto: false
,bindAction: '#testListAction'
,data:{
params:'',
type:'image',
modelid:"<?=$modelid?>",
p_id:"<?=$art_id?>"
}
,before: function (obj) {
var json = [];
layui.each($('input[name="img_title"]'), function (index, item) {
json.push({"fileName":$(item).parents('td').siblings('.fileName').html(),"img_title":$(item).val()});
});
this.data.params = JSON.stringify(json);
}
多文件before 只会触发一次,所以一次性把所有的值传一个json 到后台,然后后台再调用你要用的
2020年08月18日 09点08分
7