commit
03365e6cba
37
pom.xml
37
pom.xml
|
|
@ -22,14 +22,14 @@
|
|||
<druid.version>1.2.6</druid.version>
|
||||
<bitwalker.version>1.21</bitwalker.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
<swagger.version>3.0.0</swagger.version>
|
||||
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
|
||||
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
||||
<fastjson.version>1.2.76</fastjson.version>
|
||||
<oshi.version>5.6.0</oshi.version>
|
||||
<jna.version>5.7.0</jna.version>
|
||||
<commons.io.version>2.5</commons.io.version>
|
||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||
<oshi.version>5.7.4</oshi.version>
|
||||
<jna.version>5.8.0</jna.version>
|
||||
<commons.io.version>2.10.0</commons.io.version>
|
||||
<commons.fileupload.version>1.4</commons.fileupload.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
</properties>
|
||||
|
|
@ -47,21 +47,21 @@
|
|||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!--阿里数据库连接池 -->
|
||||
<!-- 阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--验证码 -->
|
||||
<!-- 验证码 -->
|
||||
<dependency>
|
||||
<groupId>com.github.penggle</groupId>
|
||||
<artifactId>kaptcha</artifactId>
|
||||
<version>${kaptcha.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--Shiro核心框架 -->
|
||||
<!-- Shiro核心框架 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.shiro</groupId>
|
||||
<artifactId>shiro-core</artifactId>
|
||||
|
|
@ -129,16 +129,12 @@
|
|||
<version>${jna.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-->
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
|
|
@ -146,21 +142,14 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-UI-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--io常用工具类 -->
|
||||
<!-- io常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>${commons.io.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--文件上传工具类 -->
|
||||
<!-- 文件上传工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
|
|
@ -174,7 +163,7 @@
|
|||
<version>${poi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--velocity代码生成使用模板 -->
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
|
|
|
|||
|
|
@ -30,29 +30,17 @@
|
|||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-->
|
||||
<!-- swagger3-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.21</version>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.21</version>
|
||||
</dependency>
|
||||
|
||||
<!-- swagger2-UI-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
|
|
|
|||
|
|
@ -339,6 +339,15 @@ public class DemoTableController extends BaseController
|
|||
return prefix + "/dynamicColumns";
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义视图分页
|
||||
*/
|
||||
@GetMapping("/customView")
|
||||
public String customView()
|
||||
{
|
||||
return prefix + "/customView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格其他操作
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ public class SwaggerController extends BaseController
|
|||
@GetMapping()
|
||||
public String index()
|
||||
{
|
||||
return redirect("/swagger-ui.html");
|
||||
return redirect("/swagger-ui/index.html");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import springfox.documentation.service.ApiInfo;
|
|||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
|
|
@ -20,7 +19,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 是否开启swagger */
|
||||
|
|
@ -33,7 +31,7 @@ public class SwaggerConfig
|
|||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,108 @@
|
|||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
*/
|
||||
|
||||
const Utils = $.fn.bootstrapTable.utils
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
customView: false,
|
||||
showCustomView: false,
|
||||
showCustomViewButton: false
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
customView: {
|
||||
bootstrap3: 'glyphicon glyphicon-eye-open',
|
||||
bootstrap5: 'bi-eye',
|
||||
bootstrap4: 'fa fa-eye',
|
||||
semantic: 'fa fa-eye',
|
||||
foundation: 'fa fa-eye',
|
||||
bulma: 'fa fa-eye',
|
||||
materialize: 'remove_red_eye'
|
||||
}[$.fn.bootstrapTable.theme] || 'fa-eye'
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
onCustomViewPostBody () {
|
||||
return false
|
||||
},
|
||||
onCustomViewPreBody () {
|
||||
return false
|
||||
}
|
||||
})
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatToggleCustomView () {
|
||||
return 'Toggle custom view'
|
||||
}
|
||||
})
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales)
|
||||
|
||||
$.fn.bootstrapTable.methods.push('toggleCustomView')
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'custom-view-post-body.bs.table': 'onCustomViewPostBody',
|
||||
'custom-view-pre-body.bs.table': 'onCustomViewPreBody'
|
||||
})
|
||||
|
||||
$.BootstrapTable = class extends $.BootstrapTable {
|
||||
|
||||
init () {
|
||||
this.showCustomView = this.options.showCustomView
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
initToolbar (...args) {
|
||||
if (this.options.customView && this.options.showCustomViewButton) {
|
||||
this.buttons = Object.assign(this.buttons, {
|
||||
customView: {
|
||||
text: this.options.formatToggleCustomView(),
|
||||
icon: this.options.icons.customView,
|
||||
event: this.toggleCustomView,
|
||||
attributes: {
|
||||
'aria-label': this.options.formatToggleCustomView(),
|
||||
title: this.options.formatToggleCustomView()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
super.initToolbar(...args)
|
||||
}
|
||||
|
||||
initBody () {
|
||||
super.initBody()
|
||||
|
||||
if (!this.options.customView) {
|
||||
return
|
||||
}
|
||||
|
||||
const $table = this.$el
|
||||
const $customViewContainer = this.$container.find('.fixed-table-custom-view')
|
||||
|
||||
$table.hide()
|
||||
$customViewContainer.hide()
|
||||
if (!this.options.customView || !this.showCustomView) {
|
||||
$table.show()
|
||||
return
|
||||
}
|
||||
|
||||
const data = this.getData().slice(this.pageFrom - 1, this.pageTo)
|
||||
const value = Utils.calculateObjectValue(this, this.options.customView, [data], '')
|
||||
|
||||
this.trigger('custom-view-pre-body', data, value)
|
||||
if ($customViewContainer.length === 1) {
|
||||
$customViewContainer.show().html(value)
|
||||
} else {
|
||||
this.$tableBody.after(`<div class="fixed-table-custom-view">${value}</div>`)
|
||||
}
|
||||
|
||||
this.trigger('custom-view-post-body', data, value)
|
||||
}
|
||||
|
||||
toggleCustomView () {
|
||||
this.showCustomView = !this.showCustomView
|
||||
this.initBody()
|
||||
}
|
||||
}
|
||||
|
|
@ -152,11 +152,16 @@ jQuery.tableDnD = {
|
|||
config.dragHandle
|
||||
// We only need to add the event to the specified cells
|
||||
&& $(config.dragHandle, table).each(function() {
|
||||
// The cell is bound to "this"
|
||||
$(this).bind(startEvent, function(e) {
|
||||
$.tableDnD.initialiseDrag($(this).parents('tr')[0], table, this, e, config);
|
||||
return false;
|
||||
});
|
||||
if (! $(this).hasClass("nodrag")) {
|
||||
// The cell is bound to "this"
|
||||
$(this).bind(startEvent, function(e) {
|
||||
if (e.target.tagName === "TD" && event.target.className !== "nodrag") {
|
||||
$.tableDnD.initialiseDrag($(this).parents('tr')[0], table, this, e, config);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
})
|
||||
// For backwards compatibility, we add the event to the whole row
|
||||
// get all the rows as a wrapped set
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ var table = {
|
|||
showColumns: true,
|
||||
showToggle: true,
|
||||
showExport: false,
|
||||
showPrint: false,
|
||||
exportDataType: 'all',
|
||||
exportTypes: ['csv', 'txt', 'doc', 'excel'],
|
||||
clickToSelect: false,
|
||||
|
|
@ -110,6 +111,7 @@ var table = {
|
|||
showColumns: options.showColumns, // 是否显示隐藏某列下拉框
|
||||
showToggle: options.showToggle, // 是否显示详细视图和列表视图的切换按钮
|
||||
showExport: options.showExport, // 是否支持导出文件
|
||||
showPrint: options.showPrint, // 是否支持打印页面
|
||||
showHeader: options.showHeader, // 是否显示表头
|
||||
showFullscreen: options.showFullscreen, // 是否显示全屏按钮
|
||||
uniqueId: options.uniqueId, // 唯一的标识符
|
||||
|
|
@ -470,6 +472,11 @@ var table = {
|
|||
pageSize: pageSize
|
||||
});
|
||||
},
|
||||
// 刷新options配置
|
||||
refreshOptions: function(options, tableId) {
|
||||
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||
$("#" + currentId).bootstrapTable('refreshOptions', options);
|
||||
},
|
||||
// 查询表格指定列值
|
||||
selectColumns: function(column) {
|
||||
var rows = $.map($("#" + table.options.id).bootstrapTable('getSelections'), function (row) {
|
||||
|
|
|
|||
|
|
@ -91,5 +91,12 @@
|
|||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script type="text/javascript">
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.modal.msgSuccess('保存成功!');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('自定义视图分页')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-page-size="10"
|
||||
data-show-custom-view="true" data-custom-view="customViewFormatter"
|
||||
data-show-custom-view-button="true">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template id="profileTemplate">
|
||||
<div class="col-sm-4">
|
||||
<div class="contact-box">
|
||||
<a href="profile.html">
|
||||
<div class="col-sm-4">
|
||||
<div class="text-center">
|
||||
<img alt="image" class="img-circle m-t-xs img-responsive" src="%IMAGE%">
|
||||
<div class="m-t-xs font-bold">%userName%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<h3><strong>%userCode%</strong></h3>
|
||||
<p><i class="fa fa-jpy"></i> %userBalance%</p>
|
||||
<address>
|
||||
<strong>RuoYi, Inc.</strong><br>
|
||||
E-mail: %userEmail%<br>
|
||||
<abbr title="Phone">Tel:</abbr> %userPhone%
|
||||
</address>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div th:include="include :: footer"></div>
|
||||
<th:block th:include="include :: bootstrap-table-custom-view-js" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "demo/table";
|
||||
var datas = [[${@dict.getType('sys_normal_disable')}]];
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
showExport: true,
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field : 'userId',
|
||||
title : '用户ID'
|
||||
},
|
||||
{
|
||||
field : 'userCode',
|
||||
title : '用户编号'
|
||||
},
|
||||
{
|
||||
field : 'userName',
|
||||
title : '用户姓名'
|
||||
},
|
||||
{
|
||||
field : 'userPhone',
|
||||
title : '用户手机'
|
||||
},
|
||||
{
|
||||
field : 'userEmail',
|
||||
title : '用户邮箱'
|
||||
},
|
||||
{
|
||||
field : 'userBalance',
|
||||
title : '用户余额'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '用户状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function customViewFormatter (data) {
|
||||
var template = $('#profileTemplate').html()
|
||||
var view = ''
|
||||
$.each(data, function (i, row) {
|
||||
view += template.replace('%userCode%', row.userCode)
|
||||
.replace('%IMAGE%', "http://demo.ruoyi.vip/img/profile.jpg")
|
||||
.replace('%userName%', row.userName)
|
||||
.replace('%userEmail%', row.userEmail)
|
||||
.replace('%userPhone%', row.userPhone)
|
||||
.replace('%userBalance%', row.userBalance);
|
||||
})
|
||||
|
||||
return `<div class="row mx-0">${view}</div>`
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
data-print-filter 设置值以按此列过滤打印的数据。
|
||||
data-print-formatter 函数(值,行,索引)-返回字符串。格式化打印表中此列的单元格值。函数行为类似于“ formatter”列选项
|
||||
printIgnore 设置为true可以在打印页面中隐藏此列。 -->
|
||||
<table id="bootstrap-table" data-show-print="true"></table>
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
showPrint: true,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
|
|
|
|||
|
|
@ -217,3 +217,8 @@
|
|||
<div th:fragment="bootstrap-table-print-js">
|
||||
<script th:src="@{/ajax/libs/bootstrap-table/extensions/print/bootstrap-table-print.js?v=20210602}"></script>
|
||||
</div>
|
||||
|
||||
<!-- 表格视图分页插件 -->
|
||||
<div th:fragment="bootstrap-table-custom-view-js">
|
||||
<script th:src="@{/ajax/libs/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.js?v=20210602}"></script>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@
|
|||
<li><a class="menuItem" th:href="@{/demo/table/refresh}">表格自动刷新</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/dynamicColumns}">表格动态列</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/customView}">自定义视图分页</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@
|
|||
<li><a class="menuItem" th:href="@{/demo/table/refresh}">表格自动刷新</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/print}">表格打印配置</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/dynamicColumns}">表格动态列</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/customView}">自定义视图分页</a></li>
|
||||
<li><a class="menuItem" th:href="@{/demo/table/other}">表格其他操作</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -112,14 +112,18 @@
|
|||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.roleId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.roleId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authDataScope(" + row.roleId + ")'><i class='fa fa-check-square-o'></i>数据权限</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(" + row.roleId + ")'><i class='fa fa-user'></i>分配用户</a>");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
if (row.roleId != 1) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.roleId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.roleId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authDataScope(" + row.roleId + ")'><i class='fa fa-check-square-o'></i>数据权限</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authUser(" + row.roleId + ")'><i class='fa fa-user'></i>分配用户</a>");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -171,14 +171,18 @@
|
|||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
if (row.userId != 1) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a> ');
|
||||
var more = [];
|
||||
more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
|
||||
more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
|
||||
actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');
|
||||
return actions.join('');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -96,4 +96,9 @@ public class Constants
|
|||
* 资源映射路径 前缀
|
||||
*/
|
||||
public static final String RESOURCE_PREFIX = "/profile";
|
||||
|
||||
/**
|
||||
* RMI 远程方法调用
|
||||
*/
|
||||
public static final String LOOKUP_RMI = "rmi://";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ public class SysRole extends BaseEntity
|
|||
@Excel(name = "角色排序", cellType = ColumnType.NUMERIC)
|
||||
private String roleSort;
|
||||
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.nio.charset.Charset;
|
|||
import java.text.NumberFormat;
|
||||
import java.util.Set;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
/**
|
||||
* 类型转换器
|
||||
|
|
@ -795,9 +796,14 @@ public class Convert
|
|||
{
|
||||
return (String) obj;
|
||||
}
|
||||
else if (obj instanceof byte[] || obj instanceof Byte[])
|
||||
else if (obj instanceof byte[])
|
||||
{
|
||||
return str((Byte[]) obj, charset);
|
||||
return str((byte[]) obj, charset);
|
||||
}
|
||||
else if (obj instanceof Byte[])
|
||||
{
|
||||
byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj);
|
||||
return str(bytes, charset);
|
||||
}
|
||||
else if (obj instanceof ByteBuffer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileUtils extends org.apache.commons.io.FileUtils
|
||||
public class FileUtils
|
||||
{
|
||||
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
|
||||
|
||||
|
|
|
|||
|
|
@ -44,8 +44,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
||||
|
||||
/** swagger配置 */
|
||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import java.util.Map;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.VelocityContext;
|
||||
|
|
@ -27,7 +28,6 @@ import com.ruoyi.common.core.text.CharsetKit;
|
|||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.generator.domain.GenTable;
|
||||
import com.ruoyi.generator.domain.GenTableColumn;
|
||||
import com.ruoyi.generator.mapper.GenTableColumnMapper;
|
||||
|
|
|
|||
|
|
@ -13,11 +13,13 @@ 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.annotation.Log;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.exception.job.TaskException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.quartz.service.ISysJobService;
|
||||
|
|
@ -131,7 +133,11 @@ public class SysJobController extends BaseController
|
|||
{
|
||||
if (!CronUtils.isValid(job.getCronExpression()))
|
||||
{
|
||||
return AjaxResult.error("cron表达式不正确");
|
||||
return AjaxResult.error("新增任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
}
|
||||
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||
{
|
||||
return AjaxResult.error("新增任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
||||
}
|
||||
return toAjax(jobService.insertJob(job));
|
||||
}
|
||||
|
|
@ -157,7 +163,11 @@ public class SysJobController extends BaseController
|
|||
{
|
||||
if (!CronUtils.isValid(job.getCronExpression()))
|
||||
{
|
||||
return AjaxResult.error("cron表达式不正确");
|
||||
return AjaxResult.error("修改任务'" + job.getJobName() + "'失败,Cron表达式不正确");
|
||||
}
|
||||
else if (StringUtils.containsIgnoreCase(job.getInvokeTarget(), Constants.LOOKUP_RMI))
|
||||
{
|
||||
return AjaxResult.error("修改任务'" + job.getJobName() + "'失败,目标字符串不允许'rmi://'调用");
|
||||
}
|
||||
return toAjax(jobService.updateJob(job));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,11 +93,11 @@ public interface SysDeptMapper
|
|||
public List<String> selectRoleDeptTree(Long roleId);
|
||||
|
||||
/**
|
||||
* 修改所在部门的父级部门状态
|
||||
* 修改所在部门正常状态
|
||||
*
|
||||
* @param dept 部门
|
||||
* @param deptIds 部门ID组
|
||||
*/
|
||||
public void updateDeptStatus(SysDept dept);
|
||||
public void updateDeptStatusNormal(Long[] deptIds);
|
||||
|
||||
/**
|
||||
* 根据ID查询所有子部门
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.ruoyi.common.constant.UserConstants;
|
|||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||
|
|
@ -229,7 +230,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
||||
{
|
||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||
updateParentDeptStatus(dept);
|
||||
updateParentDeptStatusNormal(dept);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
@ -239,12 +240,11 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|||
*
|
||||
* @param dept 当前部门
|
||||
*/
|
||||
private void updateParentDeptStatus(SysDept dept)
|
||||
private void updateParentDeptStatusNormal(SysDept dept)
|
||||
{
|
||||
String updateBy = dept.getUpdateBy();
|
||||
dept = deptMapper.selectDeptById(dept.getDeptId());
|
||||
dept.setUpdateBy(updateBy);
|
||||
deptMapper.updateDeptStatus(dept);
|
||||
String ancestors = dept.getAncestors();
|
||||
Long[] deptIds = Convert.toLongArray(ancestors);
|
||||
deptMapper.updateDeptStatusNormal(deptIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -145,14 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
<update id="updateDeptStatus" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where find_in_set(#{deptId}, ancestors)
|
||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
||||
update sys_dept set status = '0' where dept_id in
|
||||
<foreach collection="array" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue