|
@@ -2846,7 +2846,7 @@ $(document).ready(() => {
|
|
|
: '';
|
|
|
const viewHtml = att.viewpath ? `<a class="ml-1" href="${att.viewpath}" target="_blank" title="预览"><i class="fa fa-eye"></i></a>` : '';
|
|
|
const downloadHtml = '<a href="'+ window.location.pathname + '/im-file/download?im_id='+ data.att_uuid +'&file_id='+ att.file_id +'" title="下载"><i class="fa fa-download "></i></a>';
|
|
|
- html.push('<tr><td style="width: 200px">' + att.filename + att.fileext + '</td><td>' + att.username + '</td><td>' + att.in_time + '</td>',
|
|
|
+ html.push(`<tr><td><input type="checkbox" name="sia-check" fid="${att.file_id}"></td><td style="width: 200px">` + att.filename + att.fileext + '</td><td>' + att.username + '</td><td>' + att.in_time + '</td>',
|
|
|
'<td>', downloadHtml, viewHtml, delHtml, '</td></tr>');
|
|
|
}
|
|
|
}
|
|
@@ -2932,7 +2932,34 @@ $(document).ready(() => {
|
|
|
$('#load-file').attr('href', filepath);
|
|
|
$('#load-file')[0].click();
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
+ $('#batch-download-im-file').click(function() {
|
|
|
+ const select = $('[name=sia-check]:checked');
|
|
|
+ if (select.length === 0) {
|
|
|
+ toastr.warning('请选择需要批量下载的文件');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const files = [];
|
|
|
+ const curIm = SpreadJsObj.getSelectObject(self.sheet);
|
|
|
+ for (const s of select) {
|
|
|
+ const att = curIm.attachment.find(x => { return x.file_id === s.getAttribute('fid')});
|
|
|
+ if (att) files.push(att);
|
|
|
+ }
|
|
|
+ if (files.length === 0) return;
|
|
|
+
|
|
|
+ AliOss.zipFiles(files, `中间计量[${curIm.code}].zip`, (fails) => {
|
|
|
+ $(self).removeAttr('disabled');
|
|
|
+ if (fails.length === 0) {
|
|
|
+ toastr.success('下载成功');
|
|
|
+ } else {
|
|
|
+ toastr.warning(`下载成功(${fails.length}个文件下载失败)`);
|
|
|
+ }
|
|
|
+ }, () => {
|
|
|
+ $(self).removeAttr('disabled');
|
|
|
+ toastr.error('批量下载失败');
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
_initImTypeSetRela() {
|
|
|
const self = this;
|