diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css b/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css index fcb43377..3831e73c 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css +++ b/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css @@ -49,7 +49,22 @@ .ml20 { margin-left: 20px; } - +.img-xs { + width: 32px; + height: 32px; +} +.img-sm { + width: 64px; + height: 64px; +} +.img-md { + width: 96px; + height: 96px; +} +.img-lg { + width: 120px; + height: 120px; +} .section-content { min-height: 250px; margin-right: auto; diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js index 8a88fea0..b4fd4f40 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/common.js @@ -139,6 +139,12 @@ $(function() { } expandFlag = expandFlag ? false: true; }) + // 按下ESC按钮关闭弹层 + $('body', document).on('keyup', function(e) { + if (e.which === 27) { + $.modal.closeAll(); + } + }); }); /** 刷新选项卡 */ diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 60ec4d3e..22137183 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -131,6 +131,23 @@ selectionIds = _[func](selectionIds, rowIds); } }); + // 图片预览事件 + $("#" + $.table._option.id).on('click', '.img-circle', function() { + var src = $(this).attr('src'); + var target = $(this).data('target'); + if($.common.equals("self", target)) { + layer.open({ + title: false, + type: 1, + closeBtn: false, + shadeClose: true, + area: ['auto', 'auto'], + content: "" + }); + } else if ($.common.equals("blank", target)) { + window.open(src); + } + }); }, // 当所有数据被加载时触发 onLoadSuccess: function(data) { @@ -174,6 +191,17 @@ actions.push(''); return actions.join(''); }, + // 图片预览 + imageView: function (value, path, target) { + var _path = $.common.isEmpty(path) ? '/profile/upload' : path; + // blank or self + var _target = $.common.isEmpty(target) ? 'self' : target; + if ($.common.isNotEmpty(value)) { + return $.common.sprintf("", _target, _path, value); + } else { + return $.common.nullToStr(value); + } + }, // 搜索-默认第一个form search: function(formId) { var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; diff --git a/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html b/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html index 224c0ce7..c8180644 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/profile/profile.html @@ -19,7 +19,7 @@