This commit is contained in:
朱文强 2023-01-05 16:56:46 +08:00
parent e1bd5e7de2
commit 248b518a2b
35 changed files with 1552 additions and 1133 deletions

View File

@ -4,7 +4,8 @@
box-sizing: border-box; box-sizing: border-box;
} }
body { body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
"微软雅黑", Arial, sans-serif;
font-size: $--font-size-base; font-size: $--font-size-base;
line-height: $base--line-height; line-height: $base--line-height;
color: $--color-text-primary; color: $--color-text-primary;
@ -80,7 +81,6 @@ img {
line-height: $base--line-height !important; line-height: $base--line-height !important;
} }
/* Reset element-ui /* Reset element-ui
------------------------------ */ ------------------------------ */
.aui-wrapper { .aui-wrapper {
@ -110,7 +110,6 @@ img {
} }
} }
/* Common /* Common
------------------------------ */ ------------------------------ */
// 图标 // 图标
@ -161,7 +160,7 @@ img {
bottom: 0; bottom: 0;
z-index: 1010; z-index: 1010;
width: 210px; width: 210px;
transition: right .3s; transition: right 0.3s;
&--open { &--open {
right: 0; right: 0;
} }
@ -197,7 +196,6 @@ img {
} }
} }
/* Layout /* Layout
------------------------------ */ ------------------------------ */
.aui-wrapper { .aui-wrapper {
@ -205,7 +203,6 @@ img {
padding-top: $navbar--height; padding-top: $navbar--height;
} }
/* Sidebar fold /* Sidebar fold
------------------------------ */ ------------------------------ */
.aui-sidebar--fold { .aui-sidebar--fold {
@ -252,7 +249,6 @@ img {
} }
} }
/* Navbar /* Navbar
------------------------------ */ ------------------------------ */
.aui-navbar { .aui-navbar {
@ -265,7 +261,7 @@ img {
align-items: stretch; align-items: stretch;
height: $navbar--height; height: $navbar--height;
background-color: $--color-primary; background-color: $--color-primary;
box-shadow: 0 1px 0 0 rgba(0, 0, 0, .05); box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
&--colorful { &--colorful {
.aui-navbar__body { .aui-navbar__body {
} }
@ -315,7 +311,7 @@ img {
position: relative; position: relative;
width: $sidebar--width; width: $sidebar--width;
height: $navbar--height; height: $navbar--height;
transition: width .3s; transition: width 0.3s;
} }
&__brand { &__brand {
background-color: rgba(0, 21, 41, 1); background-color: rgba(0, 21, 41, 1);
@ -331,7 +327,7 @@ img {
white-space: nowrap; white-space: nowrap;
color: #fff; color: #fff;
overflow: hidden; overflow: hidden;
transition: width .3s; transition: width 0.3s;
&-lg, &-lg,
&-mini { &-mini {
max-width: 100%; max-width: 100%;
@ -402,7 +398,7 @@ img {
width: auto; width: auto;
font-size: 12px; font-size: 12px;
margin: 0 0 0 5px; margin: 0 0 0 5px;
transition: transform .3s; transition: transform 0.3s;
} }
} }
} }
@ -422,7 +418,7 @@ img {
} }
&-txt { &-txt {
width: 0; width: 0;
transition: width .3s, margin-left .3s; transition: width 0.3s, margin-left 0.3s;
&.is-show { &.is-show {
width: 210px; width: 210px;
margin-left: 8px; margin-left: 8px;
@ -453,7 +449,6 @@ img {
} }
} }
/* Sidebar /* Sidebar
------------------------------ */ ------------------------------ */
.aui-sidebar { .aui-sidebar {
@ -464,9 +459,9 @@ img {
z-index: 1020; z-index: 1020;
width: $sidebar--width; width: $sidebar--width;
background-color: #fff; background-color: #fff;
box-shadow: 1px 0 2px 0 rgba(0, 0, 0, .05); box-shadow: 1px 0 2px 0 rgba(0, 0, 0, 0.05);
overflow: hidden; overflow: hidden;
transition: width .3s; transition: width 0.3s;
&--dark { &--dark {
background-color: $sidebar--background-color-dark; background-color: $sidebar--background-color-dark;
.aui-sidebar__menu, .aui-sidebar__menu,
@ -479,6 +474,10 @@ img {
&:hover { &:hover {
color: #fff; color: #fff;
background-color: rgba(11, 88, 255, 1); background-color: rgba(11, 88, 255, 1);
.aui-sidebar__menu-icon-son{
background: #fff;
border-radius: 4px;
}
} }
} }
.el-menu, .el-menu,
@ -499,12 +498,12 @@ img {
padding-bottom: 15px; padding-bottom: 15px;
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: scroll;
transition: width .3s; transition: width 0.3s;
} }
&__menu { &__menu {
width: $sidebar--width; width: $sidebar--width;
border-right: 0; border-right: 0;
transition: width .3s; transition: width 0.3s;
.el-menu-item, .el-menu-item,
.el-submenu__title { .el-submenu__title {
height: $sidebar--menu-item-height; height: $sidebar--menu-item-height;
@ -519,11 +518,20 @@ img {
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
color: inherit !important; color: inherit !important;
transition: font-size .3s; transition: font-size 0.3s;
}
&__menu-icon-son {
display: inline-block;
vertical-align: middle;
width: 8px !important;
margin-right: 15px;
text-align: center;
font-size: 8px;
color: inherit !important;
transition: font-size 0.3s;
} }
} }
/* Content /* Content
------------------------------ */ ------------------------------ */
.aui-content { .aui-content {
@ -535,7 +543,7 @@ img {
margin-left: $sidebar--width; margin-left: $sidebar--width;
min-height: calc(100vh - #{$navbar--height}); min-height: calc(100vh - #{$navbar--height});
background-color: $content--background-color; background-color: $content--background-color;
transition: margin-left .3s; transition: margin-left 0.3s;
} }
> .aui-card--fill > .el-card__body { > .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height} - 2px); min-height: calc(#{$content--fill-height} - 2px);
@ -574,9 +582,9 @@ img {
z-index: 930; z-index: 930;
padding: 0 55px 0 15px; padding: 0 55px 0 15px;
margin: 0; margin: 0;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05); box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
background-color: #fff; background-color: #fff;
transition: left .3s; transition: left 0.3s;
> .el-tabs__nav-wrap { > .el-tabs__nav-wrap {
margin-bottom: 0; margin-bottom: 0;
&:after { &:after {
@ -610,7 +618,7 @@ img {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
content: ''; content: "";
width: 100%; width: 100%;
height: 2px; height: 2px;
background-color: $--color-primary; background-color: $--color-primary;
@ -622,10 +630,10 @@ img {
line-height: 24px; line-height: 24px;
border-radius: 5px; border-radius: 5px;
background-color: rgba(239, 239, 239, 1); background-color: rgba(239, 239, 239, 1);
&.is-active { &.is-active {
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
background-color: rgba(62, 142, 247, 1); background-color: rgba(62, 142, 247, 1);
} }
} }
> .el-icon-close { > .el-icon-close {
width: 14px; width: 14px;
@ -698,7 +706,6 @@ img {
} }
} }
/* Page /* Page
------------------------------ */ ------------------------------ */
*[class*="aui-page__"] { *[class*="aui-page__"] {

38
src/filters/sys-filter.js Normal file
View File

@ -0,0 +1,38 @@
/*
* @Date: 2020-12-29 16:49:28
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:49:17
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
import i18n from "@/i18n";
const table = {
sex: {
'0': '男',
'1': '女'
},
userStatus: {
'0': i18n.t('user.status0'),
'1': i18n.t('user.status1')
},
menuType: {
'0': i18n.t('menu.type0'),
'1': i18n.t('menu.type1')
},
logOperation: {
'0': i18n.t('logLogin.operation0'),
'1': i18n.t('logLogin.operation1')
},
logStatus: {
'0': i18n.t('logLogin.status0'),
'1': i18n.t('logLogin.status1')
},
}
export default function(dictTable) {
return function(val) {
return table?.[dictTable]?.[val]
}
}

1
src/icons/svg/tuichu.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1672908143992" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2693" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M913.14 491.51L761.09 345.12c-12.16-11.71-30.41-11.71-42.57 0s-12.16 29.28 0 40.99l100.35 96.61H526.93c-18.25 0-30.41 11.71-30.41 29.28s12.16 29.28 30.41 29.28h291.93l-100.34 96.61c-12.16 11.71-12.16 29.28 0 40.99 6.08 5.86 12.16 8.78 21.28 8.78 9.13 0 15.21-2.93 21.29-8.78l152.05-149.31s0-2.93 3.04-2.93c9.13-8.79 9.13-26.35-3.04-35.13z" p-id="2694"></path><path d="M831.03 716.94c-18.25 0-30.41 11.71-30.41 29.28v58.56c0 17.56-12.16 29.28-30.41 29.28H253.24c-18.25 0-30.41-11.71-30.41-29.28V219.23c0-17.56 12.16-29.28 30.41-29.28H770.2c18.25 0 30.41 11.71 30.41 29.28v58.56c0 17.56 12.16 29.28 30.41 29.28s30.41-11.71 30.41-29.28v-58.56c0-49.77-39.53-87.83-91.23-87.83H253.24c-51.69 0-91.23 38.06-91.23 87.83v585.54c0 49.77 39.54 87.83 91.23 87.83H770.2c51.7 0 91.23-38.06 91.23-87.83v-58.56c0.01-17.56-12.16-29.27-30.4-29.27z" p-id="2695"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1672908212473" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3802" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M790.528 765.3376c0 46.4896-17.6128 80.2816-64.512 80.2816H215.8592c-46.8992 0-70.656-21.504-70.656-67.9936V246.3744c0-46.4896 17.6128-61.6448 64.512-61.6448h208.2816c18.6368 0 33.792-13.1072 33.792-31.9488 0-16.5888-13.5168-30.1056-30.3104-30.1056H187.392c-56.7296-0.2048-102.8096 45.4656-103.0144 101.9904v580.8128c0.2048 56.7296 46.4896 102.4 103.0144 102.1952h562.7904c56.7296 0 103.0144-45.8752 103.0144-102.1952V582.0416c0-18.2272-14.9504-32.9728-33.1776-32.5632-17.6128 0.4096-29.696 14.7456-29.696 32.3584l0.2048 183.5008z m101.376-592.2816l-60.2112-53.6576c-15.7696-15.7696-37.2736-24.3712-59.392-24.3712-22.528 0-43.4176 8.6016-59.392 24.3712l-340.992 342.016c-12.4928 12.4928-50.5856 48.3328-51.2 65.7408v0.4096L289.792 700.416c-2.048 9.4208 6.144 17.8176 15.5648 15.7696l187.5968-33.1776c8.192-1.4336 38.2976-32.768 54.0672-48.3328l351.232-348.16c15.7696-15.7696 20.48-32.5632 20.48-54.6816-0.2048-22.1184-11.0592-43.008-26.8288-58.7776z m-455.0656 471.04l-87.8592 20.8896c-5.7344 1.2288-11.0592-3.8912-9.6256-9.6256l22.9376-84.1728c0.4096-2.2528 3.2768-3.072 4.9152-1.4336l70.4512 69.8368c1.2288 1.4336 0.8192 3.6864-0.8192 4.5056z m42.5984-24.576c-1.2288 0.6144-2.6624 0.6144-3.6864-0.4096l-88.4736-89.7024c-1.024-1.024-1.2288-2.6624-0.2048-3.8912 9.4208-12.4928 271.5648-274.432 271.5648-274.432 1.2288-1.2288 3.072-1.2288 4.096 0l94.0032 93.184c1.2288 1.2288 1.2288 3.072 0 4.096 0.2048 0.2048-266.0352 264.192-277.2992 271.1552z m373.9648-360.6528l-60.416 60.2112c-1.024 1.024-2.8672 1.024-4.096 0l-98.304-95.232c-1.2288-1.2288-1.2288-2.8672 0-4.096L751.2064 159.744c6.3488-6.3488 14.9504-9.8304 23.9616-9.8304s17.6128 3.4816 23.9616 9.8304l54.4768 52.0192c6.3488 6.3488 9.8304 14.7456 9.8304 23.7568 0 8.6016-3.6864 17.2032-10.0352 23.3472z m0 0" fill="#666666" p-id="3803"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>椭圆形</title>
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="最新参考" transform="translate(-32.000000, -131.000000)" stroke="#FFFFFF">
<g id="编组-8备份-17" transform="translate(0.000000, 112.000000)">
<g id="编组" transform="translate(32.000000, 16.000000)">
<circle id="椭圆形" cx="4" cy="7" r="3.5"></circle>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 686 B

12
src/icons/svg/角色.svg Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>角色</title>
<g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="icon" transform="translate(-1031.000000, -175.000000)" fill="#000000" fill-rule="nonzero">
<g id="角色" transform="translate(1031.000000, 175.000000)">
<rect id="矩形" opacity="0" x="0" y="0" width="16" height="16"></rect>
<path d="M9.12497928,7.52418056 C10.0312177,7.11168584 10.6077728,6.21794728 10.6077728,5.22577248 C10.6077728,3.82266544 9.53903648,2.81330336 8.13280448,2.81330336 C6.72657248,2.81330336 5.64846128,3.83204031 5.64846128,5.23358488 C5.64846128,6.25857175 6.24376616,7.10074847 7.19062905,7.50074336 C7.60312377,7.67730359 8.44217553,7.76167752 9.12497928,7.52418056 Z M6.97813177,8.4038568 C6.92656992,8.38666952 6.86875817,8.37573216 6.81719631,8.35385744 C5.56252488,7.8257392 4.68441113,6.59919239 4.68441113,5.24139728 C4.68441113,3.38204608 6.12814264,1.80862872 8.12811705,1.80862872 C10.1702784,1.80862872 11.571823,3.37735864 11.571823,5.23514736 C11.571823,6.55075552 10.7374586,7.76636495 9.537474,8.31479544 C8.60467344,8.72104023 7.67499784,8.63510384 6.97813177,8.4038568 L6.97813177,8.4038568 Z M3.16255559,14.478779 C2.71099888,14.4772166 2.24225488,14.2740942 2.00475792,13.9006614 C1.77507336,13.5397286 1.803198,13.033485 1.98444569,12.6475525 C2.61412513,11.3038197 4.26254153,9.04134864 8.23436569,8.98041192 C12.3186884,8.90541287 13.8046069,11.3288194 14.3264752,12.7725509 C14.4639734,13.1522335 14.4858482,13.4975416 14.2592886,13.9115988 C13.9921045,14.3412808 13.5296104,14.445967 13.1014909,14.445967 L9.50325508,14.445967 C9.27357052,14.445967 9.09076037,14.211595 9.09076037,13.9819104 C9.09076037,13.7522259 9.27825796,13.5459785 9.50638004,13.5459785 L13.1296155,13.5459785 C13.2889885,13.5459785 13.3717999,13.5428535 13.4592988,13.4194176 C13.5046107,13.3553559 13.557735,13.2131702 13.4967983,13.0459849 C12.9514928,11.5381917 11.4827616,9.89602519 8.209366,9.8960252 C4.99221969,9.8960252 3.62973713,11.5444416 2.92193369,12.916299 C2.86099697,13.0459849 2.84849713,13.2334825 2.92662113,13.3537934 C3.01099505,13.4866042 3.10630633,13.544416 3.2719292,13.544416 L10.315589,13.544416 C10.5452736,13.544416 10.748396,13.7725381 10.748396,14.0022226 C10.748396,14.2319072 10.5608984,14.4772166 10.3312138,14.4772166" id="形状"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-09-19 14:12:43 * @LastEditTime: 2023-01-05 10:54:13
* @Description: * @Description:
*/ */
export default { export default {
@ -92,5 +92,8 @@ export default {
.catch(() => { }); .catch(() => { });
}); });
}, },
formClear() {
this.$refs.dataForm.resetFields()
}
} }
} }

View File

@ -2,151 +2,192 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-24 11:19:43 * @Date: 2022-08-24 11:19:43
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-09-16 13:50:19 * @LastEditTime: 2023-01-05 14:24:29
* @Description: * @Description:
*/ */
export default { export default {
data () { data() {
/* eslint-disable */ /* eslint-disable */
return { return {
urlOptions: { urlOptions: {
getDataListURL: '', getDataListURL: '',
deleteURL: '', deleteURL: '',
statusUrl: '', statusUrl: '',
exportUrl: '' exportUrl: ''
}, },
dataList: [], addOrEditTitle: '',
dataForm: {}, tableData: [],
pageIndex: 1, listQuery: {
pageSize: 10, limit: 10,
totalPage: 0, page: 1,
dataListLoading: false, total: 1,
addOrUpdateVisible: false, },
} dataListLoading: false,
}, addOrUpdateVisible: false,
created () { }
}, },
activated() { created() {
this.getDataList(); },
}, activated() {
methods: { this.getDataList();
},
methods: {
// 获取数据列表 // 获取数据列表
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.$http this.$http
.get(this.urlOptions.getDataListURL, { .get(this.urlOptions.getDataListURL, {
params: { params: this.listQuery,
page: this.pageIndex,
limit: this.pageSize,
...this.dataForm
},
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
this.totalPage = 0;
return this.$message.error(res.msg);
}
this.dataList = res.data.list;
this.totalPage = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => {});
},
// 删除
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}) })
.then(() => { .then(({ data: res }) => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => { this.dataListLoading = false;
if (data && data.code === 0) { if (res.code !== 0) {
this.$message({ this.tableData = [];
message: "操作成功", this.listQuery.total = 0;
type: "success", return this.$message.error(res.msg);
duration: 1500, }
onClose: () => { this.tableData = res.data.list;
this.getDataList(); this.listQuery.total = res.data.total;
}, })
}); .catch(() => {
} else { this.dataListLoading = false;
this.$message.error(data.msg); });
} },
}); // 每页数
}) sizeChangeHandle(val) {
.catch(() => {}); this.listQuery.limit = val;
}, this.listQuery.page = 1;
// 导出 this.getDataList();
exportHandle(name) { },
this.$http // 当前页
.get(this.urlOptions.exportUrl, { responseType: "blob" }) currentChangeHandle(val) {
.then(({ data: res }) => { this.listQuery.page = val;
var date = new Date(); this.getDataList();
var year = date.getFullYear(); },
var month = date.getMonth() + 1; // 新增 / 修改
var strDate = date.getDate(); addOrUpdateHandle(id) {
if (month >= 1 && month <= 9) { this.addOrUpdateVisible = true;
month = "0" + month; this.$nextTick(() => {
} this.$refs.addOrUpdate.init(id);
if (strDate >= 0 && strDate <= 9) { });
strDate = "0" + strDate; },
} cancel(id) {
var currentdate = year + "-" + month + "-" + strDate; this.$refs["popover-" + id].showPopper = false;
const blob = new Blob([res]); },
const downloadElement = document.createElement("a"); //改变状态
const href = window.URL.createObjectURL(blob); // 创建下载的链接 changeStatus(id) {
downloadElement.href = href; this.$http
downloadElement.download = `${name+currentdate}.xls`; // 下载后文件名 .post(this.urlOptions.statusUrl, { id })
document.body.appendChild(downloadElement); .then(({ data: res }) => {
downloadElement.click(); // 点击下载 if (res.code !== 0) {
document.body.removeChild(downloadElement); // 下载完成移除元素 return this.$message.error(res.msg);
window.URL.revokeObjectURL(href); }
}) this.$refs["popover-" + id].showPopper = false;
.catch(() => {}); this.$message({
} message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => { });
},
//tableBtn点击
handleClick(val) {
if (val.type === "edit") {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "编辑";
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id,val.data.name)
}
},
// 删除
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
} else {
this.$message.error(data.msg);
}
});
})
.catch(() => { });
},
//search-bar点击
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.xm1 = val.xm1;
this.listQuery.xm2 = val.xm2;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.addOrUpdateVisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.dataFormSubmit()
},
successSubmit() {
this.handleCancel()
this.getDataList()
},
// 导出
exportHandle(name) {
this.$http
.get(this.urlOptions.exportUrl, { responseType: "blob" })
.then(({ data: res }) => {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + "-" + month + "-" + strDate;
const blob = new Blob([res]);
const downloadElement = document.createElement("a");
const href = window.URL.createObjectURL(blob); // 创建下载的链接
downloadElement.href = href;
downloadElement.download = `${name + currentdate}.xls`; // 下载后文件名
document.body.appendChild(downloadElement);
downloadElement.click(); // 点击下载
document.body.removeChild(downloadElement); // 下载完成移除元素
window.URL.revokeObjectURL(href);
})
.catch(() => { });
} }
}
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-01-04 10:29:39 * @Date: 2023-01-04 10:29:39
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2023-01-04 10:42:56 * @LastEditTime: 2023-01-05 15:52:02
* @Description: * @Description:
*/ */
import Vue from 'vue' import Vue from 'vue'
@ -40,9 +40,6 @@ export const moduleRoutes = {
meta: { title: '主入口布局' }, meta: { title: '主入口布局' },
children: [ children: [
{ path: '/home', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } }, { path: '/home', component: () => import('@/views/modules/home'), name: 'home', meta: { title: '首页', isTab: true } },
// 基础信息
{ path: '/unitList', component: () => import('@/views/spc-basic/unitList'), name: 'unitList', meta: { title: '计量单位管理', isTab: true } },
] ]
} }

