This commit is contained in:
anjie 2020-06-22 00:41:49 +08:00
commit 8427e68b0f
26 changed files with 237 additions and 76 deletions

View File

@ -1,6 +1,7 @@
package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -21,6 +22,7 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.shiro.service.SysPasswordService;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.system.domain.SysRole;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.service.ISysPostService;
@ -106,7 +108,7 @@ public class SysUserController extends BaseController
@GetMapping("/add")
public String add(ModelMap mmap)
{
mmap.put("roles", roleService.selectRoleAll());
mmap.put("roles", roleService.selectRoleAll().stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("posts", postService.selectPostAll());
return prefix + "/add";
}
@ -144,8 +146,9 @@ public class SysUserController extends BaseController
@GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
{
List<SysRole> roles = roleService.selectRolesByUserId(userId);
mmap.put("user", userService.selectUserById(userId));
mmap.put("roles", roleService.selectRolesByUserId(userId));
mmap.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
mmap.put("posts", postService.selectPostsByUserId(userId));
return prefix + "/edit";
}

File diff suppressed because one or more lines are too long

View File

@ -145,3 +145,17 @@ body.signin {
margin-bottom: 0;
text-align: left;
}
.form-control, .form-control:focus, .has-error .form-control:focus, .has-success .form-control:focus, .has-warning .form-control:focus, .navbar-collapse, .navbar-form, .navbar-form-custom .form-control:focus, .navbar-form-custom .form-control:hover, .open .btn.dropdown-toggle, .panel, .popover, .progress, .progress-bar {
box-shadow: none;
}
.form-control{
border-radius: 1px!important;
padding: 6px 12px!important;
height: 34px!important;
}
.form-control:focus{
border-color: #1ab394 !important;
}

View File

@ -1 +1 @@
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}
html{height:100%}body.signin{height:auto;background:url(../img/login-background.jpg) no-repeat center fixed;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;color:rgba(255,255,255,.95)}.signinpanel{width:750px;margin:10% auto 0}.signinpanel .logopanel{float:none;width:auto;padding:0;background:0}.signinpanel .signin-info ul{list-style:none;padding:0;margin:20px 0}.signinpanel .form-control{display:block;margin-top:15px}.signinpanel .uname{background:#fff url(../img/user.png) no-repeat 95% center;color:#333}.signinpanel .pword{background:#fff url(../img/locked.png) no-repeat 95% center;color:#333}.signinpanel .code{background:#fff no-repeat 95% center;color:#333;margin:0 0 15px 0}.signinpanel .btn{margin-top:15px}.signinpanel form{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.3);-moz-box-shadow:0 3px 0 rgba(12,12,12,.03);-webkit-box-shadow:0 3px 0 rgba(12,12,12,.03);box-shadow:0 3px 0 rgba(12,12,12,.03);-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;padding:30px}.signup-footer{border-top:solid 1px rgba(255,255,255,.3);margin:20px 0;padding-top:15px}@media screen and (max-width:768px){.signinpanel,.signuppanel{margin:0 auto;width:420px!important;padding:20px}.signinpanel form{margin-top:20px}.signup-footer,.signuppanel .form-control{margin-bottom:10px}.signup-footer .pull-left,.signup-footer .pull-right{float:none!important;text-align:center}.signinpanel .signin-info ul{display:none}}@media screen and (max-width:320px){.signinpanel,.signuppanel{margin:0 20px;width:auto}}.checkbox-custom{position:relative;padding:0 15px 0 25px;margin-bottom:7px;display:inline-block}.checkbox-custom input[type="checkbox"]{opacity:0;position:absolute;cursor:pointer;z-index:2;margin:-6px 0 0 0;top:50%;left:3px}.checkbox-custom label:before{content:'';position:absolute;top:50%;left:0;margin-top:-9px;width:18px;height:17px;display:inline-block;border-radius:2px;border:1px solid #bbb;background:#fff}.checkbox-custom input[type="checkbox"]:checked+label:after{position:absolute;display:inline-block;font-family:'Glyphicons Halflings';content:"\e013";top:42%;left:3px;margin-top:-5px;font-size:11px;line-height:1;width:16px;height:16px;color:#333}.checkbox-custom label{cursor:pointer;line-height:1.2;font-weight:normal;margin-bottom:0;text-align:left}.form-control,.form-control:focus,.has-error .form-control:focus,.has-success .form-control:focus,.has-warning .form-control:focus,.navbar-collapse,.navbar-form,.navbar-form-custom .form-control:focus,.navbar-form-custom .form-control:hover,.open .btn.dropdown-toggle,.panel,.popover,.progress,.progress-bar{box-shadow:none}.form-control{border-radius:1px!important;padding:6px 12px!important;height:34px!important}.form-control:focus{border-color:#1ab394!important}

View File

@ -865,7 +865,7 @@ body.canvas-menu.mini-navbar nav.navbar-static-side {
color: #cacaca;
}
.form-control, .form-control:focus, .has-error .form-control:focus, .has-success .form-control:focus, .has-warning .form-control:focus, .navbar-collapse, .navbar-form, .navbar-form-custom .form-control:focus, .navbar-form-custom .form-control:hover, .open .btn.dropdown-toggle, .panel, .popover, .progress, .progress-bar {
.form-control, .has-error .form-control:focus, .has-success .form-control:focus, .has-warning .form-control:focus, .navbar-collapse, .navbar-form, .navbar-form-custom .form-control:focus, .navbar-form-custom .form-control:hover, .open .btn.dropdown-toggle, .panel, .popover, .progress, .progress-bar {
box-shadow: none;
}
@ -1818,18 +1818,19 @@ table.dataTable thead .sorting:after {
.form-control, .single-line {
background: #FFFFFF none;
border: 1px solid #e5e6e7;
border-radius: 1px;
border-radius: 4px;
color: inherit;
display: block;
padding: 6px 12px;
padding: 3px 6px 4px;
-webkit-transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
width: 100%;
height: 31px;
font-size: 14px;
}
.form-control:focus, .single-line:focus {
border-color: #1ab394 !important;
border-color: #3c8dbc !important;
}
.has-success .form-control {
@ -1858,8 +1859,8 @@ table.dataTable thead .sorting:after {
.input-group-addon {
background-color: #fff;
border: 1px solid #E5E6E7;
border-radius: 1px;
border: 1px solid #e5e6e7;
border-radius: 4px;
color: inherit;
font-size: 14px;
font-weight: 400;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because one or more lines are too long

View File

@ -330,7 +330,7 @@
label.error {
position: absolute;
right: 18px;
top: 10px;
top: 6px;
color: #ef392b;
font-size: 12px;
z-index:99;
@ -644,10 +644,10 @@ label {
margin: 5px 15px 5px 0px;
}
.select-list li p, .select-list li label:not(.radio-box):not(.select-time){
.select-list li p, .select-list li label:not(.radio-box){
float: left;
width: 65px;
margin: 5px 5px 5px 0px;
margin: 5px 0px 0px 0px;
text-align:right;
}
@ -681,11 +681,11 @@ label {
.bootstrap-select.form-control .btn-default {
color: inherit;
padding: 6px 12px;
border-radius: 1px;
padding: 4px 6px 4px;
border-radius: 4px;
border: 1px solid #e5e6e7;
outline: none;
height: 34px;
height: 31px;
background: #FFFFFF none
}
@ -1068,6 +1068,7 @@ label {
visibility: visible;
}
/* 设置滚动条样式 */
::-webkit-scrollbar {
width: 6px;
height: 10px;
@ -1078,3 +1079,20 @@ label {
border-radius: 6px;
background-color: #999;
}
/* 设置placeholder样式 */
::-webkit-input-placeholder {
color: #b3b3b3!important;
}
:-moz-placeholder {
color: #b3b3b3!important;
}
::-moz-placeholder {
color: #b3b3b3!important;
}
:-ms-input-placeholder {
color: #b3b3b3!important;
}

View File

@ -7,7 +7,7 @@ layer.config({
skin: 'layer-ext-moon'
});
var isMobile = $.common.isMobile() || $(window).width() < 769;
var isMobile = false;
var sidebarHeight = isMobile ? '100%' : '96%';
$(function() {
@ -52,12 +52,23 @@ $(function() {
});
$(window).bind("load resize",
function() {
if ($(this).width() < 769) {
$(window).bind("load resize", function() {
isMobile = $.common.isMobile() || $(window).width() < 769;
if (isMobile) {
$('body').addClass('canvas-menu');
$("body").removeClass("mini-navbar");
$("nav .logo").addClass("hide");
$(".slimScrollDiv").css({ "overflow":"hidden" })
$(".slimScrollDiv").css({ "overflow": "hidden" });
$('.navbar-static-side').fadeOut();
} else {
if($('body').hasClass('canvas-menu')) {
$('body').addClass('fixed-sidebar');
$('body').removeClass('canvas-menu');
$("body").removeClass("mini-navbar");
$("nav .logo").removeClass("hide");
$(".slimScrollDiv").css({ "overflow": "visible" });
$('.navbar-static-side').fadeIn();
}
}
});

View File

@ -365,6 +365,7 @@ var sub = {
$("#" + table.options.id).bootstrapTable("updateRow", params);
},
delColumn: function(column) {
sub.editColumn();
var subColumn = $.common.isEmpty(column) ? "index" : column;
var ids = $.table.selectColumns(subColumn);
if (ids.length == 0) {
@ -372,17 +373,6 @@ var sub = {
return;
}
$("#" + table.options.id).bootstrapTable('remove', { field: subColumn, values: ids });
if($.common.equals("index", subColumn))
{
sub.resetIndex();
}
},
resetIndex: function(msg) {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
for (var index = 0; index <= count; index++) {
// 重置序号
$("#" + table.options.id).bootstrapTable('updateRow', { index: index, row: { index: parseInt(index + 1) } })
}
}
};

View File

@ -45,6 +45,7 @@ var table = {
pagination: true,
paginationLoop: false,
pageSize: 10,
pageNumber: 1,
pageList: [10, 25, 50],
toolbar: "toolbar",
striped: false,
@ -275,8 +276,8 @@ var table = {
serialNumber: function (index, tableId) {
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
var tableParams = $("#" + currentId).bootstrapTable('getOptions');
var pageSize = tableParams.pageSize;
var pageNumber = tableParams.pageNumber;
var pageSize = $.common.isNotEmpty(tableParams.pageSize) ? tableParams.pageSize: table.options.pageSize;
var pageNumber = $.common.isNotEmpty(tableParams.pageNumber) ? tableParams.pageNumber: table.options.pageNumber;
return pageSize * (pageNumber - 1) + index + 1;
},
// 列超出指定长度浮动提示 targetcopy单击复制文本 open弹窗打开文本
@ -499,6 +500,21 @@ var table = {
});
return actions.join('');
},
// 回显数据字典(字符串数组)
selectDictLabels: function(datas, value, separator) {
var currentSeparator = $.common.isEmpty(separator) ? "," : separator;
var actions = [];
$.each(value.split(currentSeparator), function(i, val) {
$.each(datas, function(index, dict) {
if (dict.dictValue == ('' + val)) {
var listClass = $.common.equals("default", dict.listClass) || $.common.isEmpty(dict.listClass) ? "" : "badge badge-" + dict.listClass;
actions.push($.common.sprintf("<span class='%s'>%s </span>", listClass, dict.dictLabel));
return false;
}
});
});
return actions.join('');
},
// 显示表格指定列
showColumn: function(column, tableId) {
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;

View File

@ -96,7 +96,11 @@
{
field: 'index',
align: 'center',
title: "序号"
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'name',
@ -164,7 +168,6 @@
type: "",
}
});
sub.resetIndex();
}
</script>
</body>

View File

@ -35,7 +35,10 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">手机号码:</label>
<div class="col-sm-8">
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" required>
<div class="input-group">
<input id="phonenumber" name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" required>
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
</div>
</div>
</div>
</div>
@ -43,7 +46,10 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">邮箱:</label>
<div class="col-sm-8">
<input id="email" name="email" class="form-control email" type="text" maxlength="20" placeholder="请输入邮箱" required>
<div class="input-group">
<input id="email" name="email" class="form-control email" type="text" maxlength="20" placeholder="请输入邮箱" required>
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
</div>
</div>
</div>
</div>
@ -61,7 +67,12 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">登录密码:</label>
<div class="col-sm-8">
<input name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" required>
<div class="input-group">
<input id="password" name="password" placeholder="请输入登录密码" class="form-control" type="password" th:value="${@config.getKey('sys.user.initPassword')}" required>
<span class="input-group-addon" title="登录密码,鼠标按下显示密码"
onmousedown="$('#password').attr('type','text')"
onmouseup="$('#password').attr('type','password')"><i class="fa fa-key"></i></span>
</div>
</div>
</div>
</div>

View File

@ -36,7 +36,10 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">手机号码:</label>
<div class="col-sm-8">
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}" required>
<div class="input-group">
<input name="phonenumber" placeholder="请输入手机号码" class="form-control" type="text" maxlength="11" th:field="*{phonenumber}" required>
<span class="input-group-addon"><i class="fa fa-mobile"></i></span>
</div>
</div>
</div>
</div>
@ -44,7 +47,10 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">邮箱:</label>
<div class="col-sm-8">
<input name="email" class="form-control email" type="text" maxlength="20" placeholder="请输入邮箱" th:field="*{email}" required>
<div class="input-group">
<input name="email" class="form-control email" type="text" maxlength="20" placeholder="请输入邮箱" th:field="*{email}" required>
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
</div>
</div>
</div>
</div>

View File

@ -29,6 +29,11 @@ public @interface Excel
*/
public String readConverterExp() default "";
/**
* 分隔符读取字符串组内容
*/
public String separator() default ",";
/**
* 导出类型0数字 1字符串
*/

View File

@ -5,7 +5,7 @@ package com.ruoyi.common.constant;
*
* @author ruoyi
*/
public interface ScheduleConstants
public class ScheduleConstants
{
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";

View File

@ -5,7 +5,7 @@ package com.ruoyi.common.constant;
*
* @author ruoyi
*/
public interface ShiroConstants
public class ShiroConstants
{
/**
* 当前登录的用户

View File

@ -109,8 +109,9 @@ public class IpUtils
{
case 1:
l = Long.parseLong(elements[0]);
if ((l < 0L) || (l > 4294967295L))
if ((l < 0L) || (l > 4294967295L)) {
return null;
}
bytes[0] = (byte) (int) (l >> 24 & 0xFF);
bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
@ -118,12 +119,14 @@ public class IpUtils
break;
case 2:
l = Integer.parseInt(elements[0]);
if ((l < 0L) || (l > 255L))
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[0] = (byte) (int) (l & 0xFF);
l = Integer.parseInt(elements[1]);
if ((l < 0L) || (l > 16777215L))
if ((l < 0L) || (l > 16777215L)) {
return null;
}
bytes[1] = (byte) (int) (l >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
@ -132,13 +135,15 @@ public class IpUtils
for (i = 0; i < 2; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[i] = (byte) (int) (l & 0xFF);
}
l = Integer.parseInt(elements[2]);
if ((l < 0L) || (l > 65535L))
if ((l < 0L) || (l > 65535L)) {
return null;
}
bytes[2] = (byte) (int) (l >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
@ -146,8 +151,9 @@ public class IpUtils
for (i = 0; i < 4; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
if ((l < 0L) || (l > 255L)) {
return null;
}
bytes[i] = (byte) (int) (l & 0xFF);
}
break;

View File

@ -276,7 +276,7 @@ public class ExcelUtil<T>
}
else if (StringUtils.isNotEmpty(attr.readConverterExp()))
{
val = reverseByExp(String.valueOf(val), attr.readConverterExp());
val = reverseByExp(String.valueOf(val), attr.readConverterExp(), attr.separator());
}
ReflectUtils.invokeSetter(entity, propertyName, val);
}
@ -535,13 +535,14 @@ public class ExcelUtil<T>
Object value = getTargetValue(vo, field, attr);
String dateFormat = attr.dateFormat();
String readConverterExp = attr.readConverterExp();
String separator = attr.separator();
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
{
cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value));
}
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
{
cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp));
cell.setCellValue(convertByExp(String.valueOf(value), readConverterExp, separator));
}
else
{
@ -619,20 +620,36 @@ public class ExcelUtil<T>
*
* @param propertyValue 参数值
* @param converterExp 翻译注解
* @param separator 分隔符
* @return 解析后值
* @throws Exception
*/
public static String convertByExp(String propertyValue, String converterExp) throws Exception
public static String convertByExp(String propertyValue, String converterExp, String separator) throws Exception
{
StringBuilder propertyString = new StringBuilder();
try
{
String[] convertSource = converterExp.split(",");
for (String item : convertSource)
{
String[] itemArray = item.split("=");
if (itemArray[0].equals(propertyValue))
if (StringUtils.containsAny(separator, propertyValue))
{
return itemArray[1];
for (String value : propertyValue.split(separator))
{
if (itemArray[0].equals(value))
{
propertyString.append(itemArray[1] + separator);
break;
}
}
}
else
{
if (itemArray[0].equals(propertyValue))
{
return itemArray[1];
}
}
}
}
@ -640,7 +657,7 @@ public class ExcelUtil<T>
{
throw e;
}
return propertyValue;
return StringUtils.stripEnd(propertyString.toString(), separator);
}
/**
@ -648,20 +665,36 @@ public class ExcelUtil<T>
*
* @param propertyValue 参数值
* @param converterExp 翻译注解
* @param separator 分隔符
* @return 解析后值
* @throws Exception
*/
public static String reverseByExp(String propertyValue, String converterExp) throws Exception
public static String reverseByExp(String propertyValue, String converterExp, String separator) throws Exception
{
StringBuilder propertyString = new StringBuilder();
try
{
String[] convertSource = converterExp.split(",");
for (String item : convertSource)
{
String[] itemArray = item.split("=");
if (itemArray[1].equals(propertyValue))
if (StringUtils.containsAny(separator, propertyValue))
{
return itemArray[0];
for (String value : propertyValue.split(separator))
{
if (itemArray[1].equals(value))
{
propertyString.append(itemArray[0] + separator);
break;
}
}
}
else
{
if (itemArray[1].equals(propertyValue))
{
return itemArray[0];
}
}
}
}
@ -669,7 +702,7 @@ public class ExcelUtil<T>
{
throw e;
}
return propertyValue;
return StringUtils.stripEnd(propertyString.toString(), separator);
}
/**

View File

@ -104,6 +104,7 @@ public class GenTableServiceImpl implements IGenTableService
*
* @return 表信息集合
*/
@Override
public List<GenTable> selectGenTableAll()
{
return genTableMapper.selectGenTableAll();

View File

@ -65,6 +65,25 @@
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
#elseif($column.htmlType == "checkbox" && "" != $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8" th:with="type=${@dict.getType('${dictType}')}">
<label th:each="dict : ${type}" class="check-box">
<input name="${field}" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"#if($column.required) required#end>
</label>
</div>
</div>
#elseif($column.htmlType == "checkbox" && $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8">
<label class="check-box">
<input name="${field}" type="checkbox"#if($column.required) required#end> 无
</label>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
#elseif($column.htmlType == "radio" && "" != $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
@ -191,7 +210,11 @@
{
field: 'index',
align: 'center',
title: "序号"
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
#foreach($column in $subTable.columns)
#set($dictType=$column.dictType)
@ -250,7 +273,6 @@
#end
}
});
sub.resetIndex();
}
#end
</script>

View File

@ -65,6 +65,25 @@
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
#elseif($column.htmlType == "checkbox" && "" != $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8" th:with="type=${@dict.getType('${dictType}')}">
<label th:each="dict : ${type}" class="check-box">
<input name="${field}" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" th:attr="checked=${${className}.${field}.contains(dict.dictValue)?true:false}"#if($column.required) required#end>
</label>
</div>
</div>
#elseif($column.htmlType == "checkbox" && $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
<div class="col-sm-8">
<label class="check-box">
<input name="${field}" type="checkbox"#if($column.required) required#end> 无
</label>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
#elseif($column.htmlType == "radio" && "" != $dictType)
<div class="form-group">
<label class="col-sm-3 control-label">${comment}</label>
@ -192,7 +211,11 @@
{
field: 'index',
align: 'center',
title: "序号"
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
#foreach($column in $subTable.columns)
#set($dictType=$column.dictType)
@ -231,7 +254,6 @@
}]
};
$.table.init(options);
sub.resetIndex();
});
function addColumn() {
@ -252,7 +274,6 @@
#end
}
});
sub.resetIndex();
}
#end
</script>

View File

@ -120,7 +120,7 @@
title: '${comment}',
align: 'left',
formatter: function(value, row, index) {
return $.table.selectDictLabel(${javaField}Datas, value);
return $.table.selectDictLabel#if($column.htmlType == "checkbox")s#end(${javaField}Datas, value);
}
},
#elseif($column.list && "" != $javaField)

View File

@ -121,7 +121,7 @@
field: '${javaField}',
title: '${comment}',
formatter: function(value, row, index) {
return $.table.selectDictLabel(${javaField}Datas, value);
return $.table.selectDictLabel#if($column.htmlType == "checkbox")s#end(${javaField}Datas, value);
}
},
#elseif($column.list && "" != $javaField)

View File

@ -137,9 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batch${subClassName}">
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($velocityCount != $columns.size()),#end#end) values
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($velocityCount != $subTable.columns.size()),#end#end) values
<foreach item="item" index="index" collection="list" separator=",">
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($velocityCount != $columns.size()),#end#end)
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($velocityCount != $subTable.columns.size()),#end#end)
</foreach>
</insert>
#end

View File

@ -121,8 +121,8 @@ create table sys_role (
-- ----------------------------
-- 初始化-角色信息表数据
-- ----------------------------
insert into sys_role values('1', '管理员', 'admin', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '管理员');
insert into sys_role values('2', '普通角色', 'common', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '普通角色');
insert into sys_role values('1', '系统管理员', 'admin', 1, 1, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统管理员');
insert into sys_role values('2', '普通角色', 'common', 2, 2, '0', '0', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '普通角色');
-- ----------------------------
@ -651,8 +651,8 @@ create table gen_table (
table_id bigint(20) not null auto_increment comment '编号',
table_name varchar(200) default '' comment '表名称',
table_comment varchar(500) default '' comment '表描述',
sub_table_name varchar(64) default null comment '关联表的表名',
sub_table_fk_name varchar(64) default null comment '本表关联父表的外键名',
sub_table_name varchar(64) default null comment '关联表的表名',
sub_table_fk_name varchar(64) default null comment '子表关联的外键名',
class_name varchar(100) default '' comment '实体类名称',
tpl_category varchar(200) default 'crud' comment '使用的模板crud单表操作 tree树表操作 sub主子表操作',
package_name varchar(100) comment '生成包路径',