|
|
|
@ -48,6 +48,7 @@ layui.extend({ |
|
|
|
|
<tr> |
|
|
|
|
<th lay-data="{type:'numbers'}"></th> |
|
|
|
|
<th lay-data="{field:'fileName'}">文件名称</th> |
|
|
|
|
<th lay-data="{field:'fileNumber',templet:'#fileNumber'}">发文编号</th> |
|
|
|
|
<th lay-data="{field:'progress', width:'35%',templet:'#processTemplate'}">进度</th> |
|
|
|
|
<th lay-data="{field:'fileSize', width:120}">文件大小</th> |
|
|
|
|
<th lay-data="{field:'oper', fixed: 'right', width: 130, align:'center', templet: '#rowTemplate'}">操作</th> |
|
|
|
@ -63,6 +64,11 @@ layui.extend({ |
|
|
|
|
<div style="margin-top: 5px;" class="layui-progress layui-progress-big" lay-filter="{{d.fileId}}" lay-showPercent="true"> |
|
|
|
|
<div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div> |
|
|
|
|
</div> |
|
|
|
|
</script> |
|
|
|
|
<script type="text/html" id="fileNumber"> |
|
|
|
|
|
|
|
|
|
<input style="height: 25px;width: 100%;" type="text" autocomplete="off" name="fileNumber"> |
|
|
|
|
|
|
|
|
|
</script>` |
|
|
|
|
let fileBoxE = options.fileBoxEle || fileBoxEle; |
|
|
|
|
$(fileBoxE).html(fileBox); |
|
|
|
@ -137,16 +143,19 @@ layui.extend({ |
|
|
|
|
progress: file.id, |
|
|
|
|
status: 0, |
|
|
|
|
}); |
|
|
|
|
option.fileQueued && option.fileQueued(file); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 一批文件被添加
|
|
|
|
|
upload.on('filesQueued', function (files) { |
|
|
|
|
that.reloadData(rowData); |
|
|
|
|
element.render('progress'); |
|
|
|
|
option.filesQueued && option.filesQueued(files); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//文件从队列移除触发
|
|
|
|
|
upload.on('fileDequeued', function (file) { |
|
|
|
|
option.fileDequeued && option.fileDequeued(file); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 文件上传之前触发
|
|
|
|
@ -194,6 +203,8 @@ layui.extend({ |
|
|
|
|
rowData = []; |
|
|
|
|
loading.closeAll(); |
|
|
|
|
let {interruptNum, queueNum, uploadFailNum} = upload.getStats(); |
|
|
|
|
//上传成功后清楚上传文件列表
|
|
|
|
|
that.reloadData(rowData); |
|
|
|
|
option.uploadFinished && option.uploadFinished(uploadFailNum === 0 && interruptNum === 0 && queueNum === 0); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|