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

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内容
getMarkdown: function(params) {
return request({
url: 'public/p',
url: '/markdown/p',
method: 'get',
params
})

View File

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

View File

@ -3,14 +3,28 @@
<el-card class="box-card table-search-header">
<div slot="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-col :sm="12" :md="8">
<el-form-item label="账号:">
<el-input clearable placeholder="请输入" v-model="queryCondition.username" />
<el-col :sm="12" :md="5">
<el-form-item label="日志类型:">
<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-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-date-picker
v-model="pickerValue"
@ -24,9 +38,11 @@
</el-date-picker>
</el-form-item>
</el-col>
<el-col :sm="12" :md="7">
<el-col :sm="12" :md="6">
<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>
</el-col>
</el-row>
@ -77,6 +93,23 @@ export default {
pageSize: 12,
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: {
username: undefined,
@ -130,8 +163,23 @@ export default {
this.pagination = data.backData;
this.getLogList()
},
getLogList(){
if (this.pickerValue.length > 0){
selectType() {
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.endTime = this.pickerValue[1].getTime()
}
@ -152,10 +200,12 @@ export default {
<style lang="scss" scoped>
@import "src/styles/setting";
.box-card {
max-width: 1440px;
}
/deep/.el-range-editor--medium {
width: 100%;
/deep/ .el-range-editor--medium {
width: 100%;
}
</style>

View File

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

View File

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