View File

@ -1,3 +1,10 @@
/*
* @Author: zwq
* @Date: 2023-01-04 10:29:39
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 16:14:45
* @Description:
*/
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
@ -24,7 +31,7 @@ export default new Vuex.Store({
{ {
...window.SITE_CONFIG['contentTabDefault'], ...window.SITE_CONFIG['contentTabDefault'],
'name': 'home', 'name': 'home',
'title': 'home' 'title': '首页'
} }
], ],
contentTabsActiveName: 'home' contentTabsActiveName: 'home'

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-08-22 14:57:51 * @Date: 2022-08-22 14:57:51
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-22 15:25:14 * @LastEditTime: 2023-01-05 16:44:00
* @Description: * @Description:
--> -->
<template> <template>
@ -34,8 +34,12 @@
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item> <el-dropdown-item @click.native="updatePasswordHandle()">
<el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item> <svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#修改密码"></use></svg>
{{ $t('updatePassword.title') }}</el-dropdown-item>
<el-dropdown-item @click.native="logoutHandle()">
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#tuichu"></use></svg>
{{ $t('logout') }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-menu-item> </el-menu-item>

View File

@ -1,3 +1,10 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 16:48:04
* @Description:
-->
<template> <template>
<el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.id" :popper-append-to-body="false"> <el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.id" :popper-append-to-body="false">
<template slot="title"> <template slot="title">
@ -7,7 +14,8 @@
<sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu> <sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu>
</el-submenu> </el-submenu>
<el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)"> <el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true"><use xlink:href="#椭圆形"></use></svg>
<!-- <svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg> -->
<span>{{ menu.name }}</span> <span>{{ menu.name }}</span>
</el-menu-item> </el-menu-item>
</template> </template>

