|
@@ -25,7 +25,8 @@
|
|
|
' <li class="nav-item ml-auto pt-1">\n' +
|
|
|
' <a href="javascript:void(0);" id="batch-download" class="btn btn-sm btn-primary" type="curr">批量下载</a>\n' +
|
|
|
' <span id="showPage" style="display: none"><a href="javascript:void(0);" class="page-select ml-3" content="pre"><i class="fa fa-chevron-left"></i></a> <span id="att-cur-page">1</span>/<span id="att-total-page">10</span> <a href="javascript:void(0);" class="page-select mr-3" content="next"><i class="fa fa-chevron-right"></i></a></span>\n' +
|
|
|
- (setting.readOnly ? '' : ' <a href="#upload" data-toggle="modal" data-target="#upload" class="btn btn-sm btn-outline-primary ml-3">上传</a>\n') +
|
|
|
+ (setting.readOnly ? '' : ' <a href="#upload" data-toggle="modal" data-target="#upload" class="btn btn-sm btn-outline-primary ml-2">上传</a>\n') +
|
|
|
+ (setting.readOnly || !setting.bigValid ? '' : ' <a href="#add-big-file" data-toggle="modal" data-target="#add-big-file" class="btn btn-sm btn-outline-primary ml-2">上传大文件</a>\n') +
|
|
|
' </li>\n' +
|
|
|
' </ul>\n' +
|
|
|
'</div>\n' +
|
|
@@ -233,6 +234,43 @@
|
|
|
});
|
|
|
$('#upload-file').val('');
|
|
|
});
|
|
|
+ $('#add-big-file').on('show.bs.modal', function() {
|
|
|
+ $('#upload-big-file-hint').hide();
|
|
|
+ $('#upload-big-file')[0].value = '';
|
|
|
+ if ($('#add-big-file-ok').hasClass('btn-warning')) $('#add-big-file-ok').removeClass('btn-warning').addClass('btn-primary');
|
|
|
+ });
|
|
|
+ $('#add-big-file-ok').click(() => {
|
|
|
+ if (!curNode) {
|
|
|
+ toastr.error('请先选择台账节点');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const input = $('#upload-big-file');
|
|
|
+ const file = input[0].files[0];
|
|
|
+ if (file.size > 500 * 1024 * 1024) {
|
|
|
+ toastr.error('上传文件大小超过500MB。');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const fileext = '.' + file.name.toLowerCase().split('.').splice(-1)[0];
|
|
|
+ if (whiteList.indexOf(fileext) === -1) {
|
|
|
+ toastr.error('仅支持office文档、图片、压缩包格式,请勿上传' + fileext + '格式文件。');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ const data = {};
|
|
|
+ data[setting.masterKey] = curNode[setting.key];
|
|
|
+ AliOss.uploadBigFile(file, setting.uploadBigUrl, data,
|
|
|
+ { progressObj: $('#upload-big-file-progress'), resumeObj: $('#add-big-file-resume'), stopObj: $('#add-big-file-stop') },
|
|
|
+ function(result) {
|
|
|
+ result.forEach(d => {
|
|
|
+ d.node = curNode;
|
|
|
+ allAtts.push(d);
|
|
|
+ _addToNodeIndex(d, true);
|
|
|
+ });
|
|
|
+ refreshAllAttHtml();
|
|
|
+ refreshCurAttHtml();
|
|
|
+ $('#upload-big-file').val('');
|
|
|
+ $('#add-big-file').modal('hide');
|
|
|
+ });
|
|
|
+ });
|
|
|
$('body').on('click', 'a[name=att-locate]', function () {
|
|
|
const fid = this.getAttribute('file-id');
|
|
|
const att = findFile(allAtts, fid);
|