Merge branch 'dev-sy-10-14'
This commit is contained in:
commit
0db2a41a9d
|
|
@ -6,7 +6,7 @@
|
|||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build": "vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
|
||||
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
|
||||
style="width: 200px" class="filter-item ml-20" :maxlength="30"
|
||||
<el-input
|
||||
v-model="listQuery.ip"
|
||||
placeholder="请输入IP地址"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
:maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-date-picker
|
||||
|
|
@ -16,27 +19,80 @@
|
|||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
<el-select v-model="listQuery.grade" placeholder="请选择异常等级" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(levelList)" :key="item" :value="levelList[item]" :label="levelList[item]" />
|
||||
<el-select
|
||||
v-model="listQuery.grade"
|
||||
placeholder="请选择异常等级"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Object.keys(levelList)"
|
||||
:key="item"
|
||||
:value="levelList[item]"
|
||||
:label="levelList[item]"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- <el-input v-model="listQuery.errType" placeholder="请输入异常类型"
|
||||
style="width: 200px" class="filter-item" :maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/> -->
|
||||
<el-select v-model="listQuery.errType" placeholder="请选择异常类型" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(typeList)" :key="item" :value="typeList[item]" :label="typeList[item]" />
|
||||
<el-select
|
||||
v-model="listQuery.errType"
|
||||
placeholder="请选择异常类型"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Object.keys(typeList)"
|
||||
:key="item"
|
||||
:value="typeList[item]"
|
||||
:label="typeList[item]"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logSort"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logDesc"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sortList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
@click="handleFilter"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
@click="resetFilter"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
|
||||
|
|
@ -55,27 +111,32 @@
|
|||
:max-height="tableHeight"
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="operaUserName">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.operaUserName||'/' }}</span>
|
||||
<span>{{ scope.row.operaUserName || "/" }}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center" prop="operTime" width="180"/>
|
||||
<el-table-column label="IP地址" align="center" prop="ip"/>
|
||||
<el-table-column label="操作模块" align="center" prop="model" >
|
||||
<el-table-column
|
||||
label="操作时间"
|
||||
align="center"
|
||||
prop="operTime"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column label="IP地址" align="center" prop="ip" />
|
||||
<el-table-column label="操作模块" align="center" prop="model">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.model||'/' }}</span>
|
||||
<span>{{ scope.row.model || "/" }}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="异常类型" align="center" prop="errType" />
|
||||
<el-table-column label="异常原因" align="center" prop="operateDetail"/>
|
||||
<el-table-column label="异常等级" align="center" prop="grade"/>
|
||||
<el-table-column label="异常原因" align="center" prop="operateDetail" />
|
||||
<el-table-column label="异常等级" align="center" prop="grade" />
|
||||
<!-- <el-table-column label="事件结果" align="center" prop="failureReason"/> -->
|
||||
<el-table-column label="操作类型" align="center" prop="operType" />
|
||||
<!--
|
||||
|
|
@ -103,22 +164,21 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
import _ from 'lodash/fp'
|
||||
import { downloadFile } from '@/utils/download'
|
||||
|
||||
import { getErrLogs,downloadErrLogs } from '@/api/system/log'
|
||||
import _ from "lodash/fp";
|
||||
import { downloadFile } from "@/utils/download";
|
||||
|
||||
import { getErrLogs, downloadErrLogs } from "@/api/system/log";
|
||||
|
||||
const levelList = {
|
||||
1:'高',
|
||||
2:'中',
|
||||
3:'低'
|
||||
1: "高",
|
||||
2: "中",
|
||||
3: "低",
|
||||
};
|
||||
const typeList = {
|
||||
1:'越权访问',
|
||||
2:'IP异常',
|
||||
1: "越权访问",
|
||||
2: "IP异常",
|
||||
// 3:'删除',
|
||||
// 4:'查询',
|
||||
// 5:'导出',
|
||||
|
|
@ -139,84 +199,96 @@ export default {
|
|||
listLoading: false,
|
||||
tableHeight: 650,
|
||||
typeList: typeList,
|
||||
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:4,name:'ip'},{id:5,name:'异常等级'}],
|
||||
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
|
||||
timeList: [
|
||||
{ id: 1, name: "时间" },
|
||||
{ id: 2, name: "操作人" },
|
||||
{ id: 4, name: "ip" },
|
||||
{ id: 5, name: "异常等级" },
|
||||
],
|
||||
sortList: [
|
||||
{ id: 1, name: "倒序" },
|
||||
{ id: 2, name: "升序" },
|
||||
],
|
||||
listQuery: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
errType: '',
|
||||
ip: '',
|
||||
errLevel: '',
|
||||
operTime:'',
|
||||
errType: "",
|
||||
ip: "",
|
||||
errLevel: "",
|
||||
operTime: "",
|
||||
// logSort:1,
|
||||
logDesc:1,
|
||||
logDesc: 1,
|
||||
},
|
||||
rangeDate:[],
|
||||
}
|
||||
rangeDate: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList()
|
||||
// this.getOperate()
|
||||
},
|
||||
mounted() {
|
||||
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.getList()
|
||||
this.listQuery.operTime =
|
||||
this.getCurrentDate() + " - " + this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getStatus(val) {
|
||||
return this.levelList[val]
|
||||
return this.levelList[val];
|
||||
},
|
||||
//获取下拉数据
|
||||
getOperate(){
|
||||
getOperate() {
|
||||
// getOperateList().then((response) => {
|
||||
// this.typeList = response.data
|
||||
// })
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
if(this.rangeDate && this.rangeDate.length>0){
|
||||
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
|
||||
this.listLoading = true;
|
||||
if (this.rangeDate && this.rangeDate.length > 0) {
|
||||
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
|
||||
}
|
||||
getErrLogs(this.listQuery).then((response) => {
|
||||
this.list = response.rows.map(item => {
|
||||
return item
|
||||
})
|
||||
this.total = response.total
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.listLoading = false
|
||||
},500)
|
||||
this.list = response.rows.map((item) => {
|
||||
return item;
|
||||
});
|
||||
this.total = response.total;
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.listLoading = false;
|
||||
}, 500);
|
||||
},
|
||||
// 查询
|
||||
handleFilter() {
|
||||
this.listQuery.pageNum = 1
|
||||
this.getList()
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
//重置
|
||||
resetFilter() {
|
||||
this.listQuery={
|
||||
this.listQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
errType: '',
|
||||
ip: '',
|
||||
grade: '',
|
||||
errType: "",
|
||||
ip: "",
|
||||
grade: "",
|
||||
// logSort:1,
|
||||
logDesc:1,
|
||||
logDesc: 1,
|
||||
};
|
||||
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.handleFilter()
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.handleFilter();
|
||||
},
|
||||
// 备份
|
||||
handleBackups() {
|
||||
downloadErrLogs().then(res => {
|
||||
downloadFile({ fileName: '异常日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8'})
|
||||
})
|
||||
downloadErrLogs().then((res) => {
|
||||
downloadFile({
|
||||
fileName: "异常日志.sql",
|
||||
fileData: res,
|
||||
fileType: "text/html;charset=UTF-8",
|
||||
});
|
||||
});
|
||||
},
|
||||
//导出
|
||||
handleExport(){
|
||||
|
||||
handleExport() {
|
||||
// exportCarDetail().then(res => {
|
||||
// downloadFile({ fileName: '设备详情.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
// })
|
||||
|
|
@ -225,16 +297,15 @@ export default {
|
|||
let now = new Date();
|
||||
let year = now.getFullYear();
|
||||
let month = now.getMonth() + 1;
|
||||
if(month<10){
|
||||
month = '0'+month
|
||||
if (month < 10) {
|
||||
month = "0" + month;
|
||||
}
|
||||
let day = now.getDate();
|
||||
if(day<10){
|
||||
day = '0'+day
|
||||
if (day < 10) {
|
||||
day = "0" + day;
|
||||
}
|
||||
return year + "-" + month + "-" + day;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
|
||||
style="width: 200px" class="filter-item" :maxlength="30"
|
||||
<el-input
|
||||
v-model="listQuery.operaUserName"
|
||||
placeholder="请输入操作人"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
:maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
|
||||
style="width: 200px" class="filter-item ml-20" :maxlength="30"
|
||||
<el-input
|
||||
v-model="listQuery.ip"
|
||||
placeholder="请输入IP地址"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
:maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-date-picker
|
||||
|
|
@ -23,23 +31,76 @@
|
|||
style="width: 200px" class="filter-item ml-20" :maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/> -->
|
||||
<el-select v-model="listQuery.result" placeholder="请选择事件结果" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
|
||||
<el-select
|
||||
v-model="listQuery.result"
|
||||
placeholder="请选择事件结果"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Object.keys(outcomeList)"
|
||||
:key="item"
|
||||
:value="outcomeList[item]"
|
||||
:label="outcomeList[item]"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
|
||||
<el-select
|
||||
v-model="listQuery.operType"
|
||||
placeholder="请选择操作类型"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Object.keys(operateList)"
|
||||
:key="item"
|
||||
:value="operateList[item]"
|
||||
:label="operateList[item]"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logSort"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logDesc"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sortList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
@click="handleFilter"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
@click="resetFilter"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
|
||||
|
|
@ -58,8 +119,10 @@
|
|||
:max-height="tableHeight"
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="operaUserName" />
|
||||
|
|
@ -70,7 +133,7 @@
|
|||
<el-table-column label="操作详情" align="center" prop="operateDetail" />
|
||||
<el-table-column label="操作结果" align="center" prop="result">
|
||||
<template slot-scope="{ row }">
|
||||
{{ row.result}}
|
||||
{{ row.result }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作参数" align="center" prop="params" />
|
||||
|
|
@ -87,34 +150,33 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
<script>
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
import _ from 'lodash/fp'
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import _ from "lodash/fp";
|
||||
import { downloadFile } from "@/utils/download";
|
||||
|
||||
import { getYwLogs,downloadYwLogs } from '@/api/system/log'
|
||||
import { getYwLogs, downloadYwLogs } from "@/api/system/log";
|
||||
|
||||
const outcomeList = {
|
||||
1: "成功",
|
||||
2: "失败",
|
||||
};
|
||||
const operateList = {
|
||||
1: "新增",
|
||||
2: "修改",
|
||||
3: "删除",
|
||||
4: "查询",
|
||||
5: "导出",
|
||||
6: "下载",
|
||||
7: "备份",
|
||||
8: "登录",
|
||||
9: "登出",
|
||||
};
|
||||
|
||||
const outcomeList = {
|
||||
1:'成功',
|
||||
2:'失败'
|
||||
};
|
||||
const operateList = {
|
||||
1:'新增',
|
||||
2:'修改',
|
||||
3:'删除',
|
||||
4:'查询',
|
||||
5:'导出',
|
||||
6:'下载',
|
||||
7:'备份',
|
||||
8:'登录',
|
||||
9:'登出'
|
||||
};
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -125,89 +187,101 @@
|
|||
listLoading: false,
|
||||
tableHeight: 650,
|
||||
operateList: operateList,
|
||||
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},],
|
||||
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
|
||||
timeList: [
|
||||
{ id: 1, name: "时间" },
|
||||
{ id: 2, name: "操作人" },
|
||||
{ id: 3, name: "操作模块" },
|
||||
{ id: 4, name: "ip" },
|
||||
],
|
||||
sortList: [
|
||||
{ id: 1, name: "倒序" },
|
||||
{ id: 2, name: "升序" },
|
||||
],
|
||||
listQuery: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
operaUserName: '',
|
||||
ip: '',
|
||||
content:'',
|
||||
result: '',
|
||||
operTime:'',
|
||||
operType: '',
|
||||
logSort:1,
|
||||
logDesc:1,
|
||||
operaUserName: "",
|
||||
ip: "",
|
||||
content: "",
|
||||
result: "",
|
||||
operTime: "",
|
||||
operType: "",
|
||||
logSort: 1,
|
||||
logDesc: 1,
|
||||
},
|
||||
rangeDate:[],
|
||||
}
|
||||
rangeDate: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList()
|
||||
// this.getOperate()
|
||||
},
|
||||
mounted() {
|
||||
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.getList()
|
||||
this.listQuery.operTime =
|
||||
this.getCurrentDate() + " - " + this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getStatus(val) {
|
||||
return this.outcomeList[val]
|
||||
return this.outcomeList[val];
|
||||
},
|
||||
//获取下拉数据
|
||||
getOperate(){
|
||||
getOperate() {
|
||||
// getOperateList().then((response) => {
|
||||
// this.operateList = response.data
|
||||
// })
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
if(this.rangeDate && this.rangeDate.length>0){
|
||||
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
|
||||
this.listLoading = true;
|
||||
if (this.rangeDate && this.rangeDate.length > 0) {
|
||||
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
|
||||
}
|
||||
getYwLogs(this.listQuery).then((response) => {
|
||||
this.list = response.rows.map(item => {
|
||||
return item
|
||||
})
|
||||
this.total = response.total
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.listLoading = false
|
||||
},500)
|
||||
this.list = response.rows.map((item) => {
|
||||
return item;
|
||||
});
|
||||
this.total = response.total;
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.listLoading = false;
|
||||
}, 500);
|
||||
},
|
||||
// 查询
|
||||
handleFilter() {
|
||||
this.listQuery.pageNum = 1
|
||||
this.getList()
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
//重置
|
||||
resetFilter() {
|
||||
this.listQuery={
|
||||
this.listQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
operaUserName: '',
|
||||
ip: '',
|
||||
operaUserName: "",
|
||||
ip: "",
|
||||
|
||||
content:'',
|
||||
result: '',
|
||||
operType: '',
|
||||
logSort:1,
|
||||
logDesc:1,
|
||||
content: "",
|
||||
result: "",
|
||||
operType: "",
|
||||
logSort: 1,
|
||||
logDesc: 1,
|
||||
};
|
||||
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.handleFilter()
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.handleFilter();
|
||||
},
|
||||
// 备份
|
||||
handleBackups() {
|
||||
downloadYwLogs().then(res => {
|
||||
downloadFile({ fileName: '业务日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8'})
|
||||
})
|
||||
downloadYwLogs().then((res) => {
|
||||
downloadFile({
|
||||
fileName: "业务日志.sql",
|
||||
fileData: res,
|
||||
fileType: "text/html;charset=UTF-8",
|
||||
});
|
||||
});
|
||||
},
|
||||
//导出
|
||||
handleExport(){
|
||||
|
||||
handleExport() {
|
||||
// exportCarDetail().then(res => {
|
||||
// downloadFile({ fileName: '设备详情.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
// })
|
||||
|
|
@ -216,16 +290,15 @@
|
|||
let now = new Date();
|
||||
let year = now.getFullYear();
|
||||
let month = now.getMonth() + 1;
|
||||
if(month<10){
|
||||
month = '0'+month
|
||||
if (month < 10) {
|
||||
month = "0" + month;
|
||||
}
|
||||
let day = now.getDate();
|
||||
if(day<10){
|
||||
day = '0'+day
|
||||
if (day < 10) {
|
||||
day = "0" + day;
|
||||
}
|
||||
return year + "-" + month + "-" + day;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="filter-container">
|
||||
<el-input v-model="listQuery.operaUserName" placeholder="请输入操作人"
|
||||
style="width: 200px" class="filter-item" :maxlength="30"
|
||||
<el-input
|
||||
v-model="listQuery.operaUserName"
|
||||
placeholder="请输入操作人"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
:maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-input v-model="listQuery.ip" placeholder="请输入IP地址"
|
||||
style="width: 200px" class="filter-item ml-20" :maxlength="30"
|
||||
<el-input
|
||||
v-model="listQuery.ip"
|
||||
placeholder="请输入IP地址"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
:maxlength="30"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
<el-date-picker
|
||||
|
|
@ -26,20 +34,63 @@
|
|||
<el-select v-model="listQuery.result" placeholder="请选择事件结果" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(outcomeList)" :key="item" :value="outcomeList[item]" :label="outcomeList[item]" />
|
||||
</el-select>-->
|
||||
<el-select v-model="listQuery.operType" placeholder="请选择操作类型" style="width: 200px" class="filter-item ml-20">
|
||||
<el-option v-for="item in Object.keys(operateList)" :key="item" :value="operateList[item]" :label="operateList[item]" />
|
||||
<el-select
|
||||
v-model="listQuery.operType"
|
||||
placeholder="请选择操作类型"
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Object.keys(operateList)"
|
||||
:key="item"
|
||||
:value="operateList[item]"
|
||||
:label="operateList[item]"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
<el-select v-model="listQuery.logSort" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in timeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logSort"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in timeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select v-model="listQuery.logDesc" clearable filterable style="width: 200px" class="filter-item ml-20" placeholder="请选择" >
|
||||
<el-option v-for="item in sortList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-select
|
||||
v-model="listQuery.logDesc"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px"
|
||||
class="filter-item ml-20"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in sortList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button style="margin-left: 20px" class="filter-item" type="primary" @click="handleFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
@click="handleFilter"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button style="margin-left: 20px" class="filter-item" @click="resetFilter">
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="filter-item"
|
||||
@click="resetFilter"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
<!-- <el-button @click="handleBackups" class="filter-item" style="margin-left: 20px" type="warning">
|
||||
|
|
@ -58,8 +109,10 @@
|
|||
:max-height="tableHeight"
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{ (listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1 }}</span>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(listQuery.pageNum - 1) * listQuery.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="operaUserName" />
|
||||
|
|
@ -90,28 +143,27 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import Pagination from "@/components/Pagination";
|
||||
|
||||
import _ from 'lodash/fp'
|
||||
import { downloadFile } from '@/utils/download'
|
||||
|
||||
import { getSysLogs,downloadSysLogs } from '@/api/system/log'
|
||||
import _ from "lodash/fp";
|
||||
import { downloadFile } from "@/utils/download";
|
||||
|
||||
import { getSysLogs, downloadSysLogs } from "@/api/system/log";
|
||||
|
||||
const outcomeList = {
|
||||
1:'成功',
|
||||
2:'失败'
|
||||
1: "成功",
|
||||
2: "失败",
|
||||
};
|
||||
const operateList = {
|
||||
1:'新增',
|
||||
2:'修改',
|
||||
3:'删除',
|
||||
4:'查询',
|
||||
5:'导出',
|
||||
6:'下载',
|
||||
7:'备份',
|
||||
8:'登录',
|
||||
9:'登出'
|
||||
1: "新增",
|
||||
2: "修改",
|
||||
3: "删除",
|
||||
4: "查询",
|
||||
5: "导出",
|
||||
6: "下载",
|
||||
7: "备份",
|
||||
8: "登录",
|
||||
9: "登出",
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
@ -125,90 +177,101 @@ export default {
|
|||
listLoading: false,
|
||||
tableHeight: 650,
|
||||
operateList: operateList,
|
||||
timeList:[{id:1,name:'时间'},{id:2,name:'操作人'},{id:3,name:'操作模块'},{id:4,name:'ip'},],
|
||||
sortList:[{id:1,name:'倒序'},{id:2,name:'升序'}],
|
||||
timeList: [
|
||||
{ id: 1, name: "时间" },
|
||||
{ id: 2, name: "操作人" },
|
||||
{ id: 3, name: "操作模块" },
|
||||
{ id: 4, name: "ip" },
|
||||
],
|
||||
sortList: [
|
||||
{ id: 1, name: "倒序" },
|
||||
{ id: 2, name: "升序" },
|
||||
],
|
||||
listQuery: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
operaUserName: '',
|
||||
ip: '',
|
||||
content:'',
|
||||
result: '',
|
||||
operTime:'',
|
||||
operaType: '',
|
||||
logSort:1,
|
||||
logDesc:1,
|
||||
operaUserName: "",
|
||||
ip: "",
|
||||
content: "",
|
||||
result: "",
|
||||
operTime: "",
|
||||
operaType: "",
|
||||
logSort: 1,
|
||||
logDesc: 1,
|
||||
},
|
||||
rangeDate:[],
|
||||
}
|
||||
rangeDate: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList()
|
||||
// this.getOperate()
|
||||
},
|
||||
mounted() {
|
||||
this.listQuery.operTime = this.getCurrentDate()+' - '+this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.getList()
|
||||
this.listQuery.operTime =
|
||||
this.getCurrentDate() + " - " + this.getCurrentDate();
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getStatus(val) {
|
||||
return this.outcomeList[val]
|
||||
return this.outcomeList[val];
|
||||
},
|
||||
//获取下拉数据
|
||||
getOperate(){
|
||||
getOperate() {
|
||||
// getOperateList().then((response) => {
|
||||
// this.operateList = response.data
|
||||
// })
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
if(this.rangeDate && this.rangeDate.length>0){
|
||||
this.listQuery.operTime = this.rangeDate[0]+' - '+this.rangeDate[1];
|
||||
this.listLoading = true;
|
||||
if (this.rangeDate && this.rangeDate.length > 0) {
|
||||
this.listQuery.operTime = this.rangeDate[0] + " - " + this.rangeDate[1];
|
||||
}
|
||||
getSysLogs(this.listQuery).then((response) => {
|
||||
this.list = response.rows.map(item => {
|
||||
return item
|
||||
})
|
||||
this.total = response.total
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.listLoading = false
|
||||
},500)
|
||||
this.list = response.rows.map((item) => {
|
||||
return item;
|
||||
});
|
||||
this.total = response.total;
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.listLoading = false;
|
||||
}, 500);
|
||||
},
|
||||
// 查询
|
||||
handleFilter() {
|
||||
this.listQuery.pageNum = 1
|
||||
this.getList()
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
//重置
|
||||
resetFilter() {
|
||||
this.listQuery={
|
||||
this.listQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
operaUserName: '',
|
||||
ip: '',
|
||||
operaUserName: "",
|
||||
ip: "",
|
||||
|
||||
content:'',
|
||||
result: '',
|
||||
operateType: '',
|
||||
logSort:1,
|
||||
logDesc:1,
|
||||
content: "",
|
||||
result: "",
|
||||
operateType: "",
|
||||
logSort: 1,
|
||||
logDesc: 1,
|
||||
};
|
||||
this.rangeDate=[this.getCurrentDate(),this.getCurrentDate()]
|
||||
this.handleFilter()
|
||||
this.rangeDate = [this.getCurrentDate(), this.getCurrentDate()];
|
||||
this.handleFilter();
|
||||
},
|
||||
// 备份
|
||||
handleBackups() {
|
||||
downloadSysLogs().then(res => {
|
||||
downloadFile({ fileName: '系统日志.sql', fileData: res, fileType: 'text/html;charset=UTF-8' })
|
||||
})
|
||||
|
||||
downloadSysLogs().then((res) => {
|
||||
downloadFile({
|
||||
fileName: "系统日志.sql",
|
||||
fileData: res,
|
||||
fileType: "text/html;charset=UTF-8",
|
||||
});
|
||||
});
|
||||
},
|
||||
//导出
|
||||
handleExport(){
|
||||
|
||||
handleExport() {
|
||||
// exportCarDetail().then(res => {
|
||||
// downloadFile({ fileName: '设备详情.xlsx', fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
// })
|
||||
|
|
@ -217,16 +280,15 @@ export default {
|
|||
let now = new Date();
|
||||
let year = now.getFullYear();
|
||||
let month = now.getMonth() + 1;
|
||||
if(month<10){
|
||||
month = '0'+month
|
||||
if (month < 10) {
|
||||
month = "0" + month;
|
||||
}
|
||||
let day = now.getDate();
|
||||
if(day<10){
|
||||
day = '0'+day
|
||||
if (day < 10) {
|
||||
day = "0" + day;
|
||||
}
|
||||
return year + "-" + month + "-" + day;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue