🎉 2.7.1.RELEASE,增加行政区划管理,支持seata1.2

This commit is contained in:
smallchill 2020-06-12 11:53:35 +08:00
parent a36e00e554
commit e4d39096f6
24 changed files with 430 additions and 39 deletions

View File

@ -1,9 +1,9 @@
<p align="center">
<img src="https://img.shields.io/badge/Release-V2.7.0-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Release-V2.7.1-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR3-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.6.RELEASE-blue.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR5-blue.svg" alt="Coverage Status">
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.7.RELEASE-blue.svg" alt="Downloads">
<a target="_blank" href="https://bladex.vip">
<img src="https://img.shields.io/badge/Author-Small%20Chill-ff69b4.svg" alt="Downloads">
</a>
@ -58,7 +58,8 @@ SpringBlade
* 会员计划:[SpringBlade会员计划](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade会员计划)
* 交流一群:`477853168`(满)
* 交流二群:`751253339`(满)
* 交流三群:`784729540`
* 交流三群:`784729540`(满)
* 交流四群:`1034621754`
## 在线演示
* Saber-基于Vue[https://saber.bladex.vip](https://saber.bladex.vip)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
public/cdn/avue/2.5.3/avue.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
<link rel="stylesheet" href="<%= BASE_URL %>cdn/element-ui/2.12.0/theme-chalk/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.5.0/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.5.3/index.css">
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>Saber企业级开发平台</title>
<style>
@ -103,7 +103,7 @@
<script src="<%= BASE_URL %>cdn/vue-router/3.0.1/vue-router.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/element-ui/2.12.0/index.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/avue/2.5.0/avue.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/avue/2.5.3/avue.min.js" charset="utf-8"></script>
</body>
</html>

53
src/api/base/region.js Normal file
View File

@ -0,0 +1,53 @@
import request from '@/router/axios';
export const getList = (current, size, params) => {
return request({
url: '/api/blade-system/region/list',
method: 'get',
params: {
...params,
current,
size,
}
})
}
export const getLazyTree = (parentCode, params) => {
return request({
url: '/api/blade-system/region/lazy-tree',
method: 'get',
params: {
...params,
parentCode
}
})
}
export const getDetail = (code) => {
return request({
url: '/api/blade-system/region/detail',
method: 'get',
params: {
code
}
})
}
export const remove = (id) => {
return request({
url: '/api/blade-system/region/remove',
method: 'post',
params: {
id,
}
})
}
export const submit = (row) => {
return request({
url: '/api/blade-system/region/submit',
method: 'post',
data: row
})
}

334
src/views/base/region.vue Normal file
View File

@ -0,0 +1,334 @@
<template>
<el-row>
<el-col :span="9">
<div class="box">
<el-scrollbar>
<basic-container>
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
</basic-container>
</el-scrollbar>
</div>
</el-col>
<el-col :span="15">
<basic-container>
<el-button-group>
<el-button v-if="permission.region_add" type="primary" size="small" icon="el-icon-circle-plus-outline" @click="addChildren">新增下级</el-button>
<el-button v-if="permission.region_delete" type="primary" size="small" icon="el-icon-delete" @click="handleDelete">删除</el-button>
<el-button v-if="permission.region_debug" type="primary" size="small" icon="el-icon-video-play" @click="handleDebug">调试</el-button>
</el-button-group>
</basic-container>
<basic-container>
<avue-form ref="form" :option="regionOption" v-model="regionForm" @submit="handleSubmit">
<template slot="code" slot-scope="{}">
<el-input placeholder="请输入 区划子编号" v-model="regionForm.subCode">
<template slot="prepend">{{regionForm.parentCode}}</template>
</el-input>
</template>
</avue-form>
<el-dialog title="行政区划数据调试"
append-to-body
:visible.sync="debugBox"
width="350px">
<avue-form :option="debugOption" v-model="debugForm"/>
</el-dialog>
</basic-container>
</el-col>
</el-row>
</template>
<script>
import {getLazyTree, getDetail, submit, remove} from "@/api/base/region";
import {mapGetters} from "vuex";
import {validatenull} from "@/util/validate";
export default {
data() {
return {
topCode: '00',
treeCode: '',
treeParentCode: '',
treeData: [],
treeOption: {
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
const parentCode = (node.level === 0) ? "00" : node.data.id;
getLazyTree(parentCode).then(res => {
resolve(res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren
}
}))
});
},
addBtn: false,
menu: false,
size: 'small',
props: {
labelText: '标题',
label: 'title',
value: 'value',
children: 'children'
}
},
regionForm: {},
regionOption: {
labelWidth: 100,
column: [
{
label: "父区划编号",
prop: "parentCode",
span: 24,
disabled: true,
rules: [{
required: true,
message: "请输入父区划编号",
trigger: "blur"
}]
},
{
label: "父区划名称",
prop: "parentName",
span: 24,
disabled: true,
},
{
label: "区划编号",
prop: "code",
formslot: true,
span: 24,
rules: [{
required: true,
message: "请输入区划编号",
trigger: "blur"
}]
},
{
label: "区划子编号",
prop: "subCode",
display: false,
},
{
label: "区划名称",
prop: "name",
span: 24,
rules: [{
required: true,
message: "请输入区划名称",
trigger: "blur"
}]
},
{
label: "区划等级",
prop: "level",
type: "radio",
dicUrl: "/api/blade-system/dict/dictionary?code=region",
props: {
label: "dictValue",
value: "dictKey"
},
dataType: "number",
span: 24,
rules: [{
required: true,
message: "请选择区划等级",
trigger: "blur"
}]
},
{
label: "区划排序",
prop: "sort",
type: "number",
span: 24,
rules: [{
required: true,
message: "请输入区划排序",
trigger: "blur"
}]
},
{
label: "区划备注",
prop: "remark",
type: "textarea",
minRows: 6,
span: 24,
},
]
},
debugBox: false,
debugForm: {},
debugOption: {
labelWidth: 50,
submitBtn: false,
emptyBtn: false,
column: [
{
label: '省份',
prop: 'province',
type: 'select',
props: {
label: 'name',
value: 'code'
},
cascaderItem: ['city', 'district'],
dicUrl: '/api/blade-system/region/select',
span: 24,
},
{
label: '地市',
prop: 'city',
type: 'select',
props: {
label: 'name',
value: 'code'
},
dicFlag: false,
dicUrl: '/api/blade-system/region/select?code={{key}}',
span: 24,
},
{
label: '区县',
prop: 'district',
type: 'select',
props: {
label: 'name',
value: 'code'
},
dicFlag: false,
dicUrl: '/api/blade-system/region/select?code={{key}}',
span: 24,
}
]
}
};
},
watch: {
'regionForm.subCode'() {
this.regionForm.code = this.regionForm.parentCode + this.regionForm.subCode;
},
'excelForm.isCovered'() {
if (this.excelForm.isCovered !== '') {
const column = this.findObject(this.excelOption.column, "excelFile");
column.action = `/api/blade-system/region/import-region?isCovered=${this.excelForm.isCovered}`;
}
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.region_add, false),
viewBtn: this.vaildData(this.permission.region_view, false),
delBtn: this.vaildData(this.permission.region_delete, false),
editBtn: this.vaildData(this.permission.region_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
initTree() {
this.treeData = [];
getLazyTree(this.topCode).then(res => {
this.treeData = res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren
}
})
});
},
nodeClick(data) {
const column = this.findObject(this.regionOption.column, "parentCode");
column.disabled = true;
this.treeCode = data.id;
this.treeParentCode = data.parentId;
getDetail(this.treeCode).then(res => {
this.regionForm = res.data.data;
this.regionForm.subCode = this.regionForm.code.replace(this.regionForm.parentCode, '');
})
},
addChildren() {
if (validatenull(this.regionForm.code) || validatenull(this.regionForm.name)) {
this.$message.warning("请先选择一项区划");
return;
}
this.regionForm.parentCode = this.regionForm.code;
this.regionForm.parentName = this.regionForm.name;
this.regionForm.code = '';
this.regionForm.subCode = '';
this.regionForm.name = '';
this.regionForm.level = (this.regionForm.level === 5) ? 5 : this.regionForm.level + 1;
},
handleSubmit(form, done, loading) {
const parentCode = form.parentCode === this.topCode ? '' : form.parentCode;
form.code = parentCode + form.subCode;
submit(form).then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
this.initTree();
this.regionForm.subCode = '';
this.$refs.form.resetForm();
done();
}, error => {
loading();
window.console.log(error);
});
},
handleDelete() {
if (validatenull(this.regionForm.code)) {
this.$message.warning("请先选择一项区划");
return;
}
this.$confirm(`确定将 [${this.regionForm.name}] 数据删除?`, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.treeCode);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
this.initTree();
this.regionForm.subCode = '';
this.$refs.form.resetForm();
});
},
uploadAfter(res, done, loading, column) {
window.console.log(column);
this.excelBox = false;
this.initTree();
done();
},
handleDebug() {
this.debugBox = true;
},
}
};
</script>
<style>
.box {
height: 800px;
}
.el-scrollbar {
height: 100%;
}
.box .el-scrollbar__wrap {
overflow: scroll;
}
</style>

