|
@@ -1,86 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="app-container">
|
|
|
|
-
|
|
|
|
- <!-- <en-table-layout toolbar pagination :table-data="tableData" :loading="loading" @sort-change="tableSort">-->
|
|
|
|
- <!-- <!–工具栏–>-->
|
|
|
|
- <!-- <div slot="toolbar" class="inner-toolbar">-->
|
|
|
|
- <!-- <div class="toolbar-search">-->
|
|
|
|
- <!-- <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />-->
|
|
|
|
- <!-- </div>-->
|
|
|
|
- <!-- <div class="toolbar-btns">-->
|
|
|
|
- <!-- <el-button type="danger" @click="clearError">清空日志</el-button>-->
|
|
|
|
- <!-- </div>-->
|
|
|
|
- <!-- </div>-->
|
|
|
|
- <!-- <!–表头–>-->
|
|
|
|
- <!-- <template slot="table-columns">-->
|
|
|
|
- <!-- <!– <el-table-column prop="id" sortable="custom" label="ID" width="100" align="center"/>–>-->
|
|
|
|
- <!-- <el-table-column prop="class_name" sortable="custom" label="类名" width="300" align="center" />-->
|
|
|
|
- <!-- <el-table-column prop="method_name" sortable="custom" label="类型" width="140" align="center" />-->
|
|
|
|
- <!-- <el-table-column prop="exception_name" sortable="custom" label="异常名" width="200" align="center" />-->
|
|
|
|
- <!-- <el-table-column prop="err_msg" sortable="custom" label="错误信息" min-width="200" :show-overflow-tooltip="true" align="center" />-->
|
|
|
|
- <!-- <el-table-column prop="create_time" sortable="custom" label="创建时间" width="170" align="center" :formatter="forDate" />-->
|
|
|
|
- <!-- <el-table-column label="操作" align="center" width="160">-->
|
|
|
|
- <!-- <template slot-scope="scope">-->
|
|
|
|
- <!-- <el-button type="permary" size="mini" @click="showDetail(scope.row.id)">详情</el-button>-->
|
|
|
|
- <!-- <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>-->
|
|
|
|
- <!-- </template>-->
|
|
|
|
- <!-- </el-table-column>-->
|
|
|
|
-
|
|
|
|
- <!-- </template>-->
|
|
|
|
-
|
|
|
|
- <!-- <!–翻页–>-->
|
|
|
|
- <!-- <el-pagination-->
|
|
|
|
- <!-- v-if="pageData"-->
|
|
|
|
- <!-- slot="pagination"-->
|
|
|
|
- <!-- :current-page="pageData.page_no"-->
|
|
|
|
- <!-- :page-sizes="[10, 20, 50, 100]"-->
|
|
|
|
- <!-- :page-size="pageData.page_size"-->
|
|
|
|
- <!-- layout="total, sizes, prev, pager, next, jumper"-->
|
|
|
|
- <!-- :total="pageData.data_total"-->
|
|
|
|
- <!-- @size-change="handlePageSizeChange"-->
|
|
|
|
- <!-- @current-change="handlePageCurrentChange"-->
|
|
|
|
- <!-- />-->
|
|
|
|
- <!-- </en-table-layout>-->
|
|
|
|
- <!-- <el-drawer-->
|
|
|
|
- <!-- title="详情"-->
|
|
|
|
- <!-- :modal="true"-->
|
|
|
|
- <!-- :visible.sync="shopVisible"-->
|
|
|
|
- <!-- direction="rtl"-->
|
|
|
|
- <!-- size="60%"-->
|
|
|
|
- <!-- >-->
|
|
|
|
- <!-- <detail :error-id="errorId" />-->
|
|
|
|
- <!-- </el-drawer>-->
|
|
|
|
-
|
|
|
|
- <!-- <ag-grid-vue-->
|
|
|
|
- <!-- :style="{'height': tableHeight+'px'}"-->
|
|
|
|
- <!-- class="ag-theme-alpine"-->
|
|
|
|
- <!-- :column-defs="columnDefs"-->
|
|
|
|
- <!-- :row-data="rowData"-->
|
|
|
|
- <!-- :locale-text="localeText"-->
|
|
|
|
- <!-- :grid-options="gridOptions"-->
|
|
|
|
- <!-- :default-col-def="defaultColDef"-->
|
|
|
|
- <!-- :animate-rows="true"-->
|
|
|
|
- <!-- :row-selection="rowSelection"-->
|
|
|
|
- <!-- @rowDoubleClicked="getList"-->
|
|
|
|
- <!-- @filterChanged="filterModifed"-->
|
|
|
|
- <!-- @sortChanged="gridSortChange"-->
|
|
|
|
- <!-- />-->
|
|
|
|
-
|
|
|
|
- <!-- <div class="pagination">-->
|
|
|
|
- <!-- <div class="pagination-toolbar" />-->
|
|
|
|
- <!-- <el-pagination-->
|
|
|
|
- <!-- v-if="pageData"-->
|
|
|
|
- <!-- slot="pagination"-->
|
|
|
|
- <!-- :current-page="pageData.page_no"-->
|
|
|
|
- <!-- :page-sizes="[10, 20, 50, 100]"-->
|
|
|
|
- <!-- :page-size="pageData.page_size"-->
|
|
|
|
- <!-- layout="total, sizes, prev, pager, next, jumper"-->
|
|
|
|
- <!-- :total="pageData.data_total"-->
|
|
|
|
- <!-- multi-sort-key="ctrl"-->
|
|
|
|
- <!-- @size-change="handlePageSizeChange"-->
|
|
|
|
- <!-- @current-change="handlePageCurrentChange"-->
|
|
|
|
- <!-- />-->
|
|
|
|
- <!-- </div>-->
|
|
|
|
|
|
+ <div>
|
|
<ag-grid-layout
|
|
<ag-grid-layout
|
|
toolbar
|
|
toolbar
|
|
:table-height="tableHeight"
|
|
:table-height="tableHeight"
|
|
@@ -92,7 +11,7 @@
|
|
:default-col-def="defaultColDef"
|
|
:default-col-def="defaultColDef"
|
|
:animate-rows="true"
|
|
:animate-rows="true"
|
|
:row-selection="rowSelection"
|
|
:row-selection="rowSelection"
|
|
- @rowDoubleClicked="getList"
|
|
|
|
|
|
+ @rowDoubleClicked="showDetail"
|
|
@filterChanged="filterModifed"
|
|
@filterChanged="filterModifed"
|
|
@sortChanged="gridSortChange"
|
|
@sortChanged="gridSortChange"
|
|
>
|
|
>
|
|
@@ -101,7 +20,7 @@
|
|
<en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
|
|
<en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
|
|
</div>
|
|
</div>
|
|
<div class="toolbar-btns">
|
|
<div class="toolbar-btns">
|
|
- <el-button type="danger" @click="clearError">清空日志</el-button>
|
|
|
|
|
|
+ <el-button type="danger" size="mini" @click="clearError">清空日志</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<el-pagination
|
|
<el-pagination
|
|
@@ -117,17 +36,21 @@
|
|
/>
|
|
/>
|
|
</ag-grid-layout>
|
|
</ag-grid-layout>
|
|
|
|
|
|
|
|
+ <el-dialog :visible.sync="shopVisible" title="错误详情" class="customer-dialog">
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <div style="height: 500px;padding:15px" v-html="selectedRow.stack_trace" />
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import * as API_CallingNcError from '@/api/calling-ncError'
|
|
|
|
-import detail from './detail'
|
|
|
|
-import { unix2Date } from '@/utils/Foundation'
|
|
|
|
|
|
+import * as API_ErrorLog from '@/api/ncs_errorlog'
|
|
|
|
+import { unixToDate } from '@/utils/Foundation'
|
|
import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
export default {
|
|
export default {
|
|
name: 'Index',
|
|
name: 'Index',
|
|
- components: { detail },
|
|
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
tableData: [],
|
|
tableData: [],
|
|
@@ -148,7 +71,8 @@ export default {
|
|
columnApi: null,
|
|
columnApi: null,
|
|
localeText: AG_GRID_LOCALE_CN,
|
|
localeText: AG_GRID_LOCALE_CN,
|
|
filterState: null,
|
|
filterState: null,
|
|
- rowSelection: null
|
|
|
|
|
|
+ rowSelection: null,
|
|
|
|
+ selectedRow: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -183,23 +107,32 @@ export default {
|
|
{ headerName: '错误信息', field: 'err_msg', sortable: true, filter: true, flex: 1 },
|
|
{ headerName: '错误信息', field: 'err_msg', sortable: true, filter: true, flex: 1 },
|
|
{ headerName: '错误时间', field: 'create_time',
|
|
{ headerName: '错误时间', field: 'create_time',
|
|
valueFormatter: this.dateValueFormatter,
|
|
valueFormatter: this.dateValueFormatter,
|
|
- sortable: true, filter: 'date', flex: 1 }
|
|
|
|
|
|
+ filterParams: {
|
|
|
|
+ comparator: (filterLocalDateAtMidnight, cellValue) => {
|
|
|
|
+ const celldate = unixToDate(cellValue, 'yyyy-MM-dd 00:00:00')
|
|
|
|
+ return (new Date(celldate).getTime() / 1000) - (filterLocalDateAtMidnight.getTime() / 1000)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ sortable: true, filter: 'date', flex: 1 },
|
|
|
|
+ { headerName: '堆栈跟踪', field: 'stack_trace',
|
|
|
|
+ sortable: true, flex: 1 }
|
|
]
|
|
]
|
|
this.defaultColDef = {
|
|
this.defaultColDef = {
|
|
- filter: 'agTextColumnFilter',
|
|
|
|
|
|
+ // filter: 'agTextColumnFilter',
|
|
sortable: true,
|
|
sortable: true,
|
|
resizable: true,
|
|
resizable: true,
|
|
- comparator: this.testComparator,
|
|
|
|
|
|
+ // comparator: this.testComparator,
|
|
filterParams: {
|
|
filterParams: {
|
|
debounceMs: 200,
|
|
debounceMs: 200,
|
|
- newRowsAction: 'keep',
|
|
|
|
- textCustomComparator: this.textCustomComparator,
|
|
|
|
- comparator: this.testComparator
|
|
|
|
|
|
+ newRowsAction: 'keep'
|
|
|
|
+ // textCustomComparator: this.textCustomComparator,
|
|
|
|
+ // comparator: this.testComparator
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
this.rowSelection = 'multiple'
|
|
this.rowSelection = 'multiple'
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ window.onresize = this.windowResize
|
|
this.gridApi = this.gridOptions.api
|
|
this.gridApi = this.gridOptions.api
|
|
this.gridColumnApi = this.gridOptions.columnApi
|
|
this.gridColumnApi = this.gridOptions.columnApi
|
|
// var column = this.gridColumnApi.getColumn('id')
|
|
// var column = this.gridColumnApi.getColumn('id')
|
|
@@ -221,13 +154,16 @@ export default {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ windowResize() {
|
|
|
|
+ this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
|
|
|
|
+ },
|
|
handlerDelete(ids) {
|
|
handlerDelete(ids) {
|
|
this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
|
|
this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- API_CallingNcError.remove(ids).then(
|
|
|
|
|
|
+ API_ErrorLog.remove(ids).then(
|
|
response => {
|
|
response => {
|
|
this.getList()
|
|
this.getList()
|
|
this.$message({
|
|
this.$message({
|
|
@@ -249,7 +185,7 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
clearError() {
|
|
clearError() {
|
|
- API_CallingNcError.clearError().then(res => {
|
|
|
|
|
|
+ API_ErrorLog.clearError().then(res => {
|
|
this.getList()
|
|
this.getList()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -269,7 +205,7 @@ export default {
|
|
this.loading = true
|
|
this.loading = true
|
|
const param = this.MixinClone(this.params)
|
|
const param = this.MixinClone(this.params)
|
|
this.gridApi.showLoadingOverlay()
|
|
this.gridApi.showLoadingOverlay()
|
|
- API_CallingNcError.getList(param).then(response => {
|
|
|
|
|
|
+ API_ErrorLog.getList(param).then(response => {
|
|
this.loading = false
|
|
this.loading = false
|
|
// this.tableData = [...response.data]
|
|
// this.tableData = [...response.data]
|
|
this.pageData = {
|
|
this.pageData = {
|
|
@@ -299,12 +235,12 @@ export default {
|
|
}
|
|
}
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- showDetail(id) {
|
|
|
|
- this.errorId = id
|
|
|
|
|
|
+ showDetail(row) {
|
|
|
|
+ this.selectedRow = { ...row.data }
|
|
this.shopVisible = true
|
|
this.shopVisible = true
|
|
},
|
|
},
|
|
forDate(row, column, cellValue) {
|
|
forDate(row, column, cellValue) {
|
|
- return unix2Date(row.create_time)
|
|
|
|
|
|
+ return unixToDate(row.create_time)
|
|
},
|
|
},
|
|
testComparator(valueA, valueB, nodeA, nodeB, isInverted) {
|
|
testComparator(valueA, valueB, nodeA, nodeB, isInverted) {
|
|
console.log('a', new Date(valueA))
|
|
console.log('a', new Date(valueA))
|
|
@@ -323,12 +259,9 @@ export default {
|
|
return 1
|
|
return 1
|
|
} else if (new Date(valueA) > cellDateMidNight) {
|
|
} else if (new Date(valueA) > cellDateMidNight) {
|
|
return -1
|
|
return -1
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|
|
-
|
|
|
|
- return 0
|
|
|
|
- // return console.log(valueA)
|
|
|
|
},
|
|
},
|
|
gridSortChange(param) {
|
|
gridSortChange(param) {
|
|
console.log('sortparam', param)
|
|
console.log('sortparam', param)
|
|
@@ -381,12 +314,13 @@ export default {
|
|
return true
|
|
return true
|
|
},
|
|
},
|
|
hashValueGetter(params) {
|
|
hashValueGetter(params) {
|
|
- return params.node.rowIndex + 1
|
|
|
|
|
|
+ // return params.node.rowIndex + 1
|
|
|
|
+ return ''
|
|
},
|
|
},
|
|
dateValueFormatter(params) {
|
|
dateValueFormatter(params) {
|
|
- console.log('ss', params)
|
|
|
|
- return unix2Date(params.value)
|
|
|
|
|
|
+ return unixToDate(params.value)
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|