解决启动时控制台warning警告

This commit is contained in:
BianLzhaoMin 2024-11-08 09:15:25 +08:00
parent e0c276dfa8
commit 8dd9cd22cb
4 changed files with 678 additions and 473 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -1,15 +1,15 @@
'use strict'
const path = require('path')
"use strict";
const path = require("path");
function resolve(dir) {
return path.join(__dirname, dir)
return path.join(__dirname, dir);
}
const CompressionPlugin = require('compression-webpack-plugin')
const CompressionPlugin = require("compression-webpack-plugin");
const name = process.env.VUE_APP_TITLE || '博诺思管理系统' // 网页标题
const name = process.env.VUE_APP_TITLE || "博诺思管理系统"; // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口
const port = process.env.port || process.env.npm_config_port || 80; // 端口
// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@ -20,119 +20,118 @@ module.exports = {
// 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: 'dist',
outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: 'static',
assetsDir: "static",
// 是否开启eslint保存检测有效值ture | false | 'error'
lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: process.env.NODE_ENV === "development",
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false,
// webpack-dev-server 相关配置
devServer: {
host: '0.0.0.0',
host: "0.0.0.0",
port: port,
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:18080`,
target: `http://192.168.2.72:18080`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
["^" + process.env.VUE_APP_BASE_API]: "",
},
"/api" : {
"target" : "http://192.168.0.21:17861",
},
"/api": {
target: "http://192.168.0.21:17861",
//设置允许跨域——此处我经过测试发现可有可无
"changeOrigin" : true,
"pathRewrite" : {
"^/api" : ""
}
changeOrigin: true,
pathRewrite: {
"^/api": "",
},
},
disableHostCheck: true
},
disableHostCheck: true,
},
css: {
loaderOptions: {
sass: {
sassOptions: { outputStyle: "expanded" }
}
}
sassOptions: { outputStyle: "expanded" },
},
},
},
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
"@": resolve("src"),
},
},
plugins: [
// http://doc.bonus.vip/bonus-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: '[path][base].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
filename: "[path][base].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false // 压缩后删除原文件
})
deleteOriginalAssets: false, // 压缩后删除原文件
}),
],
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.plugins.delete("preload"); // TODO: need test
config.plugins.delete("prefetch"); // TODO: need test
// set svg-sprite-loader
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module
.rule('icons')
.rule("icons")
.test(/\.svg$/)
.include.add(resolve('src/assets/icons'))
.include.add(resolve("src/assets/icons"))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: 'icon-[name]'
symbolId: "icon-[name]",
})
.end()
.end();
config.when(process.env.NODE_ENV !== 'development', config => {
config.when(process.env.NODE_ENV !== "development", (config) => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
.plugin("ScriptExtHtmlWebpackPlugin")
.after("html")
.use("script-ext-html-webpack-plugin", [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
inline: /runtime\..*\.js$/,
},
])
.end();
config.optimization.splitChunks({
chunks: 'all',
chunks: "all",
cacheGroups: {
libs: {
name: 'chunk-libs',
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
chunks: "initial", // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
name: "chunk-elementUI", // split elementUI into a single package
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
name: "chunk-commons",
test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
reuseExistingChunk: true,
},
},
});
config.optimization.runtimeChunk("single");
});
},
};