刘翔宇-旅管家 3 years ago
parent 4e5d8c3591
commit 7a0cb3a14b

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function listlog(params) {
return request({
url: '/api/admin/operate-log/index',
method: 'get',
params:params
})
}

@ -466,15 +466,13 @@
},
endTime(newVal, oldVal) {
if (newVal) {
this.searchFields.start_end_time = newVal[0]
this.searchFields.end_end_time = newVal[1]
this.searchFields.start_end_time = newVal[0];
this.searchFields.end_end_time = newVal[1];
} else {
this.searchFields.start_end_time = ""
this.searchFields.end_end_time = ""
this.searchFields.start_end_time = "";
this.searchFields.end_end_time = "";
}
},
}
},
methods: {
initLoad() {

@ -0,0 +1,112 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="系统日志" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" class="v-table" :height="tableHeight" border style="width: 100%">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="name" label="内容">
</el-table-column>
<el-table-column prop="username" label="操作人" align="center" width="180">
<template slot-scope="scope">
{{scope.row.admin?scope.row.admin.name:""}}
</template>
</el-table-column>
<el-table-column prop="admin" label="操作人部门" align="center" width="180">
<template slot-scope="scope">
{{scope.row.department?scope.row.department.name:""}}
</template>
</el-table-column>
<el-table-column prop="created_at" label="操作时间" align="center" width="180">
</el-table-column>
<el-table-column prop="ip" label="ip" width="180" align="center">
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
listlog
} from "../../api/system/log.js";
export default {
components: {
LxHeader
},
created() {
this.initLoad();
var that = this;
that.load();
},
mounted() {},
data() {
return {
paginations: {
page: 1,
page_size: 15,
total: 0
},
tableHeight: 0,
//
searchFields: {
keyword: ""
},
tableData: []
}
},
methods: {
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
handleCurrentChange(page) {
this.paginations.page = page;
this.load();
},
load() {
var that = this;
listlog({
page: that.paginations.page,
...this.searchFields
}).then(response => {
var data = response.data;
this.paginations.total = response.total;
that.tableData = data;
}).catch(error => {
console.log(error)
//reject(error)
})
}
}
};
</script>
<style>
</style>

@ -46,8 +46,8 @@ module.exports = {
//before: require('./mock/mock-server.js')
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'http://patrol.115.langye.net/',
// target: 'http://192.168.60.100:9001/',
//target: 'http://patrol.115.langye.net/',
target: 'http://192.168.60.100:9001/',
changeOrigin: true, //配置跨域
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save