f057e5bd by zhaoqian

日志管理

1 parent cf9dae12
import request from '@/plugin/axios'
/**
* 获取操作日志
*/
export function getLogData(data) {
return request({
url: '/system/manage/operationLog',
method: 'post',
data: data,
})
}
/**
* 获取错误日志
*/
export function getErrorLog() {
return request({
url: '/system/manage/getErrorLog',
method: 'post',
})
}
\ No newline at end of file
......@@ -97,6 +97,7 @@
<tr>
<td colspan="2" class="tdright"><i class="requisite">*</i>电话</td>
<td colspan="3">
<!-- @blur="inputBlur($event)"-->
<input type="text" class="formInput" v-model="formData.dh" />
</td>
<td colspan="2" class="tdright"><i class="requisite">*</i>地址</td>
......@@ -465,14 +466,21 @@
}
},
inputBlur(e){
if(e.target.value!=''){
e.target.style.border=""
}else{
e.target.style.border="1px solid red";
e.target.style.boxSizing = 'border-box';
}
},
// inputBlur(e){
// if(e.target.value!=''){
// console.log(e.target.value)
// console.log(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value)))
// if(!(/^1(3|4|5|6|7|8|9)d{9}$/.test(e.target.value))){
// e.target.style.border="1px solid red";
// e.target.style.boxSizing = 'border-box';
// }else {
// e.target.style.border=""
// }
// }else{
// e.target.style.border="1px solid red";
// e.target.style.boxSizing = 'border-box';
// }
// },
//删除行数据
delRow() {
......
......@@ -81,6 +81,12 @@ const constantRoutes = [
name: "地图",
code: "0-6",
component: () => import("@/views/systemTX/map"),
},
{
path: "/manage",
name: "系统管理",
code: "0-7",
component: () => import("@/views/manage/index"),
}
],
},
......
......@@ -105,6 +105,10 @@ export default {
path: "/search",
select: false,
},
{
path: "/manage",
select: false,
},
],
// 上导航选中id
indId: undefined,
......@@ -199,6 +203,11 @@ export default {
icon: "iconfont iconzonghechaxun",
path: "/search",
},
{
name: "系统管理",
icon: "iconfont iconzonghechaxun",
path: "/manage",
}
];
this.navigationList = list;
}
......
<template>
<div>
字典管理
</div>
</template>
<script>
export default {
name: "index"
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-tabs v-model="activeName" class="tabs" @tab-click="handleClick">
<el-tab-pane label="日志管理" name="log"><log></log></el-tab-pane>
<el-tab-pane label="字典管理" name="dictionary"><dictionary></dictionary></el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import log from "./log/index"
import dictionary from "./dictionary/index"
export default {
name: "index",
components: {
log,dictionary
},
data() {
return {
activeName: "log",
};
},
methods: {
handleClick(tab, event) {
},
},
created() {},
mounted() {},
computed: {},
watch: {},
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="log-content">
<div class="log-search">
开始时间:
<el-date-picker
v-model="startValue"
type="datetime"
placeholder="选择日期时间"
align="right"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions">
</el-date-picker>
结束时间:
<el-date-picker
v-model="endValue"
type="datetime"
placeholder="选择日期时间"
align="right"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions">
</el-date-picker>
<el-button type="primary" @click="query">查询</el-button>
<el-button type="warning" @click="reset">重置</el-button>
<el-button type="info" @click="getError">错误日志</el-button>
</div>
<el-dialog title="错误日志" :visible.sync="outerVisible">
<div v-for="item in errorLog">
{{item.name}}
{{item.value}}
</div>
</el-dialog>
<div class="log-table">
<el-table :data="tableData">
<el-table-column type="index" width="80" align="center" label="序号">
</el-table-column>
<el-table-column prop="operationtype" align="center" label="操作类型">
</el-table-column>
<el-table-column prop="username" align="center" width="100" label="操作人">
</el-table-column>
<el-table-column prop="addtime" align="center" label="操作时间">
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import {getLogData,getErrorLog} from "@api/manage";
export default {
name: "index",
data(){
return{
tableData:[],
errorLog:[],
outerVisible: false,
innerVisible: false,
pickerOptions: {
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
startValue: '',
endValue:'',
}
},
methods:{
getData(){
let data={
"startTime": "",
"pageNo": 1,
"pageSize": 50
};
getLogData(data).then((res)=>{
console.log(res.result);
this.tableData = res.result.records;
})
},
query(){
let data={
"startTime": this.startValue,
"endTime": this.endValue,
"pageNo": 1,
"pageSize": 50
};
getLogData(data).then((res)=>{
console.log(res.result);
this.tableData = res.result.records;
})
},
getError(){
getErrorLog().then((res)=>{
console.log(res.result)
this.errorLog= res.result;
this.outerVisible = true;
})
},
reset(){
this.startValue = "";
this.endValue = "";
}
},
mounted() {
this.getData();
}
}
</script>
<style scoped>
.log-content{
width: 100%;
/*border: 1px solid red;*/
}
.log-search{
margin-top: 10px;
padding-left: 15px;
padding-top: 20px;
width: 100%;
border: 1px solid #a8adad;
height: 60px;
background-color: white;
}
.log-table{
margin-top: 10px;
width: 100%;
border: 1px solid #a8adad;
}
.el-button {
width: 100px;
margin-left: 15px;
}
</style>
\ No newline at end of file