chore: 同步Saber2.8.1版本

master
ssc 5 years ago
parent 6323a79de6
commit f9b74506a1
  1. 6
      .gitignore
  2. 2
      package.json
  3. 9
      public/cdn/avue/2.8.12/avue.min.js
  4. 1
      public/cdn/avue/2.8.12/index.css
  5. 8
      public/cdn/avue/2.8.2/avue.min.js
  6. 1
      public/cdn/avue/2.8.2/index.css
  7. 6
      public/index.html
  8. 49
      src/components/basic-container/main.vue
  9. 12
      src/option/system/dict.js
  10. 11
      src/option/system/dictbiz.js
  11. 4
      src/page/index/sidebar/index.vue
  12. 9
      src/router/avue-router.js
  13. 43
      src/store/modules/user.js
  14. 8
      src/styles/element-ui.scss
  15. 807
      src/views/system/dict.vue
  16. 237
      src/views/system/dictbiz.vue
  17. 2
      src/views/system/menu.vue
  18. 454
      src/views/util/demo/dict.vue
  19. 447
      src/views/util/demo/dictbiz.vue
  20. 37
      src/views/wel/index.vue
  21. 2
      src/views/work/process/leave/detail.vue
  22. 2
      src/views/work/process/leave/handle.vue

6
.gitignore vendored

@ -1,7 +1,6 @@
.DS_Store
node_modules*
node_modules
/dist
*.sh
/tests/e2e/videos/
/tests/e2e/screenshots/
@ -24,3 +23,6 @@ yarn-error.log*
*.sln
*.sw*
*.lock
*.sh
node_modules*

