代码优化,组件复用
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search :query="query"/>
|
||||
<eHeader :query="query"/>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" border style="width: 100%;">
|
||||
<el-table-column prop="username" label="用户名"/>
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-table-column prop="description" label="描述"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="method" label="方法名称"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="params" label="参数"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="exceptionDetail" label="异常详细"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="exceptionDetail" label="异常堆栈信息"/>
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
@@ -41,9 +41,9 @@
|
||||
<script>
|
||||
import initData from '../../../mixins/initData'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import search from './module/search'
|
||||
import eHeader from './module/header'
|
||||
export default {
|
||||
components: { search },
|
||||
components: { eHeader },
|
||||
mixins: [initData],
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 查询条件
|
||||
export default {
|
||||
props: {
|
||||
query: {
|
||||
@@ -24,8 +24,8 @@ export default {
|
||||
name: 'Msg',
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 132 + 'px;',
|
||||
data: [{ name: 'elAdmin-', timestamp: parseTime(new Date().getTime()), threadName: 'system-prompt-message', level: 'INFO', className: 'me.zhengjie.AppRun' + ' :', body: '(*^ω^*) 欢迎使用,暂无日志输出~' }],
|
||||
height: document.documentElement.clientHeight - 95 + 'px;',
|
||||
data: [{ name: 'elAdmin-', timestamp: new Date(), threadName: 'system-prompt-message', level: 'INFO', className: 'me.zhengjie.AppRun' + ' :', body: 'Welcome, no log output~' }],
|
||||
// level
|
||||
INFO: '#0000ff', WARN: '#FFFF00', ERROR: '#FF0000', DEBUG: '#DEA000'
|
||||
}
|
||||
@@ -99,7 +99,6 @@ export default {
|
||||
}
|
||||
},
|
||||
getColor(level) {
|
||||
// INFO: '#0000ff', WARN: '#FFFF00', ERROR: '#FF0000', DEBUG: '#DEA000',
|
||||
if (level === 'INFO') {
|
||||
return this.INFO
|
||||
} else if (level === 'WARN') {
|
||||
@@ -115,5 +114,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
textarea,input,button{outline:0}.container .buttons .closes,.container .buttons .minimize,.container .buttons .maximize{padding:0;margin:0;margin-right:6px;width:12px;height:12px;border:1px solid rgba(0,0,0,0);border-radius:6px}.container{width:100%;margin:5px}.container .handle{height:38px;background:#f9f9f9;border:1px solid #eee;border-top-left-radius:3px;border-top-right-radius:3px;font-family:'consolas';font-size:13px;line-height:38px;text-align:center}.container .buttons{position:absolute;float:left;margin:0 8px}.container .buttons .closes{background-color:#fc625d}.container .buttons .minimize{margin-left:8px;background-color:#fdbc40}.container .buttons .maximize{margin-left:8px;background-color:#35cd4b}.container .console{font-family:consolas;overflow-y:scroll;background:#494949;color:#f7f7f7;padding:10px;font-size:14px}
|
||||
button,input,textarea{outline:0}.container .buttons .closes,.container .buttons .maximize,.container .buttons .minimize{padding:0;margin:0;margin-right:6px;width:12px;height:12px;border:1px solid transparent;border-radius:6px}.container{width:100%;margin:5px}.container .console{font-family:consolas;overflow-y:scroll;background:#494949;color:#f7f7f7;padding:10px;font-size:14px}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user