From eef1ef0be935d4a3d8fc691b2666f41796b2d4a5 Mon Sep 17 00:00:00 2001 From: gaoshp <291585735@qq.com> Date: 星期一, 04 十一月 2024 19:57:08 +0800 Subject: [PATCH] 增加列表显示 --- src/views/setting/log/index.vue | 184 +++++++++++++++++++++++---------------------- 1 files changed, 94 insertions(+), 90 deletions(-) diff --git a/src/views/setting/log/index.vue b/src/views/setting/log/index.vue index 5863c8e..13484c7 100644 --- a/src/views/setting/log/index.vue +++ b/src/views/setting/log/index.vue @@ -1,7 +1,8 @@ <template> <el-container> <el-aside width="220px"> - <el-tree ref="category" class="menu" node-key="label" :data="category" :default-expanded-keys="['绯荤粺鏃ュ織']" current-node-key="绯荤粺鏃ュ織" :highlight-current="true" :expand-on-click-node="false"> + <el-tree :expand-on-click-node="false" ref="category" class="menu" node-key="label" :data="category" + :default-expanded-keys="['绯荤粺鏃ュ織']" current-node-key="绯荤粺鏃ュ織" :highlight-current="true"> </el-tree> </el-aside> <el-container> @@ -9,7 +10,8 @@ <el-container> <el-header> <div class="left-panel"> - <el-date-picker v-model="date" type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker> + <el-date-picker v-model="date" type="datetimerange" range-separator="鑷�" + start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker> </div> <div class="right-panel"> @@ -22,9 +24,12 @@ <scTable ref="table" :apiObj="apiObj" stripe highlightCurrentRow @row-click="rowClick"> <el-table-column label="绾у埆" prop="level" width="60"> <template #default="scope"> - <el-icon v-if="scope.row.level=='error'" style="color: #F56C6C;"><el-icon-circle-close-filled /></el-icon> - <el-icon v-if="scope.row.level=='warn'" style="color: #E6A23C;"><el-icon-warning-filled /></el-icon> - <el-icon v-if="scope.row.level=='info'" style="color: #409EFF;"><el-icon-info-filled /></el-icon> + <el-icon v-if="scope.row.level == 'error'" + style="color: #F56C6C;"><el-icon-circle-close-filled /></el-icon> + <el-icon v-if="scope.row.level == 'warn'" + style="color: #E6A23C;"><el-icon-warning-filled /></el-icon> + <el-icon v-if="scope.row.level == 'info'" + style="color: #409EFF;"><el-icon-info-filled /></el-icon> </template> </el-table-column> <el-table-column label="ID" prop="id" width="180"></el-table-column> @@ -47,96 +52,95 @@ </template> <script> - import info from './info' - import scEcharts from '@/components/scEcharts' +import info from './info' +import scEcharts from '@/components/scEcharts' - export default { - name: 'log', - components: { - info, - scEcharts - }, - data() { - return { - infoDrawer: false, - logsChartOption: { - color: ['#409eff','#e6a23c','#f56c6c'], - grid: { - top: '0px', - left: '10px', - right: '10px', - bottom: '0px' - }, - tooltip: { - trigger: 'axis' - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: ['2021-07-01', '2021-07-02', '2021-07-03', '2021-07-04', '2021-07-05', '2021-07-06', '2021-07-07', '2021-07-08', '2021-07-09', '2021-07-10', '2021-07-11', '2021-07-12', '2021-07-13', '2021-07-14', '2021-07-15'] - }, - yAxis: { - show: false, - type: 'value' - }, - series: [{ - data: [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 70, 110], - type: 'bar', - stack: 'log', - barWidth: '15px' - }, - { - data: [15, 26, 7, 12, 13, 9, 21, 15, 26, 7, 12, 13, 9, 21, 12, 3], - type: 'bar', - stack: 'log', - barWidth: '15px' - }, - { - data: [0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - type: 'bar', - stack: 'log', - barWidth: '15px' - }] +export default { + name: 'log', + components: { + info, + scEcharts + }, + data() { + return { + infoDrawer: false, + logsChartOption: { + color: ['#409eff', '#e6a23c', '#f56c6c'], + grid: { + top: '0px', + left: '10px', + right: '10px', + bottom: '0px' }, - category: [ - { - label: '绯荤粺鏃ュ織', - children: [ - {label: 'debug'}, - {label: 'info'}, - {label: 'warn'}, - {label: 'error'}, - {label: 'fatal'} - ] - }, - { - label: '搴旂敤鏃ュ織', - children: [ - {label: 'selfHelp'}, - {label: 'WechatApp'} - ] - } - ], - date: [], - apiObj: this.$API.system.log.list, - search: { - keyword: "" - } - } - }, - methods: { - upsearch(){ - + tooltip: { + trigger: 'axis' + }, + xAxis: { + type: 'category', + boundaryGap: false, + data: ['2021-07-01', '2021-07-02', '2021-07-03', '2021-07-04', '2021-07-05', '2021-07-06', '2021-07-07', '2021-07-08', '2021-07-09', '2021-07-10', '2021-07-11', '2021-07-12', '2021-07-13', '2021-07-14', '2021-07-15'] + }, + yAxis: { + show: false, + type: 'value' + }, + series: [{ + data: [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 70, 110], + type: 'bar', + stack: 'log', + barWidth: '15px' + }, + { + data: [15, 26, 7, 12, 13, 9, 21, 15, 26, 7, 12, 13, 9, 21, 12, 3], + type: 'bar', + stack: 'log', + barWidth: '15px' + }, + { + data: [0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + type: 'bar', + stack: 'log', + barWidth: '15px' + }] }, - rowClick(row){ - this.infoDrawer = true - this.$nextTick(() => { - this.$refs.info.setData(row) - }) + category: [ + { + label: '绯荤粺鏃ュ織', + children: [ + { label: 'debug' }, + { label: 'info' }, + { label: 'warn' }, + { label: 'error' }, + { label: 'fatal' } + ] + }, + { + label: '搴旂敤鏃ュ織', + children: [ + { label: 'selfHelp' }, + { label: 'WechatApp' } + ] + } + ], + date: [], + apiObj: this.$API.system.log.list, + search: { + keyword: "" } } + }, + methods: { + upsearch() { + + }, + rowClick(row) { + this.infoDrawer = true + this.$nextTick(() => { + this.$refs.info.setData(row) + }) + } } +} </script> -<style> -</style> +<style></style> -- Gitblit v1.9.3