View File

@ -1,3 +1,10 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:52:01
* @Description:
-->
<template> <template>
<aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]"> <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
<div class="aui-sidebar__inner"> <div class="aui-sidebar__inner">
@ -8,16 +15,6 @@
:collapseTransition="false" :collapseTransition="false"
class="aui-sidebar__menu" class="aui-sidebar__menu"
> >
<el-submenu index="basic">
<template slot="title">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-bianji"></use></svg>
<span>基础信息</span>
</template>
<el-menu-item index="unitList" @click="$router.push({ name: 'unitList' })">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-log"></use></svg>
<span slot="title">计量单位管理</span>
</el-menu-item>
</el-submenu>
<sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" /> <sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" />
</el-menu> </el-menu>
</div> </div>

View File

@ -1,6 +1,5 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('dept.name')"> <el-form-item prop="name" :label="$t('dept.name')">
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
</el-form-item> </el-form-item>
@ -30,18 +29,19 @@
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dept.sort')"></el-input-number> <el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dept.sort')"></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dept/',
infoURL: '/sys/dept'
},
visible: false, visible: false,
deptList: [], deptList: [],
deptListVisible: false, deptListVisible: false,
@ -67,7 +67,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -117,7 +118,7 @@ export default {
this.deptListVisible = false this.deptListVisible = false
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmit: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false

View File

@ -1,43 +1,119 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 14:32:59
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dept"> <div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button v-if="$hasPermission('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> :table-data="tableData"
<el-table-column prop="name" :label="$t('dept.name')" header-align="center" min-width="150"></el-table-column> row-key="id"
<el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
<el-table-column prop="sort" :label="$t('dept.sort')" header-align="center" align="center" width="80"></el-table-column> >
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <method-btn
<template slot-scope="scope"> v-if="tableBtn.length"
<el-button v-if="$hasPermission('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> slot="handleBtn"
<el-button v-if="$hasPermission('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :width="100"
</template> label="操作"
</el-table-column> :method-list="tableBtn"
</el-table> @clickBtn="handleClick"
/>
</base-table>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dept-add-or-update' import AddOrUpdate from "./dept-add-or-update";
import i18n from "@/i18n";
const tableProps = [
{
prop: "name",
label: i18n.t("dept.name"),
},
{
prop: "parentName",
label: i18n.t("dept.parentName"),
},
{
prop: "sort",
label: i18n.t("dept.sort"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/dept/list', getDataListURL: "/sys/dept/list",
deleteURL: '/sys/dept' deleteURL: "/sys/dept",
} },
} tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
} },
} methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
this.tableData = res.data;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
}
};
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictValue" :label="$t('dict.dictValue')"> <el-form-item prop="dictValue" :label="$t('dict.dictValue')">
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input> <el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
@ -14,18 +13,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dict/data/',
infoURL: '/sys/dict/data'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -53,7 +53,9 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id,dictTypeId) {
this.dataForm.id = id || "";
this.dataForm.dictTypeId = dictTypeId || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()

View File

@ -1,96 +1,150 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')" clearable></el-input> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button @click="getDataList()">{{ $t('query') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> />
</el-form-item> </base-table>
</el-form> <pagination
<el-table :limit.sync="listQuery.limit"
v-loading="dataListLoading" :page.sync="listQuery.page"
:data="dataList" :total="listQuery.total"
border @pagination="getDataList"
@selection-change="dataListSelectionChangeHandle" />
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="dictValue" :label="$t('dict.dictValue')" header-align="center" align="center"></el-table-column>
<el-table-column prop="dictLabel" :label="$t('dict.dictLabel')" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-data-add-or-update' import AddOrUpdate from './dict-data-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictValue",
label: i18n.t("dict.dictValue"),
},
{
prop: "dictLabel",
label: i18n.t("dict.dictLabel"),
},
{
prop: "sort",
label: i18n.t("dict.sort"),
},
{
prop: "remark",
label: i18n.t("dict.remark"),
},
{
prop: "createDate",
label: i18n.t("dict.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
createdIsNeed: false, getDataListURL: "/sys/dict/data/page",
getDataListURL: '/sys/dict/data/page', deleteURL: "/sys/dict/data",
getDataListIsPage: true,
deleteURL: '/sys/dict/data',
deleteIsBatch: true
}, },
dataForm: { tableProps,
dictTypeId: '0', tableBtn,
dictLabel: '', formConfig: [
dictValue: '' {
} type: "input",
} label: i18n.t("dict.dictValue"),
placeholder: i18n.t("dict.dictValue"),
param: "dictValue",
},
{
type: "input",
label: i18n.t("dict.dictLabel"),
placeholder: i18n.t("dict.dictLabel"),
param: "dictLabel",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
}, },
created () { created () {
this.dataForm.dictTypeId = this.$route.params.dictTypeId || '0' this.listQuery.dictTypeId = this.$route.params.dictTypeId || '0'
this.getDataList() this.getDataList()
}, },
methods: { methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.dictValue = val.dictValue;
this.listQuery.dictLabel = val.dictLabel;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle (id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id this.$refs.addOrUpdate.init(id,this.listQuery.dictTypeId)
this.$refs.addOrUpdate.dataForm.dictTypeId = this.dataForm.dictTypeId
this.$refs.addOrUpdate.init()
}) })
} }
} }
} };
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictName" :label="$t('dict.dictName')"> <el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input> <el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
@ -14,18 +13,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/dict/type/',
infoURL: '/sys/dict/type'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -52,7 +52,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()

