Commit c6d3e823 by liuhulu

Merge branch 'master' of https://gitee.com/y_project/RuoYi.git

parents 4472dd7b 399b20f9
......@@ -86,12 +86,6 @@
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- thymeleaf网页解析 -->
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
......
......@@ -1032,7 +1032,7 @@ varchar(50) default ''
<text x='792' y='528' text-anchor='end' class='colType'>t</text> <a xlink:href='#sys_user_online.status'><text id='ry.sys_user_online.status' x='678' y='546'>status</text><title>status
varchar(10) default ''
在线状态on_line在线off_line离线</title></a>
<text x='792' y='543' text-anchor='end' class='colType'>t</text> <use id='nn' x='662' y='552' xlink:href='#nn'/><a xlink:href='#sys_user_online.start_timestsamp'><text id='ry.sys_user_online.start_timestsamp' x='678' y='561'>start_timestsamp</text><title>start_timestsamp
<text x='792' y='543' text-anchor='end' class='colType'>t</text> <use id='nn' x='662' y='552' xlink:href='#nn'/><a xlink:href='#sys_user_online.start_timestamp'><text id='ry.sys_user_online.start_timestamp' x='678' y='561'>start_timestamp</text><title>start_timestamp
* timestamp default CURRENT_TIMESTAMP
session创建时间</title></a>
<text x='792' y='558' text-anchor='end' class='colType'>d</text> <use id='nn' x='662' y='567' xlink:href='#nn'/><a xlink:href='#sys_user_online.last_access_time'><text id='ry.sys_user_online.last_access_time' x='678' y='576'>last_access_time</text><title>last_access_time
......@@ -2811,7 +2811,7 @@ varchar(1)</title></a>
</tr>
<tr>
<td>*</td>
<td><a name='sys_user_online.start_timestsamp'>start&#95;timestsamp</a></td>
<td><a name='sys_user_online.start_timestamp'>start&#95;timestsamp</a></td>
<td> timestamp DEFAULT CURRENT_TIMESTAMP </td>
<td> session创建时间 </td>
</tr>
......
......@@ -3655,8 +3655,8 @@ TableComment 0 新宋体,8,N</a:FontList>
</o:Column>
<o:Column Id="o163">
<a:ObjectID>0CAF2F1F-459F-4F78-9075-D95F924A4FF7</a:ObjectID>
<a:Name>start_timestsamp</a:Name>
<a:Code>start_timestsamp</a:Code>
<a:Name>start_timestamp</a:Name>
<a:Code>start_timestamp</a:Code>
<a:CreationDate>1524449375</a:CreationDate>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1524449375</a:ModificationDate>
......
......@@ -130,12 +130,12 @@ create table sys_menu (
menu_id int(11) not null auto_increment comment '菜单ID',
menu_name varchar(50) not null comment '菜单名称',
parent_id int(11) default 0 comment '父菜单ID',
order_num int(4) default null comment '显示顺序',
url varchar(200) default '' comment '请求地址',
order_num int(4) default 0 comment '显示顺序',
url varchar(200) default '#' comment '请求地址',
menu_type char(1) default '' comment '菜单类型(M目录 C菜单 F按钮)',
visible char(1) not null comment '菜单状态(0显示 1隐藏)',
visible char(1) default 0 comment '菜单状态(0显示 1隐藏)',
perms varchar(100) default '' comment '权限标识',
icon varchar(100) default '' comment '菜单图标',
icon varchar(100) default '#' comment '菜单图标',
create_by varchar(64) default '' comment '创建者',
create_time datetime comment '创建时间',
update_by varchar(64) default '' comment '更新者',
......@@ -374,16 +374,16 @@ drop table if exists sys_oper_log;
create table sys_oper_log (
oper_id int(11) not null auto_increment comment '日志主键',
title varchar(50) default '' comment '模块标题',
action varchar(100) default '' comment '功能请求',
business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)',
method varchar(100) default '' comment '方法名称',
channel varchar(20) default '' comment '来源渠道(manage后台用户 mobile手机端用户 other其它)',
operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)',
oper_name varchar(50) default '' comment '操作人员',
dept_name varchar(50) default '' comment '部门名称',
oper_url varchar(255) default '' comment '请求URL',
oper_ip varchar(30) default '' comment '主机地址',
oper_location varchar(255) default '' comment '操作地点',
oper_param varchar(255) default '' comment '请求参数',
status char(1) default '0' comment '操作状态(0正常 1异常)',
status int(1) default 0 comment '操作状态(0正常 1异常)',
error_msg varchar(2000) default '' comment '错误消息',
oper_time datetime comment '操作时间',
primary key (oper_id)
......@@ -431,8 +431,8 @@ create table sys_dict_data
dict_label varchar(100) default '' comment '字典标签',
dict_value varchar(100) default '' comment '字典键值',
dict_type varchar(100) default '' comment '字典类型',
css_class varchar(500) default '' comment '样式属性',
list_class varchar(500) default '' comment '回显样式',
css_class varchar(500) default '' comment '样式属性(其他样式扩展)',
list_class varchar(500) default '' comment '表格回显样式',
is_default char(1) default 'N' comment '是否默认(Y是 N否)',
status char(1) default '0' comment '状态(0正常 1停用)',
create_by varchar(64) default '' comment '创建者',
......@@ -444,31 +444,31 @@ create table sys_dict_data
) engine=innodb auto_increment=100 default charset=utf8 comment = '字典数据表';
insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别男');
insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别女');
insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别未知');
insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', 'radio radio-info radio-inline', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '显示菜单');
insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', 'radio radio-danger radio-inline', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '隐藏菜单');
insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', 'radio radio-info radio-inline', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', 'radio radio-danger radio-inline', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', 'radio radio-info radio-inline', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', 'radio radio-danger radio-inline', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
insert into sys_dict_data values(10, 1, '是', 'Y', 'sys_yes_no', 'radio radio-info radio-inline', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认是');
insert into sys_dict_data values(11, 2, '否', 'N', 'sys_yes_no', 'radio radio-danger radio-inline', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认否');
insert into sys_dict_data values(12, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知');
insert into sys_dict_data values(13, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '公告');
insert into sys_dict_data values(14, 1, '正常', '0', 'sys_notice_status', 'radio radio-info radio-inline', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(15, 2, '关闭', '1', 'sys_notice_status', 'radio radio-danger radio-inline', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '关闭状态');
insert into sys_dict_data values(16, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(17, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(18, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(19, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(20, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(21, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(22, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(23, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(24, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(25, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
insert into sys_dict_data values(1, 1, '男', '0', 'sys_user_sex', '', '', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别男');
insert into sys_dict_data values(2, 2, '女', '1', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别女');
insert into sys_dict_data values(3, 3, '未知', '2', 'sys_user_sex', '', '', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '性别未知');
insert into sys_dict_data values(4, 1, '显示', '0', 'sys_show_hide', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '显示菜单');
insert into sys_dict_data values(5, 2, '隐藏', '1', 'sys_show_hide', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '隐藏菜单');
insert into sys_dict_data values(6, 1, '正常', '0', 'sys_normal_disable', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(7, 2, '停用', '1', 'sys_normal_disable', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
insert into sys_dict_data values(8, 1, '正常', '0', 'sys_job_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(9, 2, '暂停', '1', 'sys_job_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
insert into sys_dict_data values(10, 1, '是', 'Y', 'sys_yes_no', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认是');
insert into sys_dict_data values(11, 2, '否', 'N', 'sys_yes_no', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统默认否');
insert into sys_dict_data values(12, 1, '通知', '1', 'sys_notice_type', '', 'warning', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知');
insert into sys_dict_data values(13, 2, '公告', '2', 'sys_notice_type', '', 'success', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '公告');
insert into sys_dict_data values(14, 1, '正常', '0', 'sys_notice_status', '', 'primary', 'Y', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(15, 2, '关闭', '1', 'sys_notice_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '关闭状态');
insert into sys_dict_data values(16, 1, '新增', '1', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(17, 2, '修改', '2', 'sys_oper_type', '', 'info', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(18, 3, '删除', '3', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(19, 4, '授权', '4', 'sys_oper_type', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(20, 5, '导出', '5', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(21, 6, '导入', '6', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(22, 7, '强退', '7', 'sys_oper_type', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(23, 8, '生成代码', '8', 'sys_oper_type', '', 'warning', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '新增操作');
insert into sys_dict_data values(24, 1, '成功', '0', 'sys_common_status', '', 'primary', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '正常状态');
insert into sys_dict_data values(25, 2, '失败', '1', 'sys_common_status', '', 'danger', 'N', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '停用状态');
-- ----------------------------
......@@ -524,7 +524,7 @@ create table sys_user_online (
browser varchar(50) default '' comment '浏览器类型',
os varchar(50) default '' comment '操作系统',
status varchar(10) default '' comment '在线状态on_line在线off_line离线',
start_timestsamp datetime comment 'session创建时间',
start_timestamp datetime comment 'session创建时间',
last_access_time datetime comment 'session最后访问时间',
expire_time int(5) default 0 comment '超时时间,单位为分钟',
primary key (sessionId)
......
......@@ -19,22 +19,20 @@ public class AddressUtils
public static String getRealAddressByIP(String ip)
{
String address = "";
try
String address = "XX XX";
if (RuoYiConfig.isAddressEnabled())
{
if (RuoYiConfig.isAddressEnabled())
String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
if (StringUtils.isEmpty(rspStr))
{
address = HttpUtils.sendPost(IP_URL, "ip=" + ip);
JSONObject json = JSONObject.parseObject(address);
JSONObject object = json.getObject("data", JSONObject.class);
String region = object.getString("region");
String city = object.getString("city");
address = region + " " + city;
log.error("获取地理位置异常 {}", ip);
return address;
}
}
catch (Exception e)
{
log.error("获取地理位置异常:", e);
JSONObject obj = JSONObject.parseObject(rspStr);
JSONObject data = obj.getObject("data", JSONObject.class);
String region = data.getString("region");
String city = data.getString("city");
address = region + " " + city;
}
return address;
}
......
package com.ruoyi.common.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.project.monitor.logininfor.domain.Logininfor;
import com.ruoyi.project.monitor.logininfor.service.LogininforServiceImpl;
import eu.bitwalker.useragentutils.UserAgent;
/**
* 记录用户日志信息
*
* @author ruoyi
*/
@Deprecated // 加入异步功能之后,该类已无意义
public class SystemLogUtils {
private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
/**
* 记录格式 [ip][用户名][操作][错误消息]
* <p/>
* 注意操作如下: loginError 登录失败 loginSuccess 登录成功 passwordError 密码错误
* changePassword 修改密码 changeStatus 修改状态
*
* @param username
* @param op
* @param msg
* @param args
*/
public static void log(String username, String status, String msg, Object... args) {
StringBuilder s = new StringBuilder();
s.append(LogUtils.getBlock(ShiroUtils.getIp()));
s.append(AddressUtils.getRealAddressByIP(ShiroUtils.getIp()));
s.append(LogUtils.getBlock(username));
s.append(LogUtils.getBlock(status));
s.append(LogUtils.getBlock(msg));
sys_user_logger.info(s.toString(), args);
if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status)) {
saveOpLog(username, msg, Constants.SUCCESS);
} else if (Constants.LOGIN_FAIL.equals(status)) {
saveOpLog(username, msg, Constants.FAIL);
}
}
public static void saveOpLog(String username, String message, String status) {
UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
// 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器
String browser = userAgent.getBrowser().getName();
LogininforServiceImpl logininforService = SpringUtils.getBean(LogininforServiceImpl.class);
Logininfor logininfor = new Logininfor();
logininfor.setLoginName(username);
logininfor.setStatus(status);
logininfor.setIpaddr(ShiroUtils.getIp());
logininfor.setLoginLocation(AddressUtils.getRealAddressByIP(ShiroUtils.getIp()));
logininfor.setBrowser(browser);
logininfor.setOs(os);
logininfor.setMsg(message);
logininforService.insertLogininfor(logininfor);
}
}
......@@ -2,6 +2,7 @@ package com.ruoyi.common.utils.poi;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
......@@ -53,22 +54,46 @@ public class ExcelUtil<T>
this.clazz = clazz;
}
/**
* 对excel表单默认第一个索引名转换成list
*
* @param input 输入流
* @return 转换后集合
*/
public List<T> importExcel(InputStream input) throws Exception
{
return importExcel(StringUtils.EMPTY, input);
}
/**
* 对excel表单指定表格索引名转换成list
*
* @param sheetName 表格索引名
* @param input 输入流
* @return 转换后集合
*/
public List<T> importExcel(String sheetName, InputStream input) throws Exception
{
List<T> list = new ArrayList<T>();
Workbook workbook = WorkbookFactory.create(input);
Sheet sheet = workbook.getSheet(sheetName);
Sheet sheet = null;
if (StringUtils.isNotEmpty(sheetName))
{
// 如果指定sheet名,则取指定sheet中的内容.
sheet = workbook.getSheet(sheetName);
}
if (sheet == null)
else
{
// 如果传入的sheet名不存在则默认指向第1个sheet.
sheet = workbook.getSheetAt(0);
}
if (sheet == null)
{
throw new IOException("文件sheet不存在");
}
int rows = sheet.getPhysicalNumberOfRows();
if (rows > 0)
......@@ -117,7 +142,7 @@ public class ExcelUtil<T>
// 如果不存在实例则新建.
entity = (entity == null ? clazz.newInstance() : entity);
// 从map中得到对应列的field.
Field field = fieldsMap.get(j);
Field field = fieldsMap.get(j + 1);
// 取得类型,并根据对象类型设置值.
Class<?> fieldType = field.getType();
if (String.class == fieldType)
......
......@@ -39,13 +39,11 @@ public class DsAspect
Method method = signature.getMethod();
if (method.isAnnotationPresent(Ds.class))
Ds dataSource = method.getAnnotation(Ds.class);
if (StringUtils.isNotNull(dataSource))
{
Ds dataSource = method.getAnnotation(Ds.class);
if (StringUtils.isNotNull(dataSource) && StringUtils.isNotEmpty(dataSource.name()))
{
DynamicDataSourceContextHolder.setDB(dataSource.name());
}
DynamicDataSourceContextHolder.setDateSoureType(dataSource.value().name());
}
try
......@@ -54,7 +52,8 @@ public class DsAspect
}
finally
{
DynamicDataSourceContextHolder.clearDB();
// 销毁数据源 在执行方法之后
DynamicDataSourceContextHolder.clearDateSoureType();
}
}
}
......@@ -2,7 +2,6 @@ package com.ruoyi.framework.aspectj;
import java.lang.reflect.Method;
import java.util.Map;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterReturning;
......@@ -15,13 +14,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessStatus;
import com.ruoyi.framework.aspectj.lang.enums.BusinessStatus;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.project.monitor.operlog.domain.OperLog;
......@@ -35,128 +33,144 @@ import com.ruoyi.project.system.user.domain.User;
@Aspect
@Component
@EnableAsync
public class LogAspect {
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
// 配置织入点
@Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.Log)")
public void logPointCut() {
}
/**
* 前置通知 用于拦截操作
*
* @param joinPoint
* 切点
*/
@AfterReturning(pointcut = "logPointCut()")
public void doBefore(JoinPoint joinPoint) {
handleLog(joinPoint, null);
}
/**
* 拦截异常操作
*
* @param joinPoint
* @param e
*/
@AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfter(JoinPoint joinPoint, Exception e) {
handleLog(joinPoint, e);
}
@Async
protected void handleLog(final JoinPoint joinPoint, final Exception e) {
try {
// 获得注解
Log controllerLog = getAnnotationLog(joinPoint);
if (controllerLog == null) {
return;
}
// 获取当前的用户
User currentUser = ShiroUtils.getUser();
// *========数据库日志=========*//
OperLog operLog = new OperLog();
operLog.setStatus(BusinessStatus.SUCCESS);
// 请求的地址
String ip = ShiroUtils.getIp();
operLog.setOperIp(ip);
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (currentUser != null) {
operLog.setOperName(currentUser.getLoginName());
if (StringUtils.isNotNull(currentUser.getDept()) && StringUtils.isNotEmpty(currentUser.getDept().getDeptName())) {
operLog.setDeptName(currentUser.getDept().getDeptName());
}
}
if (e != null) {
operLog.setStatus(BusinessStatus.FAIL);
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()");
// 处理设置注解上的参数
getControllerMethodDescription(controllerLog, operLog);
// 保存数据库
AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
} catch (Exception exp) {
// 记录本地异常日志
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
}
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param joinPoint
* 切点
* @return 方法描述
* @throws Exception
*/
public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception {
// 设置action动作
operLog.setAction(log.action());
// 设置标题
operLog.setTitle(log.title());
// 设置channel
operLog.setChannel(log.channel());
// 是否需要保存request,参数和值
if (log.isSaveRequestData()) {
// 获取参数的信息,传入到数据库中。
setRequestValue(operLog);
}
}
/**
* 获取请求的参数,放到log中
*
* @param operLog
* @param request
*/
private void setRequestValue(OperLog operLog) {
Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
String params = JSONObject.toJSONString(map);
operLog.setOperParam(StringUtils.substring(params, 0, 255));
}
/**
* 是否存在注解,如果存在就获取
*/
private Log getAnnotationLog(JoinPoint joinPoint) throws Exception {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null) {
return method.getAnnotation(Log.class);
}
return null;
}
public class LogAspect
{
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
// 配置织入点
@Pointcut("@annotation(com.ruoyi.framework.aspectj.lang.annotation.Log)")
public void logPointCut()
{
}
/**
* 前置通知 用于拦截操作
*
* @param joinPoint 切点
*/
@AfterReturning(pointcut = "logPointCut()")
public void doBefore(JoinPoint joinPoint)
{
handleLog(joinPoint, null);
}
/**
* 拦截异常操作
*
* @param joinPoint
* @param e
*/
@AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfter(JoinPoint joinPoint, Exception e)
{
handleLog(joinPoint, e);
}
@Async
protected void handleLog(final JoinPoint joinPoint, final Exception e)
{
try
{
// 获得注解
Log controllerLog = getAnnotationLog(joinPoint);
if (controllerLog == null)
{
return;
}
// 获取当前的用户
User currentUser = ShiroUtils.getUser();
// *========数据库日志=========*//
OperLog operLog = new OperLog();
operLog.setStatus(BusinessStatus.SUCCESS.ordinal());
// 请求的地址
String ip = ShiroUtils.getIp();
operLog.setOperIp(ip);
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (currentUser != null)
{
operLog.setOperName(currentUser.getLoginName());
if (StringUtils.isNotNull(currentUser.getDept())
&& StringUtils.isNotEmpty(currentUser.getDept().getDeptName()))
{
operLog.setDeptName(currentUser.getDept().getDeptName());
}
}
if (e != null)
{
operLog.setStatus(BusinessStatus.FAIL.ordinal());
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()");
// 处理设置注解上的参数
getControllerMethodDescription(controllerLog, operLog);
// 保存数据库
AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
}
catch (Exception exp)
{
// 记录本地异常日志
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
}
/**
* 获取注解中对方法的描述信息 用于Controller层注解
*
* @param joinPoint 切点
* @return 方法描述
* @throws Exception
*/
public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception
{
// 设置action动作
operLog.setBusinessType(log.businessType().ordinal());
// 设置标题
operLog.setTitle(log.title());
// 设置操作人类别
operLog.setOperatorType(log.operatorType().ordinal());
// 是否需要保存request,参数和值
if (log.isSaveRequestData())
{
// 获取参数的信息,传入到数据库中。
setRequestValue(operLog);
}
}
/**
* 获取请求的参数,放到log中
*
* @param operLog
* @param request
*/
private void setRequestValue(OperLog operLog)
{
Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
String params = JSONObject.toJSONString(map);
operLog.setOperParam(StringUtils.substring(params, 0, 255));
}
/**
* 是否存在注解,如果存在就获取
*/
private Log getAnnotationLog(JoinPoint joinPoint) throws Exception
{
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null)
{
return method.getAnnotation(Log.class);
}
return null;
}
}
......@@ -4,7 +4,8 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
/**
* 自定义多数据源切换注解
......@@ -16,7 +17,7 @@ import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
public @interface Ds
{
/**
* 切换数据源
* 切换数据源名称
*/
String name() default DataSourceName.MASTER;
public DataSourceType value() default DataSourceType.MASTER;
}
......@@ -5,7 +5,8 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.ruoyi.framework.aspectj.lang.constant.OperatorType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.OperatorType;
/**
* 自定义操作日志记录注解
......@@ -22,10 +23,10 @@ public @interface Log
String title() default "";
/** 功能 */
String action() default "";
BusinessType businessType() default BusinessType.OTHER;
/** 渠道 */
String channel() default OperatorType.MANAGE;
/** 操作人类别 */
OperatorType operatorType() default OperatorType.MANAGE;
/** 是否保存请求的参数 */
boolean isSaveRequestData() default true;
......
package com.ruoyi.framework.aspectj.lang.constant;
/**
* 操作状态
*
* @author ruoyi
*
*/
public class BusinessStatus
{
/** 其它 */
public static final String OTHER = "-1";
/** 成功 */
public static final String SUCCESS = "0";
/** 失败 */
public static final String FAIL = "1";
}
package com.ruoyi.framework.aspectj.lang.constant;
/**
* 业务操作类型
*
* @author ruoyi
*
*/
public class BusinessType
{
/** 其它 */
public static final String OTHER = "0";
/** 新增 */
public static final String INSERT = "1";
/** 修改 */
public static final String UPDATE = "2";
/** 删除 */
public static final String DELETE = "3";
/** 授权 */
public static final String GRANT = "4";
/** 导出 */
public static final String EXPORT = "5";
/** 导入 */
public static final String IMPORT = "6";
/** 强退 */
public static final String FORCE = "7";
/** 生成代码 */
public static final String GENCODE = "8";
}
package com.ruoyi.framework.aspectj.lang.constant;
/**
* 多数据源别名
*
* @author ruoyi
*
*/
public class DataSourceName
{
/** 主库 */
public static final String MASTER = "master";
/** 从库 */
public static final String SLAVE = "slave";
}
package com.ruoyi.framework.aspectj.lang.constant;
/**
* 操作人类别
*
* @author ruoyi
*
*/
public class OperatorType
{
/** 其它 */
public static final String OTHER = "0";
/** 后台用户 */
public static final String MANAGE = "1";
/** 渠道用户 */
public static final String CHANNEL = "2";
/** 手机端用户 */
public static final String MOBILE = "3";
}
package com.ruoyi.framework.aspectj.lang.enums;
/**
* 操作状态
*
* @author ruoyi
*
*/
public enum BusinessStatus
{
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
}
package com.ruoyi.framework.aspectj.lang.enums;
/**
* 业务操作类型
*
* @author ruoyi
*
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 授权
*/
GRANT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT,
/**
* 强退
*/
FORCE,
/**
* 生成代码
*/
GENCODE,
}
package com.ruoyi.framework.aspectj.lang.enums;
/**
* 数据源
*
* @author ruoyi
*/
public enum DataSourceType
{
/**
* 主库
*/
MASTER,
/**
* 从库
*/
SLAVE
}
package com.ruoyi.framework.aspectj.lang.enums;
/**
* 操作人类别
*
* @author ruoyi
*
*/
public enum OperatorType
{
/**
* 其它
*/
OTHER,
/**
* 后台用户
*/
MANAGE,
/**
* 手机端用户
*/
MOBILE
}
......@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.ruoyi.framework.aspectj.lang.constant.DataSourceName;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.framework.datasource.DynamicDataSource;
/**
......@@ -29,7 +29,7 @@ public class DruidConfig
@Bean
@ConfigurationProperties("spring.datasource.druid.slave")
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "open", havingValue = "true")
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
public DataSource slaveDataSource()
{
return DruidDataSourceBuilder.create().build();
......@@ -40,8 +40,8 @@ public class DruidConfig
public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource)
{
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceName.MASTER, masterDataSource);
targetDataSources.put(DataSourceName.SLAVE, slaveDataSource);
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource);
return new DynamicDataSource(masterDataSource, targetDataSources);
}
}
......@@ -38,6 +38,8 @@ public class ScheduleConfig
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
// sqlserver 启用
//prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
factory.setQuartzProperties(prop);
......
......@@ -21,7 +21,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource
@Override
protected Object determineCurrentLookupKey()
{
return DynamicDataSourceContextHolder.getDB();
return DynamicDataSourceContextHolder.getDateSoureType();
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 当前线程数据源
* 数据源切换处理
*
* @author ruoyi
*/
......@@ -12,29 +12,33 @@ public class DynamicDataSourceContextHolder
{
public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
/**
* 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本,
* 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。
*/
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
/**
* 设置数据源
* 设置数据源的变量
*/
public static void setDB(String dbType)
public static void setDateSoureType(String dsType)
{
log.info("切换到{}数据源", dbType);
CONTEXT_HOLDER.set(dbType);
log.info("切换到{}数据源", dsType);
CONTEXT_HOLDER.set(dsType);
}
/**
* 获取数据源名
* 获得数据源的变量
*/
public static String getDB()
public static String getDateSoureType()
{
return CONTEXT_HOLDER.get();
}
/**
* 清理数据源名
* 清空数据源变量
*/
public static void clearDB()
public static void clearDateSoureType()
{
CONTEXT_HOLDER.remove();
}
......
......@@ -9,18 +9,35 @@ import java.util.concurrent.TimeUnit;
*
* @author liuhulu
*/
public class AsyncManager {
// 操作延迟
private final int OPERATE_DELAY_TIME = 10;
// 异步操作此案城池
private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5);
// 单例
private static AsyncManager me = new AsyncManager();
public static AsyncManager me() {
return me;
}
// 执行任务
public void execute(TimerTask task) {
executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
}
public class AsyncManager
{
/**
* 操作延迟10毫秒
*/
private final int OPERATE_DELAY_TIME = 10;
/**
* 异步操作任务调度线程池
*/
private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(5);
/**
* 单例模式
*/
private static AsyncManager me = new AsyncManager();
public static AsyncManager me()
{
return me;
}
/**
* 执行任务
*
* @param 任务task
*/
public void execute(TimerTask task)
{
executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS);
}
}
package com.ruoyi.framework.manager.factory;
import java.util.TimerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.AddressUtils;
import com.ruoyi.common.utils.LogUtils;
......@@ -18,7 +16,6 @@ import com.ruoyi.project.monitor.online.domain.UserOnline;
import com.ruoyi.project.monitor.online.service.IUserOnlineService;
import com.ruoyi.project.monitor.operlog.domain.OperLog;
import com.ruoyi.project.monitor.operlog.service.IOperLogService;
import eu.bitwalker.useragentutils.UserAgent;
/**
......@@ -27,99 +24,112 @@ import eu.bitwalker.useragentutils.UserAgent;
* @author liuhulu
*
*/
public class AsyncFactory {
private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
public class AsyncFactory
{
private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
/**
* 同步session到数据库
*
* @param operLog
* @return
*/
public static TimerTask syncSessionToDb(final OnlineSession session) {
return new TimerTask() {
@Override
public void run() {
UserOnline online = new UserOnline();
online.setSessionId(String.valueOf(session.getId()));
online.setDeptName(session.getDeptName());
online.setLoginName(session.getLoginName());
online.setStartTimestamp(session.getStartTimestamp());
online.setLastAccessTime(session.getLastAccessTime());
online.setExpireTime(session.getTimeout());
online.setIpaddr(session.getHost());
online.setLonginLocation(AddressUtils.getRealAddressByIP(session.getHost()));
online.setBrowser(session.getBrowser());
online.setOs(session.getOs());
online.setStatus(session.getStatus());
online.setSession(session);
SpringUtils.getBean(IUserOnlineService.class).saveOnline(online);
/**
* 同步session到数据库
*
* @param session 在线用户会话
* @return 任务task
*/
public static TimerTask syncSessionToDb(final OnlineSession session)
{
return new TimerTask()
{
@Override
public void run()
{
UserOnline online = new UserOnline();
online.setSessionId(String.valueOf(session.getId()));
online.setDeptName(session.getDeptName());
online.setLoginName(session.getLoginName());
online.setStartTimestamp(session.getStartTimestamp());
online.setLastAccessTime(session.getLastAccessTime());
online.setExpireTime(session.getTimeout());
online.setIpaddr(session.getHost());
online.setLonginLocation(AddressUtils.getRealAddressByIP(session.getHost()));
online.setBrowser(session.getBrowser());
online.setOs(session.getOs());
online.setStatus(session.getStatus());
online.setSession(session);
SpringUtils.getBean(IUserOnlineService.class).saveOnline(online);
}
};
}
/**
* 记录 操作log
*
* @param rc
* @return
*/
public static TimerTask recordOper(final OperLog operLog) {
return new TimerTask() {
@Override
public void run() {
// 远程查询操作地点
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
SpringUtils.getBean(IOperLogService.class).insertOperlog(operLog);
}
};
}
}
};
}
/**
* 记录登陆信息
*
* @param username
* @param status
* @param message
* @param userAgent
* @param args
* @return
*/
public static TimerTask recordLogininfor(final String username, final String status, final String message, final Object... args) {
final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
return new TimerTask() {
@Override
public void run() {
StringBuilder s = new StringBuilder();
s.append(LogUtils.getBlock(ShiroUtils.getIp()));
s.append(AddressUtils.getRealAddressByIP(ShiroUtils.getIp()));
s.append(LogUtils.getBlock(username));
s.append(LogUtils.getBlock(status));
s.append(LogUtils.getBlock(message));
// 打印信息到日志
sys_user_logger.info(s.toString(), args);
// 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器
String browser = userAgent.getBrowser().getName();
// 封装对象
Logininfor logininfor = new Logininfor();
logininfor.setLoginName(username);
logininfor.setIpaddr(ShiroUtils.getIp());
logininfor.setLoginLocation(AddressUtils.getRealAddressByIP(ShiroUtils.getIp()));
logininfor.setBrowser(browser);
logininfor.setOs(os);
logininfor.setMsg(message);
// 日志状态
if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status)) {
logininfor.setStatus(Constants.SUCCESS);
} else if (Constants.LOGIN_FAIL.equals(status)) {
logininfor.setStatus(Constants.FAIL);
}
// 插入数据
SpringUtils.getBean(LogininforServiceImpl.class).insertLogininfor(logininfor);
}
};
}
/**
* 操作日志记录
*
* @param operLog 操作日志信息
* @return 任务task
*/
public static TimerTask recordOper(final OperLog operLog)
{
return new TimerTask()
{
@Override
public void run()
{
// 远程查询操作地点
operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
SpringUtils.getBean(IOperLogService.class).insertOperlog(operLog);
}
};
}
/**
* 记录登陆信息
*
* @param username 用户名
* @param status 状态
* @param message 消息
* @param args 列表
* @return 任务task
*/
public static TimerTask recordLogininfor(final String username, final String status, final String message, final Object... args)
{
final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
final String ip = ShiroUtils.getIp();
return new TimerTask()
{
@Override
public void run()
{
StringBuilder s = new StringBuilder();
s.append(LogUtils.getBlock(ip));
s.append(AddressUtils.getRealAddressByIP(ip));
s.append(LogUtils.getBlock(username));
s.append(LogUtils.getBlock(status));
s.append(LogUtils.getBlock(message));
// 打印信息到日志
sys_user_logger.info(s.toString(), args);
// 获取客户端操作系统
String os = userAgent.getOperatingSystem().getName();
// 获取客户端浏览器
String browser = userAgent.getBrowser().getName();
// 封装对象
Logininfor logininfor = new Logininfor();
logininfor.setLoginName(username);
logininfor.setIpaddr(ip);
logininfor.setLoginLocation(AddressUtils.getRealAddressByIP(ip));
logininfor.setBrowser(browser);
logininfor.setOs(os);
logininfor.setMsg(message);
// 日志状态
if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status))
{
logininfor.setStatus(Constants.SUCCESS);
}
else if (Constants.LOGIN_FAIL.equals(status))
{
logininfor.setStatus(Constants.FAIL);
}
// 插入数据
SpringUtils.getBean(LogininforServiceImpl.class).insertLogininfor(logininfor);
}
};
}
}
......@@ -3,7 +3,6 @@ package com.ruoyi.framework.shiro.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.constant.ShiroConstants;
import com.ruoyi.common.constant.UserConstants;
......@@ -27,101 +26,104 @@ import com.ruoyi.project.system.user.service.IUserService;
* @author ruoyi
*/
@Component
public class LoginService {
@Autowired
private PasswordService passwordService;
@Autowired
private IUserService userService;
/**
* 登录
*/
public User login(String username, String password) {
// 验证码校验
if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA))) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("user.jcaptcha.error"));
throw new CaptchaException();
}
// 用户名或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("not.null"));
throw new UserNotExistsException();
}
// 密码如果不在指定范围内 错误
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH || password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("user.password.not.match"));
throw new UserPasswordNotMatchException();
}
// 用户名不在指定范围内 错误
if (username.length() < UserConstants.USERNAME_MIN_LENGTH || username.length() > UserConstants.USERNAME_MAX_LENGTH) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("user.password.not.match"));
throw new UserPasswordNotMatchException();
}
// 查询用户信息
User user = userService.selectUserByLoginName(username);
if (user == null && maybeMobilePhoneNumber(username)) {
user = userService.selectUserByPhoneNumber(username);
}
if (user == null && maybeEmail(username)) {
user = userService.selectUserByEmail(username);
}
if (user == null || UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists")));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("user.not.exists"));
throw new UserNotExistsException();
}
passwordService.validate(user, password);
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark())));
// SystemLogUtils.log(username, Constants.LOGIN_FAIL,
// MessageUtils.message("user.blocked", user.getRemark()));
throw new UserBlockedException(user.getRemark());
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
// SystemLogUtils.log(username, Constants.LOGIN_SUCCESS,
// MessageUtils.message("user.login.success"));
recordLoginInfo(user);
return user;
}
private boolean maybeEmail(String username) {
if (!username.matches(UserConstants.EMAIL_PATTERN)) {
return false;
}
return true;
}
private boolean maybeMobilePhoneNumber(String username) {
if (!username.matches(UserConstants.MOBILE_PHONE_NUMBER_PATTERN)) {
return false;
}
return true;
}
/**
* 记录登录信息
*/
public void recordLoginInfo(User user) {
user.setLoginIp(ShiroUtils.getIp());
user.setLoginDate(DateUtils.getNowDate());
userService.updateUserInfo(user);
}
public class LoginService
{
@Autowired
private PasswordService passwordService;
@Autowired
private IUserService userService;
/**
* 登录
*/
public User login(String username, String password)
{
// 验证码校验
if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
// 用户名或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
throw new UserNotExistsException();
}
// 密码如果不在指定范围内 错误
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
// 用户名不在指定范围内 错误
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
throw new UserPasswordNotMatchException();
}
// 查询用户信息
User user = userService.selectUserByLoginName(username);
if (user == null && maybeMobilePhoneNumber(username))
{
user = userService.selectUserByPhoneNumber(username);
}
if (user == null && maybeEmail(username))
{
user = userService.selectUserByEmail(username);
}
if (user == null || UserStatus.DELETED.getCode().equals(user.getDelFlag()))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.not.exists")));
throw new UserNotExistsException();
}
passwordService.validate(user, password);
if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.blocked", user.getRemark())));
throw new UserBlockedException(user.getRemark());
}
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
recordLoginInfo(user);
return user;
}
private boolean maybeEmail(String username)
{
if (!username.matches(UserConstants.EMAIL_PATTERN))
{
return false;
}
return true;
}
private boolean maybeMobilePhoneNumber(String username)
{
if (!username.matches(UserConstants.MOBILE_PHONE_NUMBER_PATTERN))
{
return false;
}
return true;
}
/**
* 记录登录信息
*/
public void recordLoginInfo(User user)
{
user.setLoginIp(ShiroUtils.getIp());
user.setLoginDate(DateUtils.getNowDate());
userService.updateUserInfo(user);
}
}
package com.ruoyi.framework.shiro.service;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.PostConstruct;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
import com.ruoyi.common.exception.user.UserPasswordRetryLimitExceedException;
......@@ -25,66 +22,70 @@ import com.ruoyi.project.system.user.domain.User;
* @author ruoyi
*/
@Component
public class PasswordService {
@Autowired
private CacheManager cacheManager;
private Cache<String, AtomicInteger> loginRecordCache;
@Value(value = "${user.password.maxRetryCount}")
private String maxRetryCount;
@PostConstruct
public void init() {
loginRecordCache = cacheManager.getCache("loginRecordCache");
}
public void validate(User user, String password) {
String loginName = user.getLoginName();
AtomicInteger retryCount = loginRecordCache.get(loginName);
if (retryCount == null) {
retryCount = new AtomicInteger(0);
loginRecordCache.put(loginName, retryCount);
}
if (retryCount.incrementAndGet() > Integer.valueOf(maxRetryCount).intValue()) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.exceed"), maxRetryCount));
// SystemLogUtils.log(loginName, Constants.LOGIN_FAIL,
// MessageUtils.message("user.password.retry.limit.exceed",
// maxRetryCount));
throw new UserPasswordRetryLimitExceedException(Integer.valueOf(maxRetryCount).intValue());
}
if (!matches(user, password)) {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.count"), retryCount, password));
// SystemLogUtils.log(loginName, Constants.LOGIN_FAIL,
// MessageUtils.message("user.password.retry.limit.count",
// retryCount, password));
loginRecordCache.put(loginName, retryCount);
throw new UserPasswordNotMatchException();
} else {
clearLoginRecordCache(loginName);
}
}
public boolean matches(User user, String newPassword) {
return user.getPassword().equals(encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
}
public void clearLoginRecordCache(String username) {
loginRecordCache.remove(username);
}
public String encryptPassword(String username, String password, String salt) {
return new Md5Hash(username + password + salt).toHex().toString();
}
public static void main(String[] args) {
// System.out.println(new PasswordService().encryptPassword("admin",
// "admin123", "111111"));
// System.out.println(new PasswordService().encryptPassword("ry",
// "admin123", "222222"));
}
public class PasswordService
{
@Autowired
private CacheManager cacheManager;
private Cache<String, AtomicInteger> loginRecordCache;
@Value(value = "${user.password.maxRetryCount}")
private String maxRetryCount;
@PostConstruct
public void init()
{
loginRecordCache = cacheManager.getCache("loginRecordCache");
}
public void validate(User user, String password)
{
String loginName = user.getLoginName();
AtomicInteger retryCount = loginRecordCache.get(loginName);
if (retryCount == null)
{
retryCount = new AtomicInteger(0);
loginRecordCache.put(loginName, retryCount);
}
if (retryCount.incrementAndGet() > Integer.valueOf(maxRetryCount).intValue())
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount)));
throw new UserPasswordRetryLimitExceedException(Integer.valueOf(maxRetryCount).intValue());
}
if (!matches(user, password))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.count", retryCount, password)));
loginRecordCache.put(loginName, retryCount);
throw new UserPasswordNotMatchException();
}
else
{
clearLoginRecordCache(loginName);
}
}
public boolean matches(User user, String newPassword)
{
return user.getPassword().equals(encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
}
public void clearLoginRecordCache(String username)
{
loginRecordCache.remove(username);
}
public String encryptPassword(String username, String password, String salt)
{
return new Md5Hash(username + password + salt).toHex().toString();
}
public static void main(String[] args)
{
System.out.println(new PasswordService().encryptPassword("admin", "admin123", "111111"));
System.out.println(new PasswordService().encryptPassword("ry", "admin123", "222222"));
}
}
......@@ -2,12 +2,10 @@ package com.ruoyi.framework.shiro.session;
import java.io.Serializable;
import java.util.Date;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import com.ruoyi.framework.manager.AsyncManager;
import com.ruoyi.framework.manager.factory.AsyncFactory;
import com.ruoyi.project.monitor.online.domain.OnlineSession;
......@@ -19,90 +17,101 @@ import com.ruoyi.project.monitor.online.service.IUserOnlineService;
*
* @author ruoyi
*/
public class OnlineSessionDAO extends EnterpriseCacheSessionDAO {
/**
* 同步session到数据库的周期 单位为毫秒(默认1分钟)
*/
@Value("${shiro.session.dbSyncPeriod}")
private int dbSyncPeriod;
public class OnlineSessionDAO extends EnterpriseCacheSessionDAO
{
/**
* 同步session到数据库的周期 单位为毫秒(默认1分钟)
*/
@Value("${shiro.session.dbSyncPeriod}")
private int dbSyncPeriod;
/**
* 上次同步数据库的时间戳
*/
private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP";
/**
* 上次同步数据库的时间戳
*/
private static final String LAST_SYNC_DB_TIMESTAMP = OnlineSessionDAO.class.getName() + "LAST_SYNC_DB_TIMESTAMP";
@Autowired
private IUserOnlineService onlineService;
@Autowired
private IUserOnlineService onlineService;
@Autowired
private OnlineSessionFactory onlineSessionFactory;
@Autowired
private OnlineSessionFactory onlineSessionFactory;
public OnlineSessionDAO() {
super();
}
public OnlineSessionDAO()
{
super();
}
public OnlineSessionDAO(long expireTime) {
super();
}
public OnlineSessionDAO(long expireTime)
{
super();
}
/**
* 根据会话ID获取会话
*
* @param sessionId
* 会话ID
* @return ShiroSession
*/
@Override
protected Session doReadSession(Serializable sessionId) {
UserOnline userOnline = onlineService.selectOnlineById(String.valueOf(sessionId));
if (userOnline == null) {
return null;
}
return onlineSessionFactory.createSession(userOnline);
}
/**
* 根据会话ID获取会话
*
* @param sessionId 会话ID
* @return ShiroSession
*/
@Override
protected Session doReadSession(Serializable sessionId)
{
UserOnline userOnline = onlineService.selectOnlineById(String.valueOf(sessionId));
if (userOnline == null)
{
return null;
}
return onlineSessionFactory.createSession(userOnline);
}
/**
* 更新会话;如更新会话最后访问时间/停止会话/设置超时时间/设置移除属性等会调用
*/
public void syncToDb(OnlineSession onlineSession) {
Date lastSyncTimestamp = (Date) onlineSession.getAttribute(LAST_SYNC_DB_TIMESTAMP);
if (lastSyncTimestamp != null) {
boolean needSync = true;
long deltaTime = onlineSession.getLastAccessTime().getTime() - lastSyncTimestamp.getTime();
if (deltaTime < dbSyncPeriod * 60 * 1000) {
// 时间差不足 无需同步
needSync = false;
}
boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L;
/**
* 更新会话;如更新会话最后访问时间/停止会话/设置超时时间/设置移除属性等会调用
*/
public void syncToDb(OnlineSession onlineSession)
{
Date lastSyncTimestamp = (Date) onlineSession.getAttribute(LAST_SYNC_DB_TIMESTAMP);
if (lastSyncTimestamp != null)
{
boolean needSync = true;
long deltaTime = onlineSession.getLastAccessTime().getTime() - lastSyncTimestamp.getTime();
if (deltaTime < dbSyncPeriod * 60 * 1000)
{
// 时间差不足 无需同步
needSync = false;
}
boolean isGuest = onlineSession.getUserId() == null || onlineSession.getUserId() == 0L;
// session 数据变更了 同步
if (isGuest == false && onlineSession.isAttributeChanged()) {
needSync = true;
}
// session 数据变更了 同步
if (isGuest == false && onlineSession.isAttributeChanged())
{
needSync = true;
}
if (needSync == false) {
return;
}
}
onlineSession.setAttribute(LAST_SYNC_DB_TIMESTAMP, onlineSession.getLastAccessTime());
// 更新完后 重置标识
if (onlineSession.isAttributeChanged()) {
onlineSession.resetAttributeChanged();
}
// onlineService.saveOnline(UserOnline.fromOnlineSession(onlineSession));
AsyncManager.me().execute(AsyncFactory.syncSessionToDb(onlineSession));
}
if (needSync == false)
{
return;
}
}
onlineSession.setAttribute(LAST_SYNC_DB_TIMESTAMP, onlineSession.getLastAccessTime());
// 更新完后 重置标识
if (onlineSession.isAttributeChanged())
{
onlineSession.resetAttributeChanged();
}
AsyncManager.me().execute(AsyncFactory.syncSessionToDb(onlineSession));
}
/**
* 当会话过期/停止(如用户退出时)属性等会调用
*/
@Override
protected void doDelete(Session session) {
OnlineSession onlineSession = (OnlineSession) session;
if (null == onlineSession) {
return;
}
onlineSession.setStatus(OnlineSession.OnlineStatus.off_line);
onlineService.deleteOnlineById(String.valueOf(onlineSession.getId()));
}
/**
* 当会话过期/停止(如用户退出时)属性等会调用
*/
@Override
protected void doDelete(Session session)
{
OnlineSession onlineSession = (OnlineSession) session;
if (null == onlineSession)
{
return;
}
onlineSession.setStatus(OnlineSession.OnlineStatus.off_line);
onlineService.deleteOnlineById(String.valueOf(onlineSession.getId()));
}
}
......@@ -2,12 +2,10 @@ package com.ruoyi.framework.shiro.web.filter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.apache.shiro.session.SessionException;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.common.utils.StringUtils;
......@@ -21,58 +19,69 @@ import com.ruoyi.project.system.user.domain.User;
*
* @author ruoyi
*/
public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter {
private static final Logger log = LoggerFactory.getLogger(LogoutFilter.class);
public class LogoutFilter extends org.apache.shiro.web.filter.authc.LogoutFilter
{
private static final Logger log = LoggerFactory.getLogger(LogoutFilter.class);
/**
* 退出后重定向的地址
*/
private String loginUrl;
/**
* 退出后重定向的地址
*/
private String loginUrl;
public String getLoginUrl() {
return loginUrl;
}
public String getLoginUrl()
{
return loginUrl;
}
public void setLoginUrl(String loginUrl) {
this.loginUrl = loginUrl;
}
public void setLoginUrl(String loginUrl)
{
this.loginUrl = loginUrl;
}
@Override
protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
try {
Subject subject = getSubject(request, response);
String redirectUrl = getRedirectUrl(request, response, subject);
try {
User user = ShiroUtils.getUser();
if (StringUtils.isNotNull(user)) {
String loginName = user.getLoginName();
// 记录用户退出日志
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGOUT, MessageUtils.message("user.logout.success")));
// SystemLogUtils.log(loginName, Constants.LOGOUT,
// MessageUtils.message("user.logout.success"));
}
// 退出登录
subject.logout();
} catch (SessionException ise) {
log.error("logout fail.", ise);
}
issueRedirect(request, response, redirectUrl);
} catch (Exception e) {
log.error("Encountered session exception during logout. This can generally safely be ignored.", e);
}
return false;
}
@Override
protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception
{
try
{
Subject subject = getSubject(request, response);
String redirectUrl = getRedirectUrl(request, response, subject);
try
{
User user = ShiroUtils.getUser();
if (StringUtils.isNotNull(user))
{
String loginName = user.getLoginName();
// 记录用户退出日志
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGOUT, MessageUtils.message("user.logout.success")));
}
// 退出登录
subject.logout();
}
catch (SessionException ise)
{
log.error("logout fail.", ise);
}
issueRedirect(request, response, redirectUrl);
}
catch (Exception e)
{
log.error("Encountered session exception during logout. This can generally safely be ignored.", e);
}
return false;
}
/**
* 退出跳转URL
*/
@Override
protected String getRedirectUrl(ServletRequest request, ServletResponse response, Subject subject) {
String url = getLoginUrl();
if (StringUtils.isNotEmpty(url)) {
return url;
}
return super.getRedirectUrl(request, response, subject);
}
/**
* 退出跳转URL
*/
@Override
protected String getRedirectUrl(ServletRequest request, ServletResponse response, Subject subject)
{
String url = getLoginUrl();
if (StringUtils.isNotEmpty(url))
{
return url;
}
return super.getRedirectUrl(request, response, subject);
}
}
......@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.Date;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Maps;
/**
* Entity基类
......@@ -99,6 +100,10 @@ public class BaseEntity implements Serializable
public Map<String, Object> getParams()
{
if (params == null)
{
params = Maps.newHashMap();
}
return params;
}
......@@ -106,5 +111,4 @@ public class BaseEntity implements Serializable
{
this.params = params;
}
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -50,7 +50,7 @@ public class JobController extends BaseController
return getDataTable(list);
}
@Log(title = "定时任务", action = BusinessType.EXPORT)
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:job:export")
@PostMapping("/export")
@ResponseBody
......@@ -68,7 +68,7 @@ public class JobController extends BaseController
}
}
@Log(title = "定时任务", action = BusinessType.DELETE)
@Log(title = "定时任务", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/remove")
@ResponseBody
......@@ -89,7 +89,7 @@ public class JobController extends BaseController
/**
* 任务调度状态修改
*/
@Log(title = "定时任务", action = BusinessType.UPDATE)
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:changeStatus")
@PostMapping("/changeStatus")
@ResponseBody
......@@ -101,7 +101,7 @@ public class JobController extends BaseController
/**
* 任务调度立即执行一次
*/
@Log(title = "定时任务", action = BusinessType.UPDATE)
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:changeStatus")
@PostMapping("/run")
@ResponseBody
......@@ -122,7 +122,7 @@ public class JobController extends BaseController
/**
* 新增保存调度
*/
@Log(title = "定时任务", action = BusinessType.INSERT)
@Log(title = "定时任务", businessType = BusinessType.INSERT)
@RequiresPermissions("monitor:job:add")
@PostMapping("/add")
@ResponseBody
......@@ -144,7 +144,7 @@ public class JobController extends BaseController
/**
* 修改保存调度
*/
@Log(title = "定时任务", action = BusinessType.UPDATE)
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:edit")
@PostMapping("/edit")
@ResponseBody
......
......@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -48,7 +48,7 @@ public class JobLogController extends BaseController
return getDataTable(list);
}
@Log(title = "调度日志", action = BusinessType.EXPORT)
@Log(title = "调度日志", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:job:export")
@PostMapping("/export")
@ResponseBody
......@@ -66,7 +66,7 @@ public class JobLogController extends BaseController
}
}
@Log(title = "调度日志", action = BusinessType.DELETE)
@Log(title = "调度日志", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/remove")
@ResponseBody
......
......@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -48,7 +48,7 @@ public class LogininforController extends BaseController
return getDataTable(list);
}
@Log(title = "登陆日志", action = BusinessType.EXPORT)
@Log(title = "登陆日志", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:logininfor:export")
@PostMapping("/export")
@ResponseBody
......@@ -67,7 +67,7 @@ public class LogininforController extends BaseController
}
@RequiresPermissions("monitor:logininfor:remove")
@Log(title = "登陆日志", action = BusinessType.DELETE)
@Log(title = "登陆日志", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
......@@ -55,7 +55,7 @@ public class UserOnlineController extends BaseController
}
@RequiresPermissions("monitor:online:batchForceLogout")
@Log(title = "在线用户", action = BusinessType.FORCE)
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@PostMapping("/batchForceLogout")
@ResponseBody
public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids)
......@@ -84,7 +84,7 @@ public class UserOnlineController extends BaseController
}
@RequiresPermissions("monitor:online:forceLogout")
@Log(title = "在线用户", action = BusinessType.FORCE)
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@PostMapping("/forceLogout")
@ResponseBody
public AjaxResult forceLogout(String sessionId)
......
package com.ruoyi.project.monitor.online.domain;
import java.util.Date;
import com.ruoyi.common.utils.AddressUtils;
import com.ruoyi.framework.web.domain.BaseEntity;
import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus;
......@@ -11,164 +9,172 @@ import com.ruoyi.project.monitor.online.domain.OnlineSession.OnlineStatus;
*
* @author ruoyi
*/
public class UserOnline extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 用户会话id */
private String sessionId;
/** 部门名称 */
private String deptName;
/** 登录名称 */
private String loginName;
/** 登录IP地址 */
private String ipaddr;
/** 登录地址 */
private String longinLocation;
/** 浏览器类型 */
private String browser;
/** 操作系统 */
private String os;
/** session创建时间 */
private Date startTimestamp;
/** session最后访问时间 */
private Date lastAccessTime;
/** 超时时间,单位为分钟 */
private Long expireTime;
/** 在线状态 */
private OnlineStatus status = OnlineStatus.on_line;
/** 备份的当前用户会话 */
private OnlineSession session;
/**
* 设置session对象
*/
@Deprecated
public static final UserOnline fromOnlineSession(OnlineSession session) {
UserOnline online = new UserOnline();
online.setSessionId(String.valueOf(session.getId()));
online.setDeptName(session.getDeptName());
online.setLoginName(session.getLoginName());
online.setStartTimestamp(session.getStartTimestamp());
online.setLastAccessTime(session.getLastAccessTime());
online.setExpireTime(session.getTimeout());
online.setIpaddr(session.getHost());
online.setLonginLocation(AddressUtils.getRealAddressByIP(session.getHost()));
online.setBrowser(session.getBrowser());
online.setOs(session.getOs());
online.setStatus(session.getStatus());
online.setSession(session);
return online;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getIpaddr() {
return ipaddr;
}
public void setIpaddr(String ipaddr) {
this.ipaddr = ipaddr;
}
public String getLonginLocation() {
return longinLocation;
}
public void setLonginLocation(String longinLocation) {
this.longinLocation = longinLocation;
}
public String getBrowser() {
return browser;
}
public void setBrowser(String browser) {
this.browser = browser;
}
public String getOs() {
return os;
}
public void setOs(String os) {
this.os = os;
}
public Date getStartTimestamp() {
return startTimestamp;
}
public void setStartTimestamp(Date startTimestamp) {
this.startTimestamp = startTimestamp;
}
public Date getLastAccessTime() {
return lastAccessTime;
}
public void setLastAccessTime(Date lastAccessTime) {
this.lastAccessTime = lastAccessTime;
}
public Long getExpireTime() {
return expireTime;
}
public void setExpireTime(Long expireTime) {
this.expireTime = expireTime;
}
public OnlineStatus getStatus() {
return status;
}
public void setStatus(OnlineStatus status) {
this.status = status;
}
public OnlineSession getSession() {
return session;
}
public void setSession(OnlineSession session) {
this.session = session;
}
@Override
public String toString() {
return "UserOnline [sessionId=" + sessionId + ", deptName=" + deptName + ", loginName=" + loginName + ", ipaddr=" + ipaddr + ", browser=" + browser + ", os=" + os + ", startTimestamp=" + startTimestamp + ", lastAccessTime=" + lastAccessTime + ", expireTime=" + expireTime + ", status=" + status + ", session=" + session + "]";
}
public class UserOnline extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 用户会话id */
private String sessionId;
/** 部门名称 */
private String deptName;
/** 登录名称 */
private String loginName;
/** 登录IP地址 */
private String ipaddr;
/** 登录地址 */
private String longinLocation;
/** 浏览器类型 */
private String browser;
/** 操作系统 */
private String os;
/** session创建时间 */
private Date startTimestamp;
/** session最后访问时间 */
private Date lastAccessTime;
/** 超时时间,单位为分钟 */
private Long expireTime;
/** 在线状态 */
private OnlineStatus status = OnlineStatus.on_line;
/** 备份的当前用户会话 */
private OnlineSession session;
public String getSessionId()
{
return sessionId;
}
public void setSessionId(String sessionId)
{
this.sessionId = sessionId;
}
public String getDeptName()
{
return deptName;
}
public void setDeptName(String deptName)
{
this.deptName = deptName;
}
public String getLoginName()
{
return loginName;
}
public void setLoginName(String loginName)
{
this.loginName = loginName;
}
public String getIpaddr()
{
return ipaddr;
}
public void setIpaddr(String ipaddr)
{
this.ipaddr = ipaddr;
}
public String getLonginLocation()
{
return longinLocation;
}
public void setLonginLocation(String longinLocation)
{
this.longinLocation = longinLocation;
}
public String getBrowser()
{
return browser;
}
public void setBrowser(String browser)
{
this.browser = browser;
}
public String getOs()
{
return os;
}
public void setOs(String os)
{
this.os = os;
}
public Date getStartTimestamp()
{
return startTimestamp;
}
public void setStartTimestamp(Date startTimestamp)
{
this.startTimestamp = startTimestamp;
}
public Date getLastAccessTime()
{
return lastAccessTime;
}
public void setLastAccessTime(Date lastAccessTime)
{
this.lastAccessTime = lastAccessTime;
}
public Long getExpireTime()
{
return expireTime;
}
public void setExpireTime(Long expireTime)
{
this.expireTime = expireTime;
}
public OnlineStatus getStatus()
{
return status;
}
public void setStatus(OnlineStatus status)
{
this.status = status;
}
public OnlineSession getSession()
{
return session;
}
public void setSession(OnlineSession session)
{
this.session = session;
}
@Override
public String toString()
{
return "UserOnline [sessionId=" + sessionId + ", deptName=" + deptName + ", loginName=" + loginName
+ ", ipaddr=" + ipaddr + ", browser=" + browser + ", os=" + os + ", startTimestamp=" + startTimestamp
+ ", lastAccessTime=" + lastAccessTime + ", expireTime=" + expireTime + ", status=" + status
+ ", session=" + session + "]";
}
}
......@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -50,7 +50,7 @@ public class OperlogController extends BaseController
return getDataTable(list);
}
@Log(title = "操作日志", action = BusinessType.EXPORT)
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:operlog:export")
@PostMapping("/export")
@ResponseBody
......
......@@ -21,17 +21,17 @@ public class OperLog extends BaseEntity
@Excel(name = "操作模块")
private String title;
/** 操作类型 */
@Excel(name = "操作类型")
private String action;
/** 操作业务类型 */
@Excel(name = "业务类型")
private Integer businessType;
/** 请求方法 */
@Excel(name = "请求方法")
private String method;
/** 来源渠道 */
@Excel(name = "来源渠道")
private String channel;
/** 操作人类别 */
@Excel(name = "操作类别")
private Integer operatorType;
/** 操作人员 */
@Excel(name = "操作人员")
......@@ -59,7 +59,7 @@ public class OperLog extends BaseEntity
/** 状态0正常 1异常 */
@Excel(name = "状态")
private String status;
private Integer status;
/** 错误消息 */
@Excel(name = "错误消息")
......@@ -89,14 +89,14 @@ public class OperLog extends BaseEntity
this.title = title;
}
public String getAction()
public Integer getBusinessType()
{
return action;
return businessType;
}
public void setAction(String action)
public void setBusinessType(Integer businessType)
{
this.action = action;
this.businessType = businessType;
}
public String getMethod()
......@@ -109,14 +109,14 @@ public class OperLog extends BaseEntity
this.method = method;
}
public String getChannel()
public Integer getOperatorType()
{
return channel;
return operatorType;
}
public void setChannel(String channel)
public void setOperatorType(Integer operatorType)
{
this.channel = channel;
this.operatorType = operatorType;
}
public String getOperName()
......@@ -179,12 +179,12 @@ public class OperLog extends BaseEntity
this.operParam = operParam;
}
public String getStatus()
public Integer getStatus()
{
return status;
}
public void setStatus(String status)
public void setStatus(Integer status)
{
this.status = status;
}
......@@ -212,10 +212,10 @@ public class OperLog extends BaseEntity
@Override
public String toString()
{
return "OperLog [operId=" + operId + ", title=" + title + ", action=" + action + ", method=" + method
+ ", channel=" + channel + ", operName=" + operName + ", deptName=" + deptName + ", operUrl=" + operUrl
+ ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + operParam + ", status="
+ status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]";
return "OperLog [operId=" + operId + ", title=" + title + ", businessType=" + businessType + ", method="
+ method + ", operatorType=" + operatorType + ", operName=" + operName + ", deptName=" + deptName
+ ", operUrl=" + operUrl + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam="
+ operParam + ", status=" + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]";
}
}
......@@ -10,10 +10,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -54,7 +53,7 @@ public class ConfigController extends BaseController
return getDataTable(list);
}
@Log(title = "参数管理", action = BusinessType.EXPORT)
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
@ResponseBody
......@@ -85,7 +84,7 @@ public class ConfigController extends BaseController
* 新增保存参数配置
*/
@RequiresPermissions("system:config:add")
@Log(title = "参数管理", action = BusinessType.INSERT)
@Log(title = "参数管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Config config)
......@@ -107,7 +106,7 @@ public class ConfigController extends BaseController
* 修改保存参数配置
*/
@RequiresPermissions("system:config:edit")
@Log(title = "参数管理", action = BusinessType.UPDATE)
@Log(title = "参数管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Config config)
......@@ -119,7 +118,7 @@ public class ConfigController extends BaseController
* 删除参数配置
*/
@RequiresPermissions("system:config:remove")
@Log(title = "参数管理", action = BusinessType.DELETE)
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......@@ -134,12 +133,7 @@ public class ConfigController extends BaseController
@ResponseBody
public String checkConfigKeyUnique(Config config)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(config))
{
uniqueFlag = configService.checkConfigKeyUnique(config);
}
return uniqueFlag;
return configService.checkConfigKeyUnique(config);
}
}
......@@ -82,4 +82,10 @@ public class Config extends BaseEntity
this.configType = configType;
}
public String toString()
{
return "Config [configId=" + configId + ", configName=" + configName + ", configKey=" + configKey
+ ", configValue=" + configValue + ", configType=" + configType + "]";
}
}
......@@ -11,9 +11,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.dept.domain.Dept;
......@@ -62,7 +61,7 @@ public class DeptController extends BaseController
/**
* 新增保存部门
*/
@Log(title = "部门管理", action = BusinessType.INSERT)
@Log(title = "部门管理", businessType = BusinessType.INSERT)
@RequiresPermissions("system:dept:add")
@PostMapping("/add")
@ResponseBody
......@@ -84,7 +83,7 @@ public class DeptController extends BaseController
/**
* 保存
*/
@Log(title = "部门管理", action = BusinessType.UPDATE)
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:dept:edit")
@PostMapping("/edit")
@ResponseBody
......@@ -96,7 +95,7 @@ public class DeptController extends BaseController
/**
* 删除
*/
@Log(title = "部门管理", action = BusinessType.DELETE)
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:dept:remove")
@PostMapping("/remove/{deptId}")
@ResponseBody
......@@ -120,12 +119,7 @@ public class DeptController extends BaseController
@ResponseBody
public String checkDeptNameUnique(Dept dept)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(dept))
{
uniqueFlag = deptService.checkDeptNameUnique(dept);
}
return uniqueFlag;
return deptService.checkDeptNameUnique(dept);
}
/**
......
......@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -50,7 +50,7 @@ public class DictDataController extends BaseController
return getDataTable(list);
}
@Log(title = "字典数据", action = BusinessType.EXPORT)
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:dict:export")
@PostMapping("/export")
@ResponseBody
......@@ -81,7 +81,7 @@ public class DictDataController extends BaseController
/**
* 新增保存字典类型
*/
@Log(title = "字典数据", action = BusinessType.INSERT)
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@RequiresPermissions("system:dict:add")
@PostMapping("/add")
@ResponseBody
......@@ -103,7 +103,7 @@ public class DictDataController extends BaseController
/**
* 修改保存字典类型
*/
@Log(title = "字典数据", action = BusinessType.UPDATE)
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:dict:edit")
@PostMapping("/edit")
@ResponseBody
......@@ -112,7 +112,7 @@ public class DictDataController extends BaseController
return toAjax(dictDataService.updateDictData(dict));
}
@Log(title = "字典数据", action = BusinessType.DELETE)
@Log(title = "字典数据", businessType = BusinessType.DELETE)
@RequiresPermissions("system:dict:remove")
@PostMapping("/remove")
@ResponseBody
......
......@@ -10,10 +10,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -51,7 +50,7 @@ public class DictTypeController extends BaseController
return getDataTable(list);
}
@Log(title = "字典类型", action = BusinessType.EXPORT)
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:dict:export")
@PostMapping("/export")
@ResponseBody
......@@ -81,7 +80,7 @@ public class DictTypeController extends BaseController
/**
* 新增保存字典类型
*/
@Log(title = "字典类型", action = BusinessType.INSERT)
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@RequiresPermissions("system:dict:add")
@PostMapping("/add")
@ResponseBody
......@@ -103,7 +102,7 @@ public class DictTypeController extends BaseController
/**
* 修改保存字典类型
*/
@Log(title = "字典类型", action = BusinessType.UPDATE)
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:dict:edit")
@PostMapping("/edit")
@ResponseBody
......@@ -112,7 +111,7 @@ public class DictTypeController extends BaseController
return toAjax(dictTypeService.updateDictType(dict));
}
@Log(title = "字典类型", action = BusinessType.DELETE)
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@RequiresPermissions("system:dict:remove")
@PostMapping("/remove")
@ResponseBody
......@@ -147,11 +146,6 @@ public class DictTypeController extends BaseController
@ResponseBody
public String checkDictTypeUnique(DictType dictType)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(dictType))
{
uniqueFlag = dictTypeService.checkDictTypeUnique(dictType);
}
return uniqueFlag;
return dictTypeService.checkDictTypeUnique(dictType);
}
}
......@@ -11,9 +11,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.system.menu.domain.Menu;
......@@ -54,7 +53,7 @@ public class MenuController extends BaseController
/**
* 删除菜单
*/
@Log(title = "菜单管理", action = BusinessType.DELETE)
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:menu:remove")
@PostMapping("/remove/{menuId}")
@ResponseBody
......@@ -95,7 +94,7 @@ public class MenuController extends BaseController
/**
* 新增保存菜单
*/
@Log(title = "菜单管理", action = BusinessType.INSERT)
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@RequiresPermissions("system:menu:add")
@PostMapping("/add")
@ResponseBody
......@@ -117,7 +116,7 @@ public class MenuController extends BaseController
/**
* 修改保存菜单
*/
@Log(title = "菜单管理", action = BusinessType.UPDATE)
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:menu:edit")
@PostMapping("/edit")
@ResponseBody
......@@ -142,12 +141,7 @@ public class MenuController extends BaseController
@ResponseBody
public String checkMenuNameUnique(Menu menu)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(menu))
{
uniqueFlag = menuService.checkMenuNameUnique(menu);
}
return uniqueFlag;
return menuService.checkMenuNameUnique(menu);
}
/**
......
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -65,7 +65,7 @@ public class NoticeController extends BaseController
* 新增保存公告
*/
@RequiresPermissions("system:notice:add")
@Log(title = "通知公告", action = BusinessType.INSERT)
@Log(title = "通知公告", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Notice notice)
......@@ -87,7 +87,7 @@ public class NoticeController extends BaseController
* 修改保存公告
*/
@RequiresPermissions("system:notice:edit")
@Log(title = "通知公告", action = BusinessType.UPDATE)
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Notice notice)
......@@ -99,7 +99,7 @@ public class NoticeController extends BaseController
* 删除公告
*/
@RequiresPermissions("system:notice:remove")
@Log(title = "通知公告", action = BusinessType.DELETE)
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......
......@@ -10,10 +10,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -51,7 +50,7 @@ public class PostController extends BaseController
return getDataTable(list);
}
@Log(title = "岗位管理", action = BusinessType.EXPORT)
@Log(title = "岗位管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:post:export")
@PostMapping("/export")
@ResponseBody
......@@ -70,7 +69,7 @@ public class PostController extends BaseController
}
@RequiresPermissions("system:post:remove")
@Log(title = "岗位管理", action = BusinessType.DELETE)
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......@@ -98,7 +97,7 @@ public class PostController extends BaseController
* 新增保存岗位
*/
@RequiresPermissions("system:post:add")
@Log(title = "岗位管理", action = BusinessType.INSERT)
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Post post)
......@@ -120,7 +119,7 @@ public class PostController extends BaseController
* 修改保存岗位
*/
@RequiresPermissions("system:post:edit")
@Log(title = "岗位管理", action = BusinessType.UPDATE)
@Log(title = "岗位管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Post post)
......@@ -135,12 +134,7 @@ public class PostController extends BaseController
@ResponseBody
public String checkPostNameUnique(Post post)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(post))
{
uniqueFlag = postService.checkPostNameUnique(post);
}
return uniqueFlag;
return postService.checkPostNameUnique(post);
}
/**
......@@ -150,12 +144,7 @@ public class PostController extends BaseController
@ResponseBody
public String checkPostCodeUnique(Post post)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(post))
{
uniqueFlag = postService.checkPostCodeUnique(post);
}
return uniqueFlag;
return postService.checkPostCodeUnique(post);
}
}
......@@ -11,10 +11,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -53,7 +52,7 @@ public class RoleController extends BaseController
return getDataTable(list);
}
@Log(title = "角色管理", action = BusinessType.EXPORT)
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:role:export")
@PostMapping("/export")
@ResponseBody
......@@ -84,7 +83,7 @@ public class RoleController extends BaseController
* 新增保存角色
*/
@RequiresPermissions("system:role:add")
@Log(title = "角色管理", action = BusinessType.INSERT)
@Log(title = "角色管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
......@@ -108,7 +107,7 @@ public class RoleController extends BaseController
* 修改保存角色
*/
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", action = BusinessType.UPDATE)
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
......@@ -118,7 +117,7 @@ public class RoleController extends BaseController
}
@RequiresPermissions("system:role:remove")
@Log(title = "角色管理", action = BusinessType.DELETE)
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......@@ -140,12 +139,7 @@ public class RoleController extends BaseController
@ResponseBody
public String checkRoleNameUnique(Role role)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(role))
{
uniqueFlag = roleService.checkRoleNameUnique(role);
}
return uniqueFlag;
return roleService.checkRoleNameUnique(role);
}
/**
......@@ -155,12 +149,7 @@ public class RoleController extends BaseController
@ResponseBody
public String checkRoleKeyUnique(Role role)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(role))
{
uniqueFlag = roleService.checkRoleKeyUnique(role);
}
return uniqueFlag;
return roleService.checkRoleKeyUnique(role);
}
/**
......
......@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.service.DictService;
......@@ -75,7 +75,7 @@ public class ProfileController extends BaseController
return prefix + "/resetPwd";
}
@Log(title = "重置密码", action = BusinessType.UPDATE)
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@PostMapping("/resetPwd")
@ResponseBody
public AjaxResult resetPwd(User user)
......@@ -112,7 +112,7 @@ public class ProfileController extends BaseController
/**
* 修改用户
*/
@Log(title = "个人信息", action = BusinessType.UPDATE)
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PostMapping("/update")
@ResponseBody
public AjaxResult update(User user)
......@@ -128,7 +128,7 @@ public class ProfileController extends BaseController
/**
* 保存头像
*/
@Log(title = "个人信息", action = BusinessType.UPDATE)
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PostMapping("/updateAvatar")
@ResponseBody
public AjaxResult updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file)
......
......@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
......@@ -60,7 +60,7 @@ public class UserController extends BaseController
return getDataTable(list);
}
@Log(title = "用户管理", action = BusinessType.EXPORT)
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:user:export")
@PostMapping("/export")
@ResponseBody
......@@ -93,7 +93,7 @@ public class UserController extends BaseController
* 新增保存用户
*/
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", action = BusinessType.INSERT)
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
......@@ -122,7 +122,7 @@ public class UserController extends BaseController
* 修改保存用户
*/
@RequiresPermissions("system:user:edit")
@Log(title = "用户管理", action = BusinessType.UPDATE)
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
......@@ -136,7 +136,7 @@ public class UserController extends BaseController
}
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", action = BusinessType.UPDATE)
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
{
......@@ -145,7 +145,7 @@ public class UserController extends BaseController
}
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", action = BusinessType.UPDATE)
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@PostMapping("/resetPwd")
@ResponseBody
public AjaxResult resetPwd(User user)
......@@ -154,7 +154,7 @@ public class UserController extends BaseController
}
@RequiresPermissions("system:user:remove")
@Log(title = "用户管理", action = BusinessType.DELETE)
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
......@@ -176,12 +176,7 @@ public class UserController extends BaseController
@ResponseBody
public String checkLoginNameUnique(User user)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(user))
{
uniqueFlag = userService.checkLoginNameUnique(user.getLoginName());
}
return uniqueFlag;
return userService.checkLoginNameUnique(user.getLoginName());
}
/**
......@@ -191,12 +186,7 @@ public class UserController extends BaseController
@ResponseBody
public String checkPhoneUnique(User user)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(user))
{
uniqueFlag = userService.checkPhoneUnique(user);
}
return uniqueFlag;
return userService.checkPhoneUnique(user);
}
/**
......@@ -206,11 +196,6 @@ public class UserController extends BaseController
@ResponseBody
public String checkEmailUnique(User user)
{
String uniqueFlag = "0";
if (StringUtils.isNotNull(user))
{
uniqueFlag = userService.checkEmailUnique(user);
}
return uniqueFlag;
return userService.checkEmailUnique(user);
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.support.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.tool.gen.domain.TableInfo;
......@@ -55,7 +55,7 @@ public class GenController extends BaseController
* 生成代码
*/
@RequiresPermissions("tool:gen:code")
@Log(title = "代码生成", action = BusinessType.GENCODE)
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
@GetMapping("/genCode/{tableName}")
public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
{
......@@ -72,7 +72,7 @@ public class GenController extends BaseController
* 批量生成代码
*/
@RequiresPermissions("tool:gen:code")
@Log(title = "代码生成", action = BusinessType.GENCODE)
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
@GetMapping("/batchGenCode")
@ResponseBody
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
......
#数据源配置
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
master: #主库
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
username: root
password: password
#slave: #从库
# open: true
# url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
# username: root
# password: password
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initial-size: 10
# 最大连接池数量
......
......@@ -32,10 +32,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="methodName != null and methodName != ''">
AND method_name like concat('%', #{methodName}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -33,10 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginName != null and loginName != ''">
AND login_name like concat('%', #{loginName}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(login_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(login_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="browser" column="browser" />
<result property="os" column="os" />
<result property="status" column="status" />
<result property="startTimestamp" column="start_timestsamp" />
<result property="startTimestamp" column="start_timestamp" />
<result property="lastAccessTime" column="last_access_time" />
<result property="expireTime" column="expire_time" />
<association property="session" javaType="OnlineSession" resultMap="OnlineSessionResult" />
......@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectOnlineVo">
select sessionId,login_name,dept_name,ipaddr,login_location,browser,os,status,status,start_timestsamp,last_access_time,expire_time
select sessionId,login_name,dept_name,ipaddr,login_location,browser,os,status,status,start_timestamp,last_access_time,expire_time
from sys_user_online
</sql>
......@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="saveOnline" parameterType="UserOnline">
replace into sys_user_online(sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, start_timestsamp, last_access_time, expire_time)
replace into sys_user_online(sessionId, login_name, dept_name, ipaddr, login_location, browser, os, status, start_timestamp, last_access_time, expire_time)
values (#{sessionId}, #{loginName}, #{deptName}, #{ipaddr}, #{longinLocation}, #{browser}, #{os}, #{status}, #{startTimestamp}, #{lastAccessTime}, #{expireTime})
</insert>
......
......@@ -7,10 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="OperLog" id="OperLogResult">
<id property="operId" column="oper_id" />
<result property="title" column="title" />
<result property="action" column="action" />
<result property="businessType" column="business_type" />
<result property="method" column="method" />
<result property="channel" column="channel" />
<result property="operName" column="oper_name" />
<result property="operatorType" column="operator_type" />
<result property="operName" column="oper_name" />
<result property="deptName" column="dept_name" />
<result property="operUrl" column="oper_url" />
<result property="operIp" column="oper_ip" />
......@@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectOperLogVo">
select
oper_id, title, action, method, channel, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time
from
sys_oper_log
</sql>
<insert id="insertOperlog" parameterType="OperLog">
insert into sys_oper_log(title, action, method, channel, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
values (#{title}, #{action}, #{method}, #{channel}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time)
values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
</insert>
<select id="selectOperLogList" parameterType="OperLog" resultMap="OperLogResult">
......@@ -39,16 +39,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="title != null and title != ''">
AND title like concat('%', #{title}, '%')
</if>
<if test="action != null and action != ''">
AND action = #{action}
<if test="businessType != null">
AND business_type = #{businessType}
</if>
<if test="operName != null and operName != ''">
AND oper_name like concat('%', #{operName}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(oper_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(oper_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -49,10 +49,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configKey != null and configKey != ''">
AND config_key like concat('%', #{configKey}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -31,10 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dictType != null and dictType != ''">
AND dict_type like concat('%', #{dictType}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -33,10 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roleKey != null and roleKey != ''">
AND role_key like concat('%', #{roleKey}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
......
......@@ -56,10 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != 0">
......
......@@ -30,10 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tableComment != null and tableComment != ''">
AND table_comment like concat('%', #{tableComment}, '%')
</if>
<if test="params != null and params.beginTime != ''"><!-- 开始时间检索 -->
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params != null and params.endTime != ''"><!-- 结束时间检索 -->
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</select>
......
......@@ -4,7 +4,7 @@
.bootstrap-tree-table .treetable-table{border:0 !important;margin-bottom:0}
.bootstrap-tree-table .treetable-table tbody {display:block;height:auto;overflow-y:auto;}
.bootstrap-tree-table .treetable-table thead, .treetable-table tbody tr {display:table;width:100%;table-layout:fixed;}
.bootstrap-tree-table .treetable-thead th{line-height:40px;border: 0 !important;background:#f3f3f4 !important;border-radius: 4px;border-left:0px solid #e7eaec !important;border-bottom:2px solid #e7eaec !important;text-align: center;}
.bootstrap-tree-table .treetable-thead th{line-height:24px;border: 0 !important;border-radius: 4px;border-left:0px solid #e7eaec !important;border-bottom:1px solid #ccc!important;text-align: center;}
.bootstrap-tree-table .treetable-thead tr :first-child{border-left:0 !important}
.bootstrap-tree-table .treetable-tbody td{border: 0 !important;border-left:0px solid #e7eaec !important;border-bottom:1px solid #e7eaec !important;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
.bootstrap-tree-table .treetable-tbody td{border: 0 !important;border-left:0px solid #e7eaec !important;border-bottom:1px solid #e7eaec!important;overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
.bootstrap-tree-table .treetable-tbody tr :first-child{border-left:0 !important}
\ No newline at end of file
/*
@Name: layim WebIM 1.0.0
@Author:贤心(子涵修改)
@Date: 2014-04-25
@Blog: http://sentsin.com
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,input,button,textarea,p,blockquote,th,td,form{margin:0; padding:0;}
input,button,textarea,select,optgroup,option{font-family:inherit; font-size:inherit; font-style:inherit; font-weight:inherit; outline: 0;}
li{list-style:none;}
.xxim_icon, .xxim_main i, .layim_chatbox i{position:absolute;}
.loading{background:url(loading.gif) no-repeat center center;}
.layim_chatbox a, .layim_chatbox a:hover{color:#343434; text-decoration:none; }
.layim_zero{position:absolute; width:0; height:0; border-style:dashed; border-color:transparent; overflow:hidden;}
.xxim_main{position:fixed; right:1px; bottom:1px; width:230px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2); z-index:99999999}
.layim_chatbox textarea{resize:none;}
.xxim_main em, .xxim_main i, .layim_chatbox em, .layim_chatbox i{font-style:normal; font-weight:400;}
.xxim_main h5{font-size:100%; font-weight:400;}
/* 搜索栏 */
.xxim_search{position:relative; padding-left:40px; height:40px; border-bottom:1px solid #DCDCDC; background-color:#fff;}
.xxim_search i{left:10px; top:12px; width:16px; height:16px;font-size: 16px;color:#999;}
.xxim_search input{border:none; background:none; width: 180px; margin-top:10px; line-height:20px;}
.xxim_search span{display:none; position:absolute; right:10px; top:10px; height:18px; line-height:18px;width:18px;text-align: center;background-color:#AFAFAF; color:#fff; cursor:pointer; border-radius:2px; font-size:12px; font-weight:900;}
.xxim_search span:hover{background-color:#FCBE00;}
/* 主面板tab */
.xxim_tabs{height:45px; border-bottom:1px solid #DBDBDB; background-color:#F4F4F4; font-size:0;}
.xxim_tabs span{position:relative; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:76px; height:45px; border-right:1px solid #DBDBDB; cursor:pointer; font-size:12px;}
.xxim_tabs span i{top:12px; left:50%; width:20px; margin-left:-10px; height:20px;font-size:20px;color:#ccc;}
.xxim_tabs .xxim_tabnow{height:46px; background-color:#fff;}
.xxim_tabs .xxim_tabnow i{color:#1ab394;}
.xxim_tabs .xxim_latechat{border-right:none;}
.xxim_tabs .xxim_tabfriend i{width:14px; margin-left:-7px;}
/* 主面板列表 */
.xxim_list{display:none; height:350px; padding:5px 0; overflow:hidden;}
.xxim_list:hover{ overflow-y:auto;}
.xxim_list h5{position:relative; padding-left:32px; height:26px; line-height:26px; cursor:pointer; color:#000; font-size:0;}
.xxim_list h5 span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; max-width:140px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:12px;}
.xxim_list h5 i{left:15px; top:8px; width:10px; height:10px;font-size:10px;color:#666;}
.xxim_list h5 *{font-size:12px;}
.xxim_list .xxim_chatlist{display:none;}
.xxim_list .xxim_liston h5 i{width:8px; height:7px;}
.xxim_list .xxim_liston .xxim_chatlist{display:block;}
.xxim_chatlist {}
.xxim_chatlist li{position:relative; height:40px; line-height:30px; padding:5px 10px; font-size:0; cursor:pointer;}
.xxim_chatlist li:hover{background-color:#F2F4F8}
.xxim_chatlist li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;}
.xxim_chatlist li span{padding-left:10px; max-width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
.xxim_chatlist li img{width:30px; height:30px;}
.xxim_chatlist li .xxim_time{position:absolute; right:10px; color:#999;}
.xxim_list .xxim_errormsg{text-align:center; margin:50px 0; color:#999;}
.xxim_searchmain{position:absolute; width:230px; height:491px; left:0; top:41px; z-index:10; background-color:#fff;}
/* 主面板底部 */
.xxim_bottom{height:34px; border-top:1px solid #D0DCF3; background-color:#F2F4F8;}
.xxim_expend{border-left:1px solid #D0DCF3; border-bottom:1px solid #D0DCF3;}
.xxim_bottom li{position:relative; width:50px; height:32px; line-height:32px; float:left; border-right:1px solid #D0DCF3; cursor:pointer;}
.xxim_bottom li i{ top:9px;}
.xxim_bottom .xxim_hide{border-right:none;}
.xxim_bottom .xxim_online{width:72px; padding-left:35px;}
.xxim_online i{left:13px; width:14px; height:14px;font-size:14px;color:#FFA00A;}
.xxim_setonline{display:none; position:absolute; left:-79px; bottom:-1px; border:1px solid #DCDCDC; background-color:#fff;}
.xxim_setonline span{position:relative; display:block; width:32px;width: 77px; padding:0 10px 0 35px;}
.xxim_setonline span:hover{background-color:#F2F4F8;}
.xxim_offline .xxim_nowstate, .xxim_setoffline i{color:#999;}
.xxim_mymsg i{left:18px; width:14px; height:14px;font-size: 14px;}
.xxim_mymsg a{position:absolute; left:0; top:0; width:50px; height:32px;}
.xxim_seter i{left:18px; width:14px; height:14px;font-size: 14px;}
.xxim_hide i{left:18px; width:14px; height:14px;font-size: 14px;}
.xxim_show i{}
.xxim_bottom .xxim_on{position:absolute; left:-17px; top:50%; width:16px;text-align: center;color:#999;line-height: 97px; height:97px; margin-top:-49px;border:solid 1px #BEBEBE;border-right: none; background:#F2F4F8;}
.xxim_bottom .xxim_off{}
/* 聊天窗口 */
.layim_chatbox{width:620px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2);}
.layim_chatbox h6{position:relative; height:40px; border-bottom:1px solid #D9D9D9; background-color:#FCFDFA}
.layim_move{position:absolute; height:40px; width: 620px; z-index:0;}
.layim_face{position:absolute; bottom:-1px; left:10px; width:64px; height:64px;padding:1px;background: #fff; border:1px solid #ccc;}
.layim_face img{width:60px; height:60px;}
.layim_names{position:absolute; left:90px; max-width:300px; line-height:40px; color:#000; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:14px;}
.layim_rightbtn{position:absolute; right:15px; top:12px; font-size:20px;}
.layim_rightbtn i{position:relative; width:16px; height:16px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; cursor:pointer; transition: all .3s;text-align: center;line-height: 16px;}
.layim_rightbtn .layim_close{background: #FFA00A;color:#fff;}
.layim_rightbtn .layim_close:hover{-webkit-transform: rotate(180deg); -moz-transform: rotate(180deg);}
.layim_rightbtn .layer_setmin{margin-right:5px;color:#999;font-size:14px;font-weight: 700;}
.layim_chat, .layim_chatmore,.layim_groups{height:450px; overflow:hidden;}
.layim_chatmore{display:none; float:left; width:135px; border-right:1px solid #BEBEBE; background-color:#F2F2F2}
.layim_chatlist li, .layim_groups li{position:relative; height:30px; line-height:30px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; cursor:pointer;}
.layim_chatlist li{padding:0 20px 0 10px;}
.layim_chatlist li:hover{background-color:#E3E3E3;}
.layim_chatlist li span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:90px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
.layim_chatlist li em{display:none; position:absolute; top:6px; right:10px; height:18px; line-height:18px;width:18px;text-align: center;font-size:14px;font-weight:900; border-radius:3px;}
.layim_chatlist li em:hover{background-color: #FCBE00; color:#fff;}
.layim_chatlist .layim_chatnow,.layim_chatlist .layim_chatnow:hover{/*border-top:1px solid #D9D9D9; border-bottom:1px solid #D9D9D9;*/ background-color:#fff;}
.layim_chat{}
.layim_chatarea{height:280px;}
.layim_chatview{display:none; height:280px; overflow:hidden;}
.layim_chatmore:hover, .layim_groups:hover, .layim_chatview:hover{overflow-y:auto;}
.layim_chatview li{margin-bottom:10px; clear:both; *zoom:1;}
.layim_chatview li:after{content:'\20'; clear:both; *zoom:1; display:block; height:0;}
.layim_chatthis{display:block;}
.layim_chatuser{float:left; padding:15px; font-size:0;}
.layim_chatuser *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; line-height:30px; font-size:12px; padding-right:10px;}
.layim_chatuser img{width:30px; height:30px;padding-right: 0;margin-right: 15px;}
.layim_chatuser .layim_chatname{max-width:230px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
.layim_chatuser .layim_chattime{color:#999; padding-left:10px;}
.layim_chatsay{position:relative; float:left; margin:0 15px; padding:10px; line-height:20px; background-color:#F3F3F3; border-radius:3px; clear:both;}
.layim_chatsay .layim_zero{left:5px; top:-8px; border-width:8px; border-right-style:solid; border-right-color:#F3F3F3;}
.layim_chateme .layim_chatuser{float:right;}
.layim_chateme .layim_chatuser *{padding-right:0; padding-left:10px;}
.layim_chateme .layim_chatuser img{margin-left:15px;padding-left: 0;}
.layim_chateme .layim_chatsay .layim_zero{left:auto; right:10px;}
.layim_chateme .layim_chatuser .layim_chattime{padding-left:0; padding-right:10px;}
.layim_chateme .layim_chatsay{float:right; background-color:#EBFBE3}
.layim_chateme .layim_zero{border-right-color:#EBFBE3;}
.layim_groups{display:none; float:right; width:130px; border-left:1px solid #D9D9D9; background-color:#fff;}
.layim_groups ul{display:none;}
.layim_groups ul.layim_groupthis{display:block;}
.layim_groups li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; margin-right:10px;}
.layim_groups li img{width:20px; height:20px; margin-top:5px;}
.layim_groups li span{max-width:80px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
.layim_groups li:hover{background-color:#F3F3F3;}
.layim_groups .layim_errors{text-align:center; color:#999;}
.layim_tool{position:relative; height:35px; line-height:35px; padding-left:10px; background-color:#F3F3F3;}
.layim_tool i{position:relative; top:10px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:16px; height:16px; margin-right:10px; cursor:pointer;font-size:16px;color:#999;font-weight: 700;}
.layim_tool i:hover{color:#FFA00A;}
.layim_tool .layim_seechatlog{position:absolute; right:15px;}
.layim_tool .layim_seechatlog i{}
.layim_write{display:block; border:none; width:98%; height:90px; line-height:20px; margin:5px auto 0;}
.layim_send{position:relative; height:40px; background-color:#F3F3F3;}
.layim_sendbtn{position:absolute; height:26px; line-height:26px; right:10px; top:8px; padding:0 40px 0 20px; background-color:#FFA00A; color:#fff; border-radius:3px; cursor:pointer;}
.layim_enter{position:absolute; right:0; border-left:1px solid #FFB94F; width:24px; height:26px;}
.layim_enter:hover{background-color:#E68A00; border-radius:0 3px 3px 0;}
.layim_enter .layim_zero{left:7px; top:11px; border-width:5px; border-top-style:solid; border-top-color:#FFE0B3;}
.layim_sendtype{display:none; position:absolute; right:10px; bottom:37px; border:1px solid #D9D9D9; background-color:#fff; text-align:left;}
.layim_sendtype span{display:block; line-height:24px; padding:0 10px 0 25px; cursor:pointer;}
.layim_sendtype span:hover{background-color:#F3F3F3;}
.layim_sendtype span i{left:5px;}
.layim_min{display:none; position:absolute; left:-190px; bottom:-1px; width:160px; height:32px; line-height:32px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; border:1px solid #ccc; box-shadow: 0 0 5px rgba(0,0,75,.2); background-color:#FCFDFA; cursor:pointer;}
/*
@Name: layui WebIM 1.0.0
@Author:贤心
@Date: 2014-04-25
@Blog: http://sentsin.com
*/
;!function(win, undefined){
var config = {
msgurl: 'mailbox.html?msg=',
chatlogurl: 'mailbox.html?user=',
aniTime: 200,
right: -232,
api: {
friend: 'js/plugins/layer/layim/data/friend.json', //好友列表接口
group: 'js/plugins/layer/layim/data/group.json', //群组列表接口
chatlog: 'js/plugins/layer/layim/data/chatlog.json', //聊天记录接口
groups: 'js/plugins/layer/layim/data/groups.json', //群组成员接口
sendurl: '' //发送消息接口
},
user: { //当前用户信息
name: '游客',
face: 'img/a1.jpg'
},
//自动回复内置文案,也可动态读取数据库配置
autoReplay: [
'您好,我现在有事不在,一会再和您联系。',
'你没发错吧?',
'洗澡中,请勿打扰,偷窥请购票,个体四十,团体八折,订票电话:一般人我不告诉他!',
'你好,我是主人的美女秘书,有什么事就跟我说吧,等他回来我会转告他的。',
'我正在拉磨,没法招呼您,因为我们家毛驴去动物保护协会把我告了,说我剥夺它休产假的权利。',
'<(@ ̄︶ ̄@)>',
'你要和我说话?你真的要和我说话?你确定自己想说吗?你一定非说不可吗?那你说吧,这是自动回复。',
'主人正在开机自检,键盘鼠标看好机会出去凉快去了,我是他的电冰箱,我打字比较慢,你慢慢说,别急……',
'(*^__^*) 嘻嘻,是贤心吗?'
],
chating: {},
hosts: (function(){
var dk = location.href.match(/\:\d+/);
dk = dk ? dk[0] : '';
return 'http://' + document.domain + dk + '/';
})(),
json: function(url, data, callback, error){
return $.ajax({
type: 'POST',
url: url,
data: data,
dataType: 'json',
success: callback,
error: error
});
},
stopMP: function(e){
e ? e.stopPropagation() : e.cancelBubble = true;
}
}, dom = [$(window), $(document), $('html'), $('body')], xxim = {};
//主界面tab
xxim.tabs = function(index){
var node = xxim.node;
node.tabs.eq(index).addClass('xxim_tabnow').siblings().removeClass('xxim_tabnow');
node.list.eq(index).show().siblings('.xxim_list').hide();
if(node.list.eq(index).find('li').length === 0){
xxim.getDates(index);
}
};
//节点
xxim.renode = function(){
var node = xxim.node = {
tabs: $('#xxim_tabs>span'),
list: $('.xxim_list'),
online: $('.xxim_online'),
setonline: $('.xxim_setonline'),
onlinetex: $('#xxim_onlinetex'),
xximon: $('#xxim_on'),
layimFooter: $('#xxim_bottom'),
xximHide: $('#xxim_hide'),
xximSearch: $('#xxim_searchkey'),
searchMian: $('#xxim_searchmain'),
closeSearch: $('#xxim_closesearch'),
layimMin: $('#layim_min')
};
};
//主界面缩放
xxim.expend = function(){
var node = xxim.node;
if(xxim.layimNode.attr('state') !== '1'){
xxim.layimNode.stop().animate({right: config.right}, config.aniTime, function(){
node.xximon.addClass('xxim_off');
try{
localStorage.layimState = 1;
}catch(e){}
xxim.layimNode.attr({state: 1});
node.layimFooter.addClass('xxim_expend').stop().animate({marginLeft: config.right}, config.aniTime/2);
node.xximHide.addClass('xxim_show');
});
} else {
xxim.layimNode.stop().animate({right: 1}, config.aniTime, function(){
node.xximon.removeClass('xxim_off');
try{
localStorage.layimState = 2;
}catch(e){}
xxim.layimNode.removeAttr('state');
node.layimFooter.removeClass('xxim_expend');
node.xximHide.removeClass('xxim_show');
});
node.layimFooter.stop().animate({marginLeft: 0}, config.aniTime);
}
};
//初始化窗口格局
xxim.layinit = function(){
var node = xxim.node;
//主界面
try{
/*
if(!localStorage.layimState){
config.aniTime = 0;
localStorage.layimState = 1;
}
*/
if(localStorage.layimState === '1'){
xxim.layimNode.attr({state: 1}).css({right: config.right});
node.xximon.addClass('xxim_off');
node.layimFooter.addClass('xxim_expend').css({marginLeft: config.right});
node.xximHide.addClass('xxim_show');
}
}catch(e){
//layer.msg(e.message, 5, -1);
}
};
//聊天窗口
xxim.popchat = function(param){
var node = xxim.node, log = {};
log.success = function(layero){
layer.setMove();
xxim.chatbox = layero.find('#layim_chatbox');
log.chatlist = xxim.chatbox.find('.layim_chatmore>ul');
log.chatlist.html('<li data-id="'+ param.id +'" type="'+ param.type +'" id="layim_user'+ param.type + param.id +'"><span>'+ param.name +'</span><em>×</em></li>')
xxim.tabchat(param, xxim.chatbox);
//最小化聊天窗
xxim.chatbox.find('.layer_setmin').on('click', function(){
var indexs = layero.attr('times');
layero.hide();
node.layimMin.text(xxim.nowchat.name).show();
});
//关闭窗口
xxim.chatbox.find('.layim_close').on('click', function(){
var indexs = layero.attr('times');
layer.close(indexs);
xxim.chatbox = null;
config.chating = {};
config.chatings = 0;
});
//关闭某个聊天
log.chatlist.on('mouseenter', 'li', function(){
$(this).find('em').show();
}).on('mouseleave', 'li', function(){
$(this).find('em').hide();
});
log.chatlist.on('click', 'li em', function(e){
var parents = $(this).parent(), dataType = parents.attr('type');
var dataId = parents.attr('data-id'), index = parents.index();
var chatlist = log.chatlist.find('li'), indexs;
config.stopMP(e);
delete config.chating[dataType + dataId];
config.chatings--;
parents.remove();
$('#layim_area'+ dataType + dataId).remove();
if(dataType === 'group'){
$('#layim_group'+ dataType + dataId).remove();
}
if(parents.hasClass('layim_chatnow')){
if(index === config.chatings){
indexs = index - 1;
} else {
indexs = index + 1;
}
xxim.tabchat(config.chating[chatlist.eq(indexs).attr('type') + chatlist.eq(indexs).attr('data-id')]);
}
if(log.chatlist.find('li').length === 1){
log.chatlist.parent().hide();
}
});
//聊天选项卡
log.chatlist.on('click', 'li', function(){
var othis = $(this), dataType = othis.attr('type'), dataId = othis.attr('data-id');
xxim.tabchat(config.chating[dataType + dataId]);
});
//发送热键切换
log.sendType = $('#layim_sendtype'), log.sendTypes = log.sendType.find('span');
$('#layim_enter').on('click', function(e){
config.stopMP(e);
log.sendType.show();
});
log.sendTypes.on('click', function(){
log.sendTypes.find('i').text('')
$(this).find('i').text('√');
});
xxim.transmit();
};
log.html = '<div class="layim_chatbox" id="layim_chatbox">'
+'<h6>'
+'<span class="layim_move"></span>'
+' <a href="'+ param.url +'" class="layim_face" target="_blank"><img src="'+ param.face +'" ></a>'
+' <a href="'+ param.url +'" class="layim_names" target="_blank">'+ param.name +'</a>'
+' <span class="layim_rightbtn">'
+' <i class="layer_setmin">—</i>'
+' <i class="layim_close">&times;</i>'
+' </span>'
+'</h6>'
+'<div class="layim_chatmore" id="layim_chatmore">'
+' <ul class="layim_chatlist"></ul>'
+'</div>'
+'<div class="layim_groups" id="layim_groups"></div>'
+'<div class="layim_chat">'
+' <div class="layim_chatarea" id="layim_chatarea">'
+' <ul class="layim_chatview layim_chatthis" id="layim_area'+ param.type + param.id +'"></ul>'
+' </div>'
+' <div class="layim_tool">'
+' <i class="layim_addface fa fa-meh-o" title="发送表情"></i>'
+' <a href="javascript:;"><i class="layim_addimage fa fa-picture-o" title="上传图片"></i></a>'
+' <a href="javascript:;"><i class="layim_addfile fa fa-paperclip" title="上传附件"></i></a>'
+' <a href="" target="_blank" class="layim_seechatlog"><i class="fa fa-comment-o"></i>聊天记录</a>'
+' </div>'
+' <textarea class="layim_write" id="layim_write"></textarea>'
+' <div class="layim_send">'
+' <div class="layim_sendbtn" id="layim_sendbtn">发送<span class="layim_enter" id="layim_enter"><em class="layim_zero"></em></span></div>'
+' <div class="layim_sendtype" id="layim_sendtype">'
+' <span><i>√</i>按Enter键发送</span>'
+' <span><i></i>按Ctrl+Enter键发送</span>'
+' </div>'
+' </div>'
+'</div>'
+'</div>';
if(config.chatings < 1){
$.layer({
type: 1,
border: [0],
title: false,
shade: [0],
area: ['620px', '493px'],
move: '.layim_chatbox .layim_move',
moveType: 1,
closeBtn: false,
offset: [(($(window).height() - 493)/2)+'px', ''],
page: {
html: log.html
}, success: function(layero){
log.success(layero);
}
})
} else {
log.chatmore = xxim.chatbox.find('#layim_chatmore');
log.chatarea = xxim.chatbox.find('#layim_chatarea');
log.chatmore.show();
log.chatmore.find('ul>li').removeClass('layim_chatnow');
log.chatmore.find('ul').append('<li data-id="'+ param.id +'" type="'+ param.type +'" id="layim_user'+ param.type + param.id +'" class="layim_chatnow"><span>'+ param.name +'</span><em>×</em></li>');
log.chatarea.find('.layim_chatview').removeClass('layim_chatthis');
log.chatarea.append('<ul class="layim_chatview layim_chatthis" id="layim_area'+ param.type + param.id +'"></ul>');
xxim.tabchat(param);
}
//群组
log.chatgroup = xxim.chatbox.find('#layim_groups');
if(param.type === 'group'){
log.chatgroup.find('ul').removeClass('layim_groupthis');
log.chatgroup.append('<ul class="layim_groupthis" id="layim_group'+ param.type + param.id +'"></ul>');
xxim.getGroups(param);
}
//点击群员切换聊天窗
log.chatgroup.on('click', 'ul>li', function(){
xxim.popchatbox($(this));
});
};
//定位到某个聊天队列
xxim.tabchat = function(param){
var node = xxim.node, log = {}, keys = param.type + param.id;
xxim.nowchat = param;
xxim.chatbox.find('#layim_user'+ keys).addClass('layim_chatnow').siblings().removeClass('layim_chatnow');
xxim.chatbox.find('#layim_area'+ keys).addClass('layim_chatthis').siblings().removeClass('layim_chatthis');
xxim.chatbox.find('#layim_group'+ keys).addClass('layim_groupthis').siblings().removeClass('layim_groupthis');
xxim.chatbox.find('.layim_face>img').attr('src', param.face);
xxim.chatbox.find('.layim_face, .layim_names').attr('href', param.href);
xxim.chatbox.find('.layim_names').text(param.name);
xxim.chatbox.find('.layim_seechatlog').attr('href', config.chatlogurl + param.id);
log.groups = xxim.chatbox.find('.layim_groups');
if(param.type === 'group'){
log.groups.show();
} else {
log.groups.hide();
}
$('#layim_write').focus();
};
//弹出聊天窗
xxim.popchatbox = function(othis){
var node = xxim.node, dataId = othis.attr('data-id'), param = {
id: dataId, //用户ID
type: othis.attr('type'),
name: othis.find('.xxim_onename').text(), //用户名
face: othis.find('.xxim_oneface').attr('src'), //用户头像
href: 'profile.html?user=' + dataId //用户主页
}, key = param.type + dataId;
if(!config.chating[key]){
xxim.popchat(param);
config.chatings++;
} else {
xxim.tabchat(param);
}
config.chating[key] = param;
var chatbox = $('#layim_chatbox');
if(chatbox[0]){
node.layimMin.hide();
chatbox.parents('.xubox_layer').show();
}
};
//请求群员
xxim.getGroups = function(param){
var keys = param.type + param.id, str = '',
groupss = xxim.chatbox.find('#layim_group'+ keys);
groupss.addClass('loading');
config.json(config.api.groups, {}, function(datas){
if(datas.status === 1){
var ii = 0, lens = datas.data.length;
if(lens > 0){
for(; ii < lens; ii++){
str += '<li data-id="'+ datas.data[ii].id +'" type="one"><img src="'+ datas.data[ii].face +'" class="xxim_oneface"><span class="xxim_onename">'+ datas.data[ii].name +'</span></li>';
}
} else {
str = '<li class="layim_errors">没有群员</li>';
}
} else {
str = '<li class="layim_errors">'+ datas.msg +'</li>';
}
groupss.removeClass('loading');
groupss.html(str);
}, function(){
groupss.removeClass('loading');
groupss.html('<li class="layim_errors">请求异常</li>');
});
};
//消息传输
xxim.transmit = function(){
var node = xxim.node, log = {};
node.sendbtn = $('#layim_sendbtn');
node.imwrite = $('#layim_write');
//发送
log.send = function(){
var data = {
content: node.imwrite.val(),
id: xxim.nowchat.id,
sign_key: '', //密匙
_: +new Date
};
if(data.content.replace(/\s/g, '') === ''){
layer.tips('说点啥呗!', '#layim_write', 2);
node.imwrite.focus();
} else {
//此处皆为模拟
var keys = xxim.nowchat.type + xxim.nowchat.id;
//聊天模版
log.html = function(param, type){
return '<li class="'+ (type === 'me' ? 'layim_chateme' : '') +'">'
+'<div class="layim_chatuser">'
+ function(){
if(type === 'me'){
return '<span class="layim_chattime">'+ param.time +'</span>'
+'<span class="layim_chatname">'+ param.name +'</span>'
+'<img src="'+ param.face +'" >';
} else {
return '<img src="'+ param.face +'" >'
+'<span class="layim_chatname">'+ param.name +'</span>'
+'<span class="layim_chattime">'+ param.time +'</span>';
}
}()
+'</div>'
+'<div class="layim_chatsay">'+ param.content +'<em class="layim_zero"></em></div>'
+'</li>';
};
log.imarea = xxim.chatbox.find('#layim_area'+ keys);
log.imarea.append(log.html({
time: '2014-04-26 0:37',
name: config.user.name,
face: config.user.face,
content: data.content
}, 'me'));
node.imwrite.val('').focus();
log.imarea.scrollTop(log.imarea[0].scrollHeight);
setTimeout(function(){
log.imarea.append(log.html({
time: '2014-04-26 0:38',
name: xxim.nowchat.name,
face: xxim.nowchat.face,
content: config.autoReplay[(Math.random()*config.autoReplay.length) | 0]
}));
log.imarea.scrollTop(log.imarea[0].scrollHeight);
}, 500);
/*
that.json(config.api.sendurl, data, function(datas){
});
*/
}
};
node.sendbtn.on('click', log.send);
node.imwrite.keyup(function(e){
if(e.keyCode === 13){
log.send();
}
});
};
//事件
xxim.event = function(){
var node = xxim.node;
//主界面tab
node.tabs.eq(0).addClass('xxim_tabnow');
node.tabs.on('click', function(){
var othis = $(this), index = othis.index();
xxim.tabs(index);
});
//列表展收
node.list.on('click', 'h5', function(){
var othis = $(this), chat = othis.siblings('.xxim_chatlist'), parentss = othis.find("i");
if(parentss.hasClass('fa-caret-down')){
chat.hide();
parentss.attr('class','fa fa-caret-right');
} else {
chat.show();
parentss.attr('class','fa fa-caret-down');
}
});
//设置在线隐身
node.online.on('click', function(e){
config.stopMP(e);
node.setonline.show();
});
node.setonline.find('span').on('click', function(e){
var index = $(this).index();
config.stopMP(e);
if(index === 0){
node.onlinetex.html('在线');
node.online.removeClass('xxim_offline');
} else if(index === 1) {
node.onlinetex.html('隐身');
node.online.addClass('xxim_offline');
}
node.setonline.hide();
});
node.xximon.on('click', xxim.expend);
node.xximHide.on('click', xxim.expend);
//搜索
node.xximSearch.keyup(function(){
var val = $(this).val().replace(/\s/g, '');
if(val !== ''){
node.searchMian.show();
node.closeSearch.show();
//此处的搜索ajax参考xxim.getDates
node.list.eq(3).html('<li class="xxim_errormsg">没有符合条件的结果</li>');
} else {
node.searchMian.hide();
node.closeSearch.hide();
}
});
node.closeSearch.on('click', function(){
$(this).hide();
node.searchMian.hide();
node.xximSearch.val('').focus();
});
//弹出聊天窗
config.chatings = 0;
node.list.on('click', '.xxim_childnode', function(){
var othis = $(this);
xxim.popchatbox(othis);
});
//点击最小化栏
node.layimMin.on('click', function(){
$(this).hide();
$('#layim_chatbox').parents('.xubox_layer').show();
});
//document事件
dom[1].on('click', function(){
node.setonline.hide();
$('#layim_sendtype').hide();
});
};
//请求列表数据
xxim.getDates = function(index){
var api = [config.api.friend, config.api.group, config.api.chatlog],
node = xxim.node, myf = node.list.eq(index);
myf.addClass('loading');
config.json(api[index], {}, function(datas){
if(datas.status === 1){
var i = 0, myflen = datas.data.length, str = '', item;
if(myflen > 1){
if(index !== 2){
for(; i < myflen; i++){
str += '<li data-id="'+ datas.data[i].id +'" class="xxim_parentnode">'
+'<h5><i class="fa fa-caret-right"></i><span class="xxim_parentname">'+ datas.data[i].name +'</span><em class="xxim_nums">('+ datas.data[i].nums +')</em></h5>'
+'<ul class="xxim_chatlist">';
item = datas.data[i].item;
for(var j = 0; j < item.length; j++){
str += '<li data-id="'+ item[j].id +'" class="xxim_childnode" type="'+ (index === 0 ? 'one' : 'group') +'"><img src="'+ item[j].face +'" class="xxim_oneface"><span class="xxim_onename">'+ item[j].name +'</span></li>';
}
str += '</ul></li>';
}
} else {
str += '<li class="xxim_liston">'
+'<ul class="xxim_chatlist">';
for(; i < myflen; i++){
str += '<li data-id="'+ datas.data[i].id +'" class="xxim_childnode" type="one"><img src="'+ datas.data[i].face +'" class="xxim_oneface"><span class="xxim_onename">'+ datas.data[i].name +'</span><em class="xxim_time">'+ datas.data[i].time +'</em></li>';
}
str += '</ul></li>';
}
myf.html(str);
} else {
myf.html('<li class="xxim_errormsg">没有任何数据</li>');
}
myf.removeClass('loading');
} else {
myf.html('<li class="xxim_errormsg">'+ datas.msg +'</li>');
}
}, function(){
myf.html('<li class="xxim_errormsg">请求失败</li>');
myf.removeClass('loading');
});
};
//渲染骨架
xxim.view = (function(){
var xximNode = xxim.layimNode = $('<div id="xximmm" class="xxim_main">'
+'<div class="xxim_top" id="xxim_top">'
+' <div class="xxim_search"><i class="fa fa-search"></i><input id="xxim_searchkey" /><span id="xxim_closesearch">×</span></div>'
+' <div class="xxim_tabs" id="xxim_tabs"><span class="xxim_tabfriend" title="好友"><i class="fa fa-user"></i></span><span class="xxim_tabgroup" title="群组"><i class="fa fa-users"></i></span><span class="xxim_latechat" title="最近聊天"><i class="fa fa-clock-o"></i></span></div>'
+' <ul class="xxim_list" style="display:block"></ul>'
+' <ul class="xxim_list"></ul>'
+' <ul class="xxim_list"></ul>'
+' <ul class="xxim_list xxim_searchmain" id="xxim_searchmain"></ul>'
+'</div>'
+'<ul class="xxim_bottom" id="xxim_bottom">'
+'<li class="xxim_online" id="xxim_online">'
+'<i class="xxim_nowstate fa fa-check-circle"></i><span id="xxim_onlinetex">在线</span>'
+'<div class="xxim_setonline">'
+'<span><i class="fa fa-check-circle"></i>在线</span>'
+'<span class="xxim_setoffline"><i class="fa fa-check-circle"></i>隐身</span>'
+'</div>'
+'</li>'
+'<li class="xxim_mymsg" id="xxim_mymsg" title="我的私信"><i class="fa fa-comment"></i><a href="'+ config.msgurl +'" target="_blank"></a></li>'
+'<li class="xxim_seter" id="xxim_seter" title="设置">'
+'<i class="fa fa-gear"></i>'
+'<div>'
+'</div>'
+'</li>'
+'<li class="xxim_hide" id="xxim_hide"><i class="fa fa-exchange"></i></li>'
+'<li id="xxim_on" class="xxim_icon xxim_on fa fa-ellipsis-v"></li>'
+'<div class="layim_min" id="layim_min"></div>'
+'</ul>'
+'</div>');
dom[3].append(xximNode);
xxim.renode();
xxim.getDates(0);
xxim.event();
xxim.layinit();
}());
}(window);
.checkbox {
padding-left: 20px;
}
.checkbox label {
display: inline-block;
vertical-align: middle;
position: relative;
padding-left: 5px;
}
.checkbox label::before {
content: "";
display: inline-block;
position: absolute;
width: 17px;
height: 17px;
left: 0;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 3px;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
.checkbox label::after {
display: inline-block;
position: absolute;
width: 16px;
height: 16px;
left: 0;
top: 0;
margin-left: -20px;
padding-left: 3px;
padding-top: 1px;
font-size: 11px;
color: #555555;
}
.checkbox input[type="checkbox"],
.checkbox input[type="radio"] {
opacity: 0;
z-index: 1;
}
.checkbox input[type="checkbox"]:focus + label::before,
.checkbox input[type="radio"]:focus + label::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.checkbox input[type="checkbox"]:checked + label::after,
.checkbox input[type="radio"]:checked + label::after {
font-family: "FontAwesome";
content: "\f00c";
}
.checkbox input[type="checkbox"]:disabled + label,
.checkbox input[type="radio"]:disabled + label {
opacity: 0.65;
}
.checkbox input[type="checkbox"]:disabled + label::before,
.checkbox input[type="radio"]:disabled + label::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkbox.checkbox-circle label::before {
border-radius: 50%;
}
.checkbox.checkbox-inline {
margin-top: 0;
}
.checkbox-primary input[type="checkbox"]:checked + label::before,
.checkbox-primary input[type="radio"]:checked + label::before {
background-color: #337ab7;
border-color: #337ab7;
}
.checkbox-primary input[type="checkbox"]:checked + label::after,
.checkbox-primary input[type="radio"]:checked + label::after {
color: #fff;
}
.checkbox-danger input[type="checkbox"]:checked + label::before,
.checkbox-danger input[type="radio"]:checked + label::before {
background-color: #d9534f;
border-color: #d9534f;
}
.checkbox-danger input[type="checkbox"]:checked + label::after,
.checkbox-danger input[type="radio"]:checked + label::after {
color: #fff;
}
.checkbox-info input[type="checkbox"]:checked + label::before,
.checkbox-info input[type="radio"]:checked + label::before {
background-color: #5bc0de;
border-color: #5bc0de;
}
.checkbox-info input[type="checkbox"]:checked + label::after,
.checkbox-info input[type="radio"]:checked + label::after {
color: #fff;
}
.checkbox-warning input[type="checkbox"]:checked + label::before,
.checkbox-warning input[type="radio"]:checked + label::before {
background-color: #f0ad4e;
border-color: #f0ad4e;
}
.checkbox-warning input[type="checkbox"]:checked + label::after,
.checkbox-warning input[type="radio"]:checked + label::after {
color: #fff;
}
.checkbox-success input[type="checkbox"]:checked + label::before,
.checkbox-success input[type="radio"]:checked + label::before {
background-color: #5cb85c;
border-color: #5cb85c;
}
.checkbox-success input[type="checkbox"]:checked + label::after,
.checkbox-success input[type="radio"]:checked + label::after {
color: #fff;
}
.radio {
padding-left: 20px;
}
.radio label {
display: inline-block;
vertical-align: middle;
position: relative;
padding-left: 5px;
}
.radio label::before {
content: "";
display: inline-block;
position: absolute;
width: 17px;
height: 17px;
left: 0;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 50%;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out;
transition: border 0.15s ease-in-out;
}
.radio label::after {
display: inline-block;
position: absolute;
content: " ";
width: 11px;
height: 11px;
left: 3px;
top: 3px;
margin-left: -20px;
border-radius: 50%;
background-color: #555555;
-webkit-transform: scale(0, 0);
-ms-transform: scale(0, 0);
-o-transform: scale(0, 0);
transform: scale(0, 0);
-webkit-transition: -webkit-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
-moz-transition: -moz-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
-o-transition: -o-transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
transition: transform 0.1s cubic-bezier(0.8, -0.33, 0.2, 1.33);
}
.radio input[type="radio"] {
opacity: 0;
z-index: 1;
}
.radio input[type="radio"]:focus + label::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.radio input[type="radio"]:checked + label::after {
-webkit-transform: scale(1, 1);
-ms-transform: scale(1, 1);
-o-transform: scale(1, 1);
transform: scale(1, 1);
}
.radio input[type="radio"]:disabled + label {
opacity: 0.65;
}
.radio input[type="radio"]:disabled + label::before {
cursor: not-allowed;
}
.radio.radio-inline {
margin-top: 0;
}
.radio-primary input[type="radio"] + label::after {
background-color: #337ab7;
}
.radio-primary input[type="radio"]:checked + label::before {
border-color: #337ab7;
}
.radio-primary input[type="radio"]:checked + label::after {
background-color: #337ab7;
}
.radio-danger input[type="radio"] + label::after {
background-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::before {
border-color: #d9534f;
}
.radio-danger input[type="radio"]:checked + label::after {
background-color: #d9534f;
}
.radio-info input[type="radio"] + label::after {
background-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::before {
border-color: #5bc0de;
}
.radio-info input[type="radio"]:checked + label::after {
background-color: #5bc0de;
}
.radio-warning input[type="radio"] + label::after {
background-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::before {
border-color: #f0ad4e;
}
.radio-warning input[type="radio"]:checked + label::after {
background-color: #f0ad4e;
}
.radio-success input[type="radio"] + label::after {
background-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::before {
border-color: #5cb85c;
}
.radio-success input[type="radio"]:checked + label::after {
background-color: #5cb85c;
}
input[type="checkbox"].styled:checked + label:after,
input[type="radio"].styled:checked + label:after {
font-family: 'FontAwesome';
content: "\f00c";
}
input[type="checkbox"] .styled:checked + label::before,
input[type="radio"] .styled:checked + label::before {
color: #fff;
}
input[type="checkbox"] .styled:checked + label::after,
input[type="radio"] .styled:checked + label::after {
color: #fff;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -117,7 +117,7 @@
label.error {
position: absolute;
right: 18px;
top: 5px;
top: 7px;
color: #ef392b;
font-size: 12px
}
......@@ -136,6 +136,24 @@ label.error {
padding-left: 25px
}
.i-checks label.error, .check-box label.error, .radio-box label.error {
right:auto;
width:150px;
left:210px;
top:1px;
max-width: none;
}
/** 内联复选框&单选框 */
.check-box,.radio-box {
display:inline-block;
box-sizing:border-box;
cursor:pointer;
position:relative;
padding-right:20px;
padding-top:7px;
}
/** 遮罩层 */
.loaderbox {
display: inline-block;
......@@ -217,46 +235,41 @@ li {
padding-left: 10px;
}
label{
label {
font-weight: normal;
}
.container-div{
.container-div {
padding:10px 35px;
height:100%;
}
.container-div .row{
.container-div .row {
height: 100%;
}
.select-info{
.select-info,.select-table {
width:100%;
background: #fff;
border-radius: 6px;
margin-top:10px;
padding-top: 5px;
padding-bottom: 13px;
box-shadow: 1px 1px 3px rgba(0,0,0,.2);
}
.select-info{
.select-info {
position: relative;
}
.select-info .save-btn,.select-info .close-btn{
width: 20px;
position: absolute;
right: 20px;
top: 15px;
cursor: pointer;
}
.select-info .save-btn{
right: 50px;
.select-info .col-sm-6 .control-label {
color:#333;
}
.select-info .col-sm-6 .control-label{
color:#333;
@media ( max-width : 768px) {
.select-info {
display: none;
}
}
.select-list li{
......@@ -271,6 +284,7 @@ label{
outline: none;
height: 30px;
width:280px;
padding-left:5px;
}
.select-list li .submit-btn{
border:0px;
......@@ -289,17 +303,17 @@ label{
width:280px;
}
.select-list .time input{
.select-list .select-time input{
width:133px;
}
.time label,.time span,.time input{
.select-time label,.select-time span,.select-time input{
float:left;
}
.time label{
.select-time label{
margin-top: 5px;
}
.time span{
.select-time span{
display: block;
margin: 5px 5px;
}
......@@ -328,9 +342,10 @@ label{
.table-striped .bootstrap-table{
border:0px!important;
}
.table-striped .table, .fixed-table-container, .table-striped .table, .table-striped .table, .table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th, .table-striped .table>tfoot>tr>th, .table-striped .table>thead>tr>td, .table-striped .table>tbody>tr>td, .table-striped .table>tfoot>tr>td{
background-color: transparent!important;
border: 0px;
.table-striped .table, .fixed-table-container, table, .table-striped .table, .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td{
border-bottom: 1px solid #e7eaec!important;
background-color: transparent!important;
border: 0px;
}
.table-striped .table>thead>tr>th, .table-striped .table>tbody>tr>th{
border-bottom: 1px solid #ccc!important;
......
......@@ -2,4 +2,4 @@
* ruoyi.css
* Author: Ruoyi
*/
.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,0.1)}.box-header:before,.box-body:before,.box-footer:before,.box-header:after,.box-body:after,.box-footer:after{content:" ";display:table}.box-header:after,.box-body:after,.box-footer:after{clear:both}.btn-box-tool{padding:5px;font-size:12px;background:transparent;color:#97a0b3}.open .btn-box-tool,.btn-box-tool:hover{color:#606c84}.box-main{margin:0;border:0;padding-top:2px;border-radius:0;box-shadow:none}.box-main>.box-header{border-bottom:1px solid #eee;padding:12px 10px 2px 15px}.box-header .box-title{display:inline-block;font-size:18px;margin:0;line-height:1}.box-main>.box-header .box-title{font-size:16px;margin-bottom:13px;float:left}.box-main>.box-header .box-title .fa{font-size:14px;padding-right:3px;margin-top:-2px}.box-main>.box-header .box-tools{position:relative;top:-5px;right:0}.box-main>.box-header .box-tools .btn{padding:3px 10px 5px 10px;font-size:14px;margin-bottom:2px}.box-main>.box-header .box-tools .btn-box-tool{padding:4px 2px}.box-main form>.box-footer,.nav-main form>.box-footer{background:#fafafa}.box-main form>.box-footer .row,.nav-main form>.box-footer .row{margin:5px 0 5px -25px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#1ab394;border-color:#1ab394;padding:1px 10px;color:#fff}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{margin-right:5px;color:rgba(255,255,255,0.7)}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#fff}.select2-container .select2-selection--single .select2-selection__rendered{padding-right:10px}label.error{position:absolute;right:18px;top:5px;color:#ef392b;font-size:12px}.Validform_error,input.error,select.error{background-color:#fbe2e2;border-color:#c66161;color:#c00}.Validform_wrong,.Validform_right,.Validform_warning{display:inline-block;height:20px;font-size:12px;vertical-align:middle;padding-left:25px}.loaderbox{display:inline-block;min-width:125px;padding:10px;margin:0 auto;color:#000!important;font-size:13px;font-weight:400;text-align:center;vertical-align:middle;border:1px solid #ddd;background-color:#eee;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 8px rgba(0,0,0,0.1);box-shadow:0 1px 8px rgba(0,0,0,0.1)}.loaderbox .loading-activity{float:left;width:18px;height:18px;border:solid 2px transparent;border-top-color:#000;border-left-color:#000;border-radius:10px;-webkit-animation:pace-spinner 400ms linear infinite;-moz-animation:pace-spinner 400ms linear infinite;-ms-animation:pace-spinner 400ms linear infinite;-o-animation:pace-spinner 400ms linear infinite;animation:pace-spinner 400ms linear infinite}@media(max-width:767px){.loading-activity{width:18px;height:18px}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}li{list-style:none}.time-input{display:block;width:100%;padding-left:10px}label{font-weight:normal}.container-div{padding:10px 35px;height:100%}.container-div .row{height:100%}.select-info{width:100%;background:#fff;border-radius:6px;margin-top:10px;padding-bottom:13px;box-shadow:1px 1px 3px rgba(0,0,0,.2)}.select-info{position:relative}.select-info .save-btn,.select-info .close-btn{width:20px;position:absolute;right:20px;top:15px;cursor:pointer}.select-info .save-btn{right:50px}.select-info .col-sm-6 .control-label{color:#333}.select-list li{float:left;color:#333;margin:5px 15px 5px 0}.select-list li input{border:1px solid #ddd;border-radius:4px;background:transparent;outline:0;height:30px;width:280px}.select-list li .submit-btn{border:0;border-radius:4px;background:transparent;outline:0;width:40px;height:23px}.select-list li select{border:1px solid #ddd;border-radius:4px;background:transparent;outline:0;height:30px;width:280px}.select-list .time input{width:133px}.time label,.time span,.time input{float:left}.time label{margin-top:5px}.time span{display:block;margin:5px 5px}.search-btn{background-color:#1ab394;border-color:#1ab394;color:#FFF;margin-bottom:5px;display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;border-radius:3px;vertical-align:middle;cursor:pointer}.table-striped{min-height:75%}.table-striped .bootstrap-table{border:0!important}.table-striped .table,.fixed-table-container,.table-striped .table,.table-striped .table,.table-striped .table>thead>tr>th,.table-striped .table>tbody>tr>th,.table-striped .table>tfoot>tr>th,.table-striped .table>thead>tr>td,.table-striped .table>tbody>tr>td,.table-striped .table>tfoot>tr>td{background-color:transparent!important;border:0}.table-striped .table>thead>tr>th,.table-striped .table>tbody>tr>th{border-bottom:1px solid #ccc!important;border-top:0!important}.table-striped .table>thead:first-child>tr:first-child>th{color:#333}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}
\ No newline at end of file
.box{position:relative;border-radius:3px;background:#fff;border-top:3px solid #d2d6de;margin-bottom:20px;width:100%;box-shadow:0 1px 1px rgba(0,0,0,0.1)}.box-header:before,.box-body:before,.box-footer:before,.box-header:after,.box-body:after,.box-footer:after{content:" ";display:table}.box-header:after,.box-body:after,.box-footer:after{clear:both}.btn-box-tool{padding:5px;font-size:12px;background:transparent;color:#97a0b3}.open .btn-box-tool,.btn-box-tool:hover{color:#606c84}.box-main{margin:0;border:0;padding-top:2px;border-radius:0;box-shadow:none}.box-main>.box-header{border-bottom:1px solid #eee;padding:12px 10px 2px 15px}.box-header .box-title{display:inline-block;font-size:18px;margin:0;line-height:1}.box-main>.box-header .box-title{font-size:16px;margin-bottom:13px;float:left}.box-main>.box-header .box-title .fa{font-size:14px;padding-right:3px;margin-top:-2px}.box-main>.box-header .box-tools{position:relative;top:-5px;right:0}.box-main>.box-header .box-tools .btn{padding:3px 10px 5px 10px;font-size:14px;margin-bottom:2px}.box-main>.box-header .box-tools .btn-box-tool{padding:4px 2px}.box-main form>.box-footer,.nav-main form>.box-footer{background:#fafafa}.box-main form>.box-footer .row,.nav-main form>.box-footer .row{margin:5px 0 5px -25px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#1ab394;border-color:#1ab394;padding:1px 10px;color:#fff}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{margin-right:5px;color:rgba(255,255,255,0.7)}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#fff}.select2-container .select2-selection--single .select2-selection__rendered{padding-right:10px}label.error{position:absolute;right:18px;top:7px;color:#ef392b;font-size:12px}.Validform_error,input.error,select.error{background-color:#fbe2e2;border-color:#c66161;color:#c00}.Validform_wrong,.Validform_right,.Validform_warning{display:inline-block;height:20px;font-size:12px;vertical-align:middle;padding-left:25px}.i-checks label.error,.check-box label.error,.radio-box label.error{right:auto;width:150px;left:210px;top:1px;max-width:none}.check-box,.radio-box{display:inline-block;box-sizing:border-box;cursor:pointer;position:relative;padding-right:20px;padding-top:7px}.loaderbox{display:inline-block;min-width:125px;padding:10px;margin:0 auto;color:#000!important;font-size:13px;font-weight:400;text-align:center;vertical-align:middle;border:1px solid #ddd;background-color:#eee;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 1px 8px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 8px rgba(0,0,0,0.1);box-shadow:0 1px 8px rgba(0,0,0,0.1)}.loaderbox .loading-activity{float:left;width:18px;height:18px;border:solid 2px transparent;border-top-color:#000;border-left-color:#000;border-radius:10px;-webkit-animation:pace-spinner 400ms linear infinite;-moz-animation:pace-spinner 400ms linear infinite;-ms-animation:pace-spinner 400ms linear infinite;-o-animation:pace-spinner 400ms linear infinite;animation:pace-spinner 400ms linear infinite}@media(max-width:767px){.loading-activity{width:18px;height:18px}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}li{list-style:none}.time-input{display:block;width:100%;padding-left:10px}label{font-weight:normal}.container-div{padding:10px 35px;height:100%}.container-div .row{height:100%}.select-info,.select-table{width:100%;background:#fff;border-radius:6px;margin-top:10px;padding-top:5px;padding-bottom:13px;box-shadow:1px 1px 3px rgba(0,0,0,.2)}.select-info{position:relative}.select-info .col-sm-6 .control-label{color:#333}@media(max-width :768px){.select-info{display:none}}.select-list li{float:left;color:#333;margin:5px 15px 5px 0}.select-list li input{border:1px solid #ddd;border-radius:4px;background:transparent;outline:0;height:30px;width:280px;padding-left:5px}.select-list li .submit-btn{border:0;border-radius:4px;background:transparent;outline:0;width:40px;height:23px}.select-list li select{border:1px solid #ddd;border-radius:4px;background:transparent;outline:0;height:30px;width:280px}.select-list .select-time input{width:133px}.select-time label,.select-time span,.select-time input{float:left}.select-time label{margin-top:5px}.select-time span{display:block;margin:5px 5px}.search-btn{background-color:#1ab394;border-color:#1ab394;color:#FFF;margin-bottom:5px;display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;border-radius:3px;vertical-align:middle;cursor:pointer}.table-striped{min-height:75%}.table-striped .bootstrap-table{border:0!important}.table-striped .table,.fixed-table-container,table,.table-striped .table,.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{border-bottom:1px solid #e7eaec!important;background-color:transparent!important;border:0}.table-striped .table>thead>tr>th,.table-striped .table>tbody>tr>th{border-bottom:1px solid #ccc!important;border-top:0!important}.table-striped .table>thead:first-child>tr:first-child>th{color:#333}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}
\ No newline at end of file
......@@ -18,7 +18,13 @@ $(function(){
radioClass: "iradio_square-green",
})
}
if ($(".time").length > 0) {
if ($(".radio-box").length > 0) {
$(".radio-box").iCheck({
checkboxClass: "icheckbox_square-green",
radioClass: "iradio_square-green",
})
}
if ($(".select-time").length > 0) {
layui.use('laydate', function() {
var laydate = layui.laydate;
laydate.render({ elem: '#startTime', theme: 'molv' });
......
......@@ -159,6 +159,11 @@
},
// 表单封装处理
form: {
// 表单重置
reset: function(formId) {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
$("#" + currentId)[0].reset();
},
// 获取选中复选框项
selectCheckeds: function(name) {
var checkeds = "";
......@@ -375,7 +380,7 @@
});
},
// 批量删除信息
batRemove: function() {
removeAll: function() {
var rows = $.common.isEmpty($.table._option.id) ? $.table.selectFirstColumns() : $.table.selectColumns($.table._option.id);
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
......@@ -441,6 +446,16 @@
$.modal.closeLoading();
}
},
// 校验封装处理
validate: {
// 判断返回标识是否唯一 false 不存在 true 存在
unique: function (value) {
if (value == "0") {
return true;
}
return false;
}
},
// 通用方法封装处理
common: {
// 判断字符串是否为空
......
......@@ -2,4 +2,4 @@
* ruoyi.js
* Author: Ruoyi
*/
(function($){$.extend({table:{_option:{},_params:{},init:function(options){$.table._option=options;$.table._params=$.common.isEmpty(options.queryParams)?$.table.queryParams:options.queryParams;_sortOrder=$.common.isEmpty(options.sortOrder)?"asc":options.sortOrder;_sortName=$.common.isEmpty(options.sortName)?"":options.sortName;$("#bootstrap-table").bootstrapTable({url:options.url,contentType:"application/x-www-form-urlencoded",method:"post",cache:false,sortable:true,sortStable:true,sortName:_sortName,sortOrder:_sortOrder,pagination:$.common.visible(options.pagination),pageNumber:1,pageSize:10,pageList:[10,25,50],iconSize:"outline",toolbar:"#toolbar",sidePagination:"server",search:$.common.visible(options.search),showRefresh:$.common.visible(options.showRefresh),showColumns:$.common.visible(options.showColumns),showToggle:$.common.visible(options.showToggle),showExport:$.common.visible(options.showExport),queryParams:$.table._params,columns:options.columns,responseHandler:$.table.responseHandler})},queryParams:function(params){return{pageSize:params.limit,pageNum:params.offset/params.limit+1,searchValue:params.search,orderByColumn:params.sort,isAsc:params.order}},responseHandler:function(res){if(res.code==0){return{rows:res.rows,total:res.total}}else{$.modal.alertWarning(res.msg);return{rows:[],total:0}}},search:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;var params=$("#bootstrap-table").bootstrapTable("getOptions");params.queryParams=function(params){var search={};$.each($("#"+currentId).serializeArray(),function(i,field){search[field.name]=field.value});search.pageSize=params.limit;search.pageNum=params.offset/params.limit+1;search.searchValue=params.search;search.orderByColumn=params.sort;search.isAsc=params.order;return search};$("#bootstrap-table").bootstrapTable("refresh",params)},exportExcel:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;$.modal.loading("正在导出数据,请稍后...");$.post($.table._option.exportUrl,$("#"+currentId).serializeArray(),function(result){if(result.code==web_status.SUCCESS){window.location.href=ctx+"common/download?fileName="+result.msg+"&delete="+true}else{$.modal.alertError(result.msg)}$.modal.closeLoading()})},refresh:function(){$("#bootstrap-table").bootstrapTable("refresh",{url:$.table._option.url,silent:true})},selectColumns:function(column){return $.map($("#bootstrap-table").bootstrapTable("getSelections"),function(row){return row[column]})},selectFirstColumns:function(){return $.map($("#bootstrap-table").bootstrapTable("getSelections"),function(row){return row[$.table._option.columns[1].field]})},selectDictLabel:function(_datas,_value){var actions=[];$.each(_datas,function(index,dict){if(dict.dictValue==_value){actions.push("<span class='badge badge-"+dict.listClass+"'>"+dict.dictLabel+"</span>");return false}});return actions.join("")}},treeTable:{_option:{},_treeTable:{},init:function(options){$.table._option=options;var treeTable=$("#bootstrap-table").bootstrapTreeTable({code:options.id,parentCode:options.parentId,type:"get",url:options.url,ajaxParams:{},expandColumn:"0",striped:false,bordered:true,expandAll:$.common.visible(options.expandAll),columns:options.columns});$.treeTable._treeTable=treeTable},search:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;var params={};$.each($("#"+currentId).serializeArray(),function(i,field){params[field.name]=field.value});$.treeTable._treeTable.bootstrapTreeTable("refresh",params)},refresh:function(){$.treeTable._treeTable.bootstrapTreeTable("refresh")},},form:{selectCheckeds:function(name){var checkeds="";$('input:checkbox[name="'+name+'"]:checked').each(function(i){if(0==i){checkeds=$(this).val()}else{checkeds+=(","+$(this).val())}});return checkeds},selectSelects:function(name){var selects="";$("#"+name+" option:selected").each(function(i){if(0==i){selects=$(this).val()}else{selects+=(","+$(this).val())}});return selects}},modal:{icon:function(type){var icon="";if(type==modal_status.WARNING){icon=0}else{if(type==modal_status.SUCCESS){icon=1}else{if(type==modal_status.FAIL){icon=2}else{icon=3}}}return icon},msg:function(content,type){if(type!=undefined){layer.msg(content,{icon:$.modal.icon(type),time:1000,shift:5})}else{layer.msg(content)}},msgError:function(content){$.modal.msg(content,modal_status.FAIL)},msgSuccess:function(content){$.modal.msg(content,modal_status.SUCCESS)},msgWarning:function(content){$.modal.msg(content,modal_status.WARNING)},alert:function(content,type){layer.alert(content,{icon:$.modal.icon(type),title:"系统提示",btn:["确认"],btnclass:["btn btn-primary"],})},msgReload:function(msg,type){layer.msg(msg,{icon:$.modal.icon(type),time:500,shade:[0.1,"#8F8F8F"]},function(){$.modal.reload()})},alertError:function(content){$.modal.alert(content,modal_status.FAIL)},alertSuccess:function(content){$.modal.alert(content,modal_status.SUCCESS)},alertWarning:function(content){$.modal.alert(content,modal_status.WARNING)},close:function(){var index=parent.layer.getFrameIndex(window.name);parent.layer.close(index)},confirm:function(content,callBack){layer.confirm(content,{icon:3,title:"系统提示",btn:["确认","取消"],btnclass:["btn btn-primary","btn btn-danger"],},function(index){layer.close(index);callBack(true)})},open:function(title,url,width,height){if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){width="auto";height="auto"}if($.common.isEmpty(title)){title=false}if($.common.isEmpty(url)){url="404.html"}if($.common.isEmpty(width)){width=800}if($.common.isEmpty(height)){height=($(window).height()-50)}layer.open({type:2,area:[width+"px",height+"px"],fix:false,maxmin:true,shade:0.3,title:title,content:url})},openFull:function(title,url,width,height){if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){width="auto";height="auto"}if($.common.isEmpty(title)){title=false}if($.common.isEmpty(url)){url="404.html"}if($.common.isEmpty(width)){width=800}if($.common.isEmpty(height)){height=($(window).height()-50)}var index=layer.open({type:2,area:[width+"px",height+"px"],fix:false,maxmin:true,shade:0.3,title:title,content:url});layer.full(index)},loading:function(message){$.blockUI({message:'<div class="loaderbox"><div class="loading-activity"></div> '+message+"</div>"})},closeLoading:function(){setTimeout(function(){$.unblockUI()},50)},reload:function(){parent.location.reload()}},operate:{submit:function(url,type,dataType,data){$.modal.loading("正在处理中,请稍后...");var config={url:url,type:type,dataType:dataType,data:data,success:function(result){$.operate.ajaxSuccess(result)}};$.ajax(config)},post:function(url,data){$.operate.submit(url,"post","json",data)},remove:function(id){$.modal.confirm("确定删除该条"+$.table._option.modalName+"信息吗?",function(){var url=$.common.isEmpty(id)?$.table._option.removeUrl:$.table._option.removeUrl.replace("{id}",id);var data={"ids":id};$.operate.submit(url,"post","json",data)})},batRemove:function(){var rows=$.common.isEmpty($.table._option.id)?$.table.selectFirstColumns():$.table.selectColumns($.table._option.id);if(rows.length==0){$.modal.alertWarning("请至少选择一条记录");return}$.modal.confirm("确认要删除选中的"+rows.length+"条数据吗?",function(){var url=$.table._option.removeUrl;var data={"ids":rows.join()};$.operate.submit(url,"post","json",data)})},add:function(id){var url=$.common.isEmpty(id)?$.table._option.createUrl:$.table._option.createUrl.replace("{id}",id);$.modal.open("添加"+$.table._option.modalName,url)},edit:function(id){var url=$.table._option.updateUrl.replace("{id}",id);$.modal.open("修改"+$.table._option.modalName,url)},addFull:function(id){var url=$.common.isEmpty(id)?$.table._option.createUrl:$.table._option.createUrl.replace("{id}",id);$.modal.openFull("添加"+$.table._option.modalName,url)},editFull:function(id){var url=$.table._option.updateUrl.replace("{id}",id);$.modal.openFull("修改"+$.table._option.modalName,url)},save:function(url,data){$.modal.loading("正在处理中,请稍后...");var config={url:url,type:"post",dataType:"json",data:data,success:function(result){$.operate.saveSuccess(result)}};$.ajax(config)},ajaxSuccess:function(result){if(result.code==web_status.SUCCESS){$.modal.msgSuccess(result.msg);$.table.refresh()}else{$.modal.alertError(result.msg)}$.modal.closeLoading()},saveSuccess:function(result){if(result.code==web_status.SUCCESS){$.modal.msgReload("保存成功,正在刷新数据请稍后……",modal_status.SUCCESS)}else{$.modal.alertError(result.msg)}$.modal.closeLoading()}},common:{isEmpty:function(value){if(value==null||this.trim(value)==""){return true}return false},visible:function(value){if($.common.isEmpty(value)||value==true){return true}return false},trim:function(value){if(value==null){return""}return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g,"")},random:function(min,max){return Math.floor((Math.random()*max)+min)}}})})(jQuery);web_status={SUCCESS:0,FAIL:500};modal_status={SUCCESS:"success",FAIL:"error",WARNING:"warning"};
\ No newline at end of file
(function($){$.extend({table:{_option:{},_params:{},init:function(options){$.table._option=options;$.table._params=$.common.isEmpty(options.queryParams)?$.table.queryParams:options.queryParams;_sortOrder=$.common.isEmpty(options.sortOrder)?"asc":options.sortOrder;_sortName=$.common.isEmpty(options.sortName)?"":options.sortName;$("#bootstrap-table").bootstrapTable({url:options.url,contentType:"application/x-www-form-urlencoded",method:"post",cache:false,sortable:true,sortStable:true,sortName:_sortName,sortOrder:_sortOrder,pagination:$.common.visible(options.pagination),pageNumber:1,pageSize:10,pageList:[10,25,50],iconSize:"outline",toolbar:"#toolbar",sidePagination:"server",search:$.common.visible(options.search),showRefresh:$.common.visible(options.showRefresh),showColumns:$.common.visible(options.showColumns),showToggle:$.common.visible(options.showToggle),showExport:$.common.visible(options.showExport),queryParams:$.table._params,columns:options.columns,responseHandler:$.table.responseHandler})},queryParams:function(params){return{pageSize:params.limit,pageNum:params.offset/params.limit+1,searchValue:params.search,orderByColumn:params.sort,isAsc:params.order}},responseHandler:function(res){if(res.code==0){return{rows:res.rows,total:res.total}}else{$.modal.alertWarning(res.msg);return{rows:[],total:0}}},search:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;var params=$("#bootstrap-table").bootstrapTable("getOptions");params.queryParams=function(params){var search={};$.each($("#"+currentId).serializeArray(),function(i,field){search[field.name]=field.value});search.pageSize=params.limit;search.pageNum=params.offset/params.limit+1;search.searchValue=params.search;search.orderByColumn=params.sort;search.isAsc=params.order;return search};$("#bootstrap-table").bootstrapTable("refresh",params)},exportExcel:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;$.modal.loading("正在导出数据,请稍后...");$.post($.table._option.exportUrl,$("#"+currentId).serializeArray(),function(result){if(result.code==web_status.SUCCESS){window.location.href=ctx+"common/download?fileName="+result.msg+"&delete="+true}else{$.modal.alertError(result.msg)}$.modal.closeLoading()})},refresh:function(){$("#bootstrap-table").bootstrapTable("refresh",{url:$.table._option.url,silent:true})},selectColumns:function(column){return $.map($("#bootstrap-table").bootstrapTable("getSelections"),function(row){return row[column]})},selectFirstColumns:function(){return $.map($("#bootstrap-table").bootstrapTable("getSelections"),function(row){return row[$.table._option.columns[1].field]})},selectDictLabel:function(_datas,_value){var actions=[];$.each(_datas,function(index,dict){if(dict.dictValue==_value){actions.push("<span class='badge badge-"+dict.listClass+"'>"+dict.dictLabel+"</span>");return false}});return actions.join("")}},treeTable:{_option:{},_treeTable:{},init:function(options){$.table._option=options;var treeTable=$("#bootstrap-table").bootstrapTreeTable({code:options.id,parentCode:options.parentId,type:"get",url:options.url,ajaxParams:{},expandColumn:"0",striped:false,bordered:true,expandAll:$.common.visible(options.expandAll),columns:options.columns});$.treeTable._treeTable=treeTable},search:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;var params={};$.each($("#"+currentId).serializeArray(),function(i,field){params[field.name]=field.value});$.treeTable._treeTable.bootstrapTreeTable("refresh",params)},refresh:function(){$.treeTable._treeTable.bootstrapTreeTable("refresh")},},form:{reset:function(formId){var currentId=$.common.isEmpty(formId)?$("form").attr("id"):formId;$("#"+currentId)[0].reset()},selectCheckeds:function(name){var checkeds="";$('input:checkbox[name="'+name+'"]:checked').each(function(i){if(0==i){checkeds=$(this).val()}else{checkeds+=(","+$(this).val())}});return checkeds},selectSelects:function(name){var selects="";$("#"+name+" option:selected").each(function(i){if(0==i){selects=$(this).val()}else{selects+=(","+$(this).val())}});return selects}},modal:{icon:function(type){var icon="";if(type==modal_status.WARNING){icon=0}else{if(type==modal_status.SUCCESS){icon=1}else{if(type==modal_status.FAIL){icon=2}else{icon=3}}}return icon},msg:function(content,type){if(type!=undefined){layer.msg(content,{icon:$.modal.icon(type),time:1000,shift:5})}else{layer.msg(content)}},msgError:function(content){$.modal.msg(content,modal_status.FAIL)},msgSuccess:function(content){$.modal.msg(content,modal_status.SUCCESS)},msgWarning:function(content){$.modal.msg(content,modal_status.WARNING)},alert:function(content,type){layer.alert(content,{icon:$.modal.icon(type),title:"系统提示",btn:["确认"],btnclass:["btn btn-primary"],})},msgReload:function(msg,type){layer.msg(msg,{icon:$.modal.icon(type),time:500,shade:[0.1,"#8F8F8F"]},function(){$.modal.reload()})},alertError:function(content){$.modal.alert(content,modal_status.FAIL)},alertSuccess:function(content){$.modal.alert(content,modal_status.SUCCESS)},alertWarning:function(content){$.modal.alert(content,modal_status.WARNING)},close:function(){var index=parent.layer.getFrameIndex(window.name);parent.layer.close(index)},confirm:function(content,callBack){layer.confirm(content,{icon:3,title:"系统提示",btn:["确认","取消"],btnclass:["btn btn-primary","btn btn-danger"],},function(index){layer.close(index);callBack(true)})},open:function(title,url,width,height){if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){width="auto";height="auto"}if($.common.isEmpty(title)){title=false}if($.common.isEmpty(url)){url="404.html"}if($.common.isEmpty(width)){width=800}if($.common.isEmpty(height)){height=($(window).height()-50)}layer.open({type:2,area:[width+"px",height+"px"],fix:false,maxmin:true,shade:0.3,title:title,content:url})},openFull:function(title,url,width,height){if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){width="auto";height="auto"}if($.common.isEmpty(title)){title=false}if($.common.isEmpty(url)){url="404.html"}if($.common.isEmpty(width)){width=800}if($.common.isEmpty(height)){height=($(window).height()-50)}var index=layer.open({type:2,area:[width+"px",height+"px"],fix:false,maxmin:true,shade:0.3,title:title,content:url});layer.full(index)},loading:function(message){$.blockUI({message:'<div class="loaderbox"><div class="loading-activity"></div> '+message+"</div>"})},closeLoading:function(){setTimeout(function(){$.unblockUI()},50)},reload:function(){parent.location.reload()}},operate:{submit:function(url,type,dataType,data){$.modal.loading("正在处理中,请稍后...");var config={url:url,type:type,dataType:dataType,data:data,success:function(result){$.operate.ajaxSuccess(result)}};$.ajax(config)},post:function(url,data){$.operate.submit(url,"post","json",data)},remove:function(id){$.modal.confirm("确定删除该条"+$.table._option.modalName+"信息吗?",function(){var url=$.common.isEmpty(id)?$.table._option.removeUrl:$.table._option.removeUrl.replace("{id}",id);var data={"ids":id};$.operate.submit(url,"post","json",data)})},removeAll:function(){var rows=$.common.isEmpty($.table._option.id)?$.table.selectFirstColumns():$.table.selectColumns($.table._option.id);if(rows.length==0){$.modal.alertWarning("请至少选择一条记录");return}$.modal.confirm("确认要删除选中的"+rows.length+"条数据吗?",function(){var url=$.table._option.removeUrl;var data={"ids":rows.join()};$.operate.submit(url,"post","json",data)})},add:function(id){var url=$.common.isEmpty(id)?$.table._option.createUrl:$.table._option.createUrl.replace("{id}",id);$.modal.open("添加"+$.table._option.modalName,url)},edit:function(id){var url=$.table._option.updateUrl.replace("{id}",id);$.modal.open("修改"+$.table._option.modalName,url)},addFull:function(id){var url=$.common.isEmpty(id)?$.table._option.createUrl:$.table._option.createUrl.replace("{id}",id);$.modal.openFull("添加"+$.table._option.modalName,url)},editFull:function(id){var url=$.table._option.updateUrl.replace("{id}",id);$.modal.openFull("修改"+$.table._option.modalName,url)},save:function(url,data){$.modal.loading("正在处理中,请稍后...");var config={url:url,type:"post",dataType:"json",data:data,success:function(result){$.operate.saveSuccess(result)}};$.ajax(config)},ajaxSuccess:function(result){if(result.code==web_status.SUCCESS){$.modal.msgSuccess(result.msg);$.table.refresh()}else{$.modal.alertError(result.msg)}$.modal.closeLoading()},saveSuccess:function(result){if(result.code==web_status.SUCCESS){$.modal.msgReload("保存成功,正在刷新数据请稍后……",modal_status.SUCCESS)}else{$.modal.alertError(result.msg)}$.modal.closeLoading()}},validate:{unique:function(value){if(value=="0"){return true}return false}},common:{isEmpty:function(value){if(value==null||this.trim(value)==""){return true}return false},visible:function(value){if($.common.isEmpty(value)||value==true){return true}return false},trim:function(value){if(value==null){return""}return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g,"")},random:function(min,max){return Math.floor((Math.random()*max)+min)}}})})(jQuery);web_status={SUCCESS:0,FAIL:500};modal_status={SUCCESS:"success",FAIL:"error",WARNING:"warning"};
\ No newline at end of file
......@@ -12,8 +12,8 @@
<link th:href="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.css}" rel="stylesheet"/>
<link th:href="@{/css/animate.css}" rel="stylesheet"/>
<link th:href="@{/css/style.css}" rel="stylesheet"/>
<link th:href="@{/css/checkbox.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/iCheck/custom.css}" rel="stylesheet"/>
<link th:href="@{/ruoyi/css/ry-ui.min.css}" rel="stylesheet"/>
</head>
<div th:fragment="footer">
......@@ -36,6 +36,7 @@
<script th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script>
<!-- 遮罩层 -->
<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script th:src="@{/ajax/libs/iCheck/icheck.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/common.js?v=2.3.0}"></script>
......
......@@ -86,9 +86,9 @@
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<ul class="nav navbar-top-links navbar-right welcome-message">
<li>
<span class="m-r-sm text-muted welcome-message">欢迎来到若依管理后台.</span>
<span class="m-r-sm text-muted">欢迎来到若依管理后台.</span>
</li>
<li><a id="fullScreen"><i class="fa fa-arrows-alt"></i>全屏</a></li>
<li><a th:href="@{logout}"><i class="fa fa-sign-out"></i>退出</a></li>
......
......@@ -46,17 +46,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_job_status')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
......
......@@ -47,17 +47,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_job_status')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group">
......
......@@ -20,7 +20,7 @@
<li>
任务状态:<select name="status" th:with="type=${@dict.getType('sys_job_status')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
......@@ -36,7 +36,7 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="monitor:job:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="monitor:job:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
<a class="btn btn-outline btn-info btn-rounded" onclick="javascript:jobLog()" shiro:hasPermission="monitor:job:list">
......@@ -44,7 +44,7 @@
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -20,10 +20,10 @@
<li>
<label>执行状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>执行时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -39,12 +39,12 @@
</div>
<div class="btn-group hidden-xs" id="toolbar" role="group">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="monitor:job:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -20,10 +20,10 @@
<li>
<label>登录状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>登录时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -39,12 +39,12 @@
</div>
<div class="btn-group hidden-xs" id="toolbar" role="group">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="monitor:logininfor:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:logininfor:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -19,6 +19,7 @@
</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>
......@@ -31,7 +32,7 @@
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -8,7 +8,7 @@
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-2 control-label">操作模块:</label>
<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.action)}">
<div class="form-control-static" th:text="${operLog.title} + ' / ' + ${@dict.getLabel('sys_oper_type',operLog.businessType)}">
</div>
</div>
<div class="form-group">
......@@ -33,10 +33,10 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态:</label>
<div class="form-control-static" th:class="${operLog.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == '0' ? '正常' : '异常'}">
<div class="form-control-static" th:class="${operLog.status == 0 ? 'label label-primary' : 'label label-danger'}" th:text="${operLog.status == 0 ? '正常' : '异常'}">
</div>
</div>
<div class="form-group" th:style="'display:' + ${operLog.status == '0' ? 'none' : 'block'}">
<div class="form-group" th:style="'display:' + ${operLog.status == 0 ? 'none' : 'block'}">
<label class="col-sm-2 control-label">异常信息:</label>
<div class="form-control-static" th:text="${operLog.errorMsg}">
</div>
......
......@@ -18,12 +18,12 @@
<label>操作人员: </label><input type="text" name="operName"/>
</li>
<li>
<label>操作类型: </label><select name="action" th:with="type=${@dict.getType('sys_oper_type')}">
<label>操作类型: </label><select name="businessType" th:with="type=${@dict.getType('sys_oper_type')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>操作时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -39,12 +39,12 @@
</div>
<div class="btn-group hidden-xs" id="toolbar" role="group">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="monitor:logininfor:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:logininfor:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......@@ -77,7 +77,7 @@
title: '系统模块'
},
{
field: 'action',
field: 'businessType',
title: '操作类型',
align: 'center',
formatter: function(value, row, index) {
......
......@@ -25,10 +25,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">系统内置:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_yes_no')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="configType" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -60,12 +60,11 @@
dataType: "json",
data: {
"configKey": function() {
return $("input[name='configKey']").val();
return $.common.trim($("#configKey").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -19,10 +19,10 @@
<li>
系统内置:<select name="configType" th:with="type=${@dict.getType('sys_yes_no')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -41,11 +41,11 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:config:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:config:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:config:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -26,10 +26,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">系统内置:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_yes_no')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="configType" th:value="${dict['dictValue']}" th:field="*{configType}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="configType" th:value="${dict.dictValue}" th:field="*{configType}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -61,15 +61,14 @@
dataType: "json",
data: {
"configId": function() {
return $("input[name='configId']").val();
return $("#configId").val();
},
"configKey": function() {
return $("input[name='configKey']").val();
return $.common.trim($("#configKey").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -44,10 +44,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -74,12 +74,11 @@
dataType: "json",
data: {
"deptName" : function() {
return $("input[name='deptName']").val();
return $.common.trim($("#deptName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -87,6 +86,12 @@
required:true,
digits:true
},
email:{
email:true,
},
phone:{
isPhone:true,
},
},
messages: {
"deptName": {
......
......@@ -16,11 +16,12 @@
<li>
部门状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></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="$.treeTable.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>
......@@ -32,7 +33,7 @@
<i class="fa fa-plus"></i> 新增
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......@@ -102,10 +103,10 @@
url: prefix + "/remove/" + id,
success : function(result) {
if (result.code == web_status.SUCCESS) {
$.modal.alertSuccess(result.msg);
$.modal.msgSuccess(result.msg);
$.treeTable.refresh();
} else {
$.modal.alertError(result.msg);
$.modal.msgError(result.msg);
}
}
});
......
......@@ -45,10 +45,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -74,15 +74,14 @@
dataType: "json",
data: {
"deptId": function() {
return $("input[name='deptId']").val();
return $.common.trim($("#deptId").val());
},
"deptName": function() {
return $("input[name='deptName']").val();
return $.common.trim($("#deptName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -90,6 +89,12 @@
required:true,
digits:true
},
email:{
email:true,
},
phone:{
isPhone:true,
},
},
messages: {
"deptName": {
......
......@@ -30,39 +30,48 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">回显样式</label>
<label class="col-sm-3 control-label">字典排序</label>
<div class="col-sm-8">
<input class="form-control" type="text" id="listClass" name="listClass">
<input class="form-control" type="text" name="dictSort">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">系统默认:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_yes_no')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="isDefault" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
</div>
<label class="col-sm-3 control-label">回显样式:</label>
<div class="col-sm-8">
<select name="listClass" class="form-control m-b">
<option value="">---请选择---</option>
<option value="default">默认</option>
<option value="primary">主要</option>
<option value="success">成功</option>
<option value="info"> 信息</option>
<option value="warning">警告</option>
<option value="danger"> 危险</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> table表格字典列显示样式属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">字典排序</label>
<label class="col-sm-3 control-label">系统默认</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="dictSort">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="isDefault" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
......
......@@ -22,7 +22,7 @@
<li>
数据状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
......@@ -38,12 +38,12 @@
<a class="btn btn-outline btn-success btn-rounded" th:onclick="'javascript:$.operate.add(\''+${dict.dictType}+'\')'" shiro:hasPermission="system:dict:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:dict:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:dict:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -31,39 +31,48 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">回显样式</label>
<label class="col-sm-3 control-label">字典排序</label>
<div class="col-sm-8">
<input class="form-control" type="text" id="listClass" name="listClass" th:field="*{listClass}">
<input class="form-control" type="text" name="dictSort" th:field="*{dictSort}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">系统默认:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_yes_no')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="isDefault" th:value="${dict['dictValue']}" th:field="*{isDefault}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
</div>
<label class="col-sm-3 control-label">回显样式:</label>
<div class="col-sm-8">
<select name="listClass" class="form-control m-b">
<option value="" th:field="*{listClass}">---请选择---</option>
<option value="default" th:field="*{listClass}">默认</option>
<option value="primary" th:field="*{listClass}">主要</option>
<option value="success" th:field="*{listClass}">成功</option>
<option value="info" th:field="*{listClass}">信息</option>
<option value="warning" th:field="*{listClass}">警告</option>
<option value="danger" th:field="*{listClass}">危险</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> table表格字典列显示样式属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">字典排序</label>
<label class="col-sm-3 control-label">系统默认</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="dictSort" th:field="*{dictSort}">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
<input type="radio" th:id="${dict.dictCode}" name="isDefault" th:value="${dict.dictValue}" th:field="*{isDefault}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
......
......@@ -19,17 +19,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
......@@ -59,12 +59,11 @@
dataType: "json",
data: {
name : function() {
return $.trim($("#dictType").val());
return $.common.trim($("#dictType").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -20,17 +20,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
......@@ -60,15 +60,14 @@
dataType: "json",
data: {
dictId : function() {
return $.trim($("#dictId").val());
return $("#dictId").val();
},
dictType : function() {
return $.trim($("#dictType").val());
return $.common.trim($("#dictType").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -20,10 +20,10 @@
<li>
字典状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -42,12 +42,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:dict:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:dict:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:dict:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -58,10 +58,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">菜单状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_show_hide')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="visible" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -79,6 +79,9 @@
var prefix = ctx + "system/menu"
$("#form-menu-add").validate({
rules:{
menuType:{
required:true,
},
menuName:{
required:true,
remote: {
......@@ -87,12 +90,11 @@
dataType: "json",
data: {
"menuName" : function() {
return $.trim($("#menuName").val());
return $.common.trim($("#menuName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -59,10 +59,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">菜单状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_show_hide')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="visible" th:value="${dict['dictValue']}" th:field="*{visible}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_show_hide')}">
<input type="radio" th:id="${dict.dictCode}" name="visible" th:value="${dict.dictValue}" th:field="*{visible}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......@@ -86,6 +86,9 @@
$("#form-menu-edit").validate({
rules:{
menuType:{
required:true,
},
menuName:{
required:true,
remote: {
......@@ -94,15 +97,14 @@
dataType: "json",
data: {
"menuId": function() {
return $("input[name='menuId']").val();
return $("#menuId").val();
},
"menuName": function() {
return $("input[name='menuName']").val();
return $.common.trim($("#menuName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -16,11 +16,12 @@
<li>
菜单状态:<select name="visible" th:with="type=${@dict.getType('sys_show_hide')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></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="$.treeTable.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>
......@@ -32,7 +33,7 @@
<i class="fa fa-plus"></i> 新增
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......@@ -135,10 +136,10 @@
url: prefix + "/remove/" + id,
success : function(result) {
if (result.code == web_status.SUCCESS) {
$.modal.alertSuccess(result.msg);
$.modal.msgSuccess(result.msg);
$.treeTable.refresh();
} else {
$.modal.alertError(result.msg);
$.modal.msgError(result.msg);
}
}
});
......
......@@ -17,7 +17,7 @@
<label class="col-sm-3 control-label">公告类型:</label>
<div class="col-sm-8">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
......@@ -30,10 +30,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">公告状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......
......@@ -18,7 +18,7 @@
<label class="col-sm-3 control-label">公告类型:</label>
<div class="col-sm-8">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" th:field="*{noticeType}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{noticeType}"></option>
</select>
</div>
</div>
......@@ -31,10 +31,10 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">公告状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
......
......@@ -19,11 +19,12 @@
<li>
公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></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>
......@@ -34,12 +35,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.addFull()" shiro:hasPermission="system:notice:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:notice:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:notice:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -25,17 +25,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text">
<textarea id="remark" name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
......@@ -60,12 +60,11 @@
dataType: "json",
data: {
"postName" : function() {
return $.trim($("#postName").val());
return $.common.trim($("#postName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -77,12 +76,11 @@
dataType: "json",
data: {
"postCode" : function() {
return $.trim($("#postCode").val());
return $.common.trim($("#postCode").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -26,17 +26,17 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">岗位状态:</label>
<div class="col-sm-8" th:with="type=${@dict.getType('sys_normal_disable')}">
<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
<input type="radio" th:id="${dict['dictCode']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group">
......@@ -64,12 +64,11 @@
return $("input[name='postId']").val();
},
"postName" : function() {
return $.trim($("#postName").val());
return $.common.trim($("#postName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -84,12 +83,11 @@
return $("input[name='postId']").val();
},
"postCode" : function() {
return $.trim($("#postCode").val());
return $.common.trim($("#postCode").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -20,7 +20,7 @@
<li>
岗位状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
......@@ -36,12 +36,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:post:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -87,12 +87,11 @@
dataType: "json",
data: {
"roleName" : function() {
return $.trim($("#roleName").val());
return $.common.trim($("#roleName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -104,12 +103,11 @@
dataType: "json",
data: {
"roleName" : function() {
return $.trim($("#roleName").val());
return $.common.trim($("#roleName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -88,15 +88,14 @@
dataType: "json",
data: {
"roleId": function() {
return $("input[name='roleId']").val();
return $("#roleId").val();
},
"roleName": function() {
return $("input[name='roleName']").val();
return $.common.trim($("#roleName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -108,15 +107,14 @@
dataType: "json",
data: {
"roleId": function() {
return $("input[name='roleId']").val();
return $("#roleId").val();
},
"roleKey": function() {
return $("input[name='roleKey']").val();
return $.common.trim($("#roleKey").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -20,10 +20,10 @@
<li>
角色状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -42,12 +42,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:role:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:role:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:role:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -47,7 +47,7 @@
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<select id="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
<option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
......@@ -105,12 +105,11 @@
dataType: "json",
data: {
name : function() {
return $.trim($("#loginName").val());
return $.common.trim($("#loginName").val());
}
},
dataFilter: function(data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -134,12 +133,11 @@
dataType: "json",
data: {
name: function () {
return $.trim($("#email").val());
return $.common.trim($("#email").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -152,12 +150,11 @@
dataType: "json",
data: {
name: function () {
return $.trim($("#phonenumber").val());
return $.common.trim($("#phonenumber").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -42,7 +42,7 @@
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<select id="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
<option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" th:field="*{sex}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{sex}"></option>
</select>
</div>
</div>
......@@ -105,15 +105,14 @@
dataType: "json",
data: {
"userId": function() {
return $("input[name='userId']").val();
return $("#userId").val();
},
"email": function() {
return $("input[name='email']").val();
return $.common.trim($("#email").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -126,15 +125,14 @@
dataType: "json",
data: {
"userId": function() {
return $("input[name='userId']").val();
return $("#userId").val();
},
"phonenumber": function() {
return $("input[name='phonenumber']").val();
return $.common.trim($("#phonenumber").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -39,11 +39,11 @@
<div class="form-group">
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<div class="radio radio-info radio-inline">
<div class="radio-box">
<input type="radio" id="radio1" th:field="*{sex}" name="sex" value="0">
<label for="radio1"></label>
</div>
<div class="radio radio-danger radio-inline">
<div class="radio-box">
<input type="radio" id="radio2" th:field="*{sex}" name="sex" value="1">
<label for="radio2"></label>
</div>
......@@ -74,15 +74,14 @@
dataType: "json",
data: {
"userId": function() {
return $("input[name='userId']").val();
return $("#userId").val();
},
"email": function() {
return $("input[name='email']").val();
return $.common.trim($("#email").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......@@ -95,15 +94,14 @@
dataType: "json",
data: {
"userId": function() {
return $("input[name='userId']").val();
return $("#userId").val();
},
"phonenumber": function() {
return $("input[name='phonenumber']").val();
return $.common.trim($("#phonenumber").val());
}
},
dataFilter: function (data, type) {
if (data == "0") return true;
else return false;
return $.validate.unique(data);
}
}
},
......
......@@ -28,6 +28,7 @@
<label class="col-sm-3 control-label">再次确认:</label>
<div class="col-sm-8">
<input class="form-control" type="password" name="confirm" id="confirm">
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
</div>
</div>
<div class="form-group">
......
......@@ -45,10 +45,10 @@
<li>
用户状态:<select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
<option value="">所有</option>
<option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="time">
<li class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -67,12 +67,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:user:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -16,7 +16,7 @@
<li>
表描述:<input type="text" name="tableComment"/>
</li>
<li class="time">
<li class="select-time">
<label>表时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
......@@ -24,6 +24,7 @@
</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>
......@@ -36,7 +37,7 @@
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -8,12 +8,12 @@
<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="${moduleName}:${classname}:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="${moduleName}:${classname}:remove">
<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="${moduleName}:${classname}:remove">
<i class="fa fa-trash-o"></i> 删除
</a>
</div>
<div class="col-sm-12 select-info table-striped">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
......
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import ${package}.domain.${className};
import ${package}.service.I${className}Service;
import com.ruoyi.framework.web.controller.BaseController;
......@@ -66,7 +66,7 @@ public class ${className}Controller extends BaseController
* 新增保存${tableComment}
*/
@RequiresPermissions("${moduleName}:${classname}:add")
@Log(title = "${tableComment}", action = BusinessType.INSERT)
@Log(title = "${tableComment}", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(${className} ${classname})
......@@ -89,7 +89,7 @@ public class ${className}Controller extends BaseController
* 修改保存${tableComment}
*/
@RequiresPermissions("${moduleName}:${classname}:edit")
@Log(title = "${tableComment}", action = BusinessType.UPDATE)
@Log(title = "${tableComment}", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(${className} ${classname})
......@@ -101,7 +101,7 @@ public class ${className}Controller extends BaseController
* 删除${tableComment}
*/
@RequiresPermissions("${moduleName}:${classname}:remove")
@Log(title = "${tableComment}", action = BusinessType.DELETE)
@Log(title = "${tableComment}", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment