<#ftl >
|
<#macro multipleUpload fileList=[] urlName='url' fileName='file_name' inputFileName="infoFile" maxUploadCount="5">
|
<#if fileList?size!=0>
|
<#list fileList as file>
|
<div style='cursor:pointer;'>
|
${file[fileName]} <a href="${base}/download.html?path=${file[urlName]}&fileName=${file[fileName]}">下载</a>
|
</div>
|
</#list>
|
<#else>
|
<div id="files">
|
<input type="file" name="infoFile"/>
|
<img title="添加" id="addfile" onclick="addAttchment()" src="${common_static}/static/images/jia1.png"
|
style="cursor: pointer; margin: 0px; padding: 0px;"/>
|
<font color="red">文件大小限制在100M以内</font> <br/>
|
</div>
|
</#if>
|
<script type="text/javascript">
|
function addAttchment() {
|
var files = $("#files");
|
var context = "<div style=\"cursor:pointer;\"><input type=\"file\" class='uploadFileLength' name=\"${inputFileName}\"> <span name=\"deletefile\"><img title=\"删除\" src=\"${common_static}/static/images/jian1.png\" style=\" cursor:pointer ;margin: 0px;padding:0px;\"></span></div>";
|
if ($("span[name='deletefile']").length === ${maxUploadCount}-1) {
|
alert('提示:附件最多能添加${maxUploadCount}个!');
|
} else {
|
files.append(context);
|
}
|
$("span[name='deletefile']").live("click", function () {
|
$(this).parent("div").remove();
|
});
|
}
|
</script>
|
</#macro>
|