diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.css b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.css
index 63a56c7af..f1cba91e6 100644
--- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.css
+++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.css
@@ -1,11 +1,11 @@
/*!
- * bootstrap-fileinput v5.0.4
+ * bootstrap-fileinput v5.1.2
* http://plugins.krajee.com/file-input
*
* Krajee default styling for bootstrap-fileinput.
*
* Author: Kartik Visweswaran
- * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com
+ * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD-3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
@@ -60,10 +60,9 @@
height: 16px;
}
-.krajee-default .file-thumb-progress .progress, .krajee-default .file-thumb-progress .progress-bar {
- height: 20px;
+.file-thumb-progress .progress, .file-thumb-progress .progress-bar {
font-family: Verdana, Helvetica, sans-serif;
- font-size: 9px;
+ font-size: 0.7rem;
}
.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress {
@@ -205,8 +204,8 @@
.krajee-default.file-preview-frame {
margin: 8px;
- border: 1px solid rgba(0,0,0,0.2);
- box-shadow: 0 0 10px 0 rgba(0,0,0,0.2);
+ border: 1px solid rgba(0, 0, 0, 0.2);
+ box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
padding: 6px;
float: left;
text-align: center;
@@ -237,8 +236,8 @@
}
.krajee-default.file-preview-frame:not(.file-preview-error):hover {
- border: 1px solid rgba(0,0,0,0.3);
- box-shadow: 0 0 10px 0 rgba(0,0,0,0.4);
+ border: 1px solid rgba(0, 0, 0, 0.3);
+ box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4);
}
.krajee-default .file-preview-text {
@@ -292,7 +291,6 @@
}
.krajee-default .file-thumb-progress {
- height: 11px;
top: 37px;
left: 0;
right: 0;
@@ -318,7 +316,7 @@
}
.kv-upload-progress .progress-bar {
- height: 20px;
+ height: 11px;
font-family: Verdana, Helvetica, sans-serif;
}
@@ -340,13 +338,13 @@
.file-zoom-dialog .btn-navigate {
padding: 0;
- margin: 0;
+ margin: -60px 0 0;
+ font-size: 60px;
background: transparent;
text-decoration: none;
outline: none;
opacity: 0.7;
- top: 45%;
- font-size: 4em;
+ top: 50%;
color: #1c94c4;
}
@@ -402,6 +400,7 @@
.file-drop-zone {
border: 1px dashed #aaa;
+ min-height: 260px;
border-radius: 4px;
text-align: center;
vertical-align: middle;
@@ -424,6 +423,7 @@
.file-drop-zone-title {
color: #aaa;
font-size: 1.6em;
+ text-align:center;
padding: 85px 10px;
cursor: default;
}
@@ -467,8 +467,8 @@
}
.file-zoom-content {
- height: 480px;
text-align: center;
+ min-height: 300px;
}
.file-zoom-content .file-preview-image {
@@ -532,19 +532,29 @@
padding-right: 20px;
}
-.file-sortable .file-drag-handle {
- cursor: move;
- opacity: 1;
+.clickable .file-drop-zone-title {
+ cursor: pointer;
}
.file-sortable .file-drag-handle:hover {
opacity: 0.7;
}
-.clickable .file-drop-zone-title {
- cursor: pointer;
+.file-sortable .file-drag-handle {
+ cursor: grab;
+ opacity: 1;
}
-.file-preview-initial.sortable-chosen {
+.file-grabbing, .file-grabbing * {
+ cursor: not-allowed !important;
+}
+
+.file-grabbing .file-preview-thumbnails * {
+ cursor: grabbing !important;
+}
+
+.file-preview-frame.sortable-chosen {
background-color: #d9edf7;
+ border-color: #17a2b8;
+ box-shadow: none !important;
}
\ No newline at end of file
diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.js
index c0723da97..0391d8399 100644
--- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.js
+++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-fileinput/fileinput.js
@@ -1,26 +1,22 @@
/*!
- * bootstrap-fileinput v5.0.4
+ * bootstrap-fileinput v5.1.2
* http://plugins.krajee.com/file-input
*
* Author: Kartik Visweswaran
- * Copyright: 2014 - 2019, Kartik Visweswaran, Krajee.com
+ * Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com
*
* Licensed under the BSD-3-Clause
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
*/
(function (factory) {
'use strict';
- //noinspection JSUnresolvedVariable
- if (typeof define === 'function' && define.amd) { // jshint ignore:line
- // AMD. Register as an anonymous module.
- define(['jquery'], factory); // jshint ignore:line
- } else { // noinspection JSUnresolvedVariable
- if (typeof module === 'object' && module.exports) { // jshint ignore:line
- // Node/CommonJS
- // noinspection JSUnresolvedVariable
- module.exports = factory(require('jquery')); // jshint ignore:line
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else {
+ if (typeof module === 'object' && module.exports) {
+ //noinspection NpmUsedModulesInstalled
+ module.exports = factory(require('jquery'));
} else {
- // Browser globals
factory(window.jQuery);
}
}
@@ -41,22 +37,28 @@
return str;
};
+ if (!Array.prototype.flatMap) { // polyfill flatMap
+ Array.prototype.flatMap = function (lambda) {
+ return [].concat(this.map(lambda));
+ };
+ }
+
var $h, FileInput;
// fileinput helper object for all global variables and internal helper methods
- //noinspection JSUnresolvedVariable
$h = {
FRAMES: '.kv-preview-thumb',
SORT_CSS: 'file-sortable',
+ INIT_FLAG: 'init-',
OBJECT_PARAMS: '\n' +
- '\n' +
- '\n' +
- '\n' +
- '\n' +
- '\n',
+ '\n' +
+ '\n' +
+ '\n' +
+ '\n' +
+ '\n',
DEFAULT_PREVIEW: '
\n' +
- '{previewFileIcon}\n' +
- '
',
+ '{previewFileIcon}\n' +
+ '',
MODAL_ID: 'kvFileinputModal',
MODAL_EVENTS: ['show', 'shown', 'hide', 'hidden', 'loaded'],
logMessages: {
@@ -65,25 +67,37 @@
badExifParser: 'Error loading the piexif.js library. {details}',
badInputType: 'The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.',
exifWarning: 'To avoid this warning, either set "autoOrientImage" to "false" OR ensure you have loaded ' +
- 'the "piexif.js" library correctly on your page before the "fileinput.js" script.',
+ 'the "piexif.js" library correctly on your page before the "fileinput.js" script.',
invalidChunkSize: 'Invalid upload chunk size: "{chunkSize}". Resumable uploads are disabled.',
invalidThumb: 'Invalid thumb frame with id: "{id}".',
noResumableSupport: 'The browser does not support resumable or chunk uploads.',
noUploadUrl: 'The "uploadUrl" is not set. Ajax uploads and resumable uploads have been disabled.',
- retryStatus: 'Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.'
+ retryStatus: 'Retrying upload for chunk # {chunk} for {filename}... retry # {retry}.',
+ chunkQueueError: 'Could not push task to ajax pool for chunk index # {index}.',
+ resumableMaxRetriesReached: 'Maximum resumable ajax retries ({n}) reached.',
+ resumableRetryError: 'Could not retry the resumable request (try # {n})... aborting.',
+ resumableAborting: 'Aborting / cancelling the resumable request.'
+
},
objUrl: window.URL || window.webkitURL,
now: function () {
- return new Date();
+ return new Date().getTime();
},
round: function (num) {
num = parseFloat(num);
return isNaN(num) ? 0 : Math.floor(Math.round(num));
},
+ getArray: function (obj) {
+ var i, arr = [], len = obj && obj.length || 0;
+ for (i = 0; i < len; i++) {
+ arr.push(obj[i]);
+ }
+ return arr;
+ },
getFileRelativePath: function (file) {
/** @namespace file.relativePath */
/** @namespace file.webkitRelativePath */
- return String(file.relativePath || file.webkitRelativePath || $h.getFileName(file) || null);
+ return String(file.newPath || file.relativePath || file.webkitRelativePath || $h.getFileName(file) || null);
},
getFileId: function (file, generateFileId) {
@@ -99,6 +113,19 @@
}
return (file.size + '_' + relativePath.replace(/\s/img, '_'));
},
+ getFrameSelector: function (id, selector) {
+ selector = selector || '';
+ return '[id="' + id + '"]' + selector;
+ },
+ getZoomSelector: function (id, selector) {
+ return $h.getFrameSelector('zoom-' + id, selector);
+ },
+ getFrameElement: function ($element, id, selector) {
+ return $element.find($h.getFrameSelector(id, selector));
+ },
+ getZoomElement: function ($element, id, selector) {
+ return $element.find($h.getZoomSelector(id, selector));
+ },
getElapsed: function (seconds) {
var delta = seconds, out = '', result = {}, structure = {
year: 31536000,
@@ -109,7 +136,7 @@
minute: 60,
second: 1
};
- Object.keys(structure).forEach(function (key) {
+ $h.getObjectKeys(structure).forEach(function (key) {
result[key] = Math.floor(delta / structure[key]);
delta -= result[key] * structure[key];
});
@@ -168,6 +195,12 @@
div.parentNode.removeChild(div);
return status;
},
+ canOrientImage: function ($el) {
+ var $img = $(document.createElement('img')).css({width: '1px', height: '1px'}).insertAfter($el),
+ flag = $img.css('image-orientation');
+ $img.remove();
+ return !!flag;
+ },
canAssignFilesToInput: function () {
var input = document.createElement('input');
try {
@@ -196,8 +229,12 @@
$modal.appendTo($body);
}
},
+ isFunction: function (v) {
+ return typeof v === 'function';
+ },
isEmpty: function (value, trim) {
- return value === undefined || value === null || value.length === 0 || (trim && $.trim(value) === '');
+ return value === undefined || value === null || (!$h.isFunction(
+ value) && (value.length === 0 || (trim && $.trim(value) === '')));
},
isArray: function (a) {
return Array.isArray(a) || Object.prototype.toString.call(a) === '[object Array]';
@@ -279,7 +316,6 @@
(!!Blob.prototype.webkitSlice || !!Blob.prototype.mozSlice || !!Blob.prototype.slice || false);
},
dataURI2Blob: function (dataURI) {
- //noinspection JSUnresolvedVariable
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder ||
window.MSBlobBuilder, canBlob = $h.hasBlobSupport(), byteStr, arrayBuffer, intArray, i, mimeStr, bb,
canProceed = (canBlob || BlobBuilder) && window.atob && window.ArrayBuffer && window.Uint8Array;
@@ -305,9 +341,7 @@
return bb.getBlob(mimeStr);
},
arrayBuffer2String: function (buffer) {
- //noinspection JSUnresolvedVariable
if (window.TextDecoder) {
- // noinspection JSUnresolvedFunction
return new TextDecoder('utf-8').decode(buffer);
}
var array = Array.prototype.slice.apply(new Uint8Array(buffer)), out = '', i = 0, len, c, char2, char3;
@@ -363,7 +397,7 @@
case 'ffd8ffe1':
case 'ffd8ffe2':
return 'image/jpeg';
- case '89504E47':
+ case '89504e47':
return 'image/png';
case '47494638':
return 'image/gif';
@@ -430,8 +464,92 @@
getElement: function (options, param, value) {
return ($h.isEmpty(options) || $h.isEmpty(options[param])) ? value : $(options[param]);
},
+ createElement: function (str, tag) {
+ tag = tag || 'div';
+ return $($.parseHTML('<' + tag + '>' + str + '' + tag + '>'));
+ },
uniqId: function () {
- return Math.round(new Date().getTime()) + '_' + Math.round(Math.random() * 100);
+ return (new Date().getTime() + Math.floor(Math.random() * Math.pow(10, 15))).toString(36);
+ },
+ parseEventCallback: function (str) {
+ return Function('\'use strict\'; return (function() { ' + str + ' });')(); // jshint ignore:line
+ },
+ cspBuffer: {
+ CSP_ATTRIB: 'data-csp-01928735', // a randomly named temporary attribute to store the CSP elem id
+ domEventsList: [
+ 'mousedown', 'mouseup', 'click', 'dblclick', 'mousemove', 'mouseover', 'mousewheel', 'mouseout',
+ 'contextmenu', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'keydown', 'keypress', 'keyup',
+ 'focus', 'blur', 'change', 'submit', 'scroll', 'resize', 'hashchange', 'load', 'unload',
+ 'cut', 'copy', 'paste'
+ ],
+ domElementEvents: {},
+ domElementsStyles: {},
+ stash: function (htmlString) {
+ var self = this, outerDom = $.parseHTML('' + htmlString + '
'), $el = $(outerDom);
+ $el.find('[style]').each(function (key, elem) {
+ var $elem = $(elem), styleString = $elem.attr('style'), id = $h.uniqId(), styles = {};
+ if (styleString && styleString.length) {
+ if (styleString.indexOf(';') === -1) {
+ styleString += ';';
+ }
+ styleString.slice(0, styleString.length - 1).split(';').map(function (str) {
+ str = str.split(':');
+ if (str[0]) {
+ styles[str[0]] = str[1] ? str[1] : '';
+ }
+ });
+ self.domElementsStyles[id] = styles;
+ $elem.removeAttr('style').attr(self.CSP_ATTRIB, id);
+ }
+ });
+ $el.filter('*').removeAttr('style'); // make sure all style attr are removed
+ $.each(self.domEventsList, function (key, eventName) { // handle onXXX events set as inline markup
+ var id, fn, event = 'on' + eventName, $inlineEvent = $el.find('[' + event + ']');
+ if ($inlineEvent.length) {
+ fn = $h.parseEventCallback($inlineEvent.attr(event));
+ if ($inlineEvent.attr(self.CSP_ATTRIB)) {
+ id = $inlineEvent.attr(self.CSP_ATTRIB);
+ } else {
+ id = $h.uniqId();
+ self.domElementEvents[id] = [];
+ }
+ self.domElementEvents[id].push({name: eventName + '.csp', handler: fn}); // special csp namespace
+ $inlineEvent.removeAttr(event).attr(self.CSP_ATTRIB, id);
+ }
+ });
+ var values = Object.values ? Object.values(outerDom) : Object.keys(outerDom).map(function (itm) {
+ return outerDom[itm];
+ });
+ return values.flatMap(function (elem) {
+ return elem.innerHTML;
+ }).join('');
+ },
+ apply: function (domElement) {
+ var self = this, $el = $(domElement);
+ $el.find('[' + self.CSP_ATTRIB + ']').each(function (key, elem) {
+ var $elem = $(elem), id = $elem.attr(self.CSP_ATTRIB), styles = self.domElementsStyles[id],
+ events = self.domElementEvents[id];
+ if (styles) {
+ $elem.css(styles);
+ }
+ if (events) {
+ $.each(events, function (key, event) {
+ if (event && event.name) {
+ $elem.off(event.name).on(event.name, event.handler);
+ }
+ });
+ }
+ $elem.removeAttr(self.CSP_ATTRIB);
+ });
+ self.domElementsStyles = {};
+ self.domElementEvents = {};
+ }
+ },
+ setHtml: function ($elem, htmlString) {
+ var buf = $h.cspBuffer;
+ $elem.html(buf.stash(htmlString));
+ buf.apply($elem);
+ return $elem;
},
htmlEncode: function (str, undefVal) {
if (str === undefined) {
@@ -468,18 +586,12 @@
return filePath.split(filePath.substring(sepIndex, sepIndex + 1)).pop();
},
checkFullScreen: function () {
- //noinspection JSUnresolvedVariable
return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement ||
document.msFullscreenElement;
},
toggleFullScreen: function (maximize) {
- var doc = document, de = doc.documentElement;
- if (de && maximize && !$h.checkFullScreen()) {
- /** @namespace document.requestFullscreen */
- /** @namespace document.msRequestFullscreen */
- /** @namespace document.mozRequestFullScreen */
- /** @namespace document.webkitRequestFullscreen */
- /** @namespace Element.ALLOW_KEYBOARD_INPUT */
+ var doc = document, de = doc.documentElement, isFullScreen = $h.checkFullScreen();
+ if (de && maximize && !isFullScreen) {
if (de.requestFullscreen) {
de.requestFullscreen();
} else {
@@ -496,21 +608,19 @@
}
}
} else {
- /** @namespace document.exitFullscreen */
- /** @namespace document.msExitFullscreen */
- /** @namespace document.mozCancelFullScreen */
- /** @namespace document.webkitExitFullscreen */
- if (doc.exitFullscreen) {
- doc.exitFullscreen();
- } else {
- if (doc.msExitFullscreen) {
- doc.msExitFullscreen();
+ if (isFullScreen) {
+ if (doc.exitFullscreen) {
+ doc.exitFullscreen();
} else {
- if (doc.mozCancelFullScreen) {
- doc.mozCancelFullScreen();
+ if (doc.msExitFullscreen) {
+ doc.msExitFullscreen();
} else {
- if (doc.webkitExitFullscreen) {
- doc.webkitExitFullscreen();
+ if (doc.mozCancelFullScreen) {
+ doc.mozCancelFullScreen();
+ } else {
+ if (doc.webkitExitFullscreen) {
+ doc.webkitExitFullscreen();
+ }
}
}
}
@@ -534,13 +644,6 @@
}
return newArr;
},
- cleanZoomCache: function ($el) {
- var $cache = $el.closest('.kv-zoom-cache-theme');
- if (!$cache.length) {
- $cache = $el.closest('.kv-zoom-cache');
- }
- $cache.remove();
- },
closeButton: function (css) {
css = css ? 'close ' + css : 'close';
return '