合并2.2DEV分支
This commit is contained in:
@@ -5,4 +5,5 @@ const prodEnv = require('./prod.env')
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"',
|
||||
BASE_API: '"http://localhost:8000"'
|
||||
// BASE_API: '"https://api.auauz.net"'
|
||||
})
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
'use strict'
|
||||
// Template version: 1.2.6
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const devEnv = require('./dev.env')
|
||||
// 获取接口地址
|
||||
const base_url = devEnv.BASE_API.replace(/"/g,'')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
// 配置代理
|
||||
proxyTable: {
|
||||
'/auth': {
|
||||
// 测试环境
|
||||
target: base_url,
|
||||
secure: true,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/auth': 'auth'
|
||||
}
|
||||
},
|
||||
'/api': {
|
||||
// 测试环境
|
||||
target: base_url,
|
||||
secure: true,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/api': 'api'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
@@ -57,7 +77,7 @@ module.exports = {
|
||||
* then assetsPublicPath should be set to "/bar/".
|
||||
* In most cases please use '/' !!!
|
||||
*/
|
||||
assetsPublicPath: '/',
|
||||
assetsPublicPath: './',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
|
||||
@@ -18,14 +18,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@riophae/vue-treeselect": "0.0.38",
|
||||
"axios": ">=0.18.1",
|
||||
"axios": "^0.19.0",
|
||||
"clipboard": "1.7.1",
|
||||
"codemirror": "^5.38.0",
|
||||
"connect": "3.6.6",
|
||||
"echarts": "4.1.0",
|
||||
"element-ui": "^2.10.1",
|
||||
"element-ui": "^2.11.1",
|
||||
"file-saver": "1.3.8",
|
||||
"html2canvas": "^1.0.0-rc.3",
|
||||
"js-cookie": "2.2.0",
|
||||
"jsencrypt": "^3.0.0-rc.1",
|
||||
"jszip": "3.1.5",
|
||||
@@ -34,10 +33,9 @@
|
||||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
"screenfull": "3.3.3",
|
||||
"simple-drawing-board": "1.4.1",
|
||||
"vue": "2.5.17",
|
||||
"vue-count-to": "1.0.13",
|
||||
"vue-router": "^3.1.3",
|
||||
"vue-router": "3.1.3",
|
||||
"vuex": "3.0.1",
|
||||
"wangeditor": ">=3.0.0",
|
||||
"xlsx": "^0.11.16"
|
||||
|
||||
@@ -15,6 +15,14 @@ export function del(id) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delAll(ids) {
|
||||
return request({
|
||||
url: 'api/localStorage/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/localStorage',
|
||||
|
||||
@@ -7,6 +7,13 @@ export function add(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
export function downloadUser() {
|
||||
return request({
|
||||
url: 'api/users/download',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
|
||||
BIN
src/assets/avatar/avatar.png
Normal file
BIN
src/assets/avatar/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
@@ -37,6 +37,9 @@ export default {
|
||||
if (first && first.name !== '首页') {
|
||||
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
|
||||
}
|
||||
if (matched.length >= 4) {
|
||||
matched.splice(1, 1)
|
||||
}
|
||||
this.levelList = matched
|
||||
},
|
||||
pathCompile(path) {
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
/**
|
||||
* @description 固定头部
|
||||
*/
|
||||
fixedHeader: false,
|
||||
fixedHeader: true,
|
||||
|
||||
/**
|
||||
* @description 是否显示logo
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
/**
|
||||
* 是否显示设置的悬浮按钮
|
||||
*/
|
||||
settingBtn: true,
|
||||
settingBtn: false,
|
||||
|
||||
/**
|
||||
* 是否显示设置的底部信息
|
||||
|
||||
1
src/icons/svg/weixin.svg
Normal file
1
src/icons/svg/weixin.svg
Normal 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="1564885435527" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2023" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M1024 659.2c0-147.2-147.2-262.4-307.2-262.4-172.8 0-307.2 115.2-307.2 262.4 0 147.2 134.4 262.4 307.2 262.4 38.4 0 70.4-6.4 108.8-19.2l102.4 51.2L896 870.4C972.8 812.8 1024 742.4 1024 659.2zM614.4 614.4c-19.2 0-38.4-19.2-38.4-38.4 0-19.2 19.2-38.4 38.4-38.4 25.6 0 44.8 19.2 44.8 38.4C659.2 595.2 646.4 614.4 614.4 614.4zM812.8 614.4c-19.2 0-38.4-19.2-38.4-38.4 0-19.2 19.2-38.4 38.4-38.4 25.6 0 44.8 19.2 44.8 38.4C864 595.2 844.8 614.4 812.8 614.4z" p-id="2024" fill="#bfbfbf"></path><path d="M364.8 128C166.4 128 0 262.4 0 435.2c0 102.4 51.2 179.2 147.2 243.2l-38.4 108.8 128-64c44.8 6.4 83.2 19.2 128 19.2 12.8 0 25.6 0 32 0C390.4 716.8 384 691.2 384 665.6c0-160 134.4-288 307.2-288 12.8 0 25.6 0 32 0C697.6 236.8 537.6 128 364.8 128zM243.2 371.2C217.6 371.2 192 352 192 326.4c0-25.6 25.6-44.8 57.6-44.8s44.8 19.2 44.8 44.8C288 352 268.8 371.2 243.2 371.2zM499.2 371.2c-25.6 0-57.6-19.2-57.6-44.8 0-25.6 25.6-44.8 57.6-44.8 25.6 0 44.8 19.2 44.8 44.8C544 352 524.8 371.2 499.2 371.2z" p-id="2025" fill="#bfbfbf"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -5,13 +5,6 @@
|
||||
<div :class="{hasTagsView:needTagsView}" class="main-container">
|
||||
<div :class="{'fixed-header':fixedHeader}">
|
||||
<navbar />
|
||||
<div class="feedback">
|
||||
<el-tooltip class="item" effect="dark" content="建议反馈" placement="left">
|
||||
<el-button type="text" @click="doFeedback">
|
||||
<svg-icon style="font-size: 28px;color: #606266;" icon-class="codeConsole" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<tags-view v-if="needTagsView" />
|
||||
</div>
|
||||
<app-main />
|
||||
@@ -19,7 +12,6 @@
|
||||
<settings />
|
||||
</right-panel>
|
||||
</div>
|
||||
<feedback :show-dialog.sync="feedbackShow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -28,7 +20,6 @@ import RightPanel from '@/components/RightPanel'
|
||||
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
||||
import ResizeMixin from './mixin/ResizeHandler'
|
||||
import { mapState } from 'vuex'
|
||||
import feedback from './feedback.vue'
|
||||
|
||||
export default {
|
||||
name: 'Layout',
|
||||
@@ -38,15 +29,9 @@ export default {
|
||||
Settings,
|
||||
Sidebar,
|
||||
TagsView,
|
||||
RightPanel,
|
||||
feedback
|
||||
RightPanel
|
||||
},
|
||||
mixins: [ResizeMixin],
|
||||
data() {
|
||||
return {
|
||||
feedbackShow: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
sidebar: state => state.app.sidebar,
|
||||
@@ -66,10 +51,6 @@ export default {
|
||||
methods: {
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch('closeSideBar', { withoutAnimation: false })
|
||||
},
|
||||
doFeedback() {
|
||||
console.log(111)
|
||||
this.feedbackShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,12 +99,5 @@ export default {
|
||||
.mobile .fixed-header {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.feedback {
|
||||
position: fixed;
|
||||
z-index: 999999;
|
||||
right: 10px;
|
||||
bottom: 60px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
<el-dropdown class="avatar-container right-menu-item" trigger="click">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="user.avatar" class="user-avatar">
|
||||
<img :src="user.avatar ? baseApi + '/avatar/' + user.avatar : Avatar" class="user-avatar">
|
||||
<i class="el-icon-caret-bottom"/>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
@@ -46,7 +46,7 @@ import { mapGetters } from 'vuex'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import Hamburger from '@/components/Hamburger'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
|
||||
import Avatar from '@/assets/avatar/avatar.png'
|
||||
export default {
|
||||
components: {
|
||||
Breadcrumb,
|
||||
@@ -55,6 +55,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Avatar: Avatar,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
@@ -62,7 +63,8 @@ export default {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
'user',
|
||||
'device'
|
||||
'device',
|
||||
'baseApi'
|
||||
]),
|
||||
show: {
|
||||
get() {
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:visible.sync="show"
|
||||
data-html2canvas-ignore="true"
|
||||
title="意见反馈"
|
||||
class
|
||||
width="60%"
|
||||
center
|
||||
@open="init"
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" :model="feedback" label-width="0px" class="feedback-add-form">
|
||||
<el-form-item label prop="info">
|
||||
<el-input v-model="feedback.info" :rows="2" type="textarea" placeholder="告诉我们你的建议或遇到的问题。"/>
|
||||
</el-form-item>
|
||||
<el-form-item label>
|
||||
<span>屏幕截图 (可选):</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-loading="dataLoading" v-show="submitScreenshot" label>
|
||||
<div id="screenshot"/>
|
||||
</el-form-item>
|
||||
<el-form-item label>
|
||||
<el-checkbox v-model="submitScreenshot">提交屏幕截图</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button
|
||||
slot="footer"
|
||||
:loading="confirmLoading"
|
||||
class="confirm-btn"
|
||||
type="primary"
|
||||
@click="submit"
|
||||
>提交</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SimpleDrawingBoard from 'simple-drawing-board'
|
||||
import html2canvas from 'html2canvas'
|
||||
export default {
|
||||
props: {
|
||||
showDialog: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
feedback: {
|
||||
info: ''
|
||||
},
|
||||
submitScreenshot: true,
|
||||
dataLoading: false,
|
||||
confirmLoading: false
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
show: {
|
||||
get() {
|
||||
return this.showDialog
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:showDialog', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async loadLibrary() {
|
||||
if (typeof html2canvas === 'undefined') {
|
||||
try {
|
||||
console.error('html2canvas not import')
|
||||
} catch (e) {
|
||||
console.error('html2canvas.min.js is missing', e.toString())
|
||||
return null
|
||||
}
|
||||
}
|
||||
return html2canvas
|
||||
},
|
||||
async init() {
|
||||
await this.loadLibrary()
|
||||
this.dataLoading = true
|
||||
this.$nextTick(() => {
|
||||
// modal层处理,截屏时忽略遮罩层
|
||||
const modals = document.getElementsByClassName('v-modal')
|
||||
for (let i = 0; i < modals.length; i++) {
|
||||
modals[i].setAttribute('data-html2canvas-ignore', 'true')
|
||||
}
|
||||
|
||||
html2canvas(document.body, { logging: false })
|
||||
.then(canvas => {
|
||||
const screenshot = document.getElementById('screenshot')
|
||||
canvas.setAttribute('style', 'width:100%')
|
||||
screenshot.appendChild(canvas)
|
||||
this.dataLoading = false
|
||||
window.sdb = new SimpleDrawingBoard(
|
||||
screenshot.getElementsByTagName('canvas')[0],
|
||||
{
|
||||
lineColor: '#ff0000',
|
||||
lineSize: 4
|
||||
}
|
||||
)
|
||||
})
|
||||
.catch(e => {
|
||||
this.dataLoading = false
|
||||
console.log(e.toString())
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
close() {
|
||||
const screenshot = document.getElementById('screenshot')
|
||||
const canvas = screenshot.getElementsByTagName('canvas')[0]
|
||||
screenshot.removeChild(canvas)
|
||||
},
|
||||
|
||||
async submit() {
|
||||
try {
|
||||
this.confirmLoading = true
|
||||
const formData = new FormData()
|
||||
if (window.sdb) {
|
||||
if (this.submitScreenshot) {
|
||||
const screenshot = window.sdb.getImg()
|
||||
formData.append('file', screenshot)
|
||||
}
|
||||
formData.append('feedback', this.feedback.info)
|
||||
}
|
||||
// let res = await axios.post('http://', formData, {
|
||||
// headers: {
|
||||
// 'Origin': window.location.origin,
|
||||
// 'Content-Type': 'multipart/form-data'
|
||||
// },
|
||||
// changeOrigin: true
|
||||
// })
|
||||
this.confirmLoading = false
|
||||
|
||||
this.$notify({
|
||||
title: '反馈成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.show = false
|
||||
} catch (e) {
|
||||
this.$notify({
|
||||
title: '提交失败',
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.confirmLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#screenshot {
|
||||
cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABGdBTUEAALGPC/xhBQAAARpJREFUOBGdkr1KA0EUhTcxEkSQQIpAihQWPoedD2BnIVsZQiBVEkiR7SwtBDsJqXwBLQwEgoWNjY2FjYUQ38Ei5Oc7sBeGLTKze+Djzsyecxh2N4ryq0zkHpYQQ2H1SW5TNsxukaZzQsewACvTvIBg3eFUaABHMEv3OruBIN3icm8wZl+FZ3iBQ/AqweGW2FrlKlChV0McFsxOvaegm/T2lLzzTC/dqzaO7A1s/8GzE28Dhhj0f1jQnZ+c18CrKxxrcMO2/uK87m3AcAkrsKA7vzlvQJAmuNywrX84bwY1YBrBATyCFWj+QguCJKNCU1DZQ7r/Y55CsK5x2i2eWFcggTPIJd3Eiv5Zd3KlU3OJOQd9lVd4A5Xl1g4YG2GGhwRfegAAAABJRU5ErkJggg==)
|
||||
0 17,
|
||||
default;
|
||||
}
|
||||
.confirm-btn {
|
||||
width: 30%;
|
||||
}
|
||||
</style>
|
||||
@@ -6,7 +6,6 @@ import 'element-ui/lib/theme-chalk/index.css'
|
||||
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
|
||||
import mavonEditor from 'mavon-editor'
|
||||
import 'mavon-editor/dist/css/index.css'
|
||||
|
||||
import '@/styles/index.scss' // global css
|
||||
|
||||
import App from './App'
|
||||
@@ -16,11 +15,17 @@ import store from './store'
|
||||
|
||||
import '@/icons' // icon
|
||||
import './router/index' // permission control
|
||||
import Router from 'vue-router'
|
||||
|
||||
Vue.use(mavonEditor)
|
||||
Vue.use(permission)
|
||||
Vue.use(ElementUI, { locale })
|
||||
Vue.config.productionTip = false
|
||||
|
||||
const routerPush = Router.prototype.push
|
||||
Router.prototype.push = function push(location) {
|
||||
return routerPush.call(this, location).catch(error => error)
|
||||
}
|
||||
require('babel-polyfill')
|
||||
|
||||
new Vue({
|
||||
|
||||
@@ -147,3 +147,15 @@ export function removeClass(ele, cls) {
|
||||
ele.className = ele.className.replace(reg, ' ')
|
||||
}
|
||||
}
|
||||
|
||||
export function downloadFile(obj, name, suffix) {
|
||||
const url = window.URL.createObjectURL(new Blob([obj]))
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = url
|
||||
const fileName = parseTime(new Date()) + '-' + name + '.' + suffix
|
||||
link.setAttribute('download', fileName)
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import Config from '@/config'
|
||||
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.BASE_API, // api 的 base_url
|
||||
baseURL: process.env.NODE_ENV === 'production' ? process.env.BASE_API : '/', // api 的 base_url
|
||||
timeout: Config.timeout // 请求超时时间
|
||||
})
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import { mapGetters } from 'vuex'
|
||||
import E from 'wangeditor'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Editor',
|
||||
data() {
|
||||
return {
|
||||
headers: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<svg-icon icon-class="visits" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">Daily Pv</div>
|
||||
<div class="card-panel-text">日流量</div>
|
||||
<count-to :start-val="0" :end-val="count.newVisits" :duration="2600" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
<svg-icon icon-class="ipvisits" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">Daily Ip</div>
|
||||
<div class="card-panel-text">日IP量</div>
|
||||
<count-to :start-val="0" :end-val="count.newIp" :duration="3000" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
<svg-icon icon-class="visits" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">Weekly Pv</div>
|
||||
<div class="card-panel-text">周流量</div>
|
||||
<count-to :start-val="0" :end-val="count.recentVisits" :duration="3200" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,7 +39,7 @@
|
||||
<svg-icon icon-class="ipvisits" class-name="card-panel-icon" />
|
||||
</div>
|
||||
<div class="card-panel-description">
|
||||
<div class="card-panel-text">Weekly Ip</div>
|
||||
<div class="card-panel-text">周IP量</div>
|
||||
<count-to :start-val="0" :end-val="count.recentIp" :duration="3600" class="card-panel-num"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
<script>
|
||||
import errGif from '@/assets/401_images/401.gif'
|
||||
|
||||
export default {
|
||||
name: 'Page401',
|
||||
data() {
|
||||
|
||||
@@ -1,45 +1,72 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" size="mini" @click="toGen">生成代码</el-button>
|
||||
<el-dialog :visible.sync="dialog" title="代码生成配置" append-to-body width="800px">
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="columnName" label="字段名称"/>
|
||||
<el-table-column prop="columnType" label="字段类型"/>
|
||||
<el-table-column prop="columnComment" label="字段标题">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data[scope.$index].columnComment" class="edit-input"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="data[scope.$index].columnQuery" class="edit-input" clearable placeholder="请选择">
|
||||
<el-option
|
||||
label="模糊查询"
|
||||
value="1"/>
|
||||
<el-option
|
||||
label="精确查询"
|
||||
value="2"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="columnShow" label="列表显示">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="scope.row.columnShow === 'true' ?'显示':'不显示'" placement="top">
|
||||
<el-switch
|
||||
v-model="data[scope.$index].columnShow"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="true"
|
||||
inactive-value="false"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" title="代码生成配置" append-to-body width="850px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="form.moduleName"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="至于包下" prop="pack">
|
||||
<el-input v-model="form.pack"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端路径" prop="path">
|
||||
<el-input v-model="form.path"/>
|
||||
</el-form-item>
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;margin-bottom: 15px">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="columnName" label="字段名称"/>
|
||||
<el-table-column prop="columnType" label="字段类型"/>
|
||||
<el-table-column prop="columnComment" label="字段标题">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data[scope.$index].columnComment" class="edit-input"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="data[scope.$index].columnQuery" class="edit-input" clearable placeholder="请选择">
|
||||
<el-option
|
||||
label="模糊查询"
|
||||
value="1"/>
|
||||
<el-option
|
||||
label="精确查询"
|
||||
value="2"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="columnShow" label="列表显示">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="scope.row.columnShow === 'true' ?'显示':'不显示'" placement="top">
|
||||
<el-switch
|
||||
v-model="data[scope.$index].columnShow"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="true"
|
||||
inactive-value="false"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item label="作者名称" prop="author">
|
||||
<el-input v-model="form.author"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="去表前缀" prop="prefix">
|
||||
<el-input v-model="form.prefix" placeholder="默认不去除表前缀"/>
|
||||
</el-form-item>
|
||||
<!-- 可自定义显示配置 -->
|
||||
<!-- <el-form-item label="Api路径">-->
|
||||
<!-- <el-input v-model="form.apiPath"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否覆盖" prop="cover">
|
||||
<el-radio-group v-model="form.cover" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="genLoading" type="primary" @click="doSubmit">生成</el-button>
|
||||
@@ -50,6 +77,7 @@
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
import { update, get } from '@/api/genConfig'
|
||||
import { generator } from '@/api/generator'
|
||||
export default {
|
||||
name: 'Generator',
|
||||
@@ -62,7 +90,25 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
genLoading: false, dialog: false, columnQuery: ''
|
||||
genLoading: false, dialog: false, columnQuery: '',
|
||||
form: { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' },
|
||||
rules: {
|
||||
author: [
|
||||
{ required: true, message: '作者不能为空', trigger: 'blur' }
|
||||
],
|
||||
pack: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
moduleName: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '前端代码生成路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
cover: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -71,6 +117,10 @@ export default {
|
||||
this.time = 130
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
get().then(data => {
|
||||
this.form = data
|
||||
this.form.cover = this.form.cover.toString()
|
||||
})
|
||||
})
|
||||
},
|
||||
beforeInit() {
|
||||
@@ -81,21 +131,33 @@ export default {
|
||||
},
|
||||
cancel() {
|
||||
this.dialog = false
|
||||
this.genLoading = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' }
|
||||
},
|
||||
doSubmit() {
|
||||
this.genLoading = true
|
||||
generator(this.data, this.name).then(res => {
|
||||
this.$notify({
|
||||
title: '生成成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.dialog = false
|
||||
this.genLoading = false
|
||||
}).catch(err => {
|
||||
this.dialog = false
|
||||
this.genLoading = false
|
||||
console.log(err.response.data.message)
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
update(this.form).then(res => {
|
||||
generator(this.data, this.name).then(res => {
|
||||
this.$notify({
|
||||
title: '生成成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.cancel()
|
||||
}).catch(err => {
|
||||
this.cancel()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}).catch(err => {
|
||||
this.cancel()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -109,3 +171,12 @@ export default {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-dialog__body{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/deep/ .input-with-select .el-input-group__prepend {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,47 +4,7 @@
|
||||
<div class="head-container">
|
||||
<el-input v-model="query.name" clearable placeholder="请输入表名" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-setting"
|
||||
@click="openConfig">生成器配置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--生成器配置-->
|
||||
<el-dialog :visible.sync="dialog" title="生成器配置" append-to-body width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="78px">
|
||||
<el-form-item label="作者名称" prop="author">
|
||||
<el-input v-model="form.author" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="去表前缀" prop="prefix">
|
||||
<el-input v-model="form.prefix" placeholder="默认不去除表前缀" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="form.moduleName" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="至于包下" prop="pack">
|
||||
<el-input v-model="form.pack" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端路径" prop="path">
|
||||
<el-input v-model="form.path" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="API路径" prop="apiPath">
|
||||
<el-input v-model="form.apiPath" style="width: 420px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否覆盖" prop="cover">
|
||||
<el-radio v-model="form.cover" label="true">是</el-radio>
|
||||
<el-radio v-model="form.cover" label="false">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column label="序号" width="85" align="center">
|
||||
@@ -61,7 +21,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="140px" align="center">
|
||||
<el-table-column label="操作" width="140px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<Generator :name="scope.row.tableName"/>
|
||||
</template>
|
||||
@@ -79,11 +39,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get, update } from '@/api/genConfig'
|
||||
import initData from '@/mixins/initData'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import Generator from './generator'
|
||||
export default {
|
||||
name: 'GeneratorIndex',
|
||||
components: { Generator },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -127,13 +87,6 @@ export default {
|
||||
if (name) { this.params['name'] = name }
|
||||
return true
|
||||
},
|
||||
openConfig() {
|
||||
get().then(data => {
|
||||
this.form = data
|
||||
this.form.cover = this.form.cover.toString()
|
||||
})
|
||||
this.dialog = true
|
||||
},
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
@@ -146,25 +99,6 @@ export default {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
doUpdate() {
|
||||
update(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '更新成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="username" label="用户名"/>
|
||||
<el-table-column prop="requestIp" label="IP"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源"/>
|
||||
<el-table-column prop="description" label="描述"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="method" label="方法名称"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="params" label="参数"/>
|
||||
@@ -41,6 +42,7 @@ import { parseTime } from '@/utils/index'
|
||||
import { getErrDetail } from '@/api/log'
|
||||
import Search from './search'
|
||||
export default {
|
||||
name: 'ErrorLog',
|
||||
components: { Search },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -59,10 +61,9 @@ export default {
|
||||
this.url = 'api/logs/error'
|
||||
const sort = 'id,desc'
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (type && value) { this.params[type] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
return true
|
||||
},
|
||||
info(id) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="username" label="用户名"/>
|
||||
<el-table-column prop="requestIp" label="IP"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源"/>
|
||||
<el-table-column prop="description" label="描述"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="method" label="方法名称"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="params" label="参数"/>
|
||||
@@ -37,6 +38,7 @@ import initData from '@/mixins/initData'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import Search from './search'
|
||||
export default {
|
||||
name: 'Log',
|
||||
components: { Search },
|
||||
mixins: [initData],
|
||||
created() {
|
||||
@@ -50,10 +52,9 @@ export default {
|
||||
this.url = 'api/logs'
|
||||
const sort = 'id,desc'
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (type && value) { this.params[type] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div class="head-container">
|
||||
<el-input v-model="query.value" clearable placeholder="请输入搜索内容" style="width: 150px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
</el-select>
|
||||
<el-input v-model="query.value" clearable placeholder="请输入你要搜索的内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="$parent.toQuery">搜索</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,14 +12,6 @@ export default {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
queryTypeOptions: [
|
||||
{ key: 'username', display_name: '用户名' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','REDIS_ALL','REDIS_EDIT','REDIS_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','REDIS_ALL','REDIS_EDIT','REDIS_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
v-permission="['ADMIN','REDIS_ALL','REDIS_DELETE']"
|
||||
@@ -58,6 +58,7 @@ import checkPermission from '@/utils/permission' // 权限判断函数
|
||||
import initData from '@/mixins/initData'
|
||||
import { del, delAll } from '@/api/redis'
|
||||
export default {
|
||||
name: 'Redis',
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import elFrame from '@/components/iframe/index'
|
||||
export default {
|
||||
name: 'Sql',
|
||||
components: { elFrame },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template >
|
||||
<div style="padding:30px;">
|
||||
<el-alert :closable="false" title="三级菜单1" type="success">
|
||||
<router-view />
|
||||
</el-alert>
|
||||
<el-alert :closable="false" title="三级菜单1" type="success"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div style="padding:30px;">
|
||||
<el-alert :closable="false" title="三级菜单2" type="success">
|
||||
<router-view />
|
||||
</el-alert>
|
||||
<el-alert :closable="false" title="三级菜单2" type="success"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :visible.sync="dialog" :title="isAdd ? '新增部门' : '编辑部门'" width="500px">
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增部门' : '编辑部门'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DEPT_ALL','DEPT_EDIT','DEPT_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DEPT_ALL','DEPT_EDIT','DEPT_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','DEPT_ALL','DEPT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -73,6 +73,7 @@ import { del } from '@/api/dept'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'Dept',
|
||||
components: { eForm, treeTable },
|
||||
mixins: [initData, initDict],
|
||||
data() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :visible.sync="dialog" :title="isAdd ? '新增字典' : '编辑字典'" width="500px">
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增字典' : '编辑字典'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="10">
|
||||
<el-col :xs="24" :sm="24" :md="10" :lg="10" :xl="10" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>字典列表</span>
|
||||
@@ -19,17 +19,14 @@
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
</el-select>
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称或者描述搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" highlight-current-row style="width: 100%;" @current-change="handleCurrentChange">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="name" label="名称"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="remark" label="描述"/>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DICT_ALL','DICT_EDIT','DICT_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DICT_ALL','DICT_EDIT','DICT_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -84,6 +81,7 @@ import { del } from '@/api/dict'
|
||||
import dictDetail from '../dictDetail/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'Dict',
|
||||
components: { dictDetail, eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -107,9 +105,8 @@ export default {
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.data = []
|
||||
this.$refs.dictDetail.dictName = ''
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :visible.sync="dialog" :title="isAdd ? '新增字典详情' : '编辑字典详情'" width="500px">
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增字典详情' : '编辑字典详情'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="字典标签" prop="label">
|
||||
<el-input v-model="form.label" style="width: 370px;"/>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<el-table-column prop="label" label="字典标签"/>
|
||||
<el-table-column prop="value" label="字典值"/>
|
||||
<el-table-column prop="sort" label="排序"/>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DICT_ALL','DICT_EDIT','DICT_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','DICT_ALL','DICT_EDIT','DICT_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :visible.sync="dialog" :title="isAdd ? '新增岗位' : '编辑岗位'" width="500px">
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增岗位' : '编辑岗位'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','USERJOB_ALL','USERJOB_EDIT','USERJOB_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','USERJOB_ALL','USERJOB_EDIT','USERJOB_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','USERJOB_ALL','USERJOB_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -82,6 +82,7 @@ import { del } from '@/api/job'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'Job',
|
||||
components: { eForm },
|
||||
mixins: [initData, initDict],
|
||||
data() {
|
||||
|
||||
@@ -1,37 +1,54 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialog" :title="isAdd ? '新增菜单' : '编辑菜单'" append-to-body width="600px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增菜单' : '编辑菜单'" append-to-body width="585px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="菜单图标">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="460"
|
||||
width="450"
|
||||
trigger="click"
|
||||
@show="$refs['iconSelect'].reset()">
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
<el-input slot="reference" v-model="form.icon" style="width: 460px;" placeholder="点击选择图标" readonly>
|
||||
<el-input slot="reference" v-model="form.icon" style="width: 450px;" placeholder="点击选择图标" readonly>
|
||||
<svg-icon v-if="form.icon" slot="prefix" :icon-class="form.icon" class="el-input__icon" style="height: 32px;width: 16px;" />
|
||||
<i v-else slot="prefix" class="el-icon-search el-input__icon"/>
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="名称" style="width: 460px;"/>
|
||||
<el-input v-model="form.name" placeholder="名称" style="width: 450px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内部菜单">
|
||||
<el-radio-group v-model="form.iframe" size="mini">
|
||||
<el-radio-button label="false">是</el-radio-button>
|
||||
<el-radio-button label="true">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否缓存">
|
||||
<el-radio-group v-model="form.cache" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否隐藏">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序" prop="sort">
|
||||
<el-input-number v-model.number="form.sort" :min="0" :max="999" controls-position="right" style="width: 460px;"/>
|
||||
<el-input-number v-model.number="form.sort" :min="0" :max="999" controls-position="right" style="width: 177px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内部菜单" prop="iframe">
|
||||
<el-radio v-model="form.iframe" label="false">是</el-radio>
|
||||
<el-radio v-model="form.iframe" label="true" >否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接地址">
|
||||
<el-input v-model="form.path" placeholder="菜单路径" style="width: 460px;"/>
|
||||
<el-form-item label="链接地址" prop="path">
|
||||
<el-input v-model="form.path" placeholder="链接地址" style="width: 177px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.iframe === 'false'" label="组件路径">
|
||||
<el-input v-model="form.component" placeholder="菜单路径" style="width: 460px;"/>
|
||||
<el-input v-model="form.component" placeholder="菜单路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.iframe === 'false'" label="组件名称">
|
||||
<el-input v-model="form.componentName" placeholder="匹配组件内Name字段"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级类目">
|
||||
<treeselect v-model="form.pid" :options="menus" style="width: 460px;" placeholder="选择上级类目" />
|
||||
<treeselect v-model="form.pid" :options="menus" style="width: 450px;" placeholder="选择上级类目" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -57,7 +74,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false, menus: [],
|
||||
form: { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' },
|
||||
form: { name: '', sort: 999, path: '', component: '', componentName: '', iframe: 'false', roles: [], pid: 0, icon: '', cache: false, hidden: false },
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
@@ -65,8 +82,8 @@ export default {
|
||||
sort: [
|
||||
{ required: true, message: '请输入序号', trigger: 'blur', type: 'number' }
|
||||
],
|
||||
iframe: [
|
||||
{ required: true, message: '请选择菜单类型', trigger: 'blur' }
|
||||
path: [
|
||||
{ required: true, message: '请输入地址', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -120,7 +137,7 @@ export default {
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { name: '', sort: 999, path: '', component: '', iframe: 'false', roles: [], pid: 0, icon: '' }
|
||||
this.form = { name: '', sort: 999, path: '', component: '', componentName: '', iframe: 'false', roles: [], pid: 0, icon: '', cache: false, hidden: false }
|
||||
},
|
||||
selected(name) {
|
||||
this.form.icon = name
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-input v-model="query.value" clearable placeholder="模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['ADMIN','MENU_ALL','MENU_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||
@@ -27,31 +27,44 @@
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--表格渲染-->
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="expand" :columns="columns" size="small">
|
||||
<el-table-column prop="icon" label="图标" align="center" width="80px">
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="expand" :columns="columns" :height="height" size="small">
|
||||
<el-table-column prop="icon" label="图标" align="center" width="60px">
|
||||
<template slot-scope="scope">
|
||||
<svg-icon :icon-class="scope.row.icon" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" align="center" width="100px" label="排序">
|
||||
<el-table-column prop="sort" align="center" label="排序">
|
||||
<template slot-scope="scope">
|
||||
<el-tag>{{ scope.row.sort }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="path" label="链接地址"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="component" label="组件路径"/>
|
||||
<el-table-column prop="iframe" width="100px" label="内部菜单">
|
||||
<el-table-column :show-overflow-tooltip="true" prop="componentName" label="组件名称"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="component" label="组件路径" width="130px"/>
|
||||
<el-table-column prop="iframe" label="内部菜单">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.iframe">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
<el-table-column prop="iframe" label="是否缓存">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.cache">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="iframe" label="是否隐藏">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.hidden">是</span>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建日期" width="135px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT','MENU_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','MENU_ALL','MENU_EDIT','MENU_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','MENU_ALL','MENU_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -80,6 +93,7 @@ import { del } from '@/api/menu'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'Menu',
|
||||
components: { treeTable, eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -87,14 +101,16 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
text: '名称',
|
||||
value: 'name'
|
||||
value: 'name',
|
||||
width: 140
|
||||
}
|
||||
],
|
||||
delLoading: false, expand: true
|
||||
delLoading: false, expand: true, height: 625
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.height = document.documentElement.clientHeight - 200
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
@@ -107,7 +123,7 @@ export default {
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (value) { this.params['name'] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
@@ -136,7 +152,7 @@ export default {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.getMenus()
|
||||
_this.form = { id: data.id, component: data.component, name: data.name, sort: data.sort, pid: data.pid, path: data.path, iframe: data.iframe.toString(), roles: [], icon: data.icon }
|
||||
_this.form = { id: data.id, component: data.component, componentName: data.componentName, name: data.name, sort: data.sort, pid: data.pid, path: data.path, iframe: data.iframe.toString(), roles: [], icon: data.icon, cache: data.cache, hidden: data.hidden }
|
||||
_this.dialog = true
|
||||
},
|
||||
changExpand() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialog" :title="isAdd ? '新增权限' : '编辑权限'" append-to-body width="500px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增权限' : '编辑权限'" append-to-body width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 360px;"/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称或者别名搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_CREATE']" style="display: inline-block;margin: 0px 2px 0px">
|
||||
@@ -27,13 +27,13 @@
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--表格渲染-->
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="expand" :columns="columns" size="small">
|
||||
<tree-table v-loading="loading" :data="data" :expand-all="expand" :height="height" :columns="columns" size="small">
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_EDIT','PERMISSION_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','PERMISSION_ALL','PERMISSION_EDIT','PERMISSION_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -62,6 +62,7 @@ import { del } from '@/api/permission'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'Permission',
|
||||
components: { treeTable, eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -76,11 +77,12 @@ export default {
|
||||
value: 'alias'
|
||||
}
|
||||
],
|
||||
delLoading: false, expand: true
|
||||
delLoading: false, expand: true, height: 625
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.height = document.documentElement.clientHeight - 200
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
@@ -93,7 +95,7 @@ export default {
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (value) { this.params['name'] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialog" :title="isAdd ? '新增角色' : '编辑角色'" append-to-body width="500px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增角色' : '编辑角色'" append-to-body width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="角色名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称或者描述搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['ADMIN','ROLES_ALL','ROLES_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
<el-row :gutter="15">
|
||||
<!--角色管理-->
|
||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="17">
|
||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="17" style="margin-bottom: 10px">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">角色列表</span>
|
||||
@@ -40,7 +40,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','ROLES_ALL','ROLES_EDIT','ROLES_DELETE'])" label="操作" width="130px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','ROLES_ALL','ROLES_EDIT','ROLES_DELETE'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','ROLES_ALL','ROLES_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -133,6 +133,7 @@ import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
import { editPermission, editMenu, get } from '@/api/role'
|
||||
export default {
|
||||
name: 'Role',
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
@@ -156,15 +157,16 @@ export default {
|
||||
parseTime,
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.$refs.permission.setCheckedKeys([])
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
this.showButton = false
|
||||
this.url = 'api/roles'
|
||||
const sort = 'level,asc'
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (value) { this.params['name'] = value }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
// 清空权限与菜单的选中
|
||||
this.$refs.permission.setCheckedKeys([])
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
@@ -311,3 +313,9 @@ export default {
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-tree-node__label{
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--Form表单-->
|
||||
<el-dialog :visible.sync="dialog" :title="isAdd ? '新增任务' : '编辑任务'" append-to-body width="600px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增任务' : '编辑任务'" append-to-body width="600px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
|
||||
<el-form-item label="任务名称" prop="jobName">
|
||||
<el-input v-model="form.jobName" style="width: 460px;"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','JOB_ALL','JOB_EDIT','JOB_DELETE'])" label="操作" width="180px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','JOB_ALL','JOB_EDIT','JOB_DELETE'])" label="操作" width="180px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" size="mini" style="margin-right: 3px;" type="text" @click="edit(scope.row)">编辑</el-button>
|
||||
<el-button v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" style="margin-left: -2px" type="text" size="mini" @click="execute(scope.row.id)">执行</el-button>
|
||||
@@ -114,6 +114,7 @@ import { del, updateIsPause, execution, add, edit } from '@/api/timing'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import Log from './log'
|
||||
export default {
|
||||
name: 'Timing',
|
||||
components: { Log },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :xs="24" :sm="24" :md="8" :lg="6" :xl="5">
|
||||
<el-col :xs="24" :sm="24" :md="8" :lg="6" :xl="5" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>个人信息</span>
|
||||
@@ -15,8 +15,7 @@
|
||||
:headers="headers"
|
||||
:action="updateAvatarApi"
|
||||
class="avatar-uploader">
|
||||
<img v-if="user.avatar" :src="user.avatar" title="点击上传头像" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"/>
|
||||
<img :src="user.avatar ? baseApi + '/avatar/' + user.avatar : Avatar" title="点击上传头像" class="avatar">
|
||||
</el-upload>
|
||||
</div>
|
||||
<ul class="user-info">
|
||||
@@ -46,6 +45,7 @@
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="description" label="行为"/>
|
||||
<el-table-column prop="requestIp" label="IP"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源"/>
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
@@ -85,12 +85,14 @@ import { getToken } from '@/utils/auth'
|
||||
import store from '@/store'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import initData from '@/mixins/initData'
|
||||
import Avatar from '@/assets/avatar/avatar.png'
|
||||
export default {
|
||||
name: 'Center',
|
||||
components: { updatePass, updateEmail },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
Avatar: Avatar,
|
||||
ico: 'el-icon-refresh',
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
@@ -100,7 +102,8 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'user',
|
||||
'updateAvatarApi'
|
||||
'updateAvatarApi',
|
||||
'baseApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="display: inline-block;">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :title="title" append-to-body width="475px" @close="cancel">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="title" append-to-body width="475px" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||
<el-form-item label="新邮箱" prop="email">
|
||||
<el-input v-model="form.email" auto-complete="on" style="width: 200px;"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div style="display: inline-block">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :title="title" append-to-body width="500px" @close="cancel">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="title" append-to-body width="500px" @close="cancel">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||
<el-form-item label="旧密码" prop="oldPass">
|
||||
<el-input v-model="form.oldPass" type="password" auto-complete="on" style="width: 370px;"/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialog" :title="isAdd ? '新增用户' : '编辑用户'" append-to-body width="570px">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增用户' : '编辑用户'" append-to-body width="570px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="66px">
|
||||
<el-form-item label="用户名" prop="username">
|
||||
<el-input v-model="form.username"/>
|
||||
@@ -14,10 +14,10 @@
|
||||
<el-input v-model="form.email" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门">
|
||||
<treeselect v-model="deptId" :options="depts" :style="style" placeholder="选择部门" @select="selectFun" />
|
||||
<treeselect v-model="deptId" :options="depts" style="width: 178px" placeholder="选择部门" @select="selectFun" />
|
||||
</el-form-item>
|
||||
<el-form-item label="岗位">
|
||||
<el-select v-model="jobId" :style="style" placeholder="请先选择部门">
|
||||
<el-select v-model="jobId" style="width: 178px" placeholder="请先选择部门">
|
||||
<el-option
|
||||
v-for="(item, index) in jobs"
|
||||
:key="item.name + index"
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
}
|
||||
return {
|
||||
dialog: false, loading: false, form: { username: '', email: '', enabled: 'false', roles: [], job: { id: '' }, dept: { id: '' }, phone: null },
|
||||
roleIds: [], roles: [], depts: [], deptId: null, jobId: null, jobs: [], style: 'width: 184px', level: 3,
|
||||
roleIds: [], roles: [], depts: [], deptId: null, jobId: null, jobs: [], level: 3,
|
||||
rules: {
|
||||
username: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' },
|
||||
@@ -94,14 +94,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const explorer = navigator.userAgent
|
||||
if (explorer.indexOf('Chrome') >= 0) {
|
||||
this.style = 'width: 184px'
|
||||
} else {
|
||||
this.style = 'width: 172px'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
|
||||
@@ -4,21 +4,18 @@
|
||||
<eForm ref="form" :is-add="isAdd" :dicts="dicts"/>
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<el-col :xs="7" :sm="6" :md="4" :lg="4" :xl="4">
|
||||
<el-col :xs="9" :sm="6" :md="4" :lg="4" :xl="4">
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" clearable placeholder="输入部门名称搜索" prefix-icon="el-icon-search" style="width: 100%;" class="filter-item" @input="getDeptDatas"/>
|
||||
</div>
|
||||
<el-tree :data="depts" :props="defaultProps" :expand-on-click-node="false" default-expand-all @node-click="handleNodeClick"/>
|
||||
</el-col>
|
||||
<!--用户数据-->
|
||||
<el-col :xs="17" :sm="18" :md="20" :lg="20" :xl="20">
|
||||
<el-col :xs="15" :sm="18" :md="20" :lg="20" :xl="20">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入关键字搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
</el-select>
|
||||
<el-input v-model="query.blurry" clearable placeholder="输入名称或者邮箱搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-select v-model="query.enabled" clearable placeholder="状态" class="filter-item" style="width: 90px" @change="toQuery">
|
||||
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
</el-select>
|
||||
@@ -35,7 +32,7 @@
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
v-permission="['ADMIN']"
|
||||
v-permission="['ADMIN','USER_ALL','USER_SELECT']"
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
@@ -66,7 +63,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','USER_ALL','USER_EDIT','USER_DELETE'])" label="操作" width="125" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','USER_ALL','USER_EDIT','USER_DELETE'])" label="操作" width="125" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['ADMIN','USER_ALL','USER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
@@ -101,11 +98,12 @@
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import initDict from '@/mixins/initDict'
|
||||
import { del } from '@/api/user'
|
||||
import { del, downloadUser } from '@/api/user'
|
||||
import { getDepts } from '@/api/dept'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import { parseTime, downloadFile } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
name: 'User',
|
||||
components: { eForm },
|
||||
mixins: [initData, initDict],
|
||||
data() {
|
||||
@@ -117,10 +115,6 @@ export default {
|
||||
label: 'name'
|
||||
},
|
||||
downloadLoading: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'username', display_name: '用户名' },
|
||||
{ key: 'email', display_name: '邮箱' }
|
||||
],
|
||||
enabledTypeOptions: [
|
||||
{ key: 'true', display_name: '激活' },
|
||||
{ key: 'false', display_name: '锁定' }
|
||||
@@ -148,11 +142,10 @@ export default {
|
||||
this.url = 'api/users'
|
||||
const sort = 'id,desc'
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
const blurry = query.blurry
|
||||
const enabled = query.enabled
|
||||
this.params = { page: this.page, size: this.size, sort: sort, deptId: this.deptId }
|
||||
if (type && value) { this.params[type] = value }
|
||||
if (blurry) { this.params['blurry'] = blurry }
|
||||
if (enabled !== '' && enabled !== null) { this.params['enabled'] = enabled }
|
||||
return true
|
||||
},
|
||||
@@ -200,15 +193,10 @@ export default {
|
||||
// 导出
|
||||
download() {
|
||||
this.downloadLoading = true
|
||||
import('@/utils/export2Excel').then(excel => {
|
||||
const tHeader = ['ID', '用户名', '邮箱', '头像地址', '状态', '注册日期', '最后修改密码日期']
|
||||
const filterVal = ['id', 'username', 'email', 'avatar', 'enabled', 'createTime', 'lastPasswordResetTime']
|
||||
const data = this.formatJson(filterVal, this.data)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: 'table-list'
|
||||
})
|
||||
downloadUser().then(result => {
|
||||
downloadFile(result, '用户列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
@@ -35,6 +35,7 @@ import Config from './config'
|
||||
import ToPay from './toPay'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
name: 'AliPay',
|
||||
components: { Config, ToPay },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -28,6 +28,7 @@ import Config from './config'
|
||||
import Send from './send'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
name: 'Email',
|
||||
components: { Config, Send },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--上传图片-->
|
||||
<el-dialog :visible.sync="dialog" append-to-body width="600px" @close="doSubmit">
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" append-to-body width="600px" @close="doSubmit">
|
||||
<el-upload
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-remove="handleBeforeRemove"
|
||||
@@ -64,7 +64,7 @@
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['ADMIN','PICTURE_ALL','PICTURE_DELETE'])" label="操作" width="100px" align="center">
|
||||
<el-table-column v-if="checkPermission(['ADMIN','PICTURE_ALL','PICTURE_DELETE'])" label="操作" width="100px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
@@ -99,6 +99,7 @@ import { mapGetters } from 'vuex'
|
||||
import { del, delAll } from '@/api/picture'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Pictures',
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 8px;">
|
||||
<el-tabs v-model="activeName" style="padding-left: 8px;" @tab-click="tabClick">
|
||||
<el-tab-pane label="本地存储" name="first">
|
||||
<Local/>
|
||||
<Local ref="local"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="七牛云存储" name="second">
|
||||
<QiNiu/>
|
||||
<QiNiu ref="qiNiu"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QiNiu from './qiniu/list'
|
||||
import QiNiu from './qiniu/index'
|
||||
import Local from './local/index'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
@@ -20,6 +20,15 @@ export default {
|
||||
return {
|
||||
activeName: 'first'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabClick(name) {
|
||||
if (this.activeName === 'first') {
|
||||
this.$refs.local.init()
|
||||
} else {
|
||||
this.$refs.qiNiu.init()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:action="fileUploadApi + '?name=' + form.name">
|
||||
<div class="eladmin-upload"><i class="el-icon-upload"/> 点击上传</div>
|
||||
<div class="eladmin-upload"><i class="el-icon-upload"/> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
@@ -15,18 +15,30 @@
|
||||
icon="el-icon-upload"
|
||||
@click="add">文件上传</el-button>
|
||||
</div>
|
||||
<!-- 多选删除 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
:loading="delAllLoading"
|
||||
:disabled="data.length === 0 || $refs.table.selection.length === 0"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="open">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table v-loading="loading" ref="table" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="name" label="文件名">
|
||||
<template slot-scope="scope">
|
||||
<el-link :href="baseApi + '/file/' + scope.row.type + '/' + scope.row.realName" target="_blank" type="primary">{{ scope.row.name }}</el-link>
|
||||
<el-link :underline="false" :href="baseApi + '/file/' + scope.row.type + '/' + scope.row.realName" target="_blank" type="primary">{{ scope.row.name }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="suffix" label="后缀"/>
|
||||
<el-table-column prop="type" label="类型"/>
|
||||
<el-table-column prop="suffix" label="文件类型"/>
|
||||
<el-table-column prop="type" label="类别"/>
|
||||
<el-table-column prop="size" label="大小"/>
|
||||
<el-table-column prop="operate" label="操作人"/>
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
@@ -72,7 +84,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del } from '@/api/localStorage'
|
||||
import { del, delAll } from '@/api/localStorage'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
@@ -80,7 +92,7 @@ export default {
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
delLoading: false, delAllLoading: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '文件名' },
|
||||
{ key: 'suffix', display_name: '后缀' },
|
||||
@@ -141,6 +153,36 @@ export default {
|
||||
name: data.name
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
doDelete() {
|
||||
this.delAllLoading = true
|
||||
const data = this.$refs.table.selection
|
||||
const ids = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id)
|
||||
}
|
||||
delAll(ids).then(res => {
|
||||
this.delAllLoading = false
|
||||
this.dleChangePage(ids.length)
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.$confirm('你确定删除选中的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doDelete()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-delete"
|
||||
icon="el-icon-s-tools"
|
||||
@click="doConfig">七牛配置</el-button>
|
||||
</div>
|
||||
<!-- 多选删除 -->
|
||||
@@ -56,14 +56,10 @@
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="文件名">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.key }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" label="文件类型">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getExtensionName(scope.row.key) }}</span>
|
||||
<a href="JavaScript:;" class="el-link el-link--primary" target="_blank" type="primary" @click="download(scope.row.id)">{{ scope.row.key }}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="suffix" label="文件类型"/>
|
||||
<el-table-column prop="bucket" label="空间名称"/>
|
||||
<el-table-column prop="size" label="文件大小"/>
|
||||
<el-table-column prop="type" label="空间类型"/>
|
||||
@@ -72,14 +68,8 @@
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="130px" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="100px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="download(scope.row.id)"/>
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
@@ -103,7 +93,8 @@
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</div></template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
@@ -139,11 +130,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
beforeInit() {
|
||||
@@ -189,13 +175,6 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
getExtensionName(name) {
|
||||
const dot = name.lastIndexOf('.')
|
||||
if ((dot > -1) && (dot < (name.length - 1))) {
|
||||
return name.substring(dot + 1)
|
||||
}
|
||||
return name
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const uid = file.uid
|
||||
const id = response.id
|
||||
@@ -5,6 +5,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import elFrame from '@/components/iframe/index'
|
||||
export default {
|
||||
name: 'Swagger',
|
||||
components: { elFrame },
|
||||
computed: {
|
||||
...mapGetters([
|
||||
|
||||
Reference in New Issue
Block a user