修改:登陆日志,操作日志

This commit is contained in:
jmal 2021-02-09 14:54:23 +08:00
parent 6eb0fab315
commit 9851a297ce
6 changed files with 69 additions and 16 deletions

View File

@ -5,7 +5,7 @@ export default {
// 获取markdown内容 // 获取markdown内容
getMarkdown: function(params) { getMarkdown: function(params) {
return request({ return request({
url: 'public/p', url: '/markdown/p',
method: 'get', method: 'get',
params params
}) })

View File

@ -53,7 +53,7 @@ export default {
export function getSetting(params) { export function getSetting(params) {
return request({ return request({
url: '/public/website/setting', url: '/website/setting',
method: 'get', method: 'get',
params params
}) })

View File

@ -3,14 +3,28 @@
<el-card class="box-card table-search-header"> <el-card class="box-card table-search-header">
<div slot="header"> <div slot="header">
<div class="box-card-header"> <div class="box-card-header">
<el-form size="medium" class="search-form" ref="queryForm" label-width="77px" :model="queryCondition" @submit.native.prevent> <el-form size="medium" class="search-form" ref="queryForm" label-width="77px" :model="queryCondition"
@submit.native.prevent>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :sm="12" :md="8"> <el-col :sm="12" :md="5">
<el-form-item label="账号:"> <el-form-item label="日志类型:">
<el-input clearable placeholder="请输入" v-model="queryCondition.username" /> <el-select v-model="typeValue" placeholder="请选择日志类型" @change="selectType">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :sm="12" :md="9"> <el-col :sm="12" :md="6">
<el-form-item label="账号:">
<el-input clearable placeholder="请输入" v-model="queryCondition.username"/>
</el-form-item>
</el-col>
<el-col :sm="12" :md="6">
<el-form-item label="时间:" prop="logTime"> <el-form-item label="时间:" prop="logTime">
<el-date-picker <el-date-picker
v-model="pickerValue" v-model="pickerValue"
@ -24,9 +38,11 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :sm="12" :md="7"> <el-col :sm="12" :md="6">
<div class="el-form-actions"> <div class="el-form-actions">
<el-button class="card-btn-icon" size="medium" icon="el-icon-search" type="primary" @click="getLogList()">查询</el-button> <el-button class="card-btn-icon" size="medium" icon="el-icon-search" type="primary"
@click="getLogList()">查询
</el-button>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -77,6 +93,23 @@ export default {
pageSize: 12, pageSize: 12,
pageTotal: 0 pageTotal: 0
}, },
options: this.type === 'LOGIN' ? [{
value: 'LOGIN',
label: '登录'
}] : [{
value: 'LOGIN',
label: '登录'
}, {
value: 'OPERATION',
label: '操作'
}, {
value: 'ARTICLE',
label: '文章'
}, {
value: 'WEBDAV',
label: 'WebDAV'
}],
typeValue: this.type,
// 查询条件 // 查询条件
queryCondition: { queryCondition: {
username: undefined, username: undefined,
@ -130,8 +163,23 @@ export default {
this.pagination = data.backData; this.pagination = data.backData;
this.getLogList() this.getLogList()
}, },
getLogList(){ selectType() {
if (this.pickerValue.length > 0){ this.queryCondition.type = this.typeValue
if (this.typeValue === 'ARTICLE') {
this.tableHeader[0].disabled = true
this.tableHeader[1].disabled = true
this.tableHeader[3].disabled = true
this.tableHeader[5].minWidth = 200
} else {
this.tableHeader[0].disabled = false
this.tableHeader[1].disabled = false
this.tableHeader[3].disabled = false
this.tableHeader[5].minWidth = 105
}
this.getLogList()
},
getLogList() {
if (this.pickerValue != null && this.pickerValue.length > 0) {
this.queryCondition.startTime = this.pickerValue[0].getTime() this.queryCondition.startTime = this.pickerValue[0].getTime()
this.queryCondition.endTime = this.pickerValue[1].getTime() this.queryCondition.endTime = this.pickerValue[1].getTime()
} }
@ -152,10 +200,12 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import "src/styles/setting"; @import "src/styles/setting";
.box-card { .box-card {
max-width: 1440px; max-width: 1440px;
} }
/deep/.el-range-editor--medium {
width: 100%; /deep/ .el-range-editor--medium {
width: 100%;
} }
</style> </style>

View File

@ -30,7 +30,7 @@ export default {
} }
}, },
{prop: 'remarks',label: '备注', sortable: 'custom'}, {prop: 'remarks',label: '备注', sortable: 'custom'},
{prop: 'createTime',label: '创建时间', minWidth: 110, sortable: 'custom'}, {prop: 'createTime',label: '创建时间', minWidth: 150, sortable: 'custom'},
], ],
} }
} }

View File

@ -90,7 +90,7 @@ export default {
return time + 'ms' return time + 'ms'
} }
}, },
{prop: 'createTime',label: '创建时间', minWidth: 110, sortable: 'custom'}, {prop: 'createTime',label: '创建时间', minWidth: 150, sortable: 'custom'},
{label: '操作', minWidth: 75, active: [ {label: '操作', minWidth: 75, active: [
{name: '详情', icon: 'el-icon-view', handle: (row) => this.details(row)}, {name: '详情', icon: 'el-icon-view', handle: (row) => this.details(row)},
], ],
@ -112,6 +112,9 @@ export default {
@import "src/styles/setting"; @import "src/styles/setting";
/deep/ .box-card { /deep/ .box-card {
max-width: 1440px; max-width: 1440px;
/deep/ .el-form-item {
margin-bottom: 20px;
}
} }
/deep/ .el-form-item { /deep/ .el-form-item {
margin-bottom: 0px; margin-bottom: 0px;

View File

@ -54,7 +54,7 @@ module.exports = {
}, },
proxy: { proxy: {
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: 'http://localhost:8088/', target: 'http://localhost:8088',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''