View File

@ -0,0 +1,33 @@
<template>
<span>
<el-button type="text" size="small" @click="emitClick">{{ injectData.dictType }}</el-button>
</span>
</template>
<script>
import { addDynamicRoute } from '@/router'
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
methods: {
//
emitClick () {
//
const routeParams = {
routeName: `${this.$route.name}__${this.injectData.id}`,
title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
path: 'sys/dict-data',
params: {
dictTypeId: this.injectData.id
}
}
//
addDynamicRoute(routeParams, this.$router)
}
}
}
</script>

View File

@ -1,101 +1,141 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')" clearable></el-input> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button @click="getDataList()">{{ $t('query') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> />
</el-form-item> </base-table>
</el-form> <pagination
<el-table :limit.sync="listQuery.limit"
v-loading="dataListLoading" :page.sync="listQuery.page"
:data="dataList" :total="listQuery.total"
border @pagination="getDataList"
@selection-change="dataListSelectionChangeHandle" />
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="dictName" :label="$t('dict.dictName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="dictType" :label="$t('dict.dictType')" header-align="center" align="center">
<template slot-scope="scope">
<el-button type="text" @click="childHandle(scope.row)">{{ scope.row.dictType }}</el-button>
</template>
</el-table-column>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './dict-type-add-or-update' import AddOrUpdate from './dict-type-add-or-update'
import { addDynamicRoute } from '@/router' import toDictType from './dict-type-to'
import i18n from "@/i18n";
const tableProps = [
{
prop: "dictName",
label: i18n.t("dict.dictName"),
},
{
prop: "dictType",
label: i18n.t("dict.dictType"),
subcomponent: toDictType
},
{
prop: "sort",
label: i18n.t("dict.sort"),
},
{
prop: "remark",
label: i18n.t("dict.remark"),
},
{
prop: "createDate",
label: i18n.t("dict.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/dict/type/page', getDataListURL: "/sys/dict/type/page",
getDataListIsPage: true, deleteURL: "/sys/dict/type",
deleteURL: '/sys/dict/type',
deleteIsBatch: true
}, },
dataForm: { tableProps,
id: '0', tableBtn,
dictName: '', formConfig: [
dictType: '' {
} type: "input",
} label: i18n.t("dict.dictName"),
placeholder: i18n.t("dict.dictName"),
param: "dictName",
},
{
type: "input",
label: i18n.t("dict.dictType"),
placeholder: i18n.t("dict.dictType"),
param: "dictType",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
}, },
methods: { methods:{
// //search-bar
childHandle (row) { buttonClick(val) {
// switch (val.btnName) {
const routeParams = { case "search":
routeName: `${this.$route.name}__${row.id}`, this.listQuery.dictName = val.dictName;
title: `${this.$route.meta.title} - ${row.dictType}`, this.listQuery.dictType = val.dictType;
path: 'sys/dict-data', this.listQuery.page = 1;
params: { this.getDataList();
dictTypeId: row.id break;
} case "add":
} this.addOrEditTitle = '新增'
// this.addOrUpdateVisible = true;
addDynamicRoute(routeParams, this.$router) this.addOrUpdateHandle()
} break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,65 +1,99 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:29:06
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-error"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;"> :table-data="tableData"
<el-table-column prop="requestUri" :label="$t('logError.requestUri')" header-align="center" align="center"></el-table-column> />
<el-table-column prop="requestMethod" :label="$t('logError.requestMethod')" header-align="center" align="center"></el-table-column> <pagination
<el-table-column prop="requestParams" :label="$t('logError.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> :limit.sync="listQuery.limit"
<el-table-column prop="ip" :label="$t('logError.ip')" header-align="center" align="center"></el-table-column> :page.sync="listQuery.page"
<el-table-column prop="userAgent" :label="$t('logError.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> :total="listQuery.total"
<el-table-column prop="createDate" :label="$t('logError.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> @pagination="getDataList"
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> />
<template slot-scope="scope">
<el-button type="text" size="small" @click="infoHandle(scope.row.errorInfo)">{{ $t('logError.errorInfo') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
export default { import i18n from "@/i18n";
mixins: [mixinViewModule], import Cookies from 'js-cookie'
data () { import qs from 'qs'
return { const tableProps = [
mixinViewModuleOptions: { {
getDataListURL: '/sys/log/error/page', prop: "requestUri",
getDataListIsPage: true, label: i18n.t("logError.requestUri"),
exportURL: '/sys/log/error/export'
}
}
}, },
methods: { {
// prop: "requestMethod",
infoHandle (info) { label: i18n.t("logError.requestMethod"),
this.$alert(info, this.$t('logError.errorInfo'), { },
customClass: 'mod-sys__log-error-view-info' {
prop: "requestParams",
label: i18n.t("logError.requestParams"),
},
{
prop: "ip",
label: i18n.t("logError.ip"),
},
{
prop: "userAgent",
label: i18n.t("logError.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logError.createDate"),
},
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: "/sys/log/error/page",
exportUrl: "/sys/log/error/export",
},
tableProps,
formConfig: [
{
type: "button",
btnName: "导出",
name: "export",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "export":
this.exportHandle();
break;
default:
console.log(val)
}
},
//
exportHandle () {
var params = qs.stringify({
'token': Cookies.get('token')
}) })
window.location.href = `${window.SITE_CONFIG['apiURL']}${this.urlOptions.exportURL}?${params}`
} }
} }
} };
</script> </script>
<style lang="scss">
.mod-sys__log-error {
&-view-info {
width: 80%;
}
}
</style>

View File

@ -1,71 +1,121 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:49:17
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-login"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.creatorName" :placeholder="$t('logLogin.creatorName')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-select v-model="dataForm.status" :placeholder="$t('logLogin.status')" clearable> :table-data="tableData"
<el-option :label="$t('logLogin.status0')" :value="0"></el-option> />
<el-option :label="$t('logLogin.status1')" :value="1"></el-option> <pagination
<el-option :label="$t('logLogin.status2')" :value="2"></el-option> :limit.sync="listQuery.limit"
</el-select> :page.sync="listQuery.page"
</el-form-item> :total="listQuery.total"
<el-form-item> @pagination="getDataList"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> />
</el-form-item>
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logLogin.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logLogin.operation')" header-align="center" align="center">
<template slot-scope="scope">
{{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('logLogin.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logLogin.status0') }}</el-tag>
<el-tag v-else-if="scope.row.status === 1" size="small" type="success">{{ $t('logLogin.status1') }}</el-tag>
<el-tag v-else size="small" type="warning">{{ $t('logLogin.status2') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="ip" :label="$t('logLogin.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logLogin.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logLogin.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "creatorName",
label: i18n.t("logLogin.creatorName"),
},
{
prop: "operation",
label: i18n.t("logLogin.operation"),
filter: sysFilter('logOperation'),
},
{
prop: "status",
label: i18n.t("logLogin.status"),
filter: sysFilter('logStatus'),
},
{
prop: "ip",
label: i18n.t("logLogin.ip"),
},
{
prop: "userAgent",
label: i18n.t("logLogin.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logLogin.createDate"),
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/log/login/page', getDataListURL: "/sys/log/login/page",
getDataListIsPage: true, deleteURL: "/sys/log/login",
exportURL: '/sys/log/login/export' exportUrl: "/sys/log/login/export",
}, },
dataForm: { tableProps,
creatorName: '', formConfig: [
status: '' {
} type: "input",
} label: i18n.t("logLogin.creatorName"),
placeholder: i18n.t("logLogin.creatorName"),
param: "creatorName",
},
{
type: "select",
label: "状态",
selectOptions: [
{ id: "0", name: i18n.t("logLogin.status0") },
{ id: "1", name: i18n.t("logLogin.status1") },
{ id: "2", name: i18n.t("logLogin.status2") },
],
param: "status",
defaultSelect: "",
onchange: true,
width: 200,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.creatorName = val.creatorName;
this.listQuery.status = val.status;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,69 +1,127 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:50:27
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-operation"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-select v-model="dataForm.status" :placeholder="$t('logOperation.status')" clearable> :table-props="tableProps"
<el-option :label="$t('logOperation.status0')" :value="0"></el-option> :page="listQuery.page"
<el-option :label="$t('logOperation.status1')" :value="1"></el-option> :limit="listQuery.limit"
</el-select> :table-data="tableData"
</el-form-item> />
<el-form-item> <pagination
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :limit.sync="listQuery.limit"
</el-form-item> :page.sync="listQuery.page"
<el-form-item> :total="listQuery.total"
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> @pagination="getDataList"
</el-form-item> />
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logOperation.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logOperation.operation')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestUri" :label="$t('logOperation.requestUri')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestMethod" :label="$t('logOperation.requestMethod')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestParams" :label="$t('logOperation.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="requestTime" :label="$t('logOperation.requestTime')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
{{ `${scope.row.requestTime}ms` }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('logOperation.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logOperation.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('logOperation.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="ip" :label="$t('logOperation.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logOperation.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logOperation.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "creatorName",
label: i18n.t("logOperation.creatorName"),
},
{
prop: "operation",
label: i18n.t("logOperation.operation"),
},
{
prop: "requestUri",
label: i18n.t("logOperation.requestUri"),
},
{
prop: "requestMethod",
label: i18n.t("logOperation.requestMethod"),
},
{
prop: "requestParams",
label: i18n.t("logOperation.requestParams"),
},
{
prop: "requestTime",
label: i18n.t("logOperation.requestTime"),
},
{
prop: "status",
label: i18n.t("logOperation.status"),
filter: sysFilter('logStatus'),
},
{
prop: "ip",
label: i18n.t("logOperation.ip"),
},
{
prop: "userAgent",
label: i18n.t("logOperation.userAgent"),
},
{
prop: "createDate",
label: i18n.t("logOperation.createDate"),
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/log/operation/page', getDataListURL: "/sys/log/operation/page",
getDataListIsPage: true, exportUrl: "/sys/log/operation/export",
exportURL: '/sys/log/operation/export'
}, },
dataForm: { tableProps,
status: '' formConfig: [
} {
} type: "select",
label: "状态",
selectOptions: [
{ id: "0", name: i18n.t("logOperation.status0") },
{ id: "1", name: i18n.t("logOperation.status1") },
],
param: "status",
defaultSelect: "",
onchange: true,
width: 200,
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
],
};
},
components: {},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.status = val.status;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="type" :label="$t('menu.type')" size="mini"> <el-form-item prop="type" :label="$t('menu.type')" size="mini">
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id"> <el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
@ -53,19 +52,20 @@
<el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input> <el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { getIconList } from '@/utils' import { getIconList } from '@/utils'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/menu/',
infoURL: '/sys/menu'
},
visible: false, visible: false,
menuList: [], menuList: [],
menuListVisible: false, menuListVisible: false,
@ -102,7 +102,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()

View File

@ -1,55 +1,133 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 15:47:14
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu"> <div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-button v-if="$hasPermission('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
</el-form> :limit="listQuery.limit"
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> :table-data="tableData"
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> row-key="id"
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
<template slot-scope="scope"> >
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <method-btn
</template> v-if="tableBtn.length"
</el-table-column> slot="handleBtn"
<el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center"> :width="100"
<template slot-scope="scope"> label="操作"
<el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag> :method-list="tableBtn"
<el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag> @clickBtn="handleClick"
</template> />
</el-table-column> </base-table>
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column>
<el-table-column prop="url" :label="$t('menu.url')" header-align="center" align="center" width="150" :show-overflow-tooltip="true" ></el-table-column>
<el-table-column prop="permissions" :label="$t('menu.permissions')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:menu:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:menu:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './menu-add-or-update' import AddOrUpdate from './menu-add-or-update'
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "name",
label: i18n.t("menu.name"),
},
{
prop: "icon",
label: i18n.t("menu.icon"),
},
{
prop: "type",
label: i18n.t("menu.type"),
filter: sysFilter('menuType'),
},
{
prop: "sort",
label: i18n.t("menu.sort"),
},
{
prop: "url",
label: i18n.t("menu.url"),
},
{
prop: "permissions",
label: i18n.t("menu.permissions"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/menu/list', getDataListURL: '/sys/menu/list',
deleteURL: '/sys/menu' deleteURL: '/sys/menu'
} },
} tableProps,
tableBtn,
formConfig: [
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
} },
} methods: {
//
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: this.listQuery,
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.tableData = [];
this.listQuery.total = 0;
return this.$message.error(res.msg);
}
this.tableData = res.data;
this.listQuery.total = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
}
};
</script> </script>

