代码改造完成,加入多字典查询方式
This commit is contained in:
@@ -13,6 +13,19 @@ export function get(dictName) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDictMap(dictName) {
|
||||||
|
const params = {
|
||||||
|
dictName,
|
||||||
|
page: 0,
|
||||||
|
size: 9999
|
||||||
|
}
|
||||||
|
return request({
|
||||||
|
url: 'api/dictDetail/map',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dictDetail',
|
url: 'api/dictDetail',
|
||||||
|
|||||||
@@ -23,17 +23,6 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validPass(password) {
|
|
||||||
const data = {
|
|
||||||
password
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
url: 'api/users/validPass/',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updatePass(password) {
|
export function updatePass(password) {
|
||||||
const data = {
|
const data = {
|
||||||
password
|
password
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { initData } from '@/api/data'
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, data: [], page: 0, size: 10, total: 0, url: '', params: {}, query: {}, time: 170
|
loading: true, data: [], page: 0, size: 10, total: 0, url: '', params: {}, query: {}, time: 170, isAdd: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -46,6 +46,10 @@ export default {
|
|||||||
if (this.data.length === size && this.page !== 0) {
|
if (this.data.length === size && this.page !== 0) {
|
||||||
this.page = this.page - 1
|
this.page = this.page - 1
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
toQuery() {
|
||||||
|
this.page = 0
|
||||||
|
this.init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { get } from '@/api/dictDetail'
|
import { get, getDictMap } from '@/api/dictDetail'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dicts: []
|
dicts: [], dictMap: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -16,6 +16,26 @@ export default {
|
|||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 多个字典查询时使用逗号拼接, 如:
|
||||||
|
// 加载多个数据字典,如何调用如下:
|
||||||
|
// this.getDict('user_status,job_status')
|
||||||
|
// 在vue中使用加载出来的字典:
|
||||||
|
// dictMap.[字典名称] 如:dictMap.user_status、 dictMap.job_status
|
||||||
|
async getDictMap(names) {
|
||||||
|
// 优先放入到dictMap中,避免页面加载时 undefined
|
||||||
|
const arr = names.split(',')
|
||||||
|
for (let i = 0; i < arr.length; i++) {
|
||||||
|
this.dictMap[arr[i]] = []
|
||||||
|
}
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
getDictMap(names).then(res => {
|
||||||
|
this.dictMap = res
|
||||||
|
resolve(res)
|
||||||
|
}).catch(err => {
|
||||||
|
reject(err)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" size="mini" @click="to">生成代码</el-button>
|
<el-button type="primary" size="mini" @click="toGen">生成代码</el-button>
|
||||||
<el-dialog :visible.sync="dialog" title="代码生成配置" append-to-body width="800px">
|
<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 v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column label="序号" width="80" align="center">
|
<el-table-column label="序号" width="80" align="center">
|
||||||
@@ -66,7 +66,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
to() {
|
toGen() {
|
||||||
this.dialog = true
|
this.dialog = true
|
||||||
this.time = 130
|
this.time = 130
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -1,20 +1,67 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<!--工具栏-->
|
||||||
|
<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 v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column label="序号" width="80" align="center">
|
<el-table-column label="序号" width="85" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.$index + 1 }}</div>
|
<div>{{ scope.$index + 1 }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :show-overflow-tooltip="true" prop="tableName" label="表名"/>
|
<el-table-column :show-overflow-tooltip="true" prop="tableName" label="表名"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" prop="engine" label="数据库引擎"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" prop="coding" label="字符编码集"/>
|
||||||
|
<el-table-column :show-overflow-tooltip="true" prop="remark" label="备注"/>
|
||||||
<el-table-column prop="createTime" label="创建日期">
|
<el-table-column prop="createTime" label="创建日期">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="160px" align="center">
|
<el-table-column label="操作" width="140px" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<Generator :name="scope.row.tableName"/>
|
<Generator :name="scope.row.tableName"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -32,13 +79,39 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { get, update } from '@/api/genConfig'
|
||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import Generator from './generator'
|
||||||
import Generator from './module/generator'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, Generator },
|
components: { Generator },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false, dialog: false,
|
||||||
|
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' }
|
||||||
|
],
|
||||||
|
apiPath: [
|
||||||
|
{ required: true, message: '前端Api文件生成路径不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
cover: [
|
||||||
|
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.init()
|
this.init()
|
||||||
@@ -53,6 +126,45 @@ export default {
|
|||||||
this.params = { page: this.page, size: this.size }
|
this.params = { page: this.page, size: this.size }
|
||||||
if (name) { this.params['name'] = name }
|
if (name) { this.params['name'] = name }
|
||||||
return true
|
return true
|
||||||
|
},
|
||||||
|
openConfig() {
|
||||||
|
get().then(data => {
|
||||||
|
this.form = data
|
||||||
|
this.form.cover = this.form.cover.toString()
|
||||||
|
})
|
||||||
|
this.dialog = true
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.resetForm()
|
||||||
|
},
|
||||||
|
doSubmit() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.loading = true
|
||||||
|
this.doUpdate()
|
||||||
|
} else {
|
||||||
|
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: '' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { update } from '@/api/genConfig'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false, dialog: false,
|
|
||||||
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' }
|
|
||||||
],
|
|
||||||
apiPath: [
|
|
||||||
{ required: true, message: '前端Api文件生成路径不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
cover: [
|
|
||||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel() {
|
|
||||||
this.resetForm()
|
|
||||||
},
|
|
||||||
doSubmit() {
|
|
||||||
this.$refs['form'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true
|
|
||||||
this.doUpdate()
|
|
||||||
} else {
|
|
||||||
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: '' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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="to">生成器配置</el-button>
|
|
||||||
<eForm ref="form"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { get } from '@/api/genConfig'
|
|
||||||
import eForm from './form'
|
|
||||||
// 查询条件
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
},
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
get().then(data => {
|
|
||||||
_this.form = data
|
|
||||||
_this.form.cover = _this.form.cover.toString()
|
|
||||||
})
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<Search :query="query"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column prop="username" label="用户名"/>
|
<el-table-column prop="username" label="用户名"/>
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import { getErrDetail } from '@/api/log'
|
import { getErrDetail } from '@/api/log'
|
||||||
import eHeader from './module/header'
|
import Search from './search'
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader },
|
components: { Search },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -59,11 +59,10 @@ export default {
|
|||||||
this.url = 'api/logs/error'
|
this.url = 'api/logs/error'
|
||||||
const sort = 'id,desc'
|
const sort = 'id,desc'
|
||||||
const query = this.query
|
const query = this.query
|
||||||
const username = query.username
|
const type = query.type
|
||||||
const logType = query.logType
|
const value = query.value
|
||||||
this.params = { page: this.page, size: this.size, sort: sort }
|
this.params = { page: this.page, size: this.size, sort: sort }
|
||||||
if (username && username) { this.params['username'] = username }
|
if (type && value) { this.params[type] = value }
|
||||||
if (logType !== '' && logType !== null) { this.params['logType'] = logType }
|
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
info(id) {
|
info(id) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<Search :query="query"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column prop="username" label="用户名"/>
|
<el-table-column prop="username" label="用户名"/>
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import Search from './search'
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader },
|
components: { Search },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -50,9 +50,10 @@ export default {
|
|||||||
this.url = 'api/logs'
|
this.url = 'api/logs'
|
||||||
const sort = 'id,desc'
|
const sort = 'id,desc'
|
||||||
const query = this.query
|
const query = this.query
|
||||||
const username = query.username
|
const type = query.type
|
||||||
|
const value = query.value
|
||||||
this.params = { page: this.page, size: this.size, sort: sort }
|
this.params = { page: this.page, size: this.size, sort: sort }
|
||||||
if (username && username) { this.params['username'] = username }
|
if (type && value) { this.params[type] = value }
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<el-input v-model="query.username" 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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
downloadLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
28
src/views/monitor/log/search.vue
Normal file
28
src/views/monitor/log/search.vue
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<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-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="$parent.toQuery">搜索</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
query: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
queryTypeOptions: [
|
||||||
|
{ key: 'username', display_name: '用户名' },
|
||||||
|
{ key: 'description', display_name: '描述' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -61,7 +61,7 @@ export default {
|
|||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delLoading: false, sup_this: this, permissions: [], deleteAllLoading: false
|
delLoading: false, permissions: [], deleteAllLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -101,10 +101,6 @@ export default {
|
|||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toQuery() {
|
|
||||||
this.page = 0
|
|
||||||
this.init()
|
|
||||||
},
|
|
||||||
deleteAll() {
|
deleteAll() {
|
||||||
this.$confirm('你确定要清空缓存数据吗?', '提示', {
|
this.$confirm('你确定要清空缓存数据吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
dicts: {
|
dicts: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
@@ -84,7 +80,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -99,7 +95,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,6 +1,34 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query" :dicts="dicts"/>
|
<!--工具栏-->
|
||||||
|
<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.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>
|
||||||
|
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||||
|
<!-- 新增 -->
|
||||||
|
<div v-permission="['ADMIN','DEPT_ALL','DEPT_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="display: inline-block;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-more"
|
||||||
|
@click="changeExpand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
||||||
|
<eForm ref="form" :is-add="true" :dicts="dicts"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--表单组件-->
|
||||||
|
<eForm ref="form" :is-add="isAdd" :dicts="dicts"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<tree-table v-loading="loading" :expand-all="expand" :data="data" :columns="columns" size="small">
|
<tree-table v-loading="loading" :expand-all="expand" :data="data" :columns="columns" size="small">
|
||||||
<el-table-column label="状态" align="center">
|
<el-table-column label="状态" align="center">
|
||||||
@@ -17,7 +45,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','DEPT_ALL','DEPT_EDIT']" :dicts="dicts" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','DEPT_ALL','DEPT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','DEPT_ALL','DEPT_DELETE']"
|
v-permission="['ADMIN','DEPT_ALL','DEPT_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -43,10 +71,9 @@ import initData from '@/mixins/initData'
|
|||||||
import initDict from '@/mixins/initDict'
|
import initDict from '@/mixins/initDict'
|
||||||
import { del } from '@/api/dept'
|
import { del } from '@/api/dept'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit, treeTable },
|
components: { eForm, treeTable },
|
||||||
mixins: [initData, initDict],
|
mixins: [initData, initDict],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -56,7 +83,11 @@ export default {
|
|||||||
value: 'name'
|
value: 'name'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
delLoading: false, sup_this: this, expand: true
|
enabledTypeOptions: [
|
||||||
|
{ key: 'true', display_name: '正常' },
|
||||||
|
{ key: 'false', display_name: '禁用' }
|
||||||
|
],
|
||||||
|
delLoading: false, expand: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -96,6 +127,29 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.isAdd = true
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.getDepts()
|
||||||
|
_this.dialog = true
|
||||||
|
},
|
||||||
|
changeExpand() {
|
||||||
|
this.expand = !this.expand
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.getDepts()
|
||||||
|
_this.form = {
|
||||||
|
id: data.id,
|
||||||
|
name: data.name,
|
||||||
|
pid: data.pid,
|
||||||
|
createTime: data.createTime,
|
||||||
|
enabled: data.enabled.toString()
|
||||||
|
}
|
||||||
|
_this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false" :dicts="dicts"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dicts: {
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.getDepts()
|
|
||||||
_this.form = {
|
|
||||||
id: this.data.id,
|
|
||||||
name: this.data.name,
|
|
||||||
pid: this.data.pid,
|
|
||||||
createTime: this.data.createTime,
|
|
||||||
enabled: this.data.enabled.toString()
|
|
||||||
}
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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.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>
|
|
||||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
|
||||||
<!-- 新增 -->
|
|
||||||
<div v-permission="['ADMIN','DEPT_ALL','DEPT_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="add">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true" :dicts="dicts"/>
|
|
||||||
</div>
|
|
||||||
<div style="display: inline-block;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-more"
|
|
||||||
@click="expand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
|
||||||
<eForm ref="form" :is-add="true" :dicts="dicts"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dicts: {
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
enabledTypeOptions: [
|
|
||||||
{ key: 'true', display_name: '正常' },
|
|
||||||
{ key: 'false', display_name: '禁用' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.$refs.form.getDepts()
|
|
||||||
this.$refs.form.dialog = true
|
|
||||||
},
|
|
||||||
expand() {
|
|
||||||
this.$parent.expand = !this.$parent.expand
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -22,10 +22,6 @@ export default {
|
|||||||
isAdd: {
|
isAdd: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -66,7 +62,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -81,7 +77,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
|
<!--表单组件-->
|
||||||
|
<eForm ref="form" :is-add="isAdd"/>
|
||||||
<el-row :gutter="10">
|
<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">
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
@@ -12,16 +14,24 @@
|
|||||||
style="float: right;padding: 4px 10px"
|
style="float: right;padding: 4px 10px"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="$refs.header.$refs.form.dialog = true">新增</el-button>
|
@click="$refs.form.dialog = true;isAdd = true">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<!--工具栏-->
|
||||||
|
<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-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
<eHeader ref="header" :query="query" :sup_this="sup_this"/>
|
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" highlight-current-row style="width: 100%;" @current-change="handleCurrentChange">
|
<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="name" label="名称"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" prop="remark" 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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','DICT_ALL','DICT_DELETE']"
|
v-permission="['ADMIN','DICT_ALL','DICT_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -58,7 +68,7 @@
|
|||||||
style="float: right;padding: 4px 10px"
|
style="float: right;padding: 4px 10px"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="$refs.dictDetail.$refs.header.$refs.form.dialog = true">新增</el-button>
|
@click="$refs.dictDetail.$refs.form.dialog = true;$refs.dictDetail.isAdd = true">新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
<dictDetail ref="dictDetail"/>
|
<dictDetail ref="dictDetail"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -71,15 +81,18 @@
|
|||||||
import checkPermission from '@/utils/permission'
|
import checkPermission from '@/utils/permission'
|
||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { del } from '@/api/dict'
|
import { del } from '@/api/dict'
|
||||||
import eHeader from './module/header'
|
|
||||||
import edit from './module/edit'
|
|
||||||
import dictDetail from '../dictDetail/index'
|
import dictDetail from '../dictDetail/index'
|
||||||
|
import eForm from './form'
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit, dictDetail },
|
components: { dictDetail, eForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delLoading: false, sup_this: this
|
delLoading: false,
|
||||||
|
queryTypeOptions: [
|
||||||
|
{ key: 'name', display_name: '字典名称' },
|
||||||
|
{ key: 'remark', display_name: '描述' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -127,6 +140,16 @@ export default {
|
|||||||
this.$refs.dictDetail.dictId = val.id
|
this.$refs.dictDetail.dictId = val.id
|
||||||
this.$refs.dictDetail.init()
|
this.$refs.dictDetail.init()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.form = {
|
||||||
|
id: data.id,
|
||||||
|
name: data.name,
|
||||||
|
remark: data.remark
|
||||||
|
}
|
||||||
|
_this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.form = {
|
|
||||||
id: this.data.id,
|
|
||||||
name: this.data.name,
|
|
||||||
remark: this.data.remark
|
|
||||||
}
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
|
||||||
<div style="display: inline-block;margin: 0px 2px;">
|
|
||||||
<eForm ref="form" :is-add="true" :sup_this="sup_this"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
queryTypeOptions: [
|
|
||||||
{ key: 'name', display_name: '字典名称' },
|
|
||||||
{ key: 'remark', display_name: '描述' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
checkPermission,
|
|
||||||
toQuery() {
|
|
||||||
this.sup_this.page = 0
|
|
||||||
this.sup_this.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -26,10 +26,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
dictId: {
|
dictId: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@@ -78,7 +74,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -93,7 +89,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -4,7 +4,14 @@
|
|||||||
<div class="my-code">点击字典查看详情</div>
|
<div class="my-code">点击字典查看详情</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<eHeader ref="header" :query="query" :dict-id="dictId"/>
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<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>
|
||||||
|
<!--表单组件-->
|
||||||
|
<eForm ref="form" :is-add="isAdd" :dict-id="dictId"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column label="所属字典">
|
<el-table-column label="所属字典">
|
||||||
@@ -17,7 +24,7 @@
|
|||||||
<el-table-column prop="sort" 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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" :dict-id="dictId" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','DICT_ALL','DICT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','DICT_ALL','DICT_DELETE']"
|
v-permission="['ADMIN','DICT_ALL','DICT_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -49,14 +56,13 @@
|
|||||||
import checkPermission from '@/utils/permission'
|
import checkPermission from '@/utils/permission'
|
||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { del } from '@/api/dictDetail'
|
import { del } from '@/api/dictDetail'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit },
|
components: { eForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delLoading: false, sup_this: this, dictName: '', dictId: 0
|
delLoading: false, dictName: '', dictId: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -89,6 +95,17 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.form = {
|
||||||
|
id: data.id,
|
||||||
|
label: data.label,
|
||||||
|
value: data.value,
|
||||||
|
sort: data.sort
|
||||||
|
}
|
||||||
|
_this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false" :dict-id="dictId"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dictId: {
|
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.form = {
|
|
||||||
id: this.data.id,
|
|
||||||
label: this.data.label,
|
|
||||||
value: this.data.value,
|
|
||||||
sort: this.data.sort
|
|
||||||
}
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<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 style="display: inline-block;margin: 0px 2px;">
|
|
||||||
<eForm ref="form" :is-add="true" :dict-id="dictId"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dictId: {
|
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
checkPermission,
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -33,10 +33,6 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
dicts: {
|
dicts: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
required: true
|
||||||
@@ -94,7 +90,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -109,7 +105,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,6 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query" :dicts="dicts"/>
|
<!--工具栏-->
|
||||||
|
<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.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>
|
||||||
|
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||||
|
<!-- 新增 -->
|
||||||
|
<div v-permission="['ADMIN','USERJOB_ALL','USERJOB_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--表单组件-->
|
||||||
|
<eForm ref="form" :is-add="isAdd" :dicts="dicts"/>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column prop="name" label="名称"/>
|
<el-table-column prop="name" label="名称"/>
|
||||||
@@ -28,7 +47,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','USERJOB_ALL','USERJOB_EDIT']" :dicts="dicts" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','USERJOB_ALL','USERJOB_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','USERJOB_ALL','USERJOB_DELETE']"
|
v-permission="['ADMIN','USERJOB_ALL','USERJOB_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -61,14 +80,17 @@ import initData from '@/mixins/initData'
|
|||||||
import initDict from '@/mixins/initDict'
|
import initDict from '@/mixins/initDict'
|
||||||
import { del } from '@/api/job'
|
import { del } from '@/api/job'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit },
|
components: { eForm },
|
||||||
mixins: [initData, initDict],
|
mixins: [initData, initDict],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delLoading: false, sup_this: this
|
delLoading: false,
|
||||||
|
enabledTypeOptions: [
|
||||||
|
{ key: 'true', display_name: '正常' },
|
||||||
|
{ key: 'false', display_name: '禁用' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -109,6 +131,26 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.isAdd = true
|
||||||
|
this.$refs.form.getDepts()
|
||||||
|
this.$refs.form.dialog = true
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.getDepts()
|
||||||
|
_this.form = {
|
||||||
|
id: data.id,
|
||||||
|
name: data.name,
|
||||||
|
sort: data.sort,
|
||||||
|
enabled: data.enabled.toString(),
|
||||||
|
createTime: data.createTime,
|
||||||
|
dept: { id: data.dept.id }
|
||||||
|
}
|
||||||
|
_this.deptId = data.dept.id
|
||||||
|
_this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false" :dicts="dicts"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dicts: {
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.getDepts()
|
|
||||||
_this.form = {
|
|
||||||
id: this.data.id,
|
|
||||||
name: this.data.name,
|
|
||||||
sort: this.data.sort,
|
|
||||||
enabled: this.data.enabled.toString(),
|
|
||||||
createTime: this.data.createTime,
|
|
||||||
dept: { id: this.data.dept.id }
|
|
||||||
}
|
|
||||||
_this.deptId = this.data.dept.id
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<template>
|
|
||||||
<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.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>
|
|
||||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
|
||||||
<!-- 新增 -->
|
|
||||||
<div v-permission="['ADMIN','USERJOB_ALL','USERJOB_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="add">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true" :dicts="dicts"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dicts: {
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
enabledTypeOptions: [
|
|
||||||
{ key: 'true', display_name: '正常' },
|
|
||||||
{ key: 'false', display_name: '禁用' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
add() {
|
|
||||||
this.$refs.form.getDepts()
|
|
||||||
this.$refs.form.dialog = true
|
|
||||||
},
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -52,10 +52,6 @@ export default {
|
|||||||
isAdd: {
|
isAdd: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -100,7 +96,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -115,7 +111,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,6 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<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;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="display: inline-block;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-more"
|
||||||
|
@click="changExpand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
||||||
|
<eForm ref="form" :is-add="true"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--表单组件-->
|
||||||
|
<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" :columns="columns" size="small">
|
||||||
<el-table-column prop="icon" label="图标" align="center" width="80px">
|
<el-table-column prop="icon" label="图标" align="center" width="80px">
|
||||||
@@ -28,7 +53,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','MENU_ALL','MENU_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','MENU_ALL','MENU_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','MENU_ALL','MENU_DELETE']"
|
v-permission="['ADMIN','MENU_ALL','MENU_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -53,10 +78,9 @@ import treeTable from '@/components/TreeTable'
|
|||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { del } from '@/api/menu'
|
import { del } from '@/api/menu'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit, treeTable },
|
components: { treeTable, eForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -66,7 +90,7 @@ export default {
|
|||||||
value: 'name'
|
value: 'name'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
delLoading: false, sup_this: this, expand: true
|
delLoading: false, expand: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -102,6 +126,22 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.isAdd = true
|
||||||
|
this.$refs.form.getMenus()
|
||||||
|
this.$refs.form.dialog = true
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
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.dialog = true
|
||||||
|
},
|
||||||
|
changExpand() {
|
||||||
|
this.expand = !this.expand
|
||||||
|
this.init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.getMenus()
|
|
||||||
_this.form = { id: this.data.id, component: this.data.component, name: this.data.name, sort: this.data.sort, pid: this.data.pid, path: this.data.path, iframe: this.data.iframe.toString(), roles: [], icon: this.data.icon }
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<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;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="add">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
<div style="display: inline-block;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-more"
|
|
||||||
@click="expand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
downloadLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.$refs.form.getMenus()
|
|
||||||
this.$refs.form.dialog = true
|
|
||||||
},
|
|
||||||
expand() {
|
|
||||||
this.$parent.expand = !this.$parent.expand
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -28,10 +28,6 @@ export default {
|
|||||||
isAdd: {
|
isAdd: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -73,7 +69,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -88,7 +84,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,6 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<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">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<div style="display: inline-block;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-more"
|
||||||
|
@click="changeExpand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
||||||
|
<eForm ref="form" :is-add="true"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--表单组件-->
|
||||||
|
<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" :columns="columns" size="small">
|
||||||
<el-table-column prop="createTime" label="创建日期">
|
<el-table-column prop="createTime" label="创建日期">
|
||||||
@@ -10,7 +35,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_DELETE']"
|
v-permission="['ADMIN','PERMISSION_ALL','PERMISSION_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -35,10 +60,9 @@ import treeTable from '@/components/TreeTable'
|
|||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { del } from '@/api/permission'
|
import { del } from '@/api/permission'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit, treeTable },
|
components: { treeTable, eForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -52,7 +76,7 @@ export default {
|
|||||||
value: 'alias'
|
value: 'alias'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
delLoading: false, sup_this: this, expand: true
|
delLoading: false, expand: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -88,6 +112,22 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.isAdd = true
|
||||||
|
this.$refs.form.getPermissions()
|
||||||
|
this.$refs.form.dialog = true
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.getPermissions()
|
||||||
|
_this.form = { id: data.id, name: data.name, alias: data.alias, pid: data.pid }
|
||||||
|
_this.dialog = true
|
||||||
|
},
|
||||||
|
changeExpand() {
|
||||||
|
this.expand = !this.expand
|
||||||
|
this.init()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.getPermissions()
|
|
||||||
_this.form = { id: this.data.id, name: this.data.name, alias: this.data.alias, pid: this.data.pid }
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<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">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="add">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
<div style="display: inline-block;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-more"
|
|
||||||
@click="expand">{{ $parent.expand ? '折叠' : '展开' }}</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
downloadLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.$refs.form.getPermissions()
|
|
||||||
this.$refs.form.dialog = true
|
|
||||||
},
|
|
||||||
expand() {
|
|
||||||
this.$parent.expand = !this.$parent.expand
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -41,10 +41,6 @@ export default {
|
|||||||
isAdd: {
|
isAdd: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -99,7 +95,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$parent.$parent.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -114,7 +110,7 @@ export default {
|
|||||||
duration: 2500
|
duration: 2500
|
||||||
})
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.sup_this.init()
|
this.$parent.init()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -1,6 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<!--表单组件-->
|
||||||
|
<eForm ref="form" :is-add="isAdd"/>
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<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;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="add">新增</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<el-row :gutter="15">
|
<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">
|
||||||
@@ -26,7 +42,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','ROLES_ALL','ROLES_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
<el-button v-permission="['ADMIN','ROLES_ALL','ROLES_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||||
<el-popover
|
<el-popover
|
||||||
v-permission="['ADMIN','ROLES_ALL','ROLES_DELETE']"
|
v-permission="['ADMIN','ROLES_ALL','ROLES_DELETE']"
|
||||||
:ref="scope.row.id"
|
:ref="scope.row.id"
|
||||||
@@ -114,11 +130,10 @@ import { del } from '@/api/role'
|
|||||||
import { getPermissionTree } from '@/api/permission'
|
import { getPermissionTree } from '@/api/permission'
|
||||||
import { getMenusTree } from '@/api/menu'
|
import { getMenusTree } from '@/api/menu'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import eForm from './form'
|
||||||
import edit from './module/edit'
|
|
||||||
import { editPermission, editMenu, get } from '@/api/role'
|
import { editPermission, editMenu, get } from '@/api/role'
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit },
|
components: { eForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -127,7 +142,7 @@ export default {
|
|||||||
label: 'label'
|
label: 'label'
|
||||||
},
|
},
|
||||||
currentId: 0, permissionLoading: false, menuLoading: false, showButton: false, opt: '菜单分配',
|
currentId: 0, permissionLoading: false, menuLoading: false, showButton: false, opt: '菜单分配',
|
||||||
delLoading: false, sup_this: this, permissions: [], permissionIds: [], menus: [], menuIds: []
|
delLoading: false, permissions: [], permissionIds: [], menus: [], menuIds: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -268,6 +283,23 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.isAdd = true
|
||||||
|
this.$refs.form.dialog = true
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
const _this = this.$refs.form
|
||||||
|
_this.deptIds = []
|
||||||
|
_this.form = { id: data.id, name: data.name, remark: data.remark, depts: data.depts, dataScope: data.dataScope, level: data.level }
|
||||||
|
if (_this.form.dataScope === '自定义') {
|
||||||
|
_this.getDepts()
|
||||||
|
}
|
||||||
|
for (let i = 0; i < _this.form.depts.length; i++) {
|
||||||
|
_this.deptIds[i] = _this.form.depts[i].id
|
||||||
|
}
|
||||||
|
_this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="primary" icon="el-icon-edit" @click="to"/>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.deptIds = []
|
|
||||||
_this.form = { id: this.data.id, name: this.data.name, remark: this.data.remark, depts: this.data.depts, dataScope: this.data.dataScope, level: this.data.level }
|
|
||||||
if (_this.form.dataScope === '自定义') {
|
|
||||||
_this.getDepts()
|
|
||||||
}
|
|
||||||
for (let i = 0; i < _this.form.depts.length; i++) {
|
|
||||||
_this.deptIds[i] = _this.form.depts[i].id
|
|
||||||
}
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<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;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="$refs.form.dialog = true">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
// 查询条件
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
downloadLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,6 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<eHeader :query="query"/>
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<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','JOB_ALL','JOB_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="dialog = true; isAdd = true">新增</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- 任务日志 -->
|
||||||
|
<div v-permission="['ADMIN','JOB_ALL','JOB_SELECT']" style="display: inline-block;">
|
||||||
|
<el-button
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="warning"
|
||||||
|
icon="el-icon-tickets"
|
||||||
|
@click="doLog">执行日志</el-button>
|
||||||
|
<Log ref="log"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!--表格渲染-->
|
<!--表格渲染-->
|
||||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||||
<el-table-column :show-overflow-tooltip="true" prop="jobName" width="100px" label="任务名称"/>
|
<el-table-column :show-overflow-tooltip="true" prop="jobName" width="100px" label="任务名称"/>
|
||||||
@@ -21,7 +45,7 @@
|
|||||||
</el-table-column>
|
</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">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<edit v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" :data="scope.row" :sup_this="sup_this"/>
|
<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>
|
<el-button v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" style="margin-left: -2px" type="text" size="mini" @click="execute(scope.row.id)">执行</el-button>
|
||||||
<el-button v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" style="margin-left: 3px" type="text" size="mini" @click="updateStatus(scope.row.id,scope.row.isPause ? '恢复' : '暂停')">
|
<el-button v-permission="['ADMIN','JOB_ALL','JOB_EDIT']" style="margin-left: 3px" type="text" size="mini" @click="updateStatus(scope.row.id,scope.row.isPause ? '恢复' : '暂停')">
|
||||||
{{ scope.row.isPause ? '恢复' : '暂停' }}
|
{{ scope.row.isPause ? '恢复' : '暂停' }}
|
||||||
@@ -55,16 +79,31 @@
|
|||||||
<script>
|
<script>
|
||||||
import checkPermission from '@/utils/permission'
|
import checkPermission from '@/utils/permission'
|
||||||
import initData from '@/mixins/initData'
|
import initData from '@/mixins/initData'
|
||||||
import { del, updateIsPause, execution } from '@/api/timing'
|
import { del, updateIsPause, execution, add, edit } from '@/api/timing'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
import eHeader from './module/header'
|
import Log from './log'
|
||||||
import edit from './module/edit'
|
|
||||||
export default {
|
export default {
|
||||||
components: { eHeader, edit },
|
components: { Log },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
delLoading: false, sup_this: this
|
delLoading: false, isAdd: false,
|
||||||
|
loading: false, dialog: false,
|
||||||
|
form: { jobName: '', beanName: '', methodName: '', params: '', cronExpression: '', isPause: 'false', remark: '' }, permissionIds: [],
|
||||||
|
rules: {
|
||||||
|
jobName: [
|
||||||
|
{ required: true, message: '请输入任务名称', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
beanName: [
|
||||||
|
{ required: true, message: '请输入Bean名称', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
methodName: [
|
||||||
|
{ required: true, message: '请输入方法名称', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
cronExpression: [
|
||||||
|
{ required: true, message: '请输入Cron表达式', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -124,11 +163,70 @@ export default {
|
|||||||
this.$refs[id].doClose()
|
this.$refs[id].doClose()
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
toQuery() {
|
||||||
|
this.page = 0
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
doLog() {
|
||||||
|
this.$refs.log.dialog = true
|
||||||
|
this.$refs.log.doInit()
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.resetForm()
|
||||||
|
},
|
||||||
|
doSubmit() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.loading = true
|
||||||
|
if (this.isAdd) {
|
||||||
|
this.doAdd()
|
||||||
|
} else this.doEdit()
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doAdd() {
|
||||||
|
add(this.form).then(res => {
|
||||||
|
this.resetForm()
|
||||||
|
this.$notify({
|
||||||
|
title: '添加成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 2500
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
this.init()
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doEdit() {
|
||||||
|
edit(this.form).then(res => {
|
||||||
|
this.resetForm()
|
||||||
|
this.$notify({
|
||||||
|
title: '修改成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 2500
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
this.init()
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.dialog = false
|
||||||
|
this.$refs['form'].resetFields()
|
||||||
|
this.form = { jobName: '', beanName: '', methodName: '', params: '', cronExpression: '', isPause: 'false', remark: '' }
|
||||||
|
},
|
||||||
|
edit(data) {
|
||||||
|
this.isAdd = false
|
||||||
|
this.form = { id: data.id, jobName: data.jobName, beanName: data.beanName, methodName: data.methodName, params: data.params, cronExpression: data.cronExpression, isPause: data.isPause.toString(), remark: data.remark }
|
||||||
|
this.dialog = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
errorInfo: '', errorDialog: false,
|
errorInfo: '', errorDialog: false,
|
||||||
dialog: false, delLoading: false, sup_this: this,
|
dialog: false, delLoading: false,
|
||||||
enabledTypeOptions: [
|
enabledTypeOptions: [
|
||||||
{ key: 'true', display_name: '成功' },
|
{ key: 'true', display_name: '成功' },
|
||||||
{ key: 'false', display_name: '失败' }
|
{ key: 'false', display_name: '失败' }
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-button size="mini" type="text" @click="to">编辑</el-button>
|
|
||||||
<eForm ref="form" :sup_this="sup_this" :is-add="false"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
export default {
|
|
||||||
components: { eForm },
|
|
||||||
props: {
|
|
||||||
data: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
to() {
|
|
||||||
const _this = this.$refs.form
|
|
||||||
_this.form = { id: this.data.id, jobName: this.data.jobName, beanName: this.data.beanName, methodName: this.data.methodName, params: this.data.params, cronExpression: this.data.cronExpression, isPause: this.data.isPause.toString(), remark: this.data.remark }
|
|
||||||
_this.dialog = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
div{
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
<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="100px">
|
|
||||||
<el-form-item label="任务名称" prop="jobName">
|
|
||||||
<el-input v-model="form.jobName" style="width: 460px;"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Bean名称" prop="beanName">
|
|
||||||
<el-input v-model="form.beanName" style="width: 460px;"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="执行方法" prop="methodName">
|
|
||||||
<el-input v-model="form.methodName" style="width: 460px;"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="参数内容">
|
|
||||||
<el-input v-model="form.params" style="width: 460px;"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Cron表达式" prop="cronExpression">
|
|
||||||
<el-input v-model="form.cronExpression" style="width: 460px;"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="任务状态">
|
|
||||||
<el-radio v-model="form.isPause" label="false">启用</el-radio>
|
|
||||||
<el-radio v-model="form.isPause" label="true" >暂停</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="任务描述">
|
|
||||||
<el-input v-model="form.remark" style="width: 460px;" rows="2" type="textarea"/>
|
|
||||||
</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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { add, edit } from '@/api/timing'
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
isAdd: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
sup_this: {
|
|
||||||
type: Object,
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false, dialog: false,
|
|
||||||
form: { jobName: '', beanName: '', methodName: '', params: '', cronExpression: '', isPause: 'false', remark: '' }, permissionIds: [],
|
|
||||||
rules: {
|
|
||||||
jobName: [
|
|
||||||
{ required: true, message: '请输入任务名称', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
beanName: [
|
|
||||||
{ required: true, message: '请输入Bean名称', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
methodName: [
|
|
||||||
{ required: true, message: '请输入方法名称', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
cronExpression: [
|
|
||||||
{ required: true, message: '请输入Cron表达式', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
cancel() {
|
|
||||||
this.resetForm()
|
|
||||||
},
|
|
||||||
doSubmit() {
|
|
||||||
this.$refs['form'].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true
|
|
||||||
if (this.isAdd) {
|
|
||||||
this.doAdd()
|
|
||||||
} else this.doEdit()
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
doAdd() {
|
|
||||||
add(this.form).then(res => {
|
|
||||||
this.resetForm()
|
|
||||||
this.$notify({
|
|
||||||
title: '添加成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2500
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
this.$parent.$parent.init()
|
|
||||||
}).catch(err => {
|
|
||||||
this.loading = false
|
|
||||||
console.log(err.response.data.message)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
doEdit() {
|
|
||||||
edit(this.form).then(res => {
|
|
||||||
this.resetForm()
|
|
||||||
this.$notify({
|
|
||||||
title: '修改成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 2500
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
this.sup_this.init()
|
|
||||||
}).catch(err => {
|
|
||||||
this.loading = false
|
|
||||||
console.log(err.response.data.message)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
resetForm() {
|
|
||||||
this.dialog = false
|
|
||||||
this.$refs['form'].resetFields()
|
|
||||||
this.form = { jobName: '', beanName: '', methodName: '', params: '', cronExpression: '', isPause: 'false', remark: '' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="head-container">
|
|
||||||
<!-- 搜索 -->
|
|
||||||
<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','JOB_ALL','JOB_CREATE']" style="display: inline-block;margin: 0px 2px;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="primary"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="$refs.form.dialog = true">新增</el-button>
|
|
||||||
<eForm ref="form" :is-add="true"/>
|
|
||||||
</div>
|
|
||||||
<!-- 任务日志 -->
|
|
||||||
<div v-permission="['ADMIN','JOB_ALL','JOB_SELECT']" style="display: inline-block;">
|
|
||||||
<el-button
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="warning"
|
|
||||||
icon="el-icon-tickets"
|
|
||||||
@click="doLog">执行日志</el-button>
|
|
||||||
<Log ref="log"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import eForm from './form'
|
|
||||||
import Log from './log'
|
|
||||||
// 查询条件
|
|
||||||
export default {
|
|
||||||
components: { eForm, Log },
|
|
||||||
props: {
|
|
||||||
query: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
downloadLoading: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toQuery() {
|
|
||||||
this.$parent.page = 0
|
|
||||||
this.$parent.init()
|
|
||||||
},
|
|
||||||
doLog() {
|
|
||||||
this.$refs.log.dialog = true
|
|
||||||
this.$refs.log.doInit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -42,7 +42,32 @@
|
|||||||
<span>操作日志</span>
|
<span>操作日志</span>
|
||||||
<div style="display:inline-block;float: right;cursor: pointer" @click="refresh"><i :class="ico"/></div>
|
<div style="display:inline-block;float: right;cursor: pointer" @click="refresh"><i :class="ico"/></div>
|
||||||
</div>
|
</div>
|
||||||
<log ref="log"/>
|
<div>
|
||||||
|
<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 prop="time" label="请求耗时" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
||||||
|
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" label="创建日期" width="180px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<el-pagination
|
||||||
|
:total="total"
|
||||||
|
:current-page="page + 1"
|
||||||
|
style="margin-top: 8px;"
|
||||||
|
layout="total, prev, pager, next, sizes"
|
||||||
|
@size-change="sizeChange"
|
||||||
|
@current-change="pageChange"/>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -56,13 +81,14 @@ import { mapGetters } from 'vuex'
|
|||||||
import { regEmail } from '@/utils/index'
|
import { regEmail } from '@/utils/index'
|
||||||
import updatePass from './center/updatePass'
|
import updatePass from './center/updatePass'
|
||||||
import updateEmail from './center/updateEmail'
|
import updateEmail from './center/updateEmail'
|
||||||
import log from './center/log'
|
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from '@/utils/index'
|
||||||
|
import initData from '@/mixins/initData'
|
||||||
export default {
|
export default {
|
||||||
name: 'Center',
|
name: 'Center',
|
||||||
components: { updatePass, updateEmail, log },
|
components: { updatePass, updateEmail },
|
||||||
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ico: 'el-icon-refresh',
|
ico: 'el-icon-refresh',
|
||||||
@@ -78,6 +104,9 @@ export default {
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.init()
|
||||||
|
})
|
||||||
store.dispatch('GetInfo').then(() => {})
|
store.dispatch('GetInfo').then(() => {})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -85,6 +114,12 @@ export default {
|
|||||||
formatEmail(mail) {
|
formatEmail(mail) {
|
||||||
return regEmail(mail)
|
return regEmail(mail)
|
||||||
},
|
},
|
||||||
|
beforeInit() {
|
||||||
|
this.url = 'api/logs/user'
|
||||||
|
const sort = 'id,desc'
|
||||||
|
this.params = { page: this.page, size: this.size, sort: sort }
|
||||||
|
return true
|
||||||
|
},
|
||||||
handleSuccess(response, file, fileList) {
|
handleSuccess(response, file, fileList) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '头像修改成功',
|
title: '头像修改成功',
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<!--表格渲染-->
|
|
||||||
<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 prop="time" label="请求耗时" align="center">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
|
||||||
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
|
||||||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="createTime" label="创建日期" width="180px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!--分页组件-->
|
|
||||||
<el-pagination
|
|
||||||
:total="total"
|
|
||||||
:current-page="page + 1"
|
|
||||||
style="margin-top: 8px;"
|
|
||||||
layout="total, prev, pager, next, sizes"
|
|
||||||
@size-change="sizeChange"
|
|
||||||
@current-change="pageChange"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import initData from '@/mixins/initData'
|
|
||||||
import { parseTime } from '@/utils/index'
|
|
||||||
export default {
|
|
||||||
mixins: [initData],
|
|
||||||
created() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.init()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
parseTime,
|
|
||||||
beforeInit() {
|
|
||||||
this.url = 'api/logs/user'
|
|
||||||
const sort = 'id,desc'
|
|
||||||
this.params = { page: this.page, size: this.size, sort: sort }
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<el-dialog :visible.sync="dialog" :title="title" append-to-body width="475px" @close="cancel">
|
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :title="title" append-to-body width="475px" @close="cancel">
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||||
<el-form-item label="新邮箱" prop="email">
|
<el-form-item label="新邮箱" prop="email">
|
||||||
<el-input v-model="form.email" auto-complete="on" style="width: 200px;"/>
|
<el-input v-model="form.email" auto-complete="on" style="width: 200px;"/>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { validatEmail } from '@/utils/validate'
|
import { validatEmail } from '@/utils/validate'
|
||||||
import { validPass, updateEmail } from '@/api/user'
|
import { updateEmail } from '@/api/user'
|
||||||
import { resetEmail } from '@/api/code'
|
import { resetEmail } from '@/api/code'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -34,19 +34,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const validatePass = (rule, value, callback) => {
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
callback(new Error('密码不能为空'))
|
|
||||||
} else {
|
|
||||||
validPass(value).then(res => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
callback()
|
|
||||||
} else {
|
|
||||||
callback(new Error('密码错误,请重新输入'))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const validMail = (rule, value, callback) => {
|
const validMail = (rule, value, callback) => {
|
||||||
if (value === '' || value === null) {
|
if (value === '' || value === null) {
|
||||||
callback(new Error('新邮箱不能为空'))
|
callback(new Error('新邮箱不能为空'))
|
||||||
@@ -65,7 +52,7 @@ export default {
|
|||||||
buttonName: '获取验证码', isDisabled: false, time: 60,
|
buttonName: '获取验证码', isDisabled: false, time: 60,
|
||||||
rules: {
|
rules: {
|
||||||
pass: [
|
pass: [
|
||||||
{ required: true, validator: validatePass, trigger: 'blur' }
|
{ required: true, message: '当前密码不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{ required: true, validator: validMail, trigger: 'blur' }
|
{ required: true, validator: validMail, trigger: 'blur' }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="display: inline-block">
|
<div style="display: inline-block">
|
||||||
<el-dialog :visible.sync="dialog" :title="title" append-to-body width="500px" @close="cancel">
|
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :title="title" append-to-body width="500px" @close="cancel">
|
||||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="88px">
|
||||||
<el-form-item label="旧密码" prop="oldPass">
|
<el-form-item label="旧密码" prop="oldPass">
|
||||||
<el-input v-model="form.oldPass" type="password" auto-complete="on" style="width: 370px;"/>
|
<el-input v-model="form.oldPass" type="password" auto-complete="on" style="width: 370px;"/>
|
||||||
@@ -22,34 +22,25 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { validPass, updatePass } from '@/api/user'
|
import { updatePass } from '@/api/user'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
const validatePass = (rule, value, callback) => {
|
|
||||||
if (value) {
|
|
||||||
validPass(value).then(res => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
callback()
|
|
||||||
} else {
|
|
||||||
callback(new Error('旧密码错误,请检查'))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
callback(new Error('请输入旧密码'))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const confirmPass = (rule, value, callback) => {
|
const confirmPass = (rule, value, callback) => {
|
||||||
|
if (value) {
|
||||||
if (this.form.newPass !== value) {
|
if (this.form.newPass !== value) {
|
||||||
callback(new Error('两次输入的密码不一致'))
|
callback(new Error('两次输入的密码不一致'))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error('请再次输入密码'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
loading: false, dialog: false, title: '修改密码', form: { oldPass: '', newPass: '', confirmPass: '' },
|
loading: false, dialog: false, title: '修改密码', form: { oldPass: '', newPass: '', confirmPass: '' },
|
||||||
rules: {
|
rules: {
|
||||||
oldPass: [
|
oldPass: [
|
||||||
{ required: true, validator: validatePass, trigger: 'blur' }
|
{ required: true, message: '请输入旧密码', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
newPass: [
|
newPass: [
|
||||||
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user