c3f898b8 by 蔡俊立

错误日志

1 parent 07f01d83
import request from '@/utils/request'
import SERVER from './config'
/*
系统监控 -获取错误日志列表
*/
export function getErrorLogList (data) {
return request({
url: SERVER.SERVERAPI + '/rest/xtjk/view/getErrorLogList',
method: 'post',
data,
showLoading: true
})
}
......@@ -266,6 +266,42 @@ export const asyncRoutes = [
meta: { title: '打印模板管理' }
},
]
},
{
path: '/xtjk',
id: '6',
parentId: null,
component: Layout,
meta: { title: '系统监控', icon: 'system' },
redirect: '/xtjk/cwrz',
alwaysShow: true,
name: 'xtjk',
children: [
{
path: 'cwrz',
id: '61',
parentId: '6',
component: () => import('@/views/xtjk/cwrz/cwrz.vue'),
name: 'cwrz',
meta: { title: '错误日志' }
},
{
path: 'czrz',
id: '62',
parentId: '6',
component: () => import('@/views/xtjk/czrz/czrz.vue'),
name: 'czrz',
meta: { title: '操作日志' }
},
// {
// path: 'monitor',
// id: '63',
// parentId: '6',
// component: () => import('@/views/xtjk/host/monitor.vue'),
// name: 'monitor',
// meta: { title: '主机监控' }
// },
]
}
]
......
......@@ -380,3 +380,13 @@ aside {
height: 5px;
border-radius: 50%;
}
//错误日志样式 后期超优化
.item-cwnr {
white-space: pre-wrap;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
}
\ No newline at end of file
......
<template>
<div class="from-clues">
<!-- 表单部分 -->
<div class="from-clues-header">
<el-form :model="queryForm" ref="queryForm" @submit.native.prevent label-width="80px">
<el-row>
<el-col :span="5">
<el-form-item label="业务类型">
<el-input placeholder="请输入业务类型" v-model="queryForm.ywlx" @clear="queryClick()" clearable class="width100">
</el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="接口地址">
<el-input placeholder="请输入接口地址" v-model="queryForm.apiUri" @clear="queryClick()" clearable class="width100">
</el-input>
</el-form-item>
</el-col>
<el-col :span="4" class="btnColRight">
<el-form-item>
<el-button type="primary" native-type="submit" @click="queryClick()">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="from-clues-content">
<lb-table :page-size="pageData.size" border :current-page.sync="pageData.currentPage"
:heightNum="300" :total="tableData.total" @size-change="handleSizeChange"
@p-current-change="handleCurrentChange" :column="tableData.columns" :data="tableData.data">
</lb-table>
</div>
</div>
</template>
<script>
import table from "@/utils/mixin/table"
import { datas, sendThis } from "./cwrzdata"
import { getErrorLogList } from "@/api/xtjk.js"
export default {
name: "cwrz",
components: { },
mixins: [table],
mounted () {
sendThis(this);
},
computed: {
},
data () {
return {
queryForm: {
ywlx: "",
apiUrl: "",
},
pageData: {
current: 1,
size: 10,
},
tableData: {
total: 0,
columns: datas.columns(),
data: [],
},
};
},
methods: {
init (e) {
this.fetchData()
},
// 列表渲染接口
fetchData () {
getErrorLogList({ ...this.queryForm, ...this.pageData }).then(res => {
if (res.code === 200) {
let { total, records } = res.result
this.tableData.total = total;
this.tableData.data = records
this.tableData.data.forEach((item,index) => {
item.cwdmwz = item.cwdmwz.replace(/\\n/g, '\n')
})
}
})
},
}
};
</script>
<style scoped lang="scss">
@import "~@/styles/public.scss";
</style>
import filter from '@/utils/filter.js'
let vm = null
const sendThis = (_this) => {
vm = _this
}
class data extends filter {
constructor() {
super()
}
columns () {
return [
{
label: '序号',
type: 'index',
width: '50',
render: (h, scope) => {
return (
<div>
{(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1}
</div>
)
}
},
{
prop: "ywlx",
label: "业务类型",
width: '100'
},
{
prop: "cwdm",
label: "错误代码",
width: '100'
},
{
prop: "apiUri",
label: "api接口",
width: '200'
},
{
prop: "crcs",
label: "传入参数",
render: (h, scope) => {
return <div class="item-cwnr">{scope.row.crcs}</div>
}
},
{
prop: "cwnr",
label: "错误内容",
render: (h, scope) => {
return <div class="item-cwnr">{scope.row.cwnr}</div>
}
},
{
//prop: "cwdmwz",
label: "错误位置",
render: (h, scope) => {
return <div class="item-cwnr" style="white-space: pre-wrap;">{scope.row.cwdmwz}</div>
}
},
{
prop: "createtime",
label: "报错时间",
width: '200'
},
{
label: '操作',
width: '80',
align: 'center',
fixed: 'right',
render: (h, scope) => {
return <el-button type="text" onClick={() => { vm.del(scope.row) }}>查看</el-button>
}
}
]
}
}
let datas = new data()
export {
datas,
sendThis
}
......@@ -27,7 +27,7 @@
</div>
<!-- 表格 -->
<div class="from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total"
<lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......
......@@ -27,7 +27,7 @@
</div>
<!-- 表格 -->
<div class="from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total"
<lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......
......@@ -39,7 +39,7 @@
</div>
<!-- 表格 -->
<div class="from-clues-content">
<lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total"
<lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
@size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
:data="tableData.data">
</lb-table>
......