View File

@ -1,5 +1,11 @@
<!--
* @Author: zwq
* @Date: 2023-01-04 10:29:40
* @LastEditors: zwq
* @LastEditTime: 2023-01-05 14:40:11
* @Description:
-->
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="paramCode" :label="$t('params.paramCode')"> <el-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input> <el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
@ -11,18 +17,19 @@
<el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/params/',
infoURL: '/sys/params'
},
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
@ -45,7 +52,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()

View File

@ -1,67 +1,124 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__params"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button v-if="$hasPermission('sys:params:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:params:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
</el-form> @clickBtn="handleClick"
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> />
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> </base-table>
<el-table-column prop="paramCode" :label="$t('params.paramCode')" header-align="center" align="center"></el-table-column> <pagination
<el-table-column prop="paramValue" :label="$t('params.paramValue')" header-align="center" align="center"></el-table-column> :limit.sync="listQuery.limit"
<el-table-column prop="remark" :label="$t('params.remark')" header-align="center" align="center"></el-table-column> :page.sync="listQuery.page"
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> :total="listQuery.total"
<template slot-scope="scope"> @pagination="getDataList"
<el-button v-if="$hasPermission('sys:params:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> />
<el-button v-if="$hasPermission('sys:params:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './params-add-or-update' import AddOrUpdate from './params-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "paramCode",
label: i18n.t("params.paramCode"),
},
{
prop: "paramValue",
label: i18n.t("params.paramValue"),
},
{
prop: "remark",
label: i18n.t("params.remark"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/params/page', getDataListURL: "/sys/params/page",
getDataListIsPage: true, deleteURL: "/sys/params",
deleteURL: '/sys/params',
deleteIsBatch: true
}, },
dataForm: { tableProps,
paramCode: '' tableBtn,
} formConfig: [
} {
type: "input",
label: i18n.t("params.paramCode"),
placeholder: i18n.t("params.paramCode"),
param: "paramCode",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.paramCode = val.paramCode;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,5 +1,4 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('role.name')"> <el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
@ -34,18 +33,19 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/role/',
infoURL: '/sys/role'
},
visible: false, visible: false,
menuList: [], menuList: [],
deptList: [], deptList: [],
@ -68,8 +68,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.visible = true this.dataForm.id = id || "";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([]) this.$refs.menuListTree.setCheckedKeys([])

