同步 dev

This commit is contained in:
疯狂的狮子li 2021-06-03 10:11:07 +08:00
commit 77a7cac830
16 changed files with 70 additions and 390 deletions

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2018 RuoYi
Copyright (c) 2019 RuoYi-Vue-Plus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@ -1,4 +1,7 @@
## 平台简介
[![码云Gitee](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/badge/star.svg?theme=blue)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/JavaLionLi/RuoYi-Vue-Plus/blob/master/LICENSE)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
基于 RuoYi-Vue 集成 Mybatis-Plus Lombok Hutool 等便捷开发工具 适配重写相关业务 便于开发 定期与 RuoYi-Vue 同步
* 前端开发框架 Vue、Element UI
@ -19,7 +22,7 @@
### 依赖改动
* ORM框架 使用 Mybatis-Plus 3.4.2 简化CRUD (不支持主子表)
* ORM框架 使用 Mybatis-Plus 简化CRUD (不支持主子表)
* Bean简化 使用 Lombok 简化 get set toString 等等
* 容器改动 Tomcat 改为 并发性能更好的 undertow
* 分页移除 pagehelper 改为 Mybatis-Plus 分页
@ -49,7 +52,7 @@
## 关注作者(扫码请备注: "加群")
![](https://images.gitee.com/uploads/images/2021/0508/235345_5503356a_1766278.jpeg)
![作者图片](https://images.gitee.com/uploads/images/2021/0508/235345_5503356a_1766278.jpeg)
## 捐献作者
作者为兼职做开源,平时还需要工作,如果帮到了您可以请作者吃个盒饭

View File

@ -81,7 +81,7 @@ redisson:
# 单节点配置
singleServerConfig:
# 客户端名称
clientName: ${ruoyi-vue-plus.name}
clientName: ${ruoyi.name}
# 最小空闲连接数
connectionMinimumIdleSize: 32
# 连接池大小

View File

@ -81,7 +81,7 @@ redisson:
# 单节点配置
singleServerConfig:
# 客户端名称
clientName: ${ruoyi-vue-plus.name}
clientName: ${ruoyi.name}
# 最小空闲连接数
connectionMinimumIdleSize: 32
# 连接池大小

View File

@ -96,8 +96,12 @@ public class RedisCache {
* @param collection 多个对象
* @return
*/
public long deleteObject(final Collection collection) {
return redissonClient.getKeys().delete(Arrays.toString(collection.toArray()));
public void deleteObject(final Collection collection) {
RBatch batch = redissonClient.createBatch();
collection.forEach(t->{
batch.getBucket(t.toString()).deleteAsync();
});
batch.execute();
}
/**

View File

@ -95,6 +95,7 @@ public class ImageUtils
}
finally
{
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(baos);
}
}

View File

@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.reflect.ReflectUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.framework.web.service.TokenService;
import org.aspectj.lang.JoinPoint;
@ -159,7 +160,6 @@ public class DataScopeAspect {
}
}
@SuppressWarnings("unchecked")
private static void putDataScope(JoinPoint joinPoint, String sql) {
Object params = joinPoint.getArgs()[0];
if (Validator.isNotNull(params)) {
@ -167,13 +167,8 @@ public class DataScopeAspect {
BaseEntity baseEntity = (BaseEntity) params;
baseEntity.getParams().put(DATA_SCOPE, sql);
} else {
try {
Method getParams = params.getClass().getDeclaredMethod("getParams");
Map<String, Object> invoke = (Map<String, Object>) getParams.invoke(params);
invoke.put(DATA_SCOPE, sql);
} catch (Exception e) {
// 方法未找到 不处理
}
Map<String, Object> invoke = ReflectUtils.invokeGetter(params, "params");
invoke.put(DATA_SCOPE, sql);
}
}
}

View File

@ -247,7 +247,7 @@
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
@ -302,6 +302,8 @@ export default {
},
data() {
return {
//按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 显示搜索条件
@ -480,12 +482,14 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
this.getTreeselect();
if (row != null) {
this.form.${treeParentCode} = row.${treeCode};
}
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
this.loading = false;
this.form = response.data;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
@ -500,6 +504,7 @@ export default {
submitForm() {
this.#[[$]]#refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.join(",");
@ -507,12 +512,14 @@ export default {
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add${BusinessName}(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -527,9 +534,11 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.loading = true;
return del${BusinessName}(row.${pkColumn.javaField});
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
})

View File

@ -301,7 +301,7 @@
#end
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
@ -353,6 +353,8 @@ export default {
},
data() {
return {
//按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 导出遮罩层
@ -534,9 +536,11 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
get${BusinessName}(${pkColumn.javaField}).then(response => {
this.loading = false;
this.form = response.data;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
@ -554,6 +558,7 @@ export default {
submitForm() {
this.#[[$]]#refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
#foreach ($column in $columns)
#if($column.htmlType == "checkbox")
this.form.$column.javaField = this.form.${column.javaField}.join(",");
@ -564,12 +569,14 @@ export default {
#end
if (this.form.${pkColumn.javaField} != null) {
update${BusinessName}(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
add${BusinessName}(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -585,9 +592,11 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.loading = true;
return del${BusinessName}(${pkColumn.javaField}s);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
})

View File

@ -152,7 +152,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -168,6 +168,8 @@ export default {
},
data() {
return {
//loading
buttonLoading: false,
//
loading: true,
//
@ -277,9 +279,11 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getDemo(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改测试单表";
@ -289,14 +293,17 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateDemo(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDemo(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -312,9 +319,11 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.loading = true;
return delDemo(ids);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
})

View File

@ -1,361 +0,0 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="key键" prop="testKey">
<el-input
v-model="queryParams.testKey"
placeholder="请输入key键"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="值" prop="value">
<el-input
v-model="queryParams.value"
placeholder="请输入值"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="版本" prop="version">
<el-input
v-model="queryParams.version"
placeholder="请输入版本"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateTime"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="删除标志" prop="deleted">
<el-input
v-model="queryParams.deleted"
placeholder="请输入删除标志"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="父id" prop="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入父id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="排序号" prop="orderNum">
<el-input
v-model="queryParams.orderNum"
placeholder="请输入排序号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['demo:test:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['demo:test:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['demo:test:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['demo:test:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="testList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" v-if="false"/>
<el-table-column label="key键" align="center" prop="testKey" />
<el-table-column label="值" align="center" prop="value" />
<el-table-column label="版本" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="删除标志" align="center" prop="deleted" />
<el-table-column label="父id" align="center" prop="parentId" />
<el-table-column label="排序号" align="center" prop="orderNum" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['demo:test:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['demo:test:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改测试对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="key键" prop="testKey">
<el-input v-model="form.testKey" placeholder="请输入key键" />
</el-form-item>
<el-form-item label="值" prop="value">
<el-input v-model="form.value" placeholder="请输入值" />
</el-form-item>
<el-form-item label="版本" prop="version">
<el-input v-model="form.version" placeholder="请输入版本" />
</el-form-item>
<el-form-item label="删除标志" prop="deleted">
<el-input v-model="form.deleted" placeholder="请输入删除标志" />
</el-form-item>
<el-form-item label="父id" prop="parentId">
<el-input v-model="form.parentId" placeholder="请输入父id" />
</el-form-item>
<el-form-item label="排序号" prop="orderNum">
<el-input v-model="form.orderNum" placeholder="请输入排序号" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTest, getTest, delTest, addTest, updateTest, exportTest } from "@/api/demo/test";
export default {
name: "Test",
components: {
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
testList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
testKey: undefined,
value: undefined,
version: undefined,
createTime: undefined,
deleted: undefined,
parentId: undefined,
orderNum: undefined
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询测试列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
listTest(this.queryParams).then(response => {
this.testList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
testKey: undefined,
value: undefined,
version: undefined,
createTime: undefined,
deleted: undefined,
parentId: undefined,
orderNum: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加测试";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getTest(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改测试";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTest(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTest(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除测试编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delTest(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有测试数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportTest(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>

View File

@ -102,7 +102,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -121,6 +121,8 @@ export default {
},
data() {
return {
//loading
buttonLoading: false,
//
loading: true,
//
@ -233,12 +235,14 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
this.getTreeselect();
if (row != null) {
this.form.parentId = row.id;
}
getTree(row.id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改测试树表";
@ -248,14 +252,17 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateTree(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTree(this.form).then(response => {
this.buttonLoading = false;
this.msgSuccess("新增成功");
this.open = false;
this.getList();
@ -270,9 +277,11 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
}).then(() => {
this.loading = true;
return delTree(row.id);
}).then(() => {
this.loading = false;
this.getList();
this.msgSuccess("删除成功");
})

View File

@ -163,7 +163,7 @@
</el-col>
<el-col :span="12">
<el-form-item v-if="form.menuType != 'M'" label="权限标识">
<el-input v-model="form.perms" placeholder="请权限标识" maxlength="50" />
<el-input v-model="form.perms" placeholder="请权限标识" maxlength="100" />
</el-form-item>
</el-col>
<el-col :span="12">

View File

@ -573,6 +573,7 @@
<script>
import { isArray } from 'util'
import draggable from 'vuedraggable'
import TreeNodeDialog from './TreeNodeDialog'
import { isNumberStr } from '@/utils/index'
import IconsDialog from './IconsDialog'
@ -595,6 +596,7 @@ const dateTimeFormat = {
export default {
components: {
draggable,
TreeNodeDialog,
IconsDialog
},

View File

@ -12,7 +12,7 @@ CREATE TABLE test_demo
create_by varchar(64) NULL DEFAULT NULL COMMENT '创建人',
update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
update_by varchar(64) NULL DEFAULT NULL COMMENT '更新人',
del_flag int(0) NULL DEFAULT NULL COMMENT '删除标志',
del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志',
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB COMMENT = '测试单表';
@ -29,7 +29,7 @@ CREATE TABLE test_tree
create_by varchar(64) NULL DEFAULT NULL COMMENT '创建人',
update_time datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
update_by varchar(64) NULL DEFAULT NULL COMMENT '更新人',
del_flag int(0) NULL DEFAULT NULL COMMENT '删除标志',
del_flag int(0) NULL DEFAULT 0 COMMENT '删除标志',
PRIMARY KEY (id) USING BTREE
) ENGINE = InnoDB COMMENT = '测试树表';