diff --git a/snow-admin/src/main/java/com/snow/web/controller/system/SysMessageCenterController.java b/snow-admin/src/main/java/com/snow/web/controller/system/SysMessageCenterController.java index a2a88e0..2068f2b 100644 --- a/snow-admin/src/main/java/com/snow/web/controller/system/SysMessageCenterController.java +++ b/snow-admin/src/main/java/com/snow/web/controller/system/SysMessageCenterController.java @@ -1,9 +1,12 @@ package com.snow.web.controller.system; import cn.hutool.core.collection.CollUtil; +import com.snow.common.annotation.Log; import com.snow.common.core.controller.BaseController; import com.snow.common.core.domain.AjaxResult; import com.snow.common.core.page.TableDataInfo; +import com.snow.common.core.text.Convert; +import com.snow.common.enums.BusinessType; import com.snow.common.enums.MessageEventType; import com.snow.framework.util.ShiroUtils; import com.snow.system.domain.SysMessageTransition; @@ -13,9 +16,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.stream.Collectors; @@ -42,6 +43,7 @@ public class SysMessageCenterController extends BaseController */ @RequiresPermissions("system:messageCenter:view") @GetMapping() + @Deprecated public String messageCenter(ModelMap mmap) { SysUser sysUser = ShiroUtils.getSysUser(); @@ -91,18 +93,47 @@ public class SysMessageCenterController extends BaseController mmap.put("sysTaskList",sysTaskList); } - return prefix + "/messageCenter"; + return prefix + "/message_center"; } /** - * 前端消息中心 + * 消息列表 + * @param sysMessageTransition + * @return + */ + @RequiresPermissions("system:messageCenter:view") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysMessageTransition sysMessageTransition) { + startPage(); + sysMessageTransition.setConsumerId(String.valueOf(ShiroUtils.getUserId())); + sysMessageTransition.setOrderBy("create_time desc"); + List sysMessageTransitions = sysMessageTransitionService.selectSysMessageTransitionList(sysMessageTransition); + return getDataTable(sysMessageTransitions); + } + + /** + * 详情 + * @param id + * @param mmap + * @return + */ + @GetMapping("/detail/{id}") + @RequiresPermissions("system:messageCenter:detail") + public String detail(@PathVariable("id") Long id, ModelMap mmap) { + SysMessageTransition sysMessageTransition = sysMessageTransitionService.selectSysMessageTransitionById(id); + mmap.put("sysMessageTransition", sysMessageTransition); + return prefix + "/detail"; + } + + /** + * 官网消息中心 * @param sysMessageTransition * @param mmap * @return */ @GetMapping("/website") - public String websiteMessageCenter(SysMessageTransition sysMessageTransition,ModelMap mmap) - { + public String websiteMessageCenter(SysMessageTransition sysMessageTransition,ModelMap mmap) { startPage(); SysUser sysUser = ShiroUtils.getSysUser(); sysMessageTransition.setConsumerId(String.valueOf(sysUser.getUserId())); @@ -139,4 +170,41 @@ public class SysMessageCenterController extends BaseController int i = sysMessageTransitionService.updateSysMessageTransition(sysMessageTransition); return AjaxResult.success(i); } + + /** + * 标记已读 + * @param ids + * @return + */ + @RequiresPermissions("system:messageCenter:mark") + @PostMapping( "/mark") + @ResponseBody + public AjaxResult mark(String ids) + { + List idList = Convert.toStrList(ids); + idList.forEach(t->{ + SysUser sysUser = ShiroUtils.getSysUser(); + SysMessageTransition sysMessageTransition=new SysMessageTransition(); + sysMessageTransition.setId(Long.parseLong(t)); + sysMessageTransition.setMessageReadStatus(1L); + sysMessageTransition.setUpdateBy(String.valueOf(sysUser.getUserId())); + sysMessageTransitionService.updateSysMessageTransition(sysMessageTransition); + }); + return AjaxResult.success(); + } + + /** + * 删除消息 + * + * @param ids + * @return + */ + @RequiresPermissions("system:messageCenter:remove") + @Log(title = "消息中心", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(sysMessageTransitionService.deleteSysMessageTransitionByIds(ids)); + } } diff --git a/snow-admin/src/main/java/com/snow/web/controller/system/SysProfileController.java b/snow-admin/src/main/java/com/snow/web/controller/system/SysProfileController.java index c40441a..f8416bd 100644 --- a/snow-admin/src/main/java/com/snow/web/controller/system/SysProfileController.java +++ b/snow-admin/src/main/java/com/snow/web/controller/system/SysProfileController.java @@ -1,5 +1,6 @@ package com.snow.web.controller.system; +import cn.hutool.core.codec.Base64; import com.snow.common.core.page.TableDataInfo; import com.snow.framework.storage.StorageService; import com.snow.system.domain.SysAuthUser; @@ -134,6 +135,7 @@ public class SysProfileController extends BaseController public String avatar(ModelMap mmap) { SysUser user = ShiroUtils.getSysUser(); + user.setAvatar(Base64.encode(user.getAvatar())); mmap.put("user", userService.selectUserById(user.getUserId())); return prefix + "/avatar"; } @@ -165,26 +167,20 @@ public class SysProfileController extends BaseController @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PostMapping("/updateAvatar") @ResponseBody - public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) - { + public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file) { SysUser currentUser = ShiroUtils.getSysUser(); - try - { - if (!file.isEmpty()) - { + try { + if (!file.isEmpty()) { SysFile store = storageService.store(file); currentUser.setAvatar(store.getUrl()); - if (userService.updateUserInfo(currentUser) > 0) - { + if (userService.updateUserInfo(currentUser) > 0) { ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId())); return success(); } } return error(); - } - catch (Exception e) - { - log.error("修改头像失败!", e); + } catch (Exception e) { + log.error("@@修改头像失败!", e); return error(e.getMessage()); } } diff --git a/snow-admin/src/main/resources/application.yml b/snow-admin/src/main/resources/application.yml index cf75185..ee25b18 100644 --- a/snow-admin/src/main/resources/application.yml +++ b/snow-admin/src/main/resources/application.yml @@ -14,7 +14,7 @@ snow: # 开发环境配置 server: # 服务器的HTTP端口,默认为80 - port: 9527 + port: 80 servlet: # 应用的访问路径 context-path: / @@ -143,10 +143,10 @@ xss: #登录后是否显示最新的公告 is: - notice: true + notice: false #是否开启同步钉钉 sync: - dingtalk: false + dingtalk: true flowable: #关闭定时任务JOB diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.css b/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.css new file mode 100644 index 0000000..1ee9018 --- /dev/null +++ b/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.css @@ -0,0 +1,144 @@ +@charset "utf-8"; +.container { + margin: 10px auto 0 auto; + position: relative; + font-family: 微软雅黑; + font-size: 12px; +} + +.container p { + line-height: 12px; + line-height: 0px; + height: 0px; + margin: 10px; + color: #bbb +} + +.action { + width: 400px; + height: 30px; + margin: 10px 0; +} + +.cropped { + position: absolute; + left: 500px; + top: 0; + width: 200px; + border: 1px #ddd solid; + height: 450px; + padding: 4px; + box-shadow: 0px 0px 12px #ddd; + text-align: center; +} + +.imageBox { + position: relative; + height: 400px; + width: 400px; + border: 1px solid #aaa; + background: #fff; + overflow: hidden; + background-repeat: no-repeat; + cursor: move; + box-shadow: 4px 4px 12px #B0B0B0; +} + +.imageBox .thumbBox { + position: absolute; + top: 50%; + left: 50%; + width: 200px; + height: 200px; + margin-top: -100px; + margin-left: -100px; + box-sizing: border-box; + border: 1px solid rgb(102, 102, 102); + box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5); + background: none repeat scroll 0% 0% transparent; +} + +.imageBox .spinner { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + text-align: center; + line-height: 400px; + background: rgba(0, 0, 0, 0.7); +} + +.Btnsty_peyton { + float: right; + width: 46px; + display: inline-block; + margin-bottom: 10px; + height: 37px; + line-height: 37px; + font-size: 14px; + color: #FFFFFF; + margin: 0px 2px; + background-color: #f38e81; + border-radius: 3px; + text-decoration: none; + cursor: pointer; + box-shadow: 0px 0px 5px #B0B0B0; + border: 0px #fff solid; +} + +/*选择文件上传*/ +.new-contentarea { + width: 165px; + overflow: hidden; + margin: 0 auto; + position: relative; + float: left; +} + +.new-contentarea label { + width: 100%; + height: 100%; + display: block; +} + +.new-contentarea input[type=file] { + width: 188px; + height: 60px; + background: #333; + margin: 0 auto; + position: absolute; + right: 50%; + margin-right: -94px; + top: 0; + right /*\**/: 0px \9; + margin-right /*\**/: 0px \9; + width /*\**/: 10px \9; + opacity: 0; + filter: alpha(opacity=0); + z-index: 2; +} + +a.upload-img { + width: 165px; + display: inline-block; + margin-bottom: 10px; + height: 37px; + line-height: 37px; + font-size: 14px; + color: #FFFFFF; + background-color: #f38e81; + border-radius: 3px; + text-decoration: none; + cursor: pointer; + border: 0px #fff solid; + box-shadow: 0px 0px 5px #B0B0B0; +} + +a.upload-img:hover { + background-color: #ec7e70; +} + +.tc { + text-align: center; +} diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.js b/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.js new file mode 100644 index 0000000..9e22489 --- /dev/null +++ b/snow-admin/src/main/resources/static/ajax/libs/cropbox/cropbox.js @@ -0,0 +1,128 @@ +"use strict"; +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else { + factory(jQuery); + } +}(function ($) { + var cropbox = function (options, el) { + var el = el || $(options.imageBox), + obj = + { + state: {}, + ratio: 1, + options: options, + imageBox: el, + thumbBox: el.find(options.thumbBox), + spinner: el.find(options.spinner), + image: new Image(), + getDataURL: function () { + var width = this.thumbBox.width(), + height = this.thumbBox.height(), + canvas = document.createElement("canvas"), + dim = el.css('background-position').split(' '), + size = el.css('background-size').split(' '), + dx = parseInt(dim[0]) - el.width() / 2 + width / 2, + dy = parseInt(dim[1]) - el.height() / 2 + height / 2, + dw = parseInt(size[0]), + dh = parseInt(size[1]), + sh = parseInt(this.image.height), + sw = parseInt(this.image.width); + + canvas.width = width; + canvas.height = height; + var context = canvas.getContext("2d"); + context.drawImage(this.image, 0, 0, sw, sh, dx, dy, dw, dh); + var imageData = canvas.toDataURL('image/png'); + return imageData; + }, + getBlob: function () { + var imageData = this.getDataURL(); + var b64 = imageData.replace('data:image/png;base64,', ''); + var binary = atob(b64); + var array = []; + for (var i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + return new Blob([new Uint8Array(array)], {type: 'image/png'}); + }, + zoomIn: function () { + this.ratio *= 1.1; + setBackground(); + }, + zoomOut: function () { + this.ratio *= 0.9; + setBackground(); + } + }, + setBackground = function () { + var w = parseInt(obj.image.width) * obj.ratio; + var h = parseInt(obj.image.height) * obj.ratio; + + var pw = (el.width() - w) / 2; + var ph = (el.height() - h) / 2; + + el.css({ + 'background-image': 'url(' + obj.image.src + ')', + 'background-size': w + 'px ' + h + 'px', + 'background-position': pw + 'px ' + ph + 'px', + 'background-repeat': 'no-repeat' + }); + }, + imgMouseDown = function (e) { + e.stopImmediatePropagation(); + + obj.state.dragable = true; + obj.state.mouseX = e.clientX; + obj.state.mouseY = e.clientY; + }, + imgMouseMove = function (e) { + e.stopImmediatePropagation(); + + if (obj.state.dragable) { + var x = e.clientX - obj.state.mouseX; + var y = e.clientY - obj.state.mouseY; + + var bg = el.css('background-position').split(' '); + + var bgX = x + parseInt(bg[0]); + var bgY = y + parseInt(bg[1]); + + el.css('background-position', bgX + 'px ' + bgY + 'px'); + + obj.state.mouseX = e.clientX; + obj.state.mouseY = e.clientY; + } + }, + imgMouseUp = function (e) { + e.stopImmediatePropagation(); + obj.state.dragable = false; + }, + zoomImage = function (e) { + e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0 ? obj.ratio *= 1.1 : obj.ratio *= 0.9; + setBackground(); + } + + obj.spinner.show(); + obj.image.onload = function () { + obj.spinner.hide(); + setBackground(); + + el.bind('mousedown', imgMouseDown); + el.bind('mousemove', imgMouseMove); + $(window).bind('mouseup', imgMouseUp); + el.bind('mousewheel DOMMouseScroll', zoomImage); + }; + obj.image.crossOrigin = 'Anonymous'; + obj.image.src = options.imgSrc; + el.on('remove', function () { + $(window).unbind('mouseup', imgMouseUp) + }); + return obj; + }; + + jQuery.fn.cropbox = function (options) { + return new cropbox(options, this); + }; +})); diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.css b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.css index a4c0dc1..506909e 100644 --- a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.css +++ b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.css @@ -1,11 +1,11 @@ /*! - * Cropper.js v1.5.7 + * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2020-05-23T05:22:57.283Z + * Date: 2021-06-12T08:00:11.623Z */ .cropper-container { @@ -301,4 +301,4 @@ .cropper-disabled .cropper-line, .cropper-disabled .cropper-point { cursor: not-allowed; -} \ No newline at end of file +} diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.js b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.js index 9bed97a..07b6545 100644 --- a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.js +++ b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.js @@ -1,19 +1,57 @@ /*! - * Cropper.js v1.5.7 + * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2020-05-23T05:23:00.081Z + * Date: 2021-06-12T08:00:17.411Z */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - (global = global || self, global.Cropper = factory()); + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Cropper = factory()); }(this, (function () { 'use strict'; + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + + if (enumerableOnly) { + symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + } + + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } + function _typeof(obj) { "@babel/helpers - typeof"; @@ -67,40 +105,6 @@ return obj; } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; - } - - function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; - } - function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } @@ -110,7 +114,7 @@ } function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _unsupportedIterableToArray(o, minLen) { @@ -190,6 +194,10 @@ var REGEXP_DATA_URL = /^data:/; var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc + // Inspired by the default width and height of a canvas element. + + var MIN_CONTAINER_WIDTH = 200; + var MIN_CONTAINER_HEIGHT = 100; var DEFAULTS = { // Define the view mode of the cropper @@ -253,8 +261,8 @@ minCanvasHeight: 0, minCropBoxWidth: 0, minCropBoxHeight: 0, - minContainerWidth: 200, - minContainerHeight: 100, + minContainerWidth: MIN_CONTAINER_WIDTH, + minContainerHeight: MIN_CONTAINER_HEIGHT, // Shortcuts of events ready: null, cropstart: null, @@ -802,7 +810,7 @@ function getMaxZoomRatio(pointers) { var pointers2 = _objectSpread2({}, pointers); - var ratios = []; + var maxRatio = 0; forEach(pointers, function (pointer, pointerId) { delete pointers2[pointerId]; forEach(pointers2, function (pointer2) { @@ -813,13 +821,13 @@ var z1 = Math.sqrt(x1 * x1 + y1 * y1); var z2 = Math.sqrt(x2 * x2 + y2 * y2); var ratio = (z2 - z1) / z1; - ratios.push(ratio); + + if (Math.abs(ratio) > Math.abs(maxRatio)) { + maxRatio = ratio; + } }); }); - ratios.sort(function (a, b) { - return Math.abs(a) < Math.abs(b); - }); - return ratios[0]; + return maxRatio; } /** * Get a pointer from an event object. @@ -1223,11 +1231,13 @@ options = this.options, container = this.container, cropper = this.cropper; + var minWidth = Number(options.minContainerWidth); + var minHeight = Number(options.minContainerHeight); addClass(cropper, CLASS_HIDDEN); removeClass(element, CLASS_HIDDEN); var containerData = { - width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200), - height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100) + width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH), + height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT) }; this.containerData = containerData; setStyle(cropper, { @@ -1268,14 +1278,15 @@ width: canvasWidth, height: canvasHeight }; - canvasData.left = (containerData.width - canvasWidth) / 2; - canvasData.top = (containerData.height - canvasHeight) / 2; - canvasData.oldLeft = canvasData.left; - canvasData.oldTop = canvasData.top; this.canvasData = canvasData; this.limited = viewMode === 1 || viewMode === 2; this.limitCanvas(true, true); - this.initialImageData = assign({}, imageData); + canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth); + canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight); + canvasData.left = (containerData.width - canvasData.width) / 2; + canvasData.top = (containerData.height - canvasData.height) / 2; + canvasData.oldLeft = canvasData.left; + canvasData.oldTop = canvasData.top; this.initialCanvasData = assign({}, canvasData); }, limitCanvas: function limitCanvas(sizeLimited, positionLimited) { @@ -1809,9 +1820,11 @@ var options = this.options, container = this.container, containerData = this.containerData; - var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed + var ratioX = container.offsetWidth / containerData.width; + var ratioY = container.offsetHeight / containerData.height; + var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY; // Resize when width changed or height changed - if (ratio !== 1 || container.offsetHeight !== containerData.height) { + if (ratio !== 1) { var canvasData; var cropBoxData; @@ -3331,9 +3344,10 @@ if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) { url = addTimestamp(url); - } + } // The third parameter is required for avoiding side-effect (#682) - xhr.open('GET', url); + + xhr.open('GET', url, true); xhr.responseType = 'arraybuffer'; xhr.withCredentials = element.crossOrigin === 'use-credentials'; xhr.send(); @@ -3424,6 +3438,7 @@ naturalHeight: naturalHeight, aspectRatio: naturalWidth / naturalHeight }); + _this2.initialImageData = assign({}, _this2.imageData); _this2.sizing = false; _this2.sized = true; diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.css b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.css index 6bdccb8..9b23714 100644 --- a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.css +++ b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.css @@ -1,9 +1,9 @@ /*! - * Cropper.js v1.5.7 + * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2020-05-23T05:22:57.283Z - */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file + * Date: 2021-06-12T08:00:11.623Z + */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{image-orientation:0deg;display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file diff --git a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.js b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.js index 6896c80..365ce8b 100644 --- a/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.js +++ b/snow-admin/src/main/resources/static/ajax/libs/cropper/cropper.min.js @@ -1,10 +1,10 @@ /*! - * Cropper.js v1.5.7 + * Cropper.js v1.5.12 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2020-05-23T05:23:00.081Z + * Date: 2021-06-12T08:00:17.411Z */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Cropper=e()}(this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,a=new Array(e);it.width?3===i?h=t.height*r:s=t.width/r:3===i?s=t.width/r:h=t.height*r;var c={aspectRatio:r,naturalWidth:n,naturalHeight:o,width:h,height:s};c.left=(t.width-h)/2,c.top=(t.height-s)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=rt({},e),this.initialCanvasData=rt({},c)},limitCanvas:function(t,e){var i,a,n,o,r,h=this.options,s=this.containerData,c=this.canvasData,d=this.cropBoxData,l=h.viewMode,p=c.aspectRatio,m=this.cropped&&d;t&&(a=Number(h.minCanvasWidth)||0,n=Number(h.minCanvasHeight)||0,1=s.width&&(c.minLeft=Math.min(0,o),c.maxLeft=Math.max(0,o)),c.height>=s.height&&(c.minTop=Math.min(0,r),c.maxTop=Math.max(0,r))))):(c.minLeft=-c.width,c.minTop=-c.height,c.maxLeft=s.width,c.maxTop=s.height))},renderCanvas:function(t,e){var i,a,n,o,r,h=this.canvasData,s=this.imageData;e&&(a=(i=function(t){var e=t.width,i=t.height,a=t.degree;if(90===(a=Math.abs(a)%180))return{width:i,height:e};var n=a%90*Math.PI/180,o=Math.sin(n),r=Math.cos(n),h=e*r+i*o,s=e*o+i*r;return 90h.maxWidth||h.widthh.maxHeight||h.heighte.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=e.left+(e.width-n.width)/2,n.top=e.top+(e.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=rt({},n)},limitCropBox:function(t,e){var i,a,n,o,r=this.options,h=this.containerData,s=this.canvasData,c=this.cropBoxData,d=this.limited,l=r.aspectRatio;t&&(n=Number(r.minCropBoxWidth)||0,o=Number(r.minCropBoxHeight)||0,i=d?Math.min(h.width,s.width,s.width+s.left,h.width-s.left):h.width,a=d?Math.min(h.height,s.height,s.height+s.top,h.height-s.top):h.height,n=Math.min(n,h.width),o=Math.min(o,h.height),l&&(n&&o?ni.maxWidth||i.widthi.maxHeight||i.height=e.width&&i.height>=e.height?E:O),ct(this.cropBox,rt({width:i.width,height:i.height},Lt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ot(this.element,y,this.getData())}},jt={initPreview:function(){var t,e=this.element,i=this.crossOrigin,a=this.options.preview,n=i?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",r=document.createElement("img");i&&(r.crossOrigin=i),r.src=n,r.alt=o,this.viewBox.appendChild(r),this.viewBoxImage=r,a&&("string"==typeof(t=a)?t=e.ownerDocument.querySelectorAll(a):a.querySelector&&(t=[a]),ot(this.previews=t,function(t){var e=document.createElement("img");ft(t,f,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=n,e.alt=o,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){ot(this.previews,function(t){var e=gt(t,f);ct(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(e,i){if(_(e[i]))try{delete e[i]}catch(t){e[i]=void 0}else if(e.dataset)try{delete e.dataset[i]}catch(t){e.dataset[i]=void 0}else e.removeAttribute("data-".concat(ut(i)))}(t,f)})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,s=e.width,c=e.height,d=h.width,l=h.height,p=e.left-t.left-h.left,m=e.top-t.top-h.top;this.cropped&&!this.disabled&&(ct(this.viewBoxImage,rt({width:d,height:l},Lt(rt({translateX:-p,translateY:-m},h)))),ot(this.previews,function(t){var e=gt(t,f),i=e.width,a=e.height,n=i,o=a,r=1;s&&(o=c*(r=i/s)),c&&av&&(B.x=v-m);break;case H:c+B.xw&&(B.y=w-u)}}var x,M,C,D=r[Object.keys(r)[0]],B={x:D.endX-D.startX,y:D.endY-D.startY};switch(h){case O:c+=B.x,d+=B.y;break;case N:if(0<=B.x&&(v<=m||s&&(d<=f||w<=u))){b=!1;break}y(N),(l+=B.x)<0&&(h=H,c-=l=-l),s&&(p=l/s,d+=(o.height-p)/2);break;case z:if(B.y<=0&&(d<=f||s&&(c<=g||v<=m))){b=!1;break}y(z),p-=B.y,d+=B.y,p<0&&(h=L,d-=p=-p),s&&(l=p*s,c+=(o.width-l)/2);break;case H:if(B.x<=0&&(c<=g||s&&(d<=f||w<=u))){b=!1;break}y(H),l-=B.x,c+=B.x,l<0&&(h=N,c-=l=-l),s&&(p=l/s,d+=(o.height-p)/2);break;case L:if(0<=B.y&&(w<=u||s&&(c<=g||v<=m))){b=!1;break}y(L),(p+=B.y)<0&&(h=z,d-=p=-p),s&&(l=p*s,c+=(o.width-l)/2);break;case Y:if(s){if(B.y<=0&&(d<=f||v<=m)){b=!1;break}y(z),p-=B.y,d+=B.y,l=p*s}else y(z),y(N),!(0<=B.x)||m or element.");this.element=t,this.options=rt({},Z,et(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,e,a;return t=i,a=[{key:"noConflict",value:function(){return window.Cropper=$t,i}},{key:"setDefaults",value:function(t){rt(Z,et(t)&&t)}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[d]){if(e[d]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,r,h,s,c=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?$.test(t)?Q.test(t)?this.read((a=t.replace(Rt,""),n=atob(a),o=new ArrayBuffer(n.length),ot(r=new Uint8Array(o),function(t,e){r[e]=n.charCodeAt(e)}),o)):this.clone():(h=new XMLHttpRequest,s=this.clone.bind(this),this.reloading=!0,(this.xhr=h).onabort=s,h.onerror=s,h.ontimeout=s,h.onprogress=function(){h.getResponseHeader("content-type")!==U&&h.abort()},h.onload=function(){c.read(h.response)},h.onloadend=function(){c.reloading=!1,c.xhr=null},i.checkCrossOrigin&&Nt(t)&&e.crossOrigin&&(t=Ht(t)),h.open("GET",t),h.responseType="arraybuffer",h.withCredentials="use-credentials"===e.crossOrigin,h.send()):this.clone())}},{key:"read",value:function(t){var e,i=this.options,a=this.imageData,n=St(t),o=0,r=1,h=1;1
',r=(o=n.querySelector(".".concat(d,"-container"))).querySelector(".".concat(d,"-canvas")),h=o.querySelector(".".concat(d,"-drag-box")),c=(s=o.querySelector(".".concat(d,"-crop-box"))).querySelector(".".concat(d,"-face")),this.container=a,this.cropper=o,this.canvas=r,this.dragBox=h,this.cropBox=s,this.viewBox=o.querySelector(".".concat(d,"-view-box")),this.face=c,r.appendChild(i),dt(t,A),a.insertBefore(o,t.nextSibling),this.isImg||lt(i,l),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,dt(s,A),e.guides||dt(s.getElementsByClassName("".concat(d,"-dashed")),A),e.center||dt(s.getElementsByClassName("".concat(d,"-center")),A),e.background&&dt(o,"".concat(d,"-bg")),e.highlight||dt(c,p),e.cropBoxMovable&&(dt(c,u),ft(c,g,O)),e.cropBoxResizable||(dt(s.getElementsByClassName("".concat(d,"-line")),A),dt(s.getElementsByClassName("".concat(d,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),it(e.ready)&&kt(t,"ready",e.ready,{once:!0}),Ot(t,"ready"))}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),lt(this.element,A))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(t.prototype,e),a&&n(t,a),i}();return rt(Qt.prototype,At,jt,It,Pt,Ut,qt),Qt}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e()}(this,function(){"use strict";function e(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function B(a){for(var t=1;tt.length)&&(e=t.length);for(var i=0,a=new Array(e);it.width?3===i?a=t.height*h:e=t.width/h:3===i?e=t.width/h:a=t.height*h;e={aspectRatio:h,naturalWidth:n,naturalHeight:o,width:a,height:e};this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=rt({},e)},limitCanvas:function(t,e){var i,a=this.options,n=this.containerData,o=this.canvasData,h=this.cropBoxData,r=a.viewMode,s=o.aspectRatio,c=this.cropped&&h;t&&(t=Number(a.minCanvasWidth)||0,i=Number(a.minCanvasHeight)||0,1=n.width&&(o.minLeft=Math.min(0,i),o.maxLeft=Math.max(0,i)),o.height>=n.height&&(o.minTop=Math.min(0,e),o.maxTop=Math.max(0,e))))):(o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height))},renderCanvas:function(t,e){var i,a,n=this.canvasData,o=this.imageData;e&&(i=(a=function(t){var e=t.width,i=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))return{width:i,height:e};var n=a%90*Math.PI/180,o=Math.sin(n),t=Math.cos(n),n=e*t+i*o,t=e*o+i*t;return 90n.maxWidth||n.widthn.maxHeight||n.heighte.width?t.height=t.width/i:t.width=t.height*i),this.cropBoxData=t,this.limitCropBox(!0,!0),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),t.width=Math.max(t.minWidth,t.width*a),t.height=Math.max(t.minHeight,t.height*a),t.left=e.left+(e.width-t.width)/2,t.top=e.top+(e.height-t.height)/2,t.oldLeft=t.left,t.oldTop=t.top,this.initialCropBoxData=rt({},t)},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,h=this.canvasData,r=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(i=Number(n.minCropBoxWidth)||0,a=Number(n.minCropBoxHeight)||0,t=s?Math.min(o.width,h.width,h.width+h.left,o.width-h.left):o.width,n=s?Math.min(o.height,h.height,h.height+h.top,o.height-h.top):o.height,i=Math.min(i,o.width),a=Math.min(a,o.height),c&&(i&&a?ii.maxWidth||i.widthi.maxHeight||i.height=e.width&&i.height>=e.height?E:k),lt(this.cropBox,rt({width:i.width,height:i.height},Ht({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Bt(this.element,y,this.getData())}},St={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),ht(this.previews=o,function(t){var e=document.createElement("img");wt(t,f,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){ht(this.previews,function(t){var e=vt(t,f);lt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(e,i){if(tt(e[i]))try{delete e[i]}catch(t){e[i]=void 0}else if(e.dataset)try{delete e.dataset[i]}catch(t){e.dataset[i]=void 0}else e.removeAttribute("data-".concat(ft(i)))}(t,f)})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,r=e.width,s=e.height,c=h.width,d=h.height,l=e.left-t.left-h.left,p=e.top-t.top-h.top;this.cropped&&!this.disabled&&(lt(this.viewBoxImage,rt({width:c,height:d},Ht(rt({translateX:-l,translateY:-p},h)))),ht(this.previews,function(t){var e=vt(t,f),i=e.width,a=e.height,n=i,o=a,e=1;r&&(o=s*(e=i/r)),s&&aMath.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),h=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(ht(o,function(t,e){o[e]=t*n})),this.setCropBoxData(ht(h,function(t,e){h[e]=t*n})))))},dblclick:function(){var t,e;this.disabled||this.options.dragMode===b||this.setDragMode((t=this.dragBox,e=s,(t.classList?t.classList.contains(e):-1f&&(D.x=f-p);break;case N:s+D.xv&&(D.y=v-m)}}var y,x,M,C=o[Object.keys(o)[0]],D={x:C.endX-C.startX,y:C.endY-C.startY};switch(h){case k:s+=D.x,c+=D.y;break;case H:if(0<=D.x&&(f<=p||r&&(c<=g||v<=m))){w=!1;break}b(H),(d+=D.x)<0&&(h=N,s-=d=-d),r&&(c+=(n.height-(l=d/r))/2);break;case z:if(D.y<=0&&(c<=g||r&&(s<=u||f<=p))){w=!1;break}b(z),l-=D.y,c+=D.y,l<0&&(h=L,c-=l=-l),r&&(s+=(n.width-(d=l*r))/2);break;case N:if(D.x<=0&&(s<=u||r&&(c<=g||v<=m))){w=!1;break}b(N),d-=D.x,s+=D.x,d<0&&(h=H,s-=d=-d),r&&(c+=(n.height-(l=d/r))/2);break;case L:if(0<=D.y&&(v<=m||r&&(s<=u||f<=p))){w=!1;break}b(L),(l+=D.y)<0&&(h=z,c-=l=-l),r&&(s+=(n.width-(d=l*r))/2);break;case Y:if(r){if(D.y<=0&&(c<=g||f<=p)){w=!1;break}b(z),l-=D.y,c+=D.y,d=l*r}else b(z),b(H),!(0<=D.x)||pMath.abs(M)&&(M=i)})}),M),t),w=!1;break;case O:if(!D.x||!D.y){w=!1;break}y=kt(this.cropper),s=C.startX-y.left,c=C.startY-y.top,d=n.minWidth,l=n.minHeight,0 or element.");this.element=t,this.options=rt({},G,it(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,e,a;return t=i,a=[{key:"noConflict",value:function(){return window.Cropper=jt,i}},{key:"setDefaults",value:function(t){rt(G,it(t)&&t)}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,h,r=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?Q.test(t)?K.test(t)?this.read((h=(h=t).replace(Yt,""),a=atob(h),h=new ArrayBuffer(a.length),ht(n=new Uint8Array(h),function(t,e){n[e]=a.charCodeAt(e)}),h)):this.clone():(o=new XMLHttpRequest,h=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=h,o.onerror=h,o.ontimeout=h,o.onprogress=function(){o.getResponseHeader("content-type")!==q&&o.abort()},o.onload=function(){r.read(o.response)},o.onloadend=function(){r.reloading=!1,r.xhr=null},i.checkCrossOrigin&&Et(t)&&e.crossOrigin&&(t=Wt(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone())}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=Xt(t),n=0,o=1,h=1;1
',o=(n=s.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),h=n.querySelector(".".concat(c,"-drag-box")),s=(r=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=h,this.cropBox=r,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),pt(t,A),a.insertBefore(n,t.nextSibling),this.isImg||mt(i,l),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,pt(r,A),e.guides||pt(r.getElementsByClassName("".concat(c,"-dashed")),A),e.center||pt(r.getElementsByClassName("".concat(c,"-center")),A),e.background&&pt(n,"".concat(c,"-bg")),e.highlight||pt(s,p),e.cropBoxMovable&&(pt(s,u),wt(s,g,k)),e.cropBoxResizable||(pt(r.getElementsByClassName("".concat(c,"-line")),A),pt(r.getElementsByClassName("".concat(c,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),at(e.ready)&&Dt(t,"ready",e.ready,{once:!0}),Bt(t,"ready"))}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),mt(this.element,A))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(t.prototype,e),a&&n(t,a),i}();return rt(It.prototype,Rt,St,r,o,t,At),It}); \ No newline at end of file diff --git a/snow-admin/src/main/resources/static/img/profile.jpg b/snow-admin/src/main/resources/static/img/profile.jpg index b3a940b..636f272 100644 Binary files a/snow-admin/src/main/resources/static/img/profile.jpg and b/snow-admin/src/main/resources/static/img/profile.jpg differ diff --git a/snow-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/snow-admin/src/main/resources/static/ruoyi/js/ry-ui.js index df96aff..a0a1697 100644 --- a/snow-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/snow-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -1202,6 +1202,34 @@ var table = { $.operate.submit(url, "post", "json", data); }); }, + + mark: function(id) { + table.set(); + $.modal.confirm("确定标记该条" + table.options.modalName + "信息吗?", function() { + var url = $.common.isEmpty(id) ? table.options.markUrl : table.options.markUrl.replace("{id}", id); + if(table.options.type == table_type.bootstrapTreeTable) { + $.operate.get(url); + } else { + var data = { "ids": id }; + $.operate.submit(url, "post", "json", data); + } + }); + + }, + // 批量标记信息 + markAll: function() { + table.set(); + var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + $.modal.confirm("确认要标记选中的" + rows.length + "条数据吗?", function() { + var url = table.options.markUrl; + var data = { "ids": rows.join() }; + $.operate.submit(url, "post", "json", data); + }); + }, // 发布信息 deployment: function(id,type) { table.set(); diff --git a/snow-admin/src/main/resources/templates/include.html b/snow-admin/src/main/resources/templates/include.html index 150e295..2931951 100644 --- a/snow-admin/src/main/resources/templates/include.html +++ b/snow-admin/src/main/resources/templates/include.html @@ -100,10 +100,10 @@
- +
- +
diff --git a/snow-admin/src/main/resources/templates/system/messageCenter/detail.html b/snow-admin/src/main/resources/templates/system/messageCenter/detail.html new file mode 100644 index 0000000..35870d3 --- /dev/null +++ b/snow-admin/src/main/resources/templates/system/messageCenter/detail.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + +
+
+ +
+ +
+
+

+ [[${sysMessageTransition.sysMessageTemplate.templateName}]] +

+
+ +
+
+
+

      [[${sysMessageTransition.messageContent}]]

+ 查看详情 +
+
+ [[${#dates.format(sysMessageTransition.createTime, 'yyyy-MM-dd hh:mm:ss')}]] +
+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/snow-admin/src/main/resources/templates/system/messageCenter/messageCenter.html b/snow-admin/src/main/resources/templates/system/messageCenter/messageCenter.html index 3e142e8..99efa24 100644 --- a/snow-admin/src/main/resources/templates/system/messageCenter/messageCenter.html +++ b/snow-admin/src/main/resources/templates/system/messageCenter/messageCenter.html @@ -2,6 +2,11 @@ + + + + +
@@ -98,6 +103,7 @@
+

流程待办

@@ -115,9 +121,7 @@

[[${todoTask.messageContent}]]

查看详情 -

- -

+

@@ -186,8 +190,30 @@
+ + + + + + + \ No newline at end of file diff --git a/snow-admin/src/main/resources/templates/system/user/profile/avatar.html b/snow-admin/src/main/resources/templates/system/user/profile/avatar.html index fdb7237..e473ff1 100644 --- a/snow-admin/src/main/resources/templates/system/user/profile/avatar.html +++ b/snow-admin/src/main/resources/templates/system/user/profile/avatar.html @@ -4,258 +4,258 @@ -
-
-
- +
+
+
+ +
+
+ + + + + + + + +
-
- - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/snow-common/src/main/java/com/snow/common/enums/MessageEventType.java b/snow-common/src/main/java/com/snow/common/enums/MessageEventType.java index 842033c..ba7cce1 100644 --- a/snow-common/src/main/java/com/snow/common/enums/MessageEventType.java +++ b/snow-common/src/main/java/com/snow/common/enums/MessageEventType.java @@ -25,7 +25,7 @@ public enum MessageEventType { INNER_SYS_TODO_TASK("INNER_SYS_TODO_TASK", "站内信系统任务待办"), - INNER_SYS_TASK_COMPLETE("INNER_SYS_TASK_COMPLETE", "站内信系统任务待办"), + INNER_SYS_TASK_COMPLETE("INNER_SYS_TASK_COMPLETE", "站内信系统任务完成"), ; diff --git a/snow-framework/src/main/java/com/snow/framework/storage/StorageService.java b/snow-framework/src/main/java/com/snow/framework/storage/StorageService.java index 85a903f..b474949 100644 --- a/snow-framework/src/main/java/com/snow/framework/storage/StorageService.java +++ b/snow-framework/src/main/java/com/snow/framework/storage/StorageService.java @@ -53,14 +53,14 @@ public class StorageService { String fileName = file.getOriginalFilename(); String contentType = file.getContentType(); long size = file.getSize(); - String key = generateKey(fileName); + String key = IdUtil.fastSimpleUUID(); storage.store(key,file); String url = generateUrl(key); SysFile storageInfo = new SysFile(); storageInfo.setName(fileName); storageInfo.setSize(size); storageInfo.setType(contentType); - storageInfo.setKey(key.substring(0,key.indexOf(","))); + storageInfo.setKey(key); storageInfo.setUrl(url); storageInfo.setCreateBy(ShiroUtils.getLoginName()); sysFileService.insertSysFile(storageInfo); @@ -68,17 +68,6 @@ public class StorageService { return storageInfo; } - private String generateKey(String originalFilename) { - int index = originalFilename.lastIndexOf('.'); - String suffix; - if(index==-1){ - suffix="profile"; - }else { - suffix = originalFilename.substring(index); - } - return IdUtil.fastSimpleUUID() + suffix; - } - public Stream loadAll() { return storage.loadAll(); } diff --git a/snow-system/src/main/java/com/snow/system/service/ISysMessageTransitionService.java b/snow-system/src/main/java/com/snow/system/service/ISysMessageTransitionService.java index 2aa24d0..b18163d 100644 --- a/snow-system/src/main/java/com/snow/system/service/ISysMessageTransitionService.java +++ b/snow-system/src/main/java/com/snow/system/service/ISysMessageTransitionService.java @@ -20,6 +20,11 @@ public interface ISysMessageTransitionService public SysMessageTransition selectSysMessageTransitionById(Long id); + /** + * 获取消息是否已读 + * @param sysMessageTransition + * @return + */ public Boolean getIsRead(SysMessageTransition sysMessageTransition); /** @@ -72,6 +77,11 @@ public interface ISysMessageTransitionService public int deleteSysMessageTransitionById(Long id); + /** + * 删除消息 + * @param outsideIdList + * @return + */ public int deleteSysMessageTransitionByOutsideId(List outsideIdList); diff --git a/snow-system/src/main/java/com/snow/system/service/impl/SysMessageTransitionServiceImpl.java b/snow-system/src/main/java/com/snow/system/service/impl/SysMessageTransitionServiceImpl.java index f89aaea..69cceb1 100644 --- a/snow-system/src/main/java/com/snow/system/service/impl/SysMessageTransitionServiceImpl.java +++ b/snow-system/src/main/java/com/snow/system/service/impl/SysMessageTransitionServiceImpl.java @@ -42,7 +42,12 @@ public class SysMessageTransitionServiceImpl implements ISysMessageTransitionSer @Override public SysMessageTransition selectSysMessageTransitionById(Long id) { - return sysMessageTransitionMapper.selectSysMessageTransitionById(id); + SysMessageTransition sysMessageTransition = sysMessageTransitionMapper.selectSysMessageTransitionById(id); + sysMessageTransition.setProducerUser(sysUserService.selectUserById(Long.parseLong(sysMessageTransition.getProducerId()))); + sysMessageTransition.setConsumerUser(sysUserService.selectUserById(Long.parseLong(sysMessageTransition.getConsumerId()))); + sysMessageTransition.setSpendTime(DateUtil.formatBetween(sysMessageTransition.getCreateTime(), new Date(), BetweenFormater.Level.SECOND)+"前"); + Optional.ofNullable(sysMessageTransition.getTemplateCode()).ifPresent( m-> sysMessageTransition.setSysMessageTemplate(sysMessageTemplateService.getSysMessageTemplateByCode(sysMessageTransition.getTemplateCode()))); + return sysMessageTransition; }