c3f898b8 by 蔡俊立

错误日志

1 parent 07f01d83
1 import request from '@/utils/request'
2 import SERVER from './config'
3 /*
4 系统监控 -获取错误日志列表
5 */
6 export function getErrorLogList (data) {
7 return request({
8 url: SERVER.SERVERAPI + '/rest/xtjk/view/getErrorLogList',
9 method: 'post',
10 data,
11 showLoading: true
12 })
13 }
...@@ -266,6 +266,42 @@ export const asyncRoutes = [ ...@@ -266,6 +266,42 @@ export const asyncRoutes = [
266 meta: { title: '打印模板管理' } 266 meta: { title: '打印模板管理' }
267 }, 267 },
268 ] 268 ]
269 },
270 {
271 path: '/xtjk',
272 id: '6',
273 parentId: null,
274 component: Layout,
275 meta: { title: '系统监控', icon: 'system' },
276 redirect: '/xtjk/cwrz',
277 alwaysShow: true,
278 name: 'xtjk',
279 children: [
280 {
281 path: 'cwrz',
282 id: '61',
283 parentId: '6',
284 component: () => import('@/views/xtjk/cwrz/cwrz.vue'),
285 name: 'cwrz',
286 meta: { title: '错误日志' }
287 },
288 {
289 path: 'czrz',
290 id: '62',
291 parentId: '6',
292 component: () => import('@/views/xtjk/czrz/czrz.vue'),
293 name: 'czrz',
294 meta: { title: '操作日志' }
295 },
296 // {
297 // path: 'monitor',
298 // id: '63',
299 // parentId: '6',
300 // component: () => import('@/views/xtjk/host/monitor.vue'),
301 // name: 'monitor',
302 // meta: { title: '主机监控' }
303 // },
304 ]
269 } 305 }
270 ] 306 ]
271 307
......
...@@ -379,4 +379,14 @@ aside { ...@@ -379,4 +379,14 @@ aside {
379 width: 5px; 379 width: 5px;
380 height: 5px; 380 height: 5px;
381 border-radius: 50%; 381 border-radius: 50%;
382 }
383 //错误日志样式 后期超优化
384 .item-cwnr {
385 white-space: pre-wrap;
386 display: -webkit-box;
387 overflow: hidden;
388 text-overflow: ellipsis;
389 overflow-wrap: break-word;
390 -webkit-line-clamp: 3;
391 -webkit-box-orient: vertical;
382 } 392 }
...\ No newline at end of file ...\ No newline at end of file
......
1 <template>
2 <div class="from-clues">
3 <!-- 表单部分 -->
4 <div class="from-clues-header">
5 <el-form :model="queryForm" ref="queryForm" @submit.native.prevent label-width="80px">
6 <el-row>
7 <el-col :span="5">
8 <el-form-item label="业务类型">
9 <el-input placeholder="请输入业务类型" v-model="queryForm.ywlx" @clear="queryClick()" clearable class="width100">
10 </el-input>
11 </el-form-item>
12 </el-col>
13 <el-col :span="5">
14 <el-form-item label="接口地址">
15 <el-input placeholder="请输入接口地址" v-model="queryForm.apiUri" @clear="queryClick()" clearable class="width100">
16 </el-input>
17 </el-form-item>
18 </el-col>
19 <el-col :span="4" class="btnColRight">
20 <el-form-item>
21 <el-button type="primary" native-type="submit" @click="queryClick()">查询</el-button>
22 </el-form-item>
23 </el-col>
24 </el-row>
25 </el-form>
26 </div>
27 <div class="from-clues-content">
28 <lb-table :page-size="pageData.size" border :current-page.sync="pageData.currentPage"
29 :heightNum="300" :total="tableData.total" @size-change="handleSizeChange"
30 @p-current-change="handleCurrentChange" :column="tableData.columns" :data="tableData.data">
31 </lb-table>
32 </div>
33 </div>
34 </template>
35 <script>
36 import table from "@/utils/mixin/table"
37 import { datas, sendThis } from "./cwrzdata"
38 import { getErrorLogList } from "@/api/xtjk.js"
39 export default {
40 name: "cwrz",
41 components: { },
42 mixins: [table],
43 mounted () {
44 sendThis(this);
45 },
46 computed: {
47 },
48 data () {
49 return {
50 queryForm: {
51 ywlx: "",
52 apiUrl: "",
53 },
54 pageData: {
55 current: 1,
56 size: 10,
57 },
58 tableData: {
59 total: 0,
60 columns: datas.columns(),
61 data: [],
62 },
63 };
64 },
65 methods: {
66 init (e) {
67 this.fetchData()
68 },
69 // 列表渲染接口
70 fetchData () {
71 getErrorLogList({ ...this.queryForm, ...this.pageData }).then(res => {
72 if (res.code === 200) {
73 let { total, records } = res.result
74 this.tableData.total = total;
75 this.tableData.data = records
76 this.tableData.data.forEach((item,index) => {
77 item.cwdmwz = item.cwdmwz.replace(/\\n/g, '\n')
78 })
79 }
80 })
81 },
82 }
83 };
84 </script>
85 <style scoped lang="scss">
86 @import "~@/styles/public.scss";
87 </style>
88
1 import filter from '@/utils/filter.js'
2 let vm = null
3
4 const sendThis = (_this) => {
5 vm = _this
6 }
7 class data extends filter {
8 constructor() {
9 super()
10 }
11 columns () {
12 return [
13 {
14 label: '序号',
15 type: 'index',
16 width: '50',
17 render: (h, scope) => {
18 return (
19 <div>
20 {(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1}
21 </div>
22 )
23 }
24 },
25 {
26 prop: "ywlx",
27 label: "业务类型",
28 width: '100'
29 },
30 {
31 prop: "cwdm",
32 label: "错误代码",
33 width: '100'
34 },
35 {
36 prop: "apiUri",
37 label: "api接口",
38 width: '200'
39 },
40 {
41 prop: "crcs",
42 label: "传入参数",
43 render: (h, scope) => {
44 return <div class="item-cwnr">{scope.row.crcs}</div>
45 }
46 },
47 {
48 prop: "cwnr",
49 label: "错误内容",
50 render: (h, scope) => {
51 return <div class="item-cwnr">{scope.row.cwnr}</div>
52 }
53 },
54 {
55 //prop: "cwdmwz",
56 label: "错误位置",
57 render: (h, scope) => {
58 return <div class="item-cwnr" style="white-space: pre-wrap;">{scope.row.cwdmwz}</div>
59 }
60 },
61 {
62 prop: "createtime",
63 label: "报错时间",
64 width: '200'
65 },
66 {
67 label: '操作',
68 width: '80',
69 align: 'center',
70 fixed: 'right',
71 render: (h, scope) => {
72 return <el-button type="text" onClick={() => { vm.del(scope.row) }}>查看</el-button>
73 }
74 }
75 ]
76 }
77 }
78 let datas = new data()
79 export {
80 datas,
81 sendThis
82 }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
27 </div> 27 </div>
28 <!-- 表格 --> 28 <!-- 表格 -->
29 <div class="from-clues-content"> 29 <div class="from-clues-content">
30 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total" 30 <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
31 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 31 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
32 :data="tableData.data"> 32 :data="tableData.data">
33 </lb-table> 33 </lb-table>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
27 </div> 27 </div>
28 <!-- 表格 --> 28 <!-- 表格 -->
29 <div class="from-clues-content"> 29 <div class="from-clues-content">
30 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total" 30 <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
31 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 31 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
32 :data="tableData.data"> 32 :data="tableData.data">
33 </lb-table> 33 </lb-table>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
39 </div> 39 </div>
40 <!-- 表格 --> 40 <!-- 表格 -->
41 <div class="from-clues-content"> 41 <div class="from-clues-content">
42 <lb-table :page-size="pageData.size" :current-page.sync="pageData.current" :total="tableData.total" 42 <lb-table :page-size="pageData.size" border :current-page.sync="pageData.current" :total="tableData.total"
43 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 43 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns"
44 :data="tableData.data"> 44 :data="tableData.data">
45 </lb-table> 45 </lb-table>
......