mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
fix(代码更新): 更新代码
This commit is contained in:
1
vue/public/styles/theme-chalk/index.css
Normal file
1
vue/public/styles/theme-chalk/index.css
Normal file
File diff suppressed because one or more lines are too long
@@ -1,258 +1,272 @@
|
|||||||
/**
|
/**
|
||||||
* 通用css样式布局处理
|
* 通用css样式布局处理
|
||||||
* Copyright (c) 2019 ruoyi
|
* Copyright (c) 2019 ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** 基础通用 **/
|
/** 基础通用 **/
|
||||||
.pt5 {
|
.pt5 {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
.pr5 {
|
|
||||||
padding-right: 5px;
|
|
||||||
}
|
|
||||||
.pb5 {
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
.mt5 {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
.mr5 {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
.mb5 {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
.mb8 {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
.ml5 {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
.mt10 {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.mr10 {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.mb10 {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.ml10 {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
.mt20 {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
.mr20 {
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
.mb20 {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.ml20 {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
|
.pr5 {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pb5 {
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt5 {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mr5 {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb5 {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb8 {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml5 {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt10 {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mr10 {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb10 {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.ml10 {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt20 {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mr20 {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mb20 {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.ml20 {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-message-box__status + .el-message-box__message{
|
.el-message-box__status + .el-message-box__message{
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog:not(.is-fullscreen) {
|
.el-dialog:not(.is-fullscreen) {
|
||||||
margin-top: 6vh !important;
|
margin-top: 6vh !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
|
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
max-height: 70vh;
|
max-height: 70vh;
|
||||||
padding: 10px 20px 0;
|
padding: 10px 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table {
|
.el-table {
|
||||||
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
|
||||||
th {
|
th {
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
background-color: #f8f8f9;
|
background-color: #f8f8f9;
|
||||||
color: #515a6e;
|
color: #515a6e;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table__body-wrapper {
|
.el-table__body-wrapper {
|
||||||
.el-button [class*="el-icon-"] + span {
|
.el-button [class*="el-icon-"] + span {
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单布局 **/
|
/** 表单布局 **/
|
||||||
.form-header {
|
.form-header {
|
||||||
font-size:15px;
|
font-size: 15px;
|
||||||
color:#6379bb;
|
color: #6379bb;
|
||||||
border-bottom:1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
margin:8px 10px 25px 10px;
|
margin: 8px 10px 25px 10px;
|
||||||
padding-bottom:5px
|
padding-bottom: 5px
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表格布局 **/
|
/** 表格布局 **/
|
||||||
.pagination-container {
|
.pagination-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 25px;
|
height: 32px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
padding: 10px 20px !important;
|
padding: 10px 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tree border */
|
/* tree border */
|
||||||
.tree-border {
|
.tree-border {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
border: 1px solid #e5e6e7;
|
border: 1px solid #e5e6e7;
|
||||||
background: #FFFFFF none;
|
background: #FFFFFF none;
|
||||||
border-radius:4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination-container .el-pagination {
|
.pagination-container .el-pagination {
|
||||||
right: 0;
|
right: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
|
||||||
|
|
||||||
@media ( max-width : 768px) {
|
|
||||||
.pagination-container .el-pagination > .el-pagination__jump {
|
|
||||||
display: none !important;
|
|
||||||
}
|
}
|
||||||
.pagination-container .el-pagination > .el-pagination__sizes {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-table .fixed-width .el-button--mini {
|
@media (max-width: 768px) {
|
||||||
|
.pagination-container .el-pagination > .el-pagination__jump {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.pagination-container .el-pagination > .el-pagination__sizes {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table .fixed-width .el-button--mini {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表格更多操作下拉样式 */
|
/** 表格更多操作下拉样式 */
|
||||||
.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
|
.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .el-dropdown, .el-icon-arrow-down {
|
.el-table .el-dropdown, .el-icon-arrow-down {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tree-node__content > .el-checkbox {
|
.el-tree-node__content > .el-checkbox {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-striped > .list-group-item {
|
.list-group-striped > .list-group-item {
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group {
|
.list-group {
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
border-bottom: 1px solid #e7eaec;
|
border-bottom: 1px solid #e7eaec;
|
||||||
border-top: 1px solid #e7eaec;
|
border-top: 1px solid #e7eaec;
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
padding: 11px 0px;
|
padding: 11px 0px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pull-right {
|
.pull-right {
|
||||||
float: right !important;
|
float: right !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-card__header {
|
.el-card__header {
|
||||||
padding: 14px 15px 7px;
|
padding: 14px 15px 7px;
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-card__body {
|
.el-card__body {
|
||||||
padding: 15px 20px 20px 20px;
|
padding: 15px 20px 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-box {
|
.card-box {
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* button color */
|
/* button color */
|
||||||
.el-button--cyan.is-active,
|
.el-button--cyan.is-active,
|
||||||
.el-button--cyan:active {
|
.el-button--cyan:active {
|
||||||
background: #20B2AA;
|
background: #20B2AA;
|
||||||
border-color: #20B2AA;
|
border-color: #20B2AA;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--cyan:focus,
|
.el-button--cyan:focus,
|
||||||
.el-button--cyan:hover {
|
.el-button--cyan:hover {
|
||||||
background: #48D1CC;
|
background: #48D1CC;
|
||||||
border-color: #48D1CC;
|
border-color: #48D1CC;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--cyan {
|
.el-button--cyan {
|
||||||
background-color: #20B2AA;
|
background-color: #20B2AA;
|
||||||
border-color: #20B2AA;
|
border-color: #20B2AA;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* text color */
|
/* text color */
|
||||||
.text-navy {
|
.text-navy {
|
||||||
color: #1ab394;
|
color: #1ab394;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-primary {
|
.text-primary {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-success {
|
.text-success {
|
||||||
color: #1c84c6;
|
color: #1c84c6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-info {
|
.text-info {
|
||||||
color: #23c6c8;
|
color: #23c6c8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-warning {
|
.text-warning {
|
||||||
color: #f8ac59;
|
color: #f8ac59;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-danger {
|
.text-danger {
|
||||||
color: #ed5565;
|
color: #ed5565;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-muted {
|
.text-muted {
|
||||||
color: #888888;
|
color: #888888;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* image */
|
/* image */
|
||||||
.img-circle {
|
.img-circle {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.img-lg {
|
.img-lg {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-upload-preview {
|
.avatar-upload-preview {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -262,31 +276,22 @@
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
box-shadow: 0 0 4px #ccc;
|
box-shadow: 0 0 4px #ccc;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 拖拽列样式 */
|
/* 拖拽列样式 */
|
||||||
.sortable-ghost{
|
.sortable-ghost {
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
color: #fff!important;
|
color: #fff !important;
|
||||||
background: #42b983!important;
|
background: #42b983 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-right-btn {
|
.top-right-btn {
|
||||||
position: relative;
|
position: relative;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 分割面板样式 */
|
||||||
|
.splitpanes.default-theme .splitpanes__pane {
|
||||||
|
background-color: #fff!important;
|
||||||
|
}
|
||||||
|
|
||||||
/* 修改switch按钮样式 */
|
|
||||||
.el-switch__core{
|
|
||||||
width:45px!important;
|
|
||||||
height:22px;
|
|
||||||
border-radius:2px;
|
|
||||||
}
|
|
||||||
.el-switch__core:after{
|
|
||||||
width:20px;
|
|
||||||
height:18px;
|
|
||||||
border-radius:2px;
|
|
||||||
}
|
|
||||||
.el-switch.is-checked .el-switch__core::after{
|
|
||||||
margin-left:-21px;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -51,10 +51,16 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 单选按钮值变化时
|
// 单选按钮值变化时
|
||||||
radioChange() {
|
radioChange() {
|
||||||
|
if (this.cron.min === '*') {
|
||||||
|
this.$emit('update', 'min', '0', 'hour');
|
||||||
|
}
|
||||||
|
if (this.cron.second === '*') {
|
||||||
|
this.$emit('update', 'second', '0', 'hour');
|
||||||
|
}
|
||||||
switch (this.radioValue) {
|
switch (this.radioValue) {
|
||||||
case 1:
|
case 1:
|
||||||
this.$emit('update', 'hour', '*')
|
this.$emit('update', 'hour', '*')
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.$emit('update', 'hour', this.cycleTotal);
|
this.$emit('update', 'hour', this.cycleTotal);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<!-- @author zhengjie -->
|
<!-- @author zhengjie -->
|
||||||
<template>
|
<template>
|
||||||
<div class="icon-body">
|
<div class="icon-body">
|
||||||
<el-input v-model="name" style="position: relative;" clearable placeholder="请输入图标名称" @clear="filterIcons" @input.native="filterIcons">
|
<el-input v-model="name" class="icon-search" clearable placeholder="请输入图标名称" @clear="filterIcons" @input="filterIcons">
|
||||||
<i slot="suffix" class="el-icon-search el-input__icon" />
|
<i slot="suffix" class="el-icon-search el-input__icon" />
|
||||||
</el-input>
|
</el-input>
|
||||||
<div class="icon-list">
|
<div class="icon-list">
|
||||||
<div v-for="(item, index) in iconList" :key="index" @click="selectedIcon(item)">
|
<div class="list-container">
|
||||||
<svg-icon :icon-class="item" style="height: 30px;width: 16px;" />
|
<div v-for="(item, index) in iconList" class="icon-item-wrapper" :key="index" @click="selectedIcon(item)">
|
||||||
<span>{{ item }}</span>
|
<div :class="['icon-item', { active: activeIcon === item }]">
|
||||||
|
<svg-icon :icon-class="item" class-name="icon" style="height: 25px;width: 16px;"/>
|
||||||
|
<span>{{ item }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,6 +21,11 @@
|
|||||||
import icons from './requireIcons'
|
import icons from './requireIcons'
|
||||||
export default {
|
export default {
|
||||||
name: 'IconSelect',
|
name: 'IconSelect',
|
||||||
|
props: {
|
||||||
|
activeIcon: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: '',
|
name: '',
|
||||||
@@ -46,22 +55,49 @@ export default {
|
|||||||
.icon-body {
|
.icon-body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
.icon-search {
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
.icon-list {
|
.icon-list {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
overflow-y: scroll;
|
overflow: auto;
|
||||||
div {
|
.list-container {
|
||||||
height: 30px;
|
display: flex;
|
||||||
line-height: 30px;
|
flex-wrap: wrap;
|
||||||
margin-bottom: -5px;
|
.icon-item-wrapper {
|
||||||
cursor: pointer;
|
width: calc(100% / 3);
|
||||||
width: 33%;
|
height: 25px;
|
||||||
float: left;
|
line-height: 25px;
|
||||||
}
|
cursor: pointer;
|
||||||
span {
|
display: flex;
|
||||||
display: inline-block;
|
.icon-item {
|
||||||
vertical-align: -0.15em;
|
display: flex;
|
||||||
fill: currentColor;
|
max-width: 100%;
|
||||||
overflow: hidden;
|
height: 100%;
|
||||||
|
padding: 0 5px;
|
||||||
|
&:hover {
|
||||||
|
background: #ececec;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: -0.15em;
|
||||||
|
fill: currentColor;
|
||||||
|
padding-left: 2px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.icon-item.active {
|
||||||
|
background: #ececec;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const version = require('element-ui/package.json').version // element-ui version from node_modules
|
|
||||||
const ORIGINAL_THEME = '#409EFF' // default color
|
const ORIGINAL_THEME = '#409EFF' // default color
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -39,7 +38,6 @@ export default {
|
|||||||
this.setTheme(this.defaultTheme)
|
this.setTheme(this.defaultTheme)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async setTheme(val) {
|
async setTheme(val) {
|
||||||
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
const oldVal = this.chalk ? this.theme : ORIGINAL_THEME
|
||||||
@@ -63,12 +61,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.chalk) {
|
if (!this.chalk) {
|
||||||
const url = `https://unpkg.com/element-ui@${version}/lib/theme-chalk/index.css`
|
const url = `/styles/theme-chalk/index.css`
|
||||||
await this.getCSSString(url, 'chalk')
|
await this.getCSSString(url, 'chalk')
|
||||||
}
|
}
|
||||||
|
|
||||||
const chalkHandler = getHandler('chalk', 'chalk-style')
|
const chalkHandler = getHandler('chalk', 'chalk-style')
|
||||||
|
|
||||||
chalkHandler()
|
chalkHandler()
|
||||||
|
|
||||||
const styles = [].slice.call(document.querySelectorAll('style'))
|
const styles = [].slice.call(document.querySelectorAll('style'))
|
||||||
|
|||||||
@@ -5,23 +5,27 @@
|
|||||||
@select="handleSelect"
|
@select="handleSelect"
|
||||||
>
|
>
|
||||||
<template v-for="(item, index) in topMenus">
|
<template v-for="(item, index) in topMenus">
|
||||||
<el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber"
|
<el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber">
|
||||||
><svg-icon :icon-class="item.meta.icon" />
|
<svg-icon
|
||||||
{{ item.meta.title }}</el-menu-item
|
v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
|
||||||
>
|
:icon-class="item.meta.icon"/>
|
||||||
|
{{ item.meta.title }}
|
||||||
|
</el-menu-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 顶部菜单超出数量折叠 -->
|
<!-- 顶部菜单超出数量折叠 -->
|
||||||
<el-submenu :style="{'--theme': theme}" index="more" v-if="topMenus.length > visibleNumber">
|
<el-submenu :style="{'--theme': theme}" index="more" :key="visibleNumber" v-if="topMenus.length > visibleNumber">
|
||||||
<template slot="title">更多菜单</template>
|
<template slot="title">更多菜单</template>
|
||||||
<template v-for="(item, index) in topMenus">
|
<template v-for="(item, index) in topMenus">
|
||||||
<el-menu-item
|
<el-menu-item
|
||||||
:index="item.path"
|
:index="item.path"
|
||||||
:key="index"
|
:key="index"
|
||||||
v-if="index >= visibleNumber"
|
v-if="index >= visibleNumber">
|
||||||
><svg-icon :icon-class="item.meta.icon" />
|
<svg-icon
|
||||||
{{ item.meta.title }}</el-menu-item
|
v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"
|
||||||
>
|
:icon-class="item.meta.icon"/>
|
||||||
|
{{ item.meta.title }}
|
||||||
|
</el-menu-item>
|
||||||
</template>
|
</template>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
@@ -29,6 +33,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { constantRoutes } from "@/router";
|
import { constantRoutes } from "@/router";
|
||||||
|
import { isHttp } from "@/utils/validate";
|
||||||
|
|
||||||
// 隐藏侧边栏路由
|
// 隐藏侧边栏路由
|
||||||
const hideList = ['/index', '/user/profile'];
|
const hideList = ['/index', '/user/profile'];
|
||||||
@@ -53,9 +58,9 @@ export default {
|
|||||||
if (menu.hidden !== true) {
|
if (menu.hidden !== true) {
|
||||||
// 兼容顶部栏一级菜单内部跳转
|
// 兼容顶部栏一级菜单内部跳转
|
||||||
if (menu.path === "/") {
|
if (menu.path === "/") {
|
||||||
topMenus.push(menu.children[0]);
|
topMenus.push(menu.children[0]);
|
||||||
} else {
|
} else {
|
||||||
topMenus.push(menu);
|
topMenus.push(menu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -74,7 +79,7 @@ export default {
|
|||||||
if(router.path === "/") {
|
if(router.path === "/") {
|
||||||
router.children[item].path = "/" + router.children[item].path;
|
router.children[item].path = "/" + router.children[item].path;
|
||||||
} else {
|
} else {
|
||||||
if(!this.ishttp(router.children[item].path)) {
|
if(!isHttp(router.children[item].path)) {
|
||||||
router.children[item].path = router.path + "/" + router.children[item].path;
|
router.children[item].path = router.path + "/" + router.children[item].path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,8 +96,8 @@ export default {
|
|||||||
let activePath = path;
|
let activePath = path;
|
||||||
if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) {
|
if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) {
|
||||||
const tmpPath = path.substring(1, path.length);
|
const tmpPath = path.substring(1, path.length);
|
||||||
activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
|
|
||||||
if (!this.$route.meta.link) {
|
if (!this.$route.meta.link) {
|
||||||
|
activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/"));
|
||||||
this.$store.dispatch('app/toggleSideBarHide', false);
|
this.$store.dispatch('app/toggleSideBarHide', false);
|
||||||
}
|
}
|
||||||
} else if(!this.$route.children) {
|
} else if(!this.$route.children) {
|
||||||
@@ -122,12 +127,18 @@ export default {
|
|||||||
handleSelect(key, keyPath) {
|
handleSelect(key, keyPath) {
|
||||||
this.currentIndex = key;
|
this.currentIndex = key;
|
||||||
const route = this.routers.find(item => item.path === key);
|
const route = this.routers.find(item => item.path === key);
|
||||||
if (this.ishttp(key)) {
|
if (isHttp(key)) {
|
||||||
// http(s):// 路径新窗口打开
|
// http(s):// 路径新窗口打开
|
||||||
window.open(key, "_blank");
|
window.open(key, "_blank");
|
||||||
} else if (!route || !route.children) {
|
} else if (!route || !route.children) {
|
||||||
// 没有子路由路径内部打开
|
// 没有子路由路径内部打开
|
||||||
this.$router.push({ path: key });
|
const routeMenu = this.childrenMenus.find(item => item.path === key);
|
||||||
|
if (routeMenu && routeMenu.query) {
|
||||||
|
let query = JSON.parse(routeMenu.query);
|
||||||
|
this.$router.push({ path: key, query: query });
|
||||||
|
} else {
|
||||||
|
this.$router.push({ path: key });
|
||||||
|
}
|
||||||
this.$store.dispatch('app/toggleSideBarHide', true);
|
this.$store.dispatch('app/toggleSideBarHide', true);
|
||||||
} else {
|
} else {
|
||||||
// 显示左侧联动菜单
|
// 显示左侧联动菜单
|
||||||
@@ -150,9 +161,6 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('app/toggleSideBarHide', true);
|
this.$store.dispatch('app/toggleSideBarHide', true);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
ishttp(url) {
|
|
||||||
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,6 +22,22 @@ export default {
|
|||||||
key() {
|
key() {
|
||||||
return this.$route.path
|
return this.$route.path
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route() {
|
||||||
|
this.addIframe()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.addIframe()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addIframe() {
|
||||||
|
const {name} = this.$route
|
||||||
|
if (name && this.$route.meta.link) {
|
||||||
|
this.$store.dispatch('tagsView/addIframeView', this.$route)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -55,7 +71,21 @@ export default {
|
|||||||
// fix css style bug in open el-dialog
|
// fix css style bug in open el-dialog
|
||||||
.el-popup-parent--hidden {
|
.el-popup-parent--hidden {
|
||||||
.fixed-header {
|
.fixed-header {
|
||||||
padding-right: 17px;
|
padding-right: 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #c0c0c0;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const sessionCache = {
|
|||||||
if (value != null) {
|
if (value != null) {
|
||||||
return JSON.parse(value)
|
return JSON.parse(value)
|
||||||
}
|
}
|
||||||
|
return null
|
||||||
},
|
},
|
||||||
remove (key) {
|
remove (key) {
|
||||||
sessionStorage.removeItem(key);
|
sessionStorage.removeItem(key);
|
||||||
@@ -59,6 +60,7 @@ const localCache = {
|
|||||||
if (value != null) {
|
if (value != null) {
|
||||||
return JSON.parse(value)
|
return JSON.parse(value)
|
||||||
}
|
}
|
||||||
|
return null
|
||||||
},
|
},
|
||||||
remove (key) {
|
remove (key) {
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Message } from 'element-ui'
|
import {Loading, Message} from 'element-ui'
|
||||||
import { saveAs } from 'file-saver'
|
import { saveAs } from 'file-saver'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import errorCode from '@/utils/errorCode'
|
import errorCode from '@/utils/errorCode'
|
||||||
import { blobValidate } from "@/utils/ruoyi";
|
import { blobValidate } from "@/utils/ruoyi";
|
||||||
|
|
||||||
const baseURL = process.env.VUE_APP_BASE_API
|
const baseURL = process.env.VUE_APP_BASE_API
|
||||||
|
let downloadLoadingInstance;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name(name, isDelete = true) {
|
name(name, isDelete = true) {
|
||||||
@@ -15,9 +16,9 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
}).then(async (res) => {
|
}).then((res) => {
|
||||||
const isLogin = await blobValidate(res.data);
|
const isBlob = blobValidate(res.data);
|
||||||
if (isLogin) {
|
if (isBlob) {
|
||||||
const blob = new Blob([res.data])
|
const blob = new Blob([res.data])
|
||||||
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
||||||
} else {
|
} else {
|
||||||
@@ -32,9 +33,9 @@ export default {
|
|||||||
url: url,
|
url: url,
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
}).then(async (res) => {
|
}).then((res) => {
|
||||||
const isLogin = await blobValidate(res.data);
|
const isBlob = blobValidate(res.data);
|
||||||
if (isLogin) {
|
if (isBlob) {
|
||||||
const blob = new Blob([res.data])
|
const blob = new Blob([res.data])
|
||||||
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
|
||||||
} else {
|
} else {
|
||||||
@@ -44,19 +45,25 @@ export default {
|
|||||||
},
|
},
|
||||||
zip(url, name) {
|
zip(url, name) {
|
||||||
var url = baseURL + url
|
var url = baseURL + url
|
||||||
|
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
|
||||||
axios({
|
axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: url,
|
url: url,
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||||
}).then(async (res) => {
|
}).then((res) => {
|
||||||
const isLogin = await blobValidate(res.data);
|
const isBlob = blobValidate(res.data);
|
||||||
if (isLogin) {
|
if (isBlob) {
|
||||||
const blob = new Blob([res.data], { type: 'application/zip' })
|
const blob = new Blob([res.data], { type: 'application/zip' })
|
||||||
this.saveAs(blob, name)
|
this.saveAs(blob, name)
|
||||||
} else {
|
} else {
|
||||||
this.printErrMsg(res.data);
|
this.printErrMsg(res.data);
|
||||||
}
|
}
|
||||||
|
downloadLoadingInstance.close();
|
||||||
|
}).catch((r) => {
|
||||||
|
console.error(r)
|
||||||
|
Message.error('下载文件出现错误,请联系管理员!')
|
||||||
|
downloadLoadingInstance.close();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
saveAs(text, name, opts) {
|
saveAs(text, name, opts) {
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ export default {
|
|||||||
// 关闭指定tab页签
|
// 关闭指定tab页签
|
||||||
closePage(obj) {
|
closePage(obj) {
|
||||||
if (obj === undefined) {
|
if (obj === undefined) {
|
||||||
return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => {
|
return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => {
|
||||||
return router.push(lastPath || '/');
|
const latestView = visitedViews.slice(-1)[0]
|
||||||
|
if (latestView) {
|
||||||
|
return router.push(latestView.fullPath)
|
||||||
|
}
|
||||||
|
return router.push('/');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return store.dispatch('tagsView/delView', obj);
|
return store.dispatch('tagsView/delView', obj);
|
||||||
@@ -56,7 +60,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 添加tab页签
|
// 添加tab页签
|
||||||
openPage(title, url, params) {
|
openPage(title, url, params) {
|
||||||
var obj = { path: url, meta: { title: title } }
|
const obj = { path: url, meta: { title: title } }
|
||||||
store.dispatch('tagsView/addView', obj);
|
store.dispatch('tagsView/addView', obj);
|
||||||
return router.push({ path: url, query: params });
|
return router.push({ path: url, query: params });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,109 +1,106 @@
|
|||||||
import { login, logout, getInfo } from '@/api/login';
|
import { login, logout, getInfo } from '@/api/login'
|
||||||
import { getToken, setToken, removeToken, setUserId, removeUserId } from '@/utils/auth';
|
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||||
|
import { isHttp, isEmpty } from "@/utils/validate"
|
||||||
|
import defAva from '@/assets/images/profile.jpg'
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
roles: [],
|
roles: [],
|
||||||
permissions: [],
|
permissions: []
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
SET_TOKEN: (state, token) => {
|
SET_TOKEN: (state, token) => {
|
||||||
state.token = token;
|
state.token = token
|
||||||
|
},
|
||||||
|
SET_ID: (state, id) => {
|
||||||
|
state.id = id
|
||||||
},
|
},
|
||||||
SET_NAME: (state, name) => {
|
SET_NAME: (state, name) => {
|
||||||
state.name = name;
|
state.name = name
|
||||||
},
|
},
|
||||||
SET_AVATAR: (state, avatar) => {
|
SET_AVATAR: (state, avatar) => {
|
||||||
state.avatar = avatar;
|
state.avatar = avatar
|
||||||
},
|
},
|
||||||
SET_ROLES: (state, roles) => {
|
SET_ROLES: (state, roles) => {
|
||||||
state.roles = roles;
|
state.roles = roles
|
||||||
},
|
},
|
||||||
SET_PERMISSIONS: (state, permissions) => {
|
SET_PERMISSIONS: (state, permissions) => {
|
||||||
state.permissions = permissions;
|
state.permissions = permissions
|
||||||
},
|
}
|
||||||
SET_MQTT: (state, mqtt) => {
|
|
||||||
state.mqtt = mqtt;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
// 登录
|
// 登录
|
||||||
Login({ commit }, userInfo) {
|
Login({ commit }, userInfo) {
|
||||||
const username = userInfo.username.trim();
|
const username = userInfo.username.trim()
|
||||||
const password = userInfo.password;
|
const password = userInfo.password
|
||||||
const code = userInfo.code;
|
const code = userInfo.code
|
||||||
const uuid = userInfo.uuid;
|
const uuid = userInfo.uuid
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
login(username, password, code, uuid)
|
login(username, password, code, uuid).then(res => {
|
||||||
.then((res) => {
|
setToken(res.token)
|
||||||
setToken(res.token);
|
commit('SET_TOKEN', res.token)
|
||||||
commit('SET_TOKEN', res.token);
|
resolve()
|
||||||
resolve();
|
}).catch(error => {
|
||||||
})
|
reject(error)
|
||||||
.catch((error) => {
|
})
|
||||||
reject(error);
|
})
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
GetInfo({ commit, state }) {
|
GetInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo()
|
getInfo().then(res => {
|
||||||
.then((res) => {
|
const user = res.user
|
||||||
const user = res.user;
|
let avatar = user.avatar || ""
|
||||||
const avatar = user.avatar === '' || user.avatar == null ? require('@/assets/images/profile.jpg') : process.env.VUE_APP_BASE_API + user.avatar;
|
if (!isHttp(avatar)) {
|
||||||
if (res.roles && res.roles.length > 0) {
|
avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar
|
||||||
// 验证返回的roles是否是一个非空数组
|
}
|
||||||
commit('SET_ROLES', res.roles);
|
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||||
commit('SET_PERMISSIONS', res.permissions);
|
commit('SET_ROLES', res.roles)
|
||||||
} else {
|
commit('SET_PERMISSIONS', res.permissions)
|
||||||
commit('SET_ROLES', ['ROLE_DEFAULT']);
|
} else {
|
||||||
}
|
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||||
commit('SET_NAME', user.userName);
|
}
|
||||||
commit('SET_AVATAR', avatar);
|
commit('SET_ID', user.userId)
|
||||||
commit('SET_MQTT', res.mqtt);
|
commit('SET_NAME', user.userName)
|
||||||
setUserId(user.userId);
|
commit('SET_AVATAR', avatar)
|
||||||
resolve(res);
|
resolve(res)
|
||||||
})
|
}).catch(error => {
|
||||||
.catch((error) => {
|
reject(error)
|
||||||
reject(error);
|
})
|
||||||
});
|
})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 退出系统
|
// 退出系统
|
||||||
LogOut({ commit, state }) {
|
LogOut({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
logout(state.token)
|
logout(state.token).then(() => {
|
||||||
.then(() => {
|
commit('SET_TOKEN', '')
|
||||||
commit('SET_TOKEN', '');
|
commit('SET_ROLES', [])
|
||||||
commit('SET_ROLES', []);
|
commit('SET_PERMISSIONS', [])
|
||||||
commit('SET_PERMISSIONS', []);
|
removeToken()
|
||||||
removeToken();
|
resolve()
|
||||||
removeUserId();
|
}).catch(error => {
|
||||||
resolve();
|
reject(error)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
})
|
||||||
reject(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 前端 登出
|
// 前端 登出
|
||||||
FedLogOut({ commit }) {
|
FedLogOut({ commit }) {
|
||||||
return new Promise((resolve) => {
|
return new Promise(resolve => {
|
||||||
commit('SET_TOKEN', '');
|
commit('SET_TOKEN', '')
|
||||||
removeToken();
|
removeToken()
|
||||||
resolve();
|
resolve()
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export default user;
|
export default user
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ export function checkPermi(value) {
|
|||||||
return all_permission === permission || permissionDatas.includes(permission)
|
return all_permission === permission || permissionDatas.includes(permission)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!hasPermission) {
|
return hasPermission;
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} else {
|
} else {
|
||||||
console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
|
console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
|
||||||
return false
|
return false
|
||||||
@@ -40,10 +38,8 @@ export function checkRole(value) {
|
|||||||
return super_admin === role || permissionRoles.includes(role)
|
return super_admin === role || permissionRoles.includes(role)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!hasRole) {
|
return hasRole;
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} else {
|
} else {
|
||||||
console.error(`need roles! Like checkRole="['admin','editor']"`)
|
console.error(`need roles! Like checkRole="['admin','editor']"`)
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -1,4 +1,38 @@
|
|||||||
/**
|
/**
|
||||||
|
* 路径匹配器
|
||||||
|
* @param {string} pattern
|
||||||
|
* @param {string} path
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
export function isPathMatch(pattern, path) {
|
||||||
|
const regexPattern = pattern.replace(/\//g, '\\/').replace(/\*\*/g, '.*').replace(/\*/g, '[^\\/]*')
|
||||||
|
const regex = new RegExp(`^${regexPattern}$`)
|
||||||
|
return regex.test(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断value字符串是否为空
|
||||||
|
* @param {string} value
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
export function isEmpty(value) {
|
||||||
|
if (value == null || value == "" || value == undefined || value == "undefined") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断url是否是http或https
|
||||||
|
* @param {string} url
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
export function isHttp(url) {
|
||||||
|
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断path是否为外链
|
||||||
* @param {string} path
|
* @param {string} path
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
@@ -65,10 +99,7 @@ export function validEmail(email) {
|
|||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
export function isString(str) {
|
export function isString(str) {
|
||||||
if (typeof str === 'string' || str instanceof String) {
|
return typeof str === 'string' || str instanceof String
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,34 +112,3 @@ export function isArray(arg) {
|
|||||||
}
|
}
|
||||||
return Array.isArray(arg)
|
return Array.isArray(arg)
|
||||||
}
|
}
|
||||||
//<2F><>ֵ<EFBFBD><D6B5>ΧУ<CEA7><D0A3>
|
|
||||||
export function checkNumber(rule, value, callback) {
|
|
||||||
if (!value) {
|
|
||||||
return callback(new Error('<27><><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'));
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!Number(value)) {
|
|
||||||
} else {
|
|
||||||
if (value < 1 || value > 64) {
|
|
||||||
callback(new Error('<27><>ֵ<EFBFBD><D6B5>ΧΪ1-64'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
export function checkNumberAddr(rule, value, callback) {
|
|
||||||
if (!value) {
|
|
||||||
return callback(new Error('<27><><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'));
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!Number(value)) {
|
|
||||||
} else {
|
|
||||||
if (value < 1 || value > 65536) {
|
|
||||||
callback(new Error('<27><>ֵ<EFBFBD><D6B5>ΧΪ1-65536'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts'
|
||||||
require('echarts/theme/macarons') // echarts theme
|
require('echarts/theme/macarons') // echarts theme
|
||||||
import resize from './mixins/resize'
|
import resize from './mixins/resize'
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts'
|
||||||
require('echarts/theme/macarons') // echarts theme
|
require('echarts/theme/macarons') // echarts theme
|
||||||
import resize from './mixins/resize'
|
import resize from './mixins/resize'
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts'
|
||||||
require('echarts/theme/macarons') // echarts theme
|
require('echarts/theme/macarons') // echarts theme
|
||||||
import resize from './mixins/resize'
|
import resize from './mixins/resize'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="操作地址" prop="operIp">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.operIp"
|
||||||
|
placeholder="请输入操作地址"
|
||||||
|
clearable
|
||||||
|
style="width: 240px;"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="系统模块" prop="title">
|
<el-form-item label="系统模块" prop="title">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.title"
|
v-model="queryParams.title"
|
||||||
@@ -53,11 +62,12 @@
|
|||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="dateRange"
|
v-model="dateRange"
|
||||||
style="width: 240px"
|
style="width: 240px"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -102,16 +112,15 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="日志编号" align="center" prop="operId" />
|
<el-table-column label="日志编号" align="center" prop="operId" />
|
||||||
<el-table-column label="系统模块" align="center" prop="title" />
|
<el-table-column label="系统模块" align="center" prop="title" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作类型" align="center" prop="businessType">
|
<el-table-column label="操作类型" align="center" prop="businessType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
|
<dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="请求方式" align="center" prop="requestMethod" />
|
<el-table-column label="操作人员" align="center" prop="operName" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||||
<el-table-column label="操作人员" align="center" prop="operName" width="100" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
|
||||||
<el-table-column label="操作地址" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
<el-table-column label="操作地址" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
|
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作状态" align="center" prop="status">
|
<el-table-column label="操作状态" align="center" prop="status">
|
||||||
@@ -119,11 +128,16 @@
|
|||||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作日期" align="center" prop="operTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
|
<el-table-column label="操作日期" align="center" prop="operTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.operTime) }}</span>
|
<span>{{ parseTime(scope.row.operTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="消耗时间" align="center" prop="costTime" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.costTime }}毫秒</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -146,7 +160,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 操作日志详细 -->
|
<!-- 操作日志详细 -->
|
||||||
<el-dialog title="操作日志详细" :visible.sync="open" width="700px" append-to-body>
|
<el-dialog title="操作日志详细" :visible.sync="open" width="800px" append-to-body>
|
||||||
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -168,13 +182,16 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="返回参数:">{{ form.jsonResult }}</el-form-item>
|
<el-form-item label="返回参数:">{{ form.jsonResult }}</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
<el-form-item label="操作状态:">
|
<el-form-item label="操作状态:">
|
||||||
<div v-if="form.status === 0">正常</div>
|
<div v-if="form.status === 0">正常</div>
|
||||||
<div v-else-if="form.status === 1">失败</div>
|
<div v-else-if="form.status === 1">失败</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="8">
|
||||||
|
<el-form-item label="消耗时间:">{{ form.costTime }}毫秒</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
<el-form-item label="操作时间:">{{ parseTime(form.operTime) }}</el-form-item>
|
<el-form-item label="操作时间:">{{ parseTime(form.operTime) }}</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@@ -221,6 +238,7 @@ export default {
|
|||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
operIp: undefined,
|
||||||
title: undefined,
|
title: undefined,
|
||||||
operName: undefined,
|
operName: undefined,
|
||||||
businessType: undefined,
|
businessType: undefined,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span>CPU</span></div>
|
<div slot="header"><span><i class="el-icon-cpu"></i> CPU</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<el-col :span="12" class="card-box">
|
<el-col :span="12" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header"><span>内存</span></div>
|
<div slot="header"><span><i class="el-icon-tickets"></i> 内存</span></div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>服务器信息</span>
|
<span><i class="el-icon-monitor"></i> 服务器信息</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>Java虚拟机信息</span>
|
<span><i class="el-icon-coffee-cup"></i> Java虚拟机信息</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;table-layout:fixed;">
|
<table cellspacing="0" style="width: 100%;table-layout:fixed;">
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
<el-col :span="24" class="card-box">
|
<el-col :span="24" class="card-box">
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>磁盘状态</span>
|
<span><i class="el-icon-receiving"></i> 磁盘状态</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table el-table--enable-row-hover el-table--medium">
|
<div class="el-table el-table--enable-row-hover el-table--medium">
|
||||||
<table cellspacing="0" style="width: 100%;">
|
<table cellspacing="0" style="width: 100%;">
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
<el-table-column label="参数主键" align="center" prop="configId" />
|
<el-table-column label="参数主键" align="center" prop="configId" />
|
||||||
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
<el-table-column label="参数名称" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
<el-table-column label="参数键名" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="参数键值" align="center" prop="configValue" />
|
<el-table-column label="参数键值" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="系统内置" align="center" prop="configType">
|
<el-table-column label="系统内置" align="center" prop="configType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="参数键值" prop="configValue">
|
<el-form-item label="参数键值" prop="configValue">
|
||||||
<el-input v-model="form.configValue" placeholder="请输入参数键值" />
|
<el-input v-model="form.configValue" type="textarea" placeholder="请输入参数键值" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="系统内置" prop="configType">
|
<el-form-item label="系统内置" prop="configType">
|
||||||
<el-radio-group v-model="form.configType">
|
<el-radio-group v-model="form.configType">
|
||||||
|
|||||||
45
vue/src/views/tool/gen/createTable.vue
Normal file
45
vue/src/views/tool/gen/createTable.vue
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 创建表 -->
|
||||||
|
<el-dialog title="创建表" :visible.sync="visible" width="800px" top="5vh" append-to-body>
|
||||||
|
<span>创建表语句(支持多个建表语句):</span>
|
||||||
|
<el-input type="textarea" :rows="10" placeholder="请输入文本" v-model="content"></el-input>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleCreateTable">确 定</el-button>
|
||||||
|
<el-button @click="visible = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { createTable } from "@/api/tool/gen";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
visible: false,
|
||||||
|
// 文本内容
|
||||||
|
content: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 显示弹框
|
||||||
|
show() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
/** 创建按钮操作 */
|
||||||
|
handleCreateTable() {
|
||||||
|
if (this.content === "") {
|
||||||
|
this.$modal.msgError("请输入建表语句");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
createTable({ sql: this.content }).then(res => {
|
||||||
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("ok");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -11,6 +11,15 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="tplWebType">
|
||||||
|
<span slot="label">前端类型</span>
|
||||||
|
<el-select v-model="info.tplWebType">
|
||||||
|
<el-option label="Vue2 Element UI 模版" value="element-ui" />
|
||||||
|
<el-option label="Vue3 Element Plus 模版" value="element-plus" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item prop="packageName">
|
<el-form-item prop="packageName">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
@@ -59,6 +68,19 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item prop="genType">
|
||||||
|
<span slot="label">
|
||||||
|
生成代码方式
|
||||||
|
<el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top">
|
||||||
|
<i class="el-icon-question"></i>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
<el-radio v-model="info.genType" label="0">zip压缩包</el-radio>
|
||||||
|
<el-radio v-model="info.genType" label="1">自定义路径</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
@@ -78,19 +100,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item prop="genType">
|
|
||||||
<span slot="label">
|
|
||||||
生成代码方式
|
|
||||||
<el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top">
|
|
||||||
<i class="el-icon-question"></i>
|
|
||||||
</el-tooltip>
|
|
||||||
</span>
|
|
||||||
<el-radio v-model="info.genType" label="0">zip压缩包</el-radio>
|
|
||||||
<el-radio v-model="info.genType" label="1">自定义路径</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="24" v-if="info.genType == '1'">
|
<el-col :span="24" v-if="info.genType == '1'">
|
||||||
<el-form-item prop="genPath">
|
<el-form-item prop="genPath">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
@@ -255,10 +264,14 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
|
||||||
watch: {
|
watch: {
|
||||||
'info.subTableName': function(val) {
|
'info.subTableName': function(val) {
|
||||||
this.setSubTableColumns(val);
|
this.setSubTableColumns(val);
|
||||||
|
},
|
||||||
|
'info.tplWebType': function(val) {
|
||||||
|
if (val === '') {
|
||||||
|
this.info.tplWebType = "element-ui";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -41,10 +41,21 @@
|
|||||||
plain
|
plain
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
@click="handleGenTable"
|
@click="handleGenTable"
|
||||||
v-hasPermi="['tool:gen:code']"
|
v-hasPermi="['tool:gen:code']"
|
||||||
>生成</el-button>
|
>生成</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="openCreateTable"
|
||||||
|
v-hasRole="['admin']"
|
||||||
|
>创建</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="info"
|
type="info"
|
||||||
@@ -172,12 +183,14 @@
|
|||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<import-table ref="import" @ok="handleQuery" />
|
<import-table ref="import" @ok="handleQuery" />
|
||||||
|
<create-table ref="create" @ok="handleQuery" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
||||||
import importTable from "./importTable";
|
import importTable from "./importTable";
|
||||||
|
import createTable from "./createTable";
|
||||||
import hljs from "highlight.js/lib/highlight";
|
import hljs from "highlight.js/lib/highlight";
|
||||||
import "highlight.js/styles/github-gist.css";
|
import "highlight.js/styles/github-gist.css";
|
||||||
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
|
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
|
||||||
@@ -189,7 +202,7 @@ hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Gen",
|
name: "Gen",
|
||||||
components: { importTable },
|
components: { importTable, createTable },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@@ -283,6 +296,10 @@ export default {
|
|||||||
openImportTable() {
|
openImportTable() {
|
||||||
this.$refs.import.show();
|
this.$refs.import.show();
|
||||||
},
|
},
|
||||||
|
/** 打开创建表弹窗 */
|
||||||
|
openCreateTable() {
|
||||||
|
this.$refs.create.show();
|
||||||
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user