|
|
@@ -158,15 +158,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined, |
|
|
|
mimetype = mimetype === '*' ? null : mimetype; |
|
|
|
|
|
|
|
//最大文件限制转换成mb |
|
|
|
var maxFilesize = (function (maxsize) { |
|
|
|
var matches = maxsize.toString().match(/^([0-9\.]+)(\w+)$/); |
|
|
|
var size = matches ? parseFloat(matches[1]) : parseFloat(maxsize), |
|
|
|
unit = matches ? matches[2].toLowerCase() : 'b'; |
|
|
|
var unitDict = {'b': 0, 'k': 1, 'kb': 1, 'm': 2, 'mb': 2, 'gb': 3, 'g': 3, 'tb': 4, 't': 4}; |
|
|
|
var y = typeof unitDict[unit] !== 'undefined' ? unitDict[unit] : 0; |
|
|
|
var bytes = size * Math.pow(1024, y); |
|
|
|
return bytes / Math.pow(1024, 2); |
|
|
|
}(maxsize)); |
|
|
|
var maxFilesize = 500; |
|
|
|
|
|
|
|
var options = $(this).data() || {}; |
|
|
|
delete options.success; |
|
|
@@ -195,7 +187,7 @@ define(['jquery', 'bootstrap', 'dropzone', 'template'], function ($, undefined, |
|
|
|
}, |
|
|
|
chunking: chunking, |
|
|
|
chunkSize: chunkSize, |
|
|
|
maxFilesize: maxFilesize, |
|
|
|
maxFilesize: 500, |
|
|
|
acceptedFiles: mimetype, |
|
|
|
maxFiles: (maxcount && parseInt(maxcount) > 1 ? maxcount : (multiple ? null : 1)), |
|
|
|
timeout: timeout, |
|
|
|