修改站内消息

This commit is contained in:
459816669@qq.com 2022-05-14 17:01:26 +08:00
parent 63b9907eb9
commit ec3f0bd7f6
20 changed files with 974 additions and 344 deletions

View File

@ -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<SysMessageTransition> 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<String> 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));
}
}

View File

@ -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());
}
}

View File

@ -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

View File

@ -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;
}

View File

@ -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);
};
}));

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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}
* 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}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 223 KiB

View File

@ -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();

View File

@ -100,10 +100,10 @@
<!-- cropper图像裁剪插件 -->
<div th:fragment="cropper-css">
<link th:href="@{/ajax/libs/cropper/cropper.min.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/cropper/cropper.min.css?v=1.5.12}" rel="stylesheet"/>
</div>
<div th:fragment="cropper-js">
<script th:src="@{/ajax/libs/cropper/cropper.min.js}"></script>
<script th:src="@{/ajax/libs/cropper/cropper.min.js?v=1.5.12}"></script>
</div>
<!-- jasny功能扩展插件 -->

View File

@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />
<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" />
<!-- bootstrap-table 表格插件样式 -->
<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet" />
<link th:href="@{/css/style.css}" rel="stylesheet" />
<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet" />
</head>
<body class="white-bg" >
<form class="form-horizontal m-t" id="signupForm">
<div id="vertical-timeline5" class="vertical-container light-timeline">
<div class="pull-left">
<label th:switch="${sysMessageTransition.messageReadStatus}">
<span class="label label-danger" th:case="'0'">未读</span>
<span class="label label-success" th:case="'1'">已读</span>
</label>
</div>
<div class="text-center article-title">
<h1>
[[${sysMessageTransition.sysMessageTemplate.templateName}]]
</h1>
</div>
<div class="vertical-timeline-block">
<hr>
<div class="vertical-timeline-content">
<p >&nbsp;&nbsp; <span class="text-danger"><i th:class="${sysMessageTransition.iconClass}"></i> </span> &nbsp;&nbsp; [[${sysMessageTransition.messageContent}]]</p>
<a href="javascript:void(0)" class="btn btn-sm btn-success" th:onclick="messageDetail([[${sysMessageTransition.id}]],[[${sysMessageTransition.pcUrl}]]);"> 查看详情 </a>
</div>
<div class="pull-right">
<span class="text-muted"><i class="fa fa-clock-o"></i> [[${#dates.format(sysMessageTransition.createTime, 'yyyy-MM-dd hh:mm:ss')}]]</span>
</div>
<br/>
<hr>
</div>
</div>
</form>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
function messageDetail(id,url){
//先标记为已读
markRead(id);
//在跳转到页面
createNoPanelMenuItem(url,"详情")
}
function markRead(id){
var config = {
url: "/system/messageCenter/remarkRead",
type: "post",
dataType: "json",
data: {
"id":id
},
success: function(result) {
if (typeof callback == "function") {
callback(result);
}
if (result.code == web_status.SUCCESS) {
$(".messageReadStatus badge badge-primary").show();
$(".messageReadStatus badge badge-danger").hide();
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
}
};
$.ajax(config)
}
</script>
</body>
</html>

View File

@ -2,6 +2,11 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('消息中心')" />
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
<link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/layui/layui.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeIn">
@ -98,6 +103,7 @@
<div id="tab-3" class="tab-pane">
<div class="panel-body">
<h3>流程待办</h3>
<div id="vertical-timeline2" class="vertical-container light-timeline" th:each="todoTask,iterStat : ${todoTaskList}">
<div class="vertical-timeline-block">
@ -115,9 +121,7 @@
</p>
<p >[[${todoTask.messageContent}]]</p>
<a href="javascript:void(0)" class="btn btn-sm btn-success" th:onclick="messageDetail([[${todoTask.id}]],[[${todoTask.pcUrl}]]);"> 查看详情 </a>
<p>
<!--<small class="badge badge-warning"> <i class="fa fa-clock-o"></i>[[${todoTask.spendTime}]]</small>-->
</p>
<div id="footPage" style="text-align: center;"></div>
</div>
<hr>
</div>
@ -186,8 +190,30 @@
</div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script th:src="@{/ruoyi/js/ry-ui.js}"></script>
<script th:inline="javascript">
layui.use('laypage', function(){
var laypage = layui.laypage;
laypage.render({
elem: 'footPage'
,count: [[${dataTable.total}]]
,curr: function(){ //通过url获取当前页也可以同上pages方式获取
var page = location.search.match(/pageNum=(\d+)/);
return page ? page[1] : 1;
}()
,jump: function(obj, first){
//首次不执行
if(!first){
window.location.href="?pageNum="+obj.curr+"&pageSize=10"
}
}
});
});
function messageDetail(id,url){
//先标记为已读
@ -200,7 +226,6 @@
area : ["70%", "80%"],
content : [url, 'yes']
})
}
function markRead(id){

View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('消息中心')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li class="select-time">
<label>消息时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<label>消息状态:</label>
<select name="messageReadStatus" >
<option value="">请选择</option>
<option value="0">未读</option>
<option value="1">已读</option>
</select>
</li>
<li>
<label>消息类型:</label>
<select name="messageType" th:with="type=${@dict.getType('sys_oa_message_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success multiple disabled" onclick="$.operate.markAll()" shiro:hasPermission="system:messageCenter:mark">
<i class="fa fa-mars-stroke"></i> 标记已读
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:messageCenter:remove">
<i class="fa fa-remove"></i> 删除
</a>
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:payment:export">
<i class="fa fa-download"></i> 导出
</a>-->
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var removeFlag = [[${@permission.hasPermi('system:messageCenter:remove')}]];
var markFlag = [[${@permission.hasPermi('system:messageCenter:mark')}]];
var detailFlag = [[${@permission.hasPermi('system:messageCenter:detail')}]];
var messageType = [[${@dict.getType('sys_oa_message_type')}]];
var messageReadType = [[${@dict.getType('sys_message_read_flag')}]];
var prefix = ctx + "system/messageCenter";
$(function() {
var options = {
url: prefix + "/list",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
markUrl:prefix+"/mark",
modalName: "消息中心",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'id',
visible: false
},
{
field: 'messageType',
title: '消息类型',
formatter: function(value, row, index) {
return "<i class='text-danger "+row.iconClass+"'></i> "+ $.table.selectDictLabel(messageType, value);
}
},
{
field: 'consumerUser.userName',
title: '生产者'
},
{
field: 'messageContent',
title: '消息内容',
formatter: function(value, row, index) {
return $.table.tooltip(value);
}
},
{
field: 'messageReadStatus',
title: '消息状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(messageReadType, value);
}
},
{
field: 'spendTime',
title: '消息时间'
},
{
field: 'createTime',
title: '创建时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.messageReadStatus==0){
actions.push('<a class="btn btn-success btn-xs ' + markFlag + '" href="javascript:void(0)" onclick="$.operate.mark(\'' + row.id + '\')"><i class="fa fa-mars-stroke"></i>标记已读</a> ');
}
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="messageDetail(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function messageDetail(id) {
$.modal.openTab('消息详情', "/system/messageCenter/detail/"+id);
}
</script>
</body>
</html>

View File

@ -4,258 +4,258 @@
<th:block th:include="include :: header('修改用户头像')" />
<th:block th:include="include :: cropper-css" />
<style type='text/css'>
/* avator css start */
.container {
margin: 10px 5px 5px 5px;
}
.action {
padding: 5px 0px;
}
.cropped {
width: 200px;
border: 1px #ddd solid;
box-shadow: 0px 0px 12px #ddd;
}
.img-preview {
border-radius: 50%;
box-shadow: 0px 0px 12px #7e7e7e;
display: inline-block;
}
.preview-box {
text-align: center;
margin: 0px auto;
margin-top: 10px;
color: #bbb;
}
.preview-md {
width: 128px;
height: 128px;
}
.preview-sm {
width: 96px;
height: 96px;
}
.preview-xs {
width: 64px;
height: 64px;
}
.imageBox {
border: 1px solid #aaa;
overflow: hidden;
cursor: move;
box-shadow: 4px 4px 12px #B0B0B0;
margin: 0px auto;
}
.btn-custom {
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;
}
/* avator css end */
/* avator css start */
.container {
margin: 10px 5px 5px 5px;
}
.action {
padding: 5px 0px;
}
.cropped {
width: 200px;
border: 1px #ddd solid;
box-shadow: 0px 0px 12px #ddd;
}
.img-preview {
border-radius: 50%;
box-shadow: 0px 0px 12px #7e7e7e;
display: inline-block;
}
.preview-box {
text-align: center;
margin: 0px auto;
margin-top: 10px;
color: #bbb;
}
.preview-md {
width: 128px;
height: 128px;
}
.preview-sm {
width: 96px;
height: 96px;
}
.preview-xs {
width: 64px;
height: 64px;
}
.imageBox {
border: 1px solid #aaa;
overflow: hidden;
cursor: move;
box-shadow: 4px 4px 12px #B0B0B0;
margin: 0px auto;
}
.btn-custom {
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;
}
/* avator css end */
</style>
</head>
<body class="white-bg">
<div class="row container">
<div class="col-md-10">
<div class="imageBox">
<img id="avatar" th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="'this.src=\'' + @{'/img/profile.jpg'} + '\''">
<div class="row container">
<div class="col-md-10">
<div class="imageBox">
<img id="avatar" th:src="(${#strings.isEmpty(user.avatar)}) ? @{/img/profile.jpg} : @{${user.avatar}}" th:onerror="'this.src=\'' + @{'/img/profile.jpg'} + '\''">
</div>
<div class="action">
<div class="new-contentarea tc">
<a href="javascript:void(0)" class="upload-img"><label for="inputImage">上传图像</label> </a>
<input type="file" name="avatar" id="inputImage" accept="image/*"/>
</div>
<button type="button" class="btn-custom" data-method="zoom" data-option="0.1"><i class="fa fa-search-plus"></i></button>
<button type="button" class="btn-custom" data-method="zoom" data-option="-0.1"><i class="fa fa-search-minus"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="-45"><i class="fa fa-rotate-left"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="45"><i class="fa fa-rotate-right"></i></button>
<button type="button" class="btn-custom" data-method="scaleX" data-option="-1"><i class="fa fa-arrows-h"></i></button>
<button type="button" class="btn-custom" data-method="scaleY" data-option="-1"><i class="fa fa-arrows-v"></i></button>
<button type="button" class="btn-custom" data-method="reset"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="action">
<div class="new-contentarea tc">
<a href="javascript:void(0)" class="upload-img"><label for="inputImage">上传图像</label> </a>
<input type="file" name="avatar" id="inputImage" accept="image/*"/>
</div>
<button type="button" class="btn-custom" data-method="zoom" data-option="0.1"><i class="fa fa-search-plus"></i></button>
<button type="button" class="btn-custom" data-method="zoom" data-option="-0.1"><i class="fa fa-search-minus"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="-45"><i class="fa fa-rotate-left"></i></button>
<button type="button" class="btn-custom" data-method="rotate" data-option="45"><i class="fa fa-rotate-right"></i></button>
<button type="button" class="btn-custom" data-method="scaleX" data-option="-1"><i class="fa fa-arrows-h"></i></button>
<button type="button" class="btn-custom" data-method="scaleY" data-option="-1"><i class="fa fa-arrows-v"></i></button>
<button type="button" class="btn-custom" data-method="reset"><i class="fa fa-refresh"></i></button>
</div>
</div>
<div class="col-md-2">
<div class="cropped">
<div class="preview-box">
<div class="img-preview preview-xs"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-sm"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-md"></div>
<div class="col-md-2">
<div class="cropped">
<div class="preview-box">
<div class="img-preview preview-xs"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-sm"></div>
</div>
<div class="preview-box">
<div class="img-preview preview-md"></div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: cropper-js" />
<script type="text/javascript">
var cropper;
var croppable = false;
$(window).load(function() {
var image = document.getElementById('avatar');
cropper = new Cropper(image, {
aspectRatio: 1,
viewMode: 1,
autoCropArea: 0.9,
preview: '.img-preview',
ready: function () {
croppable = true;
}
})
var cropper;
var croppable = false;
$(window).on('load', function() {
var image = document.getElementById('avatar');
cropper = new Cropper(image, {
aspectRatio: 1,
viewMode: 1,
autoCropArea: 0.9,
preview: '.img-preview',
ready: function () {
croppable = true;
}
})
$('#inputImage').on('change', function() {
var reader = new FileReader();
var file = $('#inputImage')[0].files[0];
if (/^image\/\w+$/.test(file.type)) {
reader.onload = function(e) {
if(croppable){
cropper.replace(e.target.result)
}
}
reader.readAsDataURL(this.files[0]);
} else {
$.modal.alertWarning('请选择一个图片文件。');
}
});
$('#inputImage').on('change', function() {
var reader = new FileReader();
var file = $('#inputImage')[0].files[0];
if (/^image\/\w+$/.test(file.type)) {
reader.onload = function(e) {
if(croppable){
cropper.replace(e.target.result)
}
}
reader.readAsDataURL(this.files[0]);
} else {
$.modal.alertWarning('请选择一个图片文件。');
}
});
$('.btn-custom').on('click',function (e) {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍后...");
return;
}
var data = {
method: $(this).data('method'),
option: $(this).data('option') || undefined,
};
var result = cropper[data.method](data.option, data.secondOption);
if(['scaleX','scaleY'].indexOf(data.method) !== -1){
$(this).data('option', -data.option)
$('.btn-custom').on('click',function (e) {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍候...");
return;
}
var data = {
method: $(this).data('method'),
option: $(this).data('option') || undefined,
};
var result = cropper[data.method](data.option, data.secondOption);
if(['scaleX','scaleY'].indexOf(data.method) !== -1){
$(this).data('option', -data.option)
}
})
});
function submitHandler() {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍候...");
return
}
cropper.getCroppedCanvas().toBlob(function(img) {
var formdata = new FormData();
formdata.append("avatarfile", img);
$.ajax({
url: ctx + "system/user/profile/updateAvatar",
data: formdata,
type: "post",
processData: false,
contentType: false,
success: function(result) {
$.operate.saveReload(result);
}
})
});
}
function submitHandler() {
if (!croppable) {
$.modal.alertWarning("裁剪框加载中,请稍后...");
return
}
cropper.getCroppedCanvas().toBlob(function(img) {
var formdata = new FormData();
formdata.append("avatarfile", img);
$.ajax({
url: ctx + "system/user/profile/updateAvatar",
data: formdata,
type: "post",
processData: false,
contentType: false,
success: function(result) {
$.operate.saveSuccess(result);
$(window).resize(function() {
$('.imageBox').height($(window).height() - 80);
$('.cropped').height($(window).height() - 40);
}).resize();
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function(callback, type, quality) {
var canvas = this;
setTimeout(function() {
var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]);
var len = binStr.length;
var arr = new Uint8Array(len);
for (var i = 0; i < len; i++) {
arr[i] = binStr.charCodeAt(i);
}
})
});
}
$(window).resize(function() {
$('.imageBox').height($(window).height() - 80);
$('.cropped').height($(window).height() - 40);
}).resize();
if (!HTMLCanvasElement.prototype.toBlob) {
Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
value: function(callback, type, quality) {
var canvas = this;
setTimeout(function() {
var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]);
var len = binStr.length;
var arr = new Uint8Array(len);
for (var i = 0; i < len; i++) {
arr[i] = binStr.charCodeAt(i);
}
callback(new Blob([arr], {
type: type || 'image/png'
}));
});
}
});
}
callback(new Blob([arr], {
type: type || 'image/png'
}));
});
}
});
}
</script>
</body>
</html>

View File

@ -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", "站内信系统任务完成"),
;

View File

@ -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<Path> loadAll() {
return storage.loadAll();
}

View File

@ -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);

View File

@ -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;
}