1.2.3 后台操作按钮调整及其新增开启拼团功能

This commit is contained in:
hupeng
2019-11-19 13:44:19 +08:00
commit 4faa83dc0c
307 changed files with 23684 additions and 0 deletions

View File

@ -0,0 +1,81 @@
<template>
<div class="app-container">
<Search :query="query"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="username" label="用户名"/>
<el-table-column prop="requestIp" label="IP"/>
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源"/>
<el-table-column prop="description" label="描述"/>
<el-table-column :show-overflow-tooltip="true" prop="method" label="方法名称"/>
<el-table-column :show-overflow-tooltip="true" prop="params" label="参数"/>
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="异常详情" width="100px">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="info(scope.row.id)">查看详情</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="dialog" title="异常详情" append-to-body top="0" width="85%">
<span>
{{ errorInfo }}
</span>
</el-dialog>
<!--分页组件-->
<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'
import { getErrDetail } from '@/api/log'
import Search from './search'
export default {
name: 'ErrorLog',
components: { Search },
mixins: [initData],
data() {
return {
errorInfo: '', dialog: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
beforeInit() {
this.url = 'api/logs/error'
const sort = 'id,desc'
const query = this.query
const value = query.value
this.params = { page: this.page, size: this.size, sort: sort }
if (value) { this.params['blurry'] = value }
return true
},
info(id) {
this.dialog = true
getErrDetail(id).then(res => {
this.errorInfo = res.exception
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,66 @@
<template>
<div class="app-container">
<Search :query="query"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="username" label="用户名"/>
<el-table-column prop="requestIp" label="IP"/>
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源"/>
<el-table-column prop="description" label="描述"/>
<el-table-column :show-overflow-tooltip="true" prop="method" label="方法名称"/>
<el-table-column :show-overflow-tooltip="true" prop="params" label="参数"/>
<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'
import Search from './search'
export default {
name: 'Log',
components: { Search },
mixins: [initData],
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
beforeInit() {
this.url = 'api/logs'
const sort = 'id,desc'
const query = this.query
const value = query.value
this.params = { page: this.page, size: this.size, sort: sort }
if (value) { this.params['blurry'] = value }
return true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,17 @@
<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="$parent.toQuery">搜索</el-button>
</div>
</template>
<script>
export default {
props: {
query: {
type: Object,
required: true
}
}
}
</script>

View File

@ -0,0 +1,125 @@
<template>
<div class="app-container">
<!--工具栏-->
<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;">
<!-- 清空缓存 -->
<el-button v-permission="['ADMIN','REDIS_ALL','REDIS_DELETE']" :loading="deleteAllLoading" type="warning" size="mini" class="filter-item" icon="el-icon-delete" @click="deleteAll">清空缓存</el-button>
</div>
</div>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column label="序号" width="80" align="center">
<template slot-scope="scope">
<div>{{ scope.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" prop="key" label="KEY"/>
<el-table-column prop="value" label="VALUE">
<template slot-scope="scope">
<div style="word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
{{ scope.row.value }}
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['ADMIN','REDIS_ALL','REDIS_EDIT','REDIS_DELETE'])" label="操作" width="130px" align="center" fixed="right">
<template slot-scope="scope">
<el-popover
v-permission="['ADMIN','REDIS_ALL','REDIS_DELETE']"
:ref="scope.$index"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.$index].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.$index, scope.row)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</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 checkPermission from '@/utils/permission' // 权限判断函数
import initData from '@/mixins/initData'
import { del, delAll } from '@/api/redis'
export default {
name: 'Redis',
mixins: [initData],
data() {
return {
delLoading: false, permissions: [], deleteAllLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/redis'
const query = this.query
const value = query.value
this.params = { page: this.page, size: this.size }
if (value) {
this.params['key'] = value
} else {
this.params['key'] = '*'
}
return true
},
subDelete(index, row) {
this.delLoading = true
del(row.key).then(res => {
this.delLoading = false
this.$refs[index].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[index].doClose()
console.log(err.response.data.message)
})
},
deleteAll() {
this.$confirm('你确定要清空缓存数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.deleteAllLoading = true
delAll().then(res => {
this.page = 0
this.init()
this.deleteAllLoading = false
})
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,16 @@
<template>
<elFrame :src="sqlApi"/>
</template>
<script>
import { mapGetters } from 'vuex'
import elFrame from '@/components/iframe/index'
export default {
name: 'Sql',
components: { elFrame },
computed: {
...mapGetters([
'sqlApi'
])
}
}
</script>