@ -1,6 +1,6 @@
{
"name": "saber-admin",
"version": "2.8.0",
"version": "2.8.1",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -15,7 +15,7 @@
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/avue/iconfont.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/saber/iconfont.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.8.2/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.8.12/index.css">
<script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
<script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
<link rel="icon" href="<%= BASE_URL %>favicon.png">
@ -103,12 +103,12 @@
</div>
<!-- built files will be auto injected -->
<script src="<%= BASE_URL %>util/aes.js" charset="utf-8"></script>
<script src="https://unpkg.com/vue@2.6.12/dist/vue.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/vue/2.6.10/vue.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/vuex/3.1.1/vuex.min.js" charset="utf-8"></script>
<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.15.1/index.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/avue/2.8.2/avue.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/avue/2.8.12/avue.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/avue-form-design/index.umd.min.js" charset="utf-8"></script>
<script src="<%= BASE_URL %>cdn/wf-design/index.umd.min.js" charset="utf-8"></script>
</body>

@ -1,37 +1,38 @@
<template>
<div class="basic-container"
:style="styleName"
:class="{'basic-container--block':block}">
<el-card>
<el-card class="basic-container__card">
<slot></slot>
</el-card>
</div>
</template>
<script>
export default {
name: "basicContainer",
props: {
radius: {
type: [String, Number],
default: 10
},
background: {
type: String
},
block: {
type: Boolean,
default: false
}
export default {
name: "basicContainer",
props: {
radius: {
type: [String, Number],
default: 10
},
background: {
type: String
},
computed: {
styleName () {
return {
borderRadius: this.setPx(this.radius),
background: this.background,
}
block: {
type: Boolean,
default: false
}
},
computed: {
styleName () {
return {
borderRadius: this.setPx(this.radius),
background: this.background,
}
}
};
}
};
</script>
<style lang="scss">
@ -40,11 +41,11 @@
box-sizing: border-box;
&--block {
height: 100%;
.el-card {
.basic-container__card {
height: 100%;
}
}
.el-card {
&__card {
width: 100%;
}
&:first-child {

@ -1,6 +1,6 @@
export const optionParent = {
height: 'auto',
calcHeight: 95,
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 10,
@ -8,7 +8,7 @@ export const optionParent = {
index: true,
selection: true,
viewBtn: true,
menuWidth: 150,
menuWidth: 250,
dialogWidth: 880,
dialogClickModal: false,
column: [
@ -16,6 +16,7 @@ export const optionParent = {
label: "字典编号",
prop: "code",
search: true,
slot: true,
span: 24,
rules: [
{
@ -43,8 +44,7 @@ export const optionParent = {
prop: "sort",
type: "number",
align: "right",
width: 80,
hide: true,
width: 100,
rules: [
{
required: true,
@ -58,7 +58,7 @@ export const optionParent = {
prop: "isSealed",
type: "switch",
align: "center",
width: 80,
width: 100,
dicData: [
{
label: "否",
@ -98,7 +98,7 @@ export const optionChild = {
index: true,
selection: true,
viewBtn: true,
menuWidth: 220,
menuWidth: 300,
dialogWidth: 880,
dialogClickModal: false,
column: [

@ -1,6 +1,6 @@
export const optionParent = {
height: 'auto',
calcHeight: 95,
calcHeight: 30,
tip: false,
searchShow: true,
searchMenuSpan: 10,
@ -8,7 +8,7 @@ export const optionParent = {
index: true,
selection: true,
viewBtn: true,
menuWidth: 150,
menuWidth: 250,
dialogWidth: 880,
dialogClickModal: false,
column: [
@ -16,6 +16,7 @@ export const optionParent = {
label: "字典编号",
prop: "code",
search: true,
slot: true,
span: 24,
rules: [
{
@ -43,7 +44,7 @@ export const optionParent = {
prop: "sort",
type: "number",
align: "right",
width: 80,
width: 100,
hide: true,
rules: [
{
@ -58,7 +59,7 @@ export const optionParent = {
prop: "isSealed",
type: "switch",
align: "center",
width: 80,
width: 100,
dicData: [
{
label: "否",
@ -98,7 +99,7 @@ export const optionChild = {
index: true,
selection: true,
viewBtn: true,
menuWidth: 220,
menuWidth: 300,
dialogWidth: 880,
dialogClickModal: false,
column: [

@ -33,7 +33,7 @@
return {};
},
created() {
this.index.openMenu(this.menuId);
this.index.openMenu();
},
computed: {
...mapGetters(["website", "menu", "tag", "keyCollapse", "screen", "menuId"]),
@ -41,8 +41,6 @@
return this.$router.$avueRouter.getValue(this.$route);
}
},
mounted() {
},
methods: {}
};
</script>

@ -26,7 +26,6 @@ RouterPlugin.install = function (vue, option = {}) {
this.$router.$avueRouter = {
//全局配置
$website: this.$store.getters.website,
routerList: [],
group: '',
meta: {},
safe: this,
@ -110,8 +109,6 @@ RouterPlugin.install = function (vue, option = {}) {
for (let i = 0; i < aMenu.length; i++) {
// 取到当前要处理的一项
const oMenu = aMenu[i];
// 判断this.routerList中是否已经存在该path,存在就跳出
if (this.routerList.includes(oMenu[propsDefault.path])) return;
// 这一块的赋值 也就是取到返回的值
let path = (() => {
if (first) {
@ -191,11 +188,7 @@ RouterPlugin.install = function (vue, option = {}) {
// for循环结束
// 这个first 卡的其实就是首路由
if (first) {
window.console.log(aRouter)
if (!this.routerList.includes(aRouter[0][propsDefault.path])) {
this.safe.$router.addRoutes(aRouter)
this.routerList.push(aRouter[0][propsDefault.path])
}
this.safe.$router.addRoutes(aRouter)
} else {
// 这里返回的是子组件
return aRouter

@ -38,8 +38,8 @@ const user = {
userInfo: getStore({name: 'userInfo'}) || [],
permission: getStore({name: 'permission'}) || {},
roles: [],
menuId: {},
menu: getStore({name: 'menu'}) || [],
menuId: getStore({name: 'menuId'}) || [],
menuAll: getStore({name: 'menuAll'}) || [],
token: getStore({name: 'token'}) || '',
refreshToken: getStore({name: 'refreshToken'}) || '',
@ -134,8 +134,7 @@ const user = {
logout().then(() => {
commit('SET_TOKEN', '');
commit('SET_MENU', []);
commit('SET_MENU_ID', {});
commit('SET_MENU_ALL', []);
commit('SET_MENU_ALL_NULL', []);
commit('SET_ROLES', []);
commit('SET_TAG_LIST', []);
commit('DEL_ALL_TAG');
@ -152,8 +151,7 @@ const user = {
FedLogOut({commit}) {
return new Promise(resolve => {
commit('SET_TOKEN', '');
commit('SET_MENU_ID', {});
commit('SET_MENU_ALL', []);
commit('SET_MENU_ALL_NULL', []);
commit('SET_MENU', []);
commit('SET_ROLES', []);
commit('SET_TAG_LIST', []);
@ -208,33 +206,24 @@ const user = {
},
SET_MENU_ID(state, menuId) {
state.menuId = menuId;
setStore({name: 'menuId', content: state.menuId})
},
SET_MENU_ALL: (state, menuAll) => {
state.menuAll = menuAll
setStore({name: 'menuAll', content: state.menuAll})
let menu = state.menuAll;
menuAll.forEach(ele => {
if (!menu.find(item => item.label === ele.label && item.path === ele.path)) {
menu.push(ele);
}
})
state.menuAll = menu
setStore({ name: 'menuAll', content: state.menuAll })
},
SET_MENU_ALL_NULL: (state) => {
state.menuAll = []
setStore({ name: 'menuAll', content: state.menuAll })
},
SET_MENU: (state, menu) => {
state.menu = menu
setStore({name: 'menu', content: state.menu})
if (validatenull(menu)) return;
//合并动态路由去重
let menuAll = state.menuAll;
menuAll = menuAll.concat(menu).reverse();
let newMenu = [];
for (let item1 of menuAll) {
let flag = true;
for (let item2 of newMenu) {
if (item1.name === item2.name || item1.path === item2.path) {
flag = false;
}
}
if (flag) {
newMenu.push(item1);
}
}
state.menuAll = newMenu;
setStore({name: 'menuAll', content: state.menuAll})
setStore({ name: 'menu', content: state.menu })
},
SET_REFRESH_TOKEN: (state, refreshToken) => {
setRefreshToken(refreshToken)

@ -3,10 +3,10 @@
line-height: 28px !important;
}
.el-card.is-always-shadow {
box-shadow: none;
border: none !important;
}
//.el-card.is-always-shadow {
// box-shadow: none;
// border: none !important;
//}
.el-scrollbar__view {
height: 100%;

@ -1,454 +1,443 @@
<template>
<el-row>
<el-col :span="11">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>字典列表</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
<el-col :span="13">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>[{{dictValue}}] 字典详情</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
</el-row>
<basic-container>
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-setting"
size="small"
@click.stop="handleRowClick(scope.row)"
v-if="userInfo.role_name.includes('admin')"
>字典配置
</el-button>
</template>
<template slot-scope="{row}" slot="code">
<el-tag @click="handleRowClick(row)" style="cursor:pointer">{{ row.code }}</el-tag>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
</template>
</avue-crud>
<el-dialog :title="`[${dictValue}]字典配置`"
append-to-body
:visible.sync="box"
width="1000px">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
</template>
</avue-crud>
</el-dialog>
</basic-container>
</template>
<script>
import {
getParentList,
getChildList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import {optionParent, optionChild} from "@/option/system/dict";
import {mapGetters} from "vuex";
import {
getParentList,
getChildList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import {optionParent, optionChild} from "@/option/system/dict";
import {mapGetters} from "vuex";
export default {
data() {
export default {
data() {
return {
dictValue: '暂无',
parentId: -1,
formParent: {},
formChild: {},
selectionList: [],
query: {},
box: false,
loading: true,
loadingChild: true,
pageParent: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
dataParent: [],
dataChild: [],
optionParent: optionParent,
optionChild: optionChild,
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
dictValue: '暂无',
parentId: -1,
formParent: {},
formChild: {},
selectionList: [],
query: {},
loading: true,
loadingChild: true,
pageParent: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
dataParent: [],
dataChild: [],
optionParent: optionParent,
optionChild: optionChild,
addBtn: this.vaildData(this.permission.dict_add, false),
delBtn: this.vaildData(this.permission.dict_delete, false),
editBtn: this.vaildData(this.permission.dict_edit, false),
viewBtn: false,
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.dict_add, false),
delBtn: this.vaildData(this.permission.dict_delete, false),
editBtn: this.vaildData(this.permission.dict_edit, false),
viewBtn: false,
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
mounted() {
this.initData();
},
methods: {
initData() {
getDictTree().then(res => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
});
},
mounted() {
this.initData();
handleAdd(row) {
this.formChild.dictValue = "";
this.formChild.dictKey = "";
this.formChild.sort = 0;
this.formChild.isSealed = 0;
this.formChild.remark = "";
this.formChild.parentId = row.id;
this.$refs.crudChild.rowAdd();
},
methods: {
initData() {
getDictTree().then(res => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
rowSave(row, done, loading) {
const form = {
...row,
dictKey: -1,
};
add(form).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
},
handleAdd(row) {
this.$refs.crudChild.value.dictValue = "";
this.$refs.crudChild.value.dictKey = "";
this.$refs.crudChild.value.sort = 0;
this.$refs.crudChild.value.isSealed = 0;
this.$refs.crudChild.value.remark = "";
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = row.id;
}
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crudChild.rowAdd();
},
rowSave(row, done, loading) {
const form = {
...row,
dictKey: -1,
};
add(form).then(() => {
this.onLoadChild(this.pageChild);
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
},
handleRowClick(row) {
this.query = {};
this.parentId = row.id;
this.dictValue = row.dictValue;
const code = this.findObject(this.optionChild.column, "code");
code.value = row.code;
const parentId = this.findObject(this.optionChild.column, "parentId");
parentId.value = row.id;
this.box = true;
this.onLoadChild(this.pageChild);
},
searchReset() {
this.query = {};
this.onLoadParent(this.pageParent);
},
searchChange(params, done) {
this.query = params;
this.pageParent.currentPage = 1;
this.onLoadParent(this.pageParent, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.onLoadChild(this.pageChild);
done();
}, error => {
window.console.log(error);
loading();
this.$refs.crud.toggleSelection();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleRowClick(row) {
this.query = {};
this.parentId = row.id;
this.dictValue = row.dictValue;
this.$refs.crudChild.value.code = row.code;
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "code") {
item.value = row.code;
}
if (item.prop === "parentId") {
item.value = row.id;
}
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.formParent.id).then(res => {
this.formParent = res.data.data;
});
}
done();
},
currentChange(currentPage) {
this.pageParent.currentPage = currentPage;
},
sizeChange(pageSize) {
this.pageParent.pageSize = pageSize;
},
refreshChange() {
this.onLoadParent(this.pageParent, this.query);
},
rowSaveChild(row, done, loading) {
add(row).then(() => {
this.onLoadChild(this.pageChild);
},
searchReset() {
this.query = {};
this.onLoadParent(this.pageParent);
},
searchChange(params, done) {
this.query = params;
this.pageParent.currentPage = 1;
this.onLoadParent(this.pageParent, params);
this.$message({
type: "success",
message: "操作成功!"
});
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.formParent.id).then(res => {
this.formParent = res.data.data;
});
}
}, error => {
window.console.log(error);
loading();
});
},
rowUpdateChild(row, index, done, loading) {
update(row).then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
},
currentChange(currentPage) {
this.pageParent.currentPage = currentPage;
},
sizeChange(pageSize) {
this.pageParent.pageSize = pageSize;
},
refreshChange() {
this.onLoadParent(this.pageParent, this.query);
},
rowSaveChild(row, done, loading) {
add(row).then(() => {
}, error => {
window.console.log(error);
loading();
});
},
rowDelChild(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdateChild(row, index, done, loading) {
update(row).then(() => {
},
searchResetChild() {
this.query = {};
this.onLoadChild(this.pageChild);
},
searchChangeChild(params, done) {
this.query = params;
this.pageChild.currentPage = 1;
this.onLoadChild(this.pageChild, params);
done();
},
selectionChangeChild(list) {
this.selectionList = list;
},
selectionClearChild() {
this.selectionList = [];
this.$refs.crudChild.toggleSelection();
},
handleDeleteChild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDelChild(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchResetChild() {
this.query = {};
this.onLoadChild(this.pageChild);
},
searchChangeChild(params, done) {
this.query = params;
this.pageChild.currentPage = 1;
this.onLoadChild(this.pageChild, params);
done();
},
selectionChangeChild(list) {
this.selectionList = list;
},
selectionClearChild() {
this.selectionList = [];
this.$refs.crudChild.toggleSelection();
},
handleDeleteChild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crudChild.toggleSelection();
});
},
beforeOpenChild(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDict(this.formChild.id).then(res => {
this.formChild = res.data.data;
});
}
done();
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
});
done();
},
currentChangeChild(currentPage) {
this.pageChild.currentPage = currentPage;
},
sizeChangeChild(pageSize) {
this.pageChild.pageSize = pageSize;
},
refreshChangeChild() {
this.onLoadChild(this.pageChild, this.query);
},
onLoadParent(page, params = {}) {
this.loading = true;
getParentList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then(res => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
this.loading = false;
this.selectionClear();
this.$refs.crudChild.toggleSelection();
});
},
onLoadChild(page, params = {}) {
this.loadingChild = true;
getChildList(
page.currentPage,
page.pageSize,
this.parentId,
Object.assign(params, this.query)
).then(res => {
this.dataChild = res.data.data;
this.loadingChild = false;
this.selectionClear();
},
beforeOpenChild(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDict(this.formChild.id).then(res => {
this.formChild = res.data.data;
});
}
done();
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
});
done();
},
currentChangeChild(currentPage) {
this.pageChild.currentPage = currentPage;
},
sizeChangeChild(pageSize) {
this.pageChild.pageSize = pageSize;
},
refreshChangeChild() {
this.onLoadChild(this.pageChild, this.query);
},
onLoadParent(page, params = {}) {
this.loading = true;
getParentList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then(res => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
this.loading = false;
this.selectionClear();
});
},
onLoadChild(page, params = {}) {
this.loadingChild = true;
getChildList(
page.currentPage,
page.pageSize,
this.parentId,
Object.assign(params, this.query)
).then(res => {
this.dataChild = res.data.data;
this.loadingChild = false;
this.selectionClear();
});
}
};
}
};
</script>

@ -1,109 +1,105 @@
<template>
<el-row>
<el-col :span="11">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>业务字典列表</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
<el-col :span="13">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>[{{dictValue}}] 业务字典详情</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
</el-row>
<basic-container>
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dictbiz_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-setting"
size="small"
@click.stop="handleRowClick(scope.row)"
v-if="userInfo.role_name.includes('admin')"
>字典配置
</el-button>
</template>
<template slot-scope="{row}" slot="code">
<el-tag @click="handleRowClick(row)" style="cursor:pointer">{{ row.code }}</el-tag>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
</template>
</avue-crud>
<el-dialog :title="`[${dictValue}]字典配置`"
append-to-body
:visible.sync="box"
width="1000px">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
</template>
</avue-crud>
</el-dialog>
</basic-container>
</template>
<script>
@ -128,6 +124,7 @@
formChild: {},
selectionList: [],
query: {},
box: false,
loading: true,
loadingChild: true,
pageParent: {
@ -177,12 +174,12 @@
});
},
handleAdd(row) {
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = row.id;
}
});
this.formChild.dictValue = "";
this.formChild.dictKey = "";
this.formChild.sort = 0;
this.formChild.isSealed = 0;
this.formChild.remark = "";
this.formChild.parentId = row.id;
this.$refs.crudChild.rowAdd();
},
rowSave(row, done, loading) {
@ -209,6 +206,7 @@
type: "success",
message: "操作成功!"
});
this.onLoadChild(this.pageChild);
done();
}, error => {
window.console.log(error);
@ -236,16 +234,13 @@
this.query = {};
this.parentId = row.id;
this.dictValue = row.dictValue;
this.$refs.crudChild.value.code = row.code;
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "code") {
item.value = row.code;
}
if (item.prop === "parentId") {
item.value = row.id;
}
});
const code = this.findObject(this.optionChild.column, "code");
code.value = row.code;
const parentId = this.findObject(this.optionChild.column, "parentId");
parentId.value = row.id;
this.box = true;
this.onLoadChild(this.pageChild);
},
searchReset() {

@ -34,7 +34,7 @@
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
v-if="userInfo.role_name.includes('admin') && scope.row.category === 1"
>新增子项
</el-button>
</template>

@ -0,0 +1,454 @@
<template>
<el-row>
<el-col :span="11">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>字典列表</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
<el-col :span="13">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>[{{dictValue}}] 字典详情</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
</el-row>
</template>
<script>
import {
getParentList,
getChildList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import {optionParent, optionChild} from "@/option/system/dict";
import {mapGetters} from "vuex";
export default {
data() {
return {
dictValue: '暂无',
parentId: -1,
formParent: {},
formChild: {},
selectionList: [],
query: {},
loading: true,
loadingChild: true,
pageParent: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
dataParent: [],
dataChild: [],
optionParent: optionParent,
optionChild: optionChild,
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.dict_add, false),
delBtn: this.vaildData(this.permission.dict_delete, false),
editBtn: this.vaildData(this.permission.dict_edit, false),
viewBtn: false,
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
mounted() {
this.initData();
},
methods: {
initData() {
getDictTree().then(res => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
});
},
handleAdd(row) {
this.$refs.crudChild.value.dictValue = "";
this.$refs.crudChild.value.dictKey = "";
this.$refs.crudChild.value.sort = 0;
this.$refs.crudChild.value.isSealed = 0;
this.$refs.crudChild.value.remark = "";
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = row.id;
}
});
this.$refs.crudChild.rowAdd();
},
rowSave(row, done, loading) {
const form = {
...row,
dictKey: -1,
};
add(form).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.onLoadChild(this.pageChild);
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleRowClick(row) {
this.query = {};
this.parentId = row.id;
this.dictValue = row.dictValue;
this.$refs.crudChild.value.code = row.code;
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "code") {
item.value = row.code;
}
if (item.prop === "parentId") {
item.value = row.id;
}
});
this.onLoadChild(this.pageChild);
},
searchReset() {
this.query = {};
this.onLoadParent(this.pageParent);
},
searchChange(params, done) {
this.query = params;
this.pageParent.currentPage = 1;
this.onLoadParent(this.pageParent, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.formParent.id).then(res => {
this.formParent = res.data.data;
});
}
done();
},
currentChange(currentPage) {
this.pageParent.currentPage = currentPage;
},
sizeChange(pageSize) {
this.pageParent.pageSize = pageSize;
},
refreshChange() {
this.onLoadParent(this.pageParent, this.query);
},
rowSaveChild(row, done, loading) {
add(row).then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdateChild(row, index, done, loading) {
update(row).then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDelChild(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchResetChild() {
this.query = {};
this.onLoadChild(this.pageChild);
},
searchChangeChild(params, done) {
this.query = params;
this.pageChild.currentPage = 1;
this.onLoadChild(this.pageChild, params);
done();
},
selectionChangeChild(list) {
this.selectionList = list;
},
selectionClearChild() {
this.selectionList = [];
this.$refs.crudChild.toggleSelection();
},
handleDeleteChild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crudChild.toggleSelection();
});
},
beforeOpenChild(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDict(this.formChild.id).then(res => {
this.formChild = res.data.data;
});
}
done();
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
});
done();
},
currentChangeChild(currentPage) {
this.pageChild.currentPage = currentPage;
},
sizeChangeChild(pageSize) {
this.pageChild.pageSize = pageSize;
},
refreshChangeChild() {
this.onLoadChild(this.pageChild, this.query);
},
onLoadParent(page, params = {}) {
this.loading = true;
getParentList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then(res => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
this.loading = false;
this.selectionClear();
});
},
onLoadChild(page, params = {}) {
this.loadingChild = true;
getChildList(
page.currentPage,
page.pageSize,
this.parentId,
Object.assign(params, this.query)
).then(res => {
this.dataChild = res.data.data;
this.loadingChild = false;
this.selectionClear();
});
}
}
};
</script>

@ -0,0 +1,447 @@
<template>
<el-row>
<el-col :span="11">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>业务字典列表</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionParent"
:table-loading="loading"
:data="dataParent"
:page="pageParent"
ref="crud"
v-model="formParent"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@row-click="handleRowClick"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoadParent"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
<el-col :span="13">
<basic-container>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>[{{dictValue}}] 业务字典详情</span>
</div>
<div class="clearfix">
<avue-crud
:option="optionChild"
:table-loading="loadingChild"
:data="dataChild"
ref="crudChild"
v-model="formChild"
:permission="permissionList"
:before-open="beforeOpenChild"
:before-close="beforeCloseChild"
@row-del="rowDelChild"
@row-update="rowUpdateChild"
@row-save="rowSaveChild"
@search-change="searchChangeChild"
@search-reset="searchResetChild"
@selection-change="selectionChangeChild"
@current-change="currentChangeChild"
@size-change="sizeChangeChild"
@refresh-change="refreshChangeChild"
@on-load="onLoadChild"
>
<template slot="menuLeft">
<el-button
type="danger"
size="small"
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"
>
</el-button>
</template>
<template slot-scope="scope" slot="menu">
<el-button
type="text"
icon="el-icon-circle-plus-outline"
size="small"
@click.stop="handleAdd(scope.row,scope.index)"
v-if="userInfo.role_name.includes('admin')"
>新增子项
</el-button>
</template>
<template slot-scope="{row}" slot="isSealed">
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag>
</template>
</avue-crud>
</div>
</el-card>
</basic-container>
</el-col>
</el-row>
</template>
<script>
import {
getParentList,
getChildList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dictbiz";
import {optionParent, optionChild} from "@/option/system/dictbiz";
import {mapGetters} from "vuex";
export default {
data() {
return {
dictValue: '暂无',
parentId: -1,
formParent: {},
formChild: {},
selectionList: [],
query: {},
loading: true,
loadingChild: true,
pageParent: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
pageChild: {
pageSize: 10,
pageSizes: [10, 30, 50, 100, 200],
currentPage: 1,
total: 0
},
dataParent: [],
dataChild: [],
optionParent: optionParent,
optionChild: optionChild,
};
},
computed: {
...mapGetters(["userInfo", "permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.dictbiz_add, false),
delBtn: this.vaildData(this.permission.dictbiz_delete, false),
editBtn: this.vaildData(this.permission.dictbiz_edit, false),
viewBtn: false,
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
mounted() {
this.initData();
},
methods: {
initData() {
getDictTree().then(res => {
const column = this.findObject(this.optionChild.column, "parentId");
column.dicData = res.data.data;
});
},
handleAdd(row) {
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = row.id;
}
});
this.$refs.crudChild.rowAdd();
},
rowSave(row, done, loading) {
const form = {
...row,
dictKey: -1,
};
add(form).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdate(row, index, done, loading) {
update(row).then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleRowClick(row) {
this.query = {};
this.parentId = row.id;
this.dictValue = row.dictValue;
this.$refs.crudChild.value.code = row.code;
this.$refs.crudChild.value.parentId = row.id;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "code") {
item.value = row.code;
}
if (item.prop === "parentId") {
item.value = row.id;
}
});
this.onLoadChild(this.pageChild);
},
searchReset() {
this.query = {};
this.onLoadParent(this.pageParent);
},
searchChange(params, done) {
this.query = params;
this.pageParent.currentPage = 1;
this.onLoadParent(this.pageParent, params);
done();
},
selectionChange(list) {
this.selectionList = list;
},
selectionClear() {
this.selectionList = [];
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadParent(this.pageParent);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.formParent.id).then(res => {
this.formParent = res.data.data;
});
}
done();
},
currentChange(currentPage) {
this.pageParent.currentPage = currentPage;
},
sizeChange(pageSize) {
this.pageParent.pageSize = pageSize;
},
refreshChange() {
this.onLoadParent(this.pageParent, this.query);
},
rowSaveChild(row, done, loading) {
add(row).then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowUpdateChild(row, index, done, loading) {
update(row).then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
done();
}, error => {
window.console.log(error);
loading();
});
},
rowDelChild(row) {
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchResetChild() {
this.query = {};
this.onLoadChild(this.pageChild);
},
searchChangeChild(params, done) {
this.query = params;
this.pageChild.currentPage = 1;
this.onLoadChild(this.pageChild, params);
done();
},
selectionChangeChild(list) {
this.selectionList = list;
},
selectionClearChild() {
this.selectionList = [];
this.$refs.crudChild.toggleSelection();
},
handleDeleteChild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择数据删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoadChild(this.pageChild);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crudChild.toggleSelection();
});
},
beforeOpenChild(done, type) {
if (["add", "edit"].includes(type)) {
this.initData();
}
if (["edit", "view"].includes(type)) {
getDict(this.formChild.id).then(res => {
this.formChild = res.data.data;
});
}
done();
},
beforeCloseChild(done) {
this.$refs.crudChild.value.parentId = this.parentId;
this.$refs.crudChild.option.column.filter(item => {
if (item.prop === "parentId") {
item.value = this.parentId;
}
});
done();
},
currentChangeChild(currentPage) {
this.pageChild.currentPage = currentPage;
},
sizeChangeChild(pageSize) {
this.pageChild.pageSize = pageSize;
},
refreshChangeChild() {
this.onLoadChild(this.pageChild, this.query);
},
onLoadParent(page, params = {}) {
this.loading = true;
getParentList(
page.currentPage,
page.pageSize,
Object.assign(params, this.query)
).then(res => {
const data = res.data.data;
this.pageParent.total = data.total;
this.dataParent = data.records;
this.loading = false;
this.selectionClear();
});
},
onLoadChild(page, params = {}) {
this.loadingChild = true;
getChildList(
page.currentPage,
page.pageSize,
this.parentId,
Object.assign(params, this.query)
).then(res => {
this.dataChild = res.data.data;
this.loadingChild = false;
this.selectionClear();
});
}
}
};
</script>

@ -9,9 +9,9 @@
<el-col :span="24">
<basic-container>
<p style="text-align: center">
<img src="https://img.shields.io/badge/Release-V2.8.0-green.svg" alt="Downloads"/>
<img src="https://img.shields.io/badge/Release-V2.8.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/Spring%20Cloud-Hoxton.SR10-blue.svg" alt="Coverage Status"/>
<img src="https://img.shields.io/badge/Spring%20Cloud-Hoxton.SR11-blue.svg" alt="Coverage Status"/>
<img src="https://img.shields.io/badge/Spring%20Boot-2.2.13.RELEASE-blue.svg" alt="Downloads"/>
<a target="_blank" href="https://bladex.vip">
<img src="https://img.shields.io/badge/Saber%20Author-Small%20Chill-ff69b4.svg" alt="Downloads"/>
@ -138,6 +138,37 @@
<el-row>
<basic-container>
<el-collapse v-model="logActiveNames" @change="handleChange">
<el-collapse-item title="2.8.1.RELEASE发布,适配Nacos2支持长链接特性" name="23">
<div>1.[升级]SpringCloud Hoxton.SR11</div>
<div>2.[升级]Avue 2.8.12</div>
<div>3.[升级]Lombok 1.18.18</div>
<div>4.[升级]Nacos 2.0.1</div>
<div>5.[升级]JustAuth 1.16.1</div>
<div>6.[新增]JustAuth支持基于redis的state缓存</div>
<div>7.[新增]服务内部调用文件上传的工具类</div>
<div>8.[新增]插件市场目录说明</div>
<div>9.[新增]全新布局的字典管理模块</div>
<div>10.[优化]Dockerfile初始镜像改为固化的openjdk8-openj9含字体版本</div>
<div>11.[优化]SmsResponse返回字段message为msg</div>
<div>12.[优化]Feign熔断加载逻辑</div>
<div>13.[优化]Sql打印插件增加java8时间处理</div>
<div>14.[优化]多数据源环境下生效Sql打印插件的配置</div>
<div>15.[优化]校验短信验证码时与手机号关联验证</div>
<div>16.[优化]Request包装逻辑支持配置跳过</div>
<div>17.[优化]Mybatis-plus的SQLServerDialect逻辑</div>
<div>18.[优化]ObjectMapper支持可配</div>
<div>19.[优化]增加跨域请求头以防独立swagger服务出现跨域</div>
<div>20.[优化]数据权限与接口权限的缓存改为全局</div>
<div>21.[优化]Xss过滤逻辑</div>
<div>22.[优化]角色配置逻辑</div>
<div>23.[优化]菜单配置逻辑</div>
<div>24.[修复]ImageUtil宽高反转的bug</div>
<div>25.[修复]树组件未全选导致父节点没有入库从而引发顶部菜单生成的bug</div>
<div>26.[修复]字典通用接口未返回id与parentId产生的bug</div>
<div>27.[脚本]启动脚本增加jvm配置</div>
<div>28.[脚本]修复report脚本部署逻辑</div>
<div>29.[移除]过时的BladeRedisCache请用BladeRedis取代</div>
</el-collapse-item>
<el-collapse-item title="2.8.0.RELEASE发布,集成Prometheus全方位监控方案" name="22">
<div>1.[升级]SpringCloud Hoxton.SR10</div>
<div>2.[升级]AlibabaCloud 2.2.5.RELEASE</div>
@ -609,7 +640,7 @@
data() {
return {
activeNames: ['1', '2', '3', '5'],
logActiveNames: ['22']
logActiveNames: ['23']
};
},
computed: {

@ -85,7 +85,7 @@
init() {
this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId;
this.src = `/api/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}`;
this.src = `/api/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}&t=${new Date().getTime()}`;
historyFlowList(this.processInstanceId).then(res => {
const data = res.data;
if (data.success) {

@ -104,7 +104,7 @@
this.taskId = this.$route.params.taskId;
this.processInstanceId = this.$route.params.processInstanceId;
this.businessId = this.$route.params.businessId;
this.src = `/api/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}`;
this.src = `/api/blade-flow/process/diagram-view?processInstanceId=${this.$route.params.processInstanceId}&t=${new Date().getTime()}`;
historyFlowList(this.processInstanceId).then(res => {
const data = res.data;
if (data.success) {

Loading…
Cancel
Save