View File

@ -51,7 +51,7 @@
selectionList: [],
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,
@ -63,7 +63,7 @@
{
label: "通知标题",
prop: "title",
row: true,
span: 24,
search: true,
rules: [{
required: true,
@ -74,7 +74,6 @@
{
label: "通知类型",
type: "select",
row: true,
dicUrl: "/api/blade-system/dict/dictionary?code=notice",
props: {
label: "dictValue",
@ -218,10 +217,10 @@
}
done();
},
currentChange(currentPage){
currentChange(currentPage) {
this.page.currentPage = currentPage;
},
sizeChange(pageSize){
sizeChange(pageSize) {
this.page.pageSize = pageSize;
},
onLoad(page, params = {}) {

View File

@ -33,7 +33,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -33,7 +33,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -33,7 +33,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -47,7 +47,7 @@
selectionList: [],
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -57,8 +57,6 @@
total: 0
},
option: {
height: 'auto',
calcHeight: 80,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -56,8 +56,6 @@
total: 0
},
option: {
height: 'auto',
calcHeight: 80,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -63,8 +63,6 @@
total: 0
},
option: {
height: 'auto',
calcHeight: 80,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -47,7 +47,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -54,7 +54,7 @@
selectionList: [],
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
tip: false,
searchShow: true,
searchMenuSpan: 6,

View File

@ -75,8 +75,6 @@
total: 0
},
option: {
height: 'auto',
calcHeight: 80,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -47,7 +47,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -157,7 +157,7 @@
roleTreeObj: [],
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -62,7 +62,7 @@
},
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -48,7 +48,7 @@
selectionList: [],
option: {
height: 'auto',
calcHeight: 80,
calcHeight: 210,
searchShow: true,
searchMenuSpan: 6,
tip: false,

View File

@ -124,6 +124,18 @@
<el-row>
<basic-container>
<el-collapse v-model="logActiveNames" @change="handleChange">
<el-collapse-item title="2.7.1发布 增加行政区划管理支持seata1.2" name="18">
<div>1.升级至 SpringCloud Hoxton.SR5</div>
<div>2.升级至 SpringBoot 2.2.7.RELEASE</div>
<div>3.升级至 Seata 1.2.0</div>
<div>4.升级至 FastJson 1.2.70</div>
<div>5.升级至 Avue 2.5.3</div>
<div>6.新增行政区划管理模块</div>
<div>7.优化用户导入的密码配置逻辑</div>
<div>8.优化INode结构支持懒加载数据格式</div>
<div>9.优化代码生成模板支持最新版Saber结构</div>
<div>10.修复Log模块在多线程异步场景下报错的问题</div>
</el-collapse-item>
<el-collapse-item title="2.7.0发布 内核全面升级,增加岗位管理,用户导入导出" name="17">
<div>1.升级至 SpringCloud Hoxton.SR3</div>
<div>2.升级至 SpringBoot 2.2.6.RELEASE</div>
@ -290,7 +302,7 @@
data() {
return {
activeNames: ['1', '2', '3', '5'],
logActiveNames: ['17']
logActiveNames: ['18']
};
},
computed: {