View File

@ -1,79 +1,124 @@
<!--
* @Author: zwq
* @Date: 2022-08-22 14:57:51
* @LastEditors: zwq
* @LastEditTime: 2022-12-07 14:54:22
* @Description:
-->
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__role"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
</el-form> @clickBtn="handleClick"
<el-table />
v-loading="dataListLoading" </base-table>
:data="dataList" <pagination
border :limit.sync="listQuery.limit"
@selection-change="dataListSelectionChangeHandle" :page.sync="listQuery.page"
@sort-change="dataListSortChangeHandle" :total="listQuery.total"
style="width: 100%;"> @pagination="getDataList"
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> />
<el-table-column prop="name" :label="$t('role.name')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('role.remark')" header-align="center" align="center"></el-table-column>
<el-table-column prop="createDate" :label="$t('role.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './role-add-or-update' import AddOrUpdate from './role-add-or-update'
import i18n from "@/i18n";
const tableProps = [
{
prop: "name",
label: i18n.t("role.name"),
},
{
prop: "remark",
label: i18n.t("role.remark"),
},
{
prop: "createDate",
label: i18n.t("role.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/role/page', getDataListURL: '/sys/role/page',
getDataListIsPage: true,
deleteURL: '/sys/role', deleteURL: '/sys/role',
deleteIsBatch: true
}, },
dataForm: { tableProps,
} tableBtn,
} formConfig: [
{
type: "input",
label: i18n.t("role.name"),
placeholder: i18n.t("role.name"),
param: "name",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.name = val.name;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,6 +1,5 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="username" :label="$t('user.username')"> <el-form-item prop="username" :label="$t('user.username')">
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input> <el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
</el-form-item> </el-form-item>
@ -37,19 +36,20 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { isEmail, isMobile } from '@/utils/validate' import { isEmail, isMobile } from '@/utils/validate'
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data () { data () {
return { return {
urlOptions: {
submitURL: '/sys/user/',
infoURL: '/sys/user'
},
visible: false, visible: false,
roleList: [], roleList: [],
roleIdListDefault: [], roleIdListDefault: [],
@ -124,7 +124,8 @@ export default {
} }
}, },
methods: { methods: {
init () { init(id) {
this.dataForm.id = id || "";
this.visible = true this.visible = true
this.dataForm.deptId = '' this.dataForm.deptId = ''
this.$nextTick(() => { this.$nextTick(() => {
@ -170,7 +171,7 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmit: debounce(function () {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false

View File

@ -1,98 +1,144 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-form-item> <base-table
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input> :table-props="tableProps"
</el-form-item> :page="listQuery.page"
<el-form-item> :limit="listQuery.limit"
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> :table-data="tableData"
</el-form-item> >
<el-form-item> <method-btn
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree> v-if="tableBtn.length"
</el-form-item> slot="handleBtn"
<el-form-item> :width="100"
<el-button @click="getDataList()">{{ $t('query') }}</el-button> label="操作"
</el-form-item> :method-list="tableBtn"
<el-form-item> @clickBtn="handleClick"
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> />
</el-form-item> </base-table>
<el-form-item> <pagination
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> :limit.sync="listQuery.limit"
</el-form-item> :page.sync="listQuery.page"
<el-form-item> :total="listQuery.total"
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button> @pagination="getDataList"
</el-form-item> />
</el-form>
<el-table
v-loading="dataListLoading"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
{{ $getDictLabel("gender", scope.row.gender) }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
</base-dialog>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import basicPage from "@/mixins/basic-page";
import AddOrUpdate from './user-add-or-update' import AddOrUpdate from "./user-add-or-update";
import i18n from "@/i18n";
import sysFilter from '@/filters/sys-filter'
const tableProps = [
{
prop: "username",
label: i18n.t("user.username"),
},
{
prop: "deptName",
label: i18n.t("user.deptName"),
},
{
prop: "email",
label: i18n.t("user.email"),
},
{
prop: "mobile",
label: i18n.t("user.mobile"),
},
{
prop: "gender",
label: i18n.t("user.gender"),
filter: sysFilter('sex'),
},
{
prop: "status",
label: i18n.t("user.status"),
filter: sysFilter('userStatus'),
},
{
prop: "createDate",
label: i18n.t("user.createDate"),
},
];
const tableBtn = [
{
type: "edit",
btnName: "编辑",
},
{
type: "delete",
btnName: "删除",
},
];
export default { export default {
mixins: [mixinViewModule], mixins: [basicPage],
data () { data() {
return { return {
mixinViewModuleOptions: { urlOptions: {
getDataListURL: '/sys/user/page', getDataListURL: "/sys/user/page",
getDataListIsPage: true, deleteURL: "/sys/user",
deleteURL: '/sys/user', exportUrl: "/sys/user/export",
deleteIsBatch: true,
exportURL: '/sys/user/export'
}, },
dataForm: { tableProps,
username: '', tableBtn,
deptId: '', formConfig: [
gender: '' {
} type: "input",
} label: i18n.t("user.username"),
placeholder: i18n.t("user.username"),
param: "username",
},
{
type: "button",
btnName: "查询",
name: "search",
color: "primary",
},
{
type: "button",
btnName: "新增",
name: "add",
color: "primary",
plain: true,
},
],
};
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
methods:{
//search-bar
buttonClick(val) {
switch (val.btnName) {
case "search":
this.listQuery.username = val.username;
this.listQuery.page = 1;
this.getDataList();
break;
case "add":
this.addOrEditTitle = '新增'
this.addOrUpdateVisible = true;
this.addOrUpdateHandle()
break;
default:
console.log(val)
}
},
} }
} };
</script> </script>

View File

@ -1,85 +0,0 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 15:13:08
* @Description:
-->
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item>
<el-form-item label="单位分类" prop="type">
<el-select
v-model="dataForm.type"
filterable
placeholder="请选择单位分类"
>
<el-option
v-for="item in typeArr"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import basicAdd from '@/mixins/basic-add'
export default {
mixins: [basicAdd],
data() {
return {
urlOptions: {
submitURL: '/basic/unit/',
infoURL: '/basic/unit'
},
dataForm: {
id: '',
code: '',
name: '',
type: ''
},
typeArr: [
{
name: '不可计数',
value: 2
},
{
name: '可计数',
value: 1
}
],
dataRule: {
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '单位分类不能为空', trigger: 'change' }
]
}
}
},
methods: {
}
}
</script>

View File

@ -1,73 +0,0 @@
<!--
* @Author: zwq
* @Date: 2022-09-15 10:44:29
* @LastEditors: zwq
* @LastEditTime: 2022-09-16 13:52:21
* @Description:
-->
<template>
<el-form
style="display: flex; align-items: center; justify-content: right;"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item>
<el-input size="small" v-model="dataForm.name" clearable placeholder="请输入名称查询" />
</el-form-item>
<el-form-item>
<el-input size="small" v-model="dataForm.code" clearable placeholder="请输入编码查询" />
</el-form-item>
<el-form-item>
<el-button size="small" @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询
</el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增
</el-button>
<el-button size="small" type="primary" @click="exportHandle()">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item>
</el-form>
</template>
<script>
export default {
props: {
pageName: {
type: String,
default: () => {
return "";
},
},
dataForm: {
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
};
},
methods: {
getDataList() {
this.$emit("getDataList");
},
addOrUpdateHandle() {
this.$emit("addOrUpdateHandle");
},
exportHandle() {
this.$emit("exportHandle", this.pageName);
},
},
};
</script>
<style></style>

View File

@ -1,144 +0,0 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<query-form
:page-name="'计量单位'"
:data-form="dataForm"
@getDataList="getDataList"
@addOrUpdateHandle="addOrUpdateHandle"
@exportHandle="exportHandle"
/>
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px'
}"
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" align="center" label="名称"> </el-table-column>
<el-table-column prop="code" align="center" label="编码"> </el-table-column>
<el-table-column prop="type" align="center" label="类型">
<template slot-scope="scope">
<span>{{
scope.row.type === 2 ? "不可计数" : "可计数"
}}</span>
</template>
</el-table-column>
<el-table-column
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"
>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList"
></add-or-update>
</el-card>
</template>
<script>
import AddOrUpdate from './components/unitList-add'
import queryForm from './query-form'
import basicPage from '@/mixins/basic-page'
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: '/basic/unit/page',
deleteURL: '/basic/unit',
statusUrl: '/basic/unit/status',
exportUrl: '/basic/unit/export'
},
};
},
components: {
AddOrUpdate,
queryForm,
},
methods: {
},
};
</script>

View File

@ -1,13 +1,20 @@
/** /**
* 配置参考: https://cli.vuejs.org/zh/config/ * 配置参考: https://cli.vuejs.org/zh/config/
*/ */
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = { module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/', publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
chainWebpack: config => { chainWebpack: (config) => {
const svgRule = config.module.rule('svg') config.module.rule('svg').exclude.add(resolve('src/icons')).end()
svgRule.uses.clear()
svgRule config.module
.rule('icons')
.test(/\.svg$/) .test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader') .use('svg-sprite-loader')
.loader('svg-sprite-loader') .loader('svg-sprite-loader')
}, },