<div class="col-md-10 col-sm-10 col-xs-10">
<td class="form-control" name="photo" th:each="photo,stat:${uemiReport.upPhotoList}" id="showPhoto">
<a class="btn btn-primary fa fa-gear" th:text="${photo.fileName}" th:onclick="'javascript:uemiReport.showPhoto('+${photo.id}+');'"></a>
<a class="btn btn-primary fa fa-gear" th:text=删除 th:onclick="'javascript:uemiReport.delPhoto('+${photo.id}+','+${uemiReport.id}+')'"></a>
</td>
</div>
/**
* 根据照片ID删除照片
*var url=__ctx+"/platform/data/uemiReport/getInfo?factoryId="+factoryId+"&reportId="+reportId;
* @param responseText
*/
delPhoto:function(id,reportId){
var factoryId=$("#factoryId").val();
url=__ctx+"/platform/data/uemiReport/delPhoto?id="+id+"&reportId="+reportId+"&factoryId="+factoryId;
var showPhoto=$("#showPhoto");
showPhoto.empty();
$.post( url,function(result){
$(result).each(function(){
});
});
},
这个之前遇到的一个主要的问题是忘记了在JS的方法中去设置接收到变量,导致JS一直没有识别自定义的参数名