|
|
@@ -1,175 +1,169 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<!-- 搜索区域 -->
|
|
|
- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" class="search-form">
|
|
|
- <el-form-item label="错误类型" prop="errorType">
|
|
|
- <el-select v-model="queryParams.errorType" placeholder="请选择" clearable style="width: 120px">
|
|
|
- <el-option label="系统错误" value="SYSTEM" />
|
|
|
- <el-option label="业务错误" value="BUSINESS" />
|
|
|
- <el-option label="API错误" value="API" />
|
|
|
- <el-option label="SQL错误" value="SQL" />
|
|
|
- <el-option label="认证错误" value="AUTH" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="错误级别" prop="errorLevel">
|
|
|
- <el-select v-model="queryParams.errorLevel" placeholder="请选择" clearable style="width: 100px">
|
|
|
- <el-option label="ERROR" value="ERROR" />
|
|
|
- <el-option label="WARN" value="WARN" />
|
|
|
- <el-option label="FATAL" value="FATAL" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择" clearable style="width: 100px">
|
|
|
- <el-option label="未处理" value="0" />
|
|
|
- <el-option label="已处理" value="1" />
|
|
|
- <el-option label="已忽略" value="2" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="错误信息" prop="errorMessage">
|
|
|
- <el-input v-model="queryParams.errorMessage" placeholder="请输入" clearable @keyup.enter="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="发生时间" style="width: 308px;">
|
|
|
- <el-date-picker
|
|
|
- v-model="dateRange"
|
|
|
+ <a-form :model="queryParams" ref="queryRef" layout="inline" v-show="showSearch" class="search-form">
|
|
|
+ <a-form-item label="错误类型" name="errorType">
|
|
|
+ <a-select v-model:value="queryParams.errorType" placeholder="请选择" allow-clear style="width: 120px">
|
|
|
+ <a-select-option value="SYSTEM">系统错误</a-select-option>
|
|
|
+ <a-select-option value="BUSINESS">业务错误</a-select-option>
|
|
|
+ <a-select-option value="API">API错误</a-select-option>
|
|
|
+ <a-select-option value="SQL">SQL错误</a-select-option>
|
|
|
+ <a-select-option value="AUTH">认证错误</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="错误级别" name="errorLevel">
|
|
|
+ <a-select v-model:value="queryParams.errorLevel" placeholder="请选择" allow-clear style="width: 100px">
|
|
|
+ <a-select-option value="ERROR">ERROR</a-select-option>
|
|
|
+ <a-select-option value="WARN">WARN</a-select-option>
|
|
|
+ <a-select-option value="FATAL">FATAL</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="状态" name="status">
|
|
|
+ <a-select v-model:value="queryParams.status" placeholder="请选择" allow-clear style="width: 100px">
|
|
|
+ <a-select-option value="0">未处理</a-select-option>
|
|
|
+ <a-select-option value="1">已处理</a-select-option>
|
|
|
+ <a-select-option value="2">已忽略</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="错误信息" name="errorMessage">
|
|
|
+ <a-input v-model:value="queryParams.errorMessage" placeholder="请输入" allow-clear @pressEnter="handleQuery" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="发生时间">
|
|
|
+ <a-range-picker
|
|
|
+ v-model:value="dateRange"
|
|
|
value-format="YYYY-MM-DD"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
+ format="YYYY-MM-DD"
|
|
|
+ style="width: 308px"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button type="primary" @click="handleQuery"><SearchOutlined />搜索</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetQuery"><ReloadOutlined />重置</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
|
|
|
<!-- 操作按钮 -->
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="success" plain icon="Check" :disabled="multiple" @click="handleBatchResolve('1')" v-hasPermi="['monitor:errorLog:resolve']">
|
|
|
- 批量处理
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="warning" plain icon="Close" :disabled="multiple" @click="handleBatchResolve('2')" v-hasPermi="['monitor:errorLog:resolve']">
|
|
|
- 批量忽略
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['monitor:errorLog:remove']">
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button type="danger" plain icon="Delete" @click="handleClean" v-hasPermi="['monitor:errorLog:clean']">
|
|
|
- 清空
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
|
|
- </el-row>
|
|
|
+ <div class="button-toolbar">
|
|
|
+ <a-row :gutter="10">
|
|
|
+ <a-col :span="1.5">
|
|
|
+ <a-button type="primary" style="background-color: #52c41a; border-color: #52c41a" :disabled="multiple" @click="handleBatchResolve('1')" v-hasPermi="['monitor:errorLog:resolve']">
|
|
|
+ <CheckOutlined />批量处理
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1.5">
|
|
|
+ <a-button type="primary" style="background-color: #faad14; border-color: #faad14" :disabled="multiple" @click="handleBatchResolve('2')" v-hasPermi="['monitor:errorLog:resolve']">
|
|
|
+ <CloseOutlined />批量忽略
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1.5">
|
|
|
+ <a-button danger :disabled="multiple" @click="handleDelete" v-hasPermi="['monitor:errorLog:remove']">
|
|
|
+ <DeleteOutlined />删除
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="1.5">
|
|
|
+ <a-button danger @click="handleClean" v-hasPermi="['monitor:errorLog:clean']">
|
|
|
+ <DeleteOutlined />清空
|
|
|
+ </a-button>
|
|
|
+ </a-col>
|
|
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 数据表格 -->
|
|
|
- <el-table v-loading="loading" :data="errorList" @selection-change="handleSelectionChange" row-key="errorId">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="错误类型" prop="errorType" width="100" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-tag :type="getErrorTypeTag(scope.row.errorType)" size="small">{{ scope.row.errorType }}</el-tag>
|
|
|
+ <a-table
|
|
|
+ :loading="loading"
|
|
|
+ :data-source="errorList"
|
|
|
+ :columns="tableColumns"
|
|
|
+ :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: handleSelectionChange }"
|
|
|
+ :row-key="record => record.errorId"
|
|
|
+ :pagination="false"
|
|
|
+ >
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="column.key === 'errorType'">
|
|
|
+ <a-tag :color="getErrorTypeColor(record.errorType)">{{ record.errorType }}</a-tag>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="级别" prop="errorLevel" width="80" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-tag :type="getErrorLevelTag(scope.row.errorLevel)" size="small">{{ scope.row.errorLevel }}</el-tag>
|
|
|
+ <template v-else-if="column.key === 'errorLevel'">
|
|
|
+ <a-tag :color="getErrorLevelColor(record.errorLevel)">{{ record.errorLevel }}</a-tag>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="错误信息" prop="errorMessage" min-width="250" show-overflow-tooltip />
|
|
|
- <el-table-column label="请求URL" prop="requestUrl" width="200" show-overflow-tooltip />
|
|
|
- <el-table-column label="操作人" prop="userName" width="100" align="center" />
|
|
|
- <el-table-column label="次数" prop="occurCount" width="70" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-badge :value="scope.row.occurCount" :max="99" :type="scope.row.occurCount > 10 ? 'danger' : 'primary'" />
|
|
|
+ <template v-else-if="column.key === 'occurCount'">
|
|
|
+ <a-badge :count="record.occurCount" :number-style="{ backgroundColor: record.occurCount > 10 ? '#ff4d4f' : '#1890ff' }" />
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" prop="status" width="80" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-tag :type="getStatusTag(scope.row.status)" size="small">{{ getStatusText(scope.row.status) }}</el-tag>
|
|
|
+ <template v-else-if="column.key === 'status'">
|
|
|
+ <a-tag :color="getStatusColor(record.status)">{{ getStatusText(record.status) }}</a-tag>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="发生时间" prop="createTime" width="160" align="center" />
|
|
|
- <el-table-column label="操作" width="180" align="center" fixed="right">
|
|
|
- <template #default="scope">
|
|
|
- <el-button link type="primary" icon="View" @click="handleView(scope.row)">详情</el-button>
|
|
|
- <el-button link type="success" icon="Check" @click="handleResolve(scope.row, '1')" v-if="scope.row.status === '0'" v-hasPermi="['monitor:errorLog:resolve']">处理</el-button>
|
|
|
- <el-button link type="warning" icon="Close" @click="handleResolve(scope.row, '2')" v-if="scope.row.status === '0'" v-hasPermi="['monitor:errorLog:resolve']">忽略</el-button>
|
|
|
+ <template v-else-if="column.key === 'action'">
|
|
|
+ <a-button type="link" size="small" @click="handleView(record)"><EyeOutlined />详情</a-button>
|
|
|
+ <a-button type="link" size="small" @click="handleResolve(record, '1')" v-if="record.status === '0'" v-hasPermi="['monitor:errorLog:resolve']" style="color: #52c41a"><CheckOutlined />处理</a-button>
|
|
|
+ <a-button type="link" size="small" @click="handleResolve(record, '2')" v-if="record.status === '0'" v-hasPermi="['monitor:errorLog:resolve']" style="color: #faad14"><CloseOutlined />忽略</a-button>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
|
<!-- 详情对话框 -->
|
|
|
- <el-dialog title="错误详情" v-model="detailOpen" width="800px" append-to-body>
|
|
|
- <el-descriptions :column="2" border label-width="100px">
|
|
|
- <el-descriptions-item label="错误ID">{{ detail.errorId }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="错误代码">{{ detail.errorCode }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="错误类型">
|
|
|
- <el-tag :type="getErrorTypeTag(detail.errorType)" size="small">{{ detail.errorType }}</el-tag>
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="错误级别">
|
|
|
- <el-tag :type="getErrorLevelTag(detail.errorLevel)" size="small">{{ detail.errorLevel }}</el-tag>
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="请求URL" :span="2">{{ detail.requestUrl }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="请求方法">{{ detail.requestMethod }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="请求IP">{{ detail.requestIp }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="请求参数" :span="2" v-if="detail.requestParams">{{ detail.requestParams }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="操作人">{{ detail.userName }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="发生次数">{{ detail.occurCount }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="首次时间">{{ detail.firstTime }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="最近时间">{{ detail.lastTime }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="来源类" :span="2">{{ detail.sourceClass }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="来源方法">{{ detail.sourceMethod }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="行号">{{ detail.sourceLine }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="状态">
|
|
|
- <el-tag :type="getStatusTag(detail.status)" size="small">{{ getStatusText(detail.status) }}</el-tag>
|
|
|
- </el-descriptions-item>
|
|
|
- <el-descriptions-item label="处理人">{{ detail.resolveBy || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="处理时间" :span="2">{{ detail.resolveTime || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="处理备注" :span="2">{{ detail.resolveRemark || '-' }}</el-descriptions-item>
|
|
|
- <el-descriptions-item label="错误消息" :span="2">{{ detail.errorMessage }}</el-descriptions-item>
|
|
|
- </el-descriptions>
|
|
|
+ <a-modal title="错误详情" v-model:open="detailOpen" width="800px" :footer="null">
|
|
|
+ <a-descriptions :column="2" bordered>
|
|
|
+ <a-descriptions-item label="错误ID">{{ detail.errorId }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="错误代码">{{ detail.errorCode }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="错误类型">
|
|
|
+ <a-tag :color="getErrorTypeColor(detail.errorType)">{{ detail.errorType }}</a-tag>
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="错误级别">
|
|
|
+ <a-tag :color="getErrorLevelColor(detail.errorLevel)">{{ detail.errorLevel }}</a-tag>
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="请求URL" :span="2">{{ detail.requestUrl }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="请求方法">{{ detail.requestMethod }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="请求IP">{{ detail.requestIp }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="请求参数" :span="2" v-if="detail.requestParams">{{ detail.requestParams }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="操作人">{{ detail.userName }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="发生次数">{{ detail.occurCount }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="首次时间">{{ detail.firstTime }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="最近时间">{{ detail.lastTime }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="来源类" :span="2">{{ detail.sourceClass }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="来源方法">{{ detail.sourceMethod }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="行号">{{ detail.sourceLine }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="状态">
|
|
|
+ <a-tag :color="getStatusColor(detail.status)">{{ getStatusText(detail.status) }}</a-tag>
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="处理人">{{ detail.resolveBy || '-' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="处理时间" :span="2">{{ detail.resolveTime || '-' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="处理备注" :span="2">{{ detail.resolveRemark || '-' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="错误消息" :span="2">{{ detail.errorMessage }}</a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
|
|
|
- <el-divider content-position="left">堆栈信息</el-divider>
|
|
|
- <el-input
|
|
|
- v-model="detail.errorDetail"
|
|
|
- type="textarea"
|
|
|
+ <a-divider orientation="left">堆栈信息</a-divider>
|
|
|
+ <a-textarea
|
|
|
+ v-model:value="detail.errorDetail"
|
|
|
:rows="12"
|
|
|
readonly
|
|
|
class="stack-trace"
|
|
|
/>
|
|
|
|
|
|
<template #footer v-if="detail.status === '0'">
|
|
|
- <el-button @click="detailOpen = false">关闭</el-button>
|
|
|
- <el-button type="warning" @click="handleResolveFromDetail('2')">忽略</el-button>
|
|
|
- <el-button type="success" @click="handleResolveFromDetail('1')">标记已处理</el-button>
|
|
|
+ <a-button @click="detailOpen = false">关闭</a-button>
|
|
|
+ <a-button type="primary" style="background-color: #faad14; border-color: #faad14" @click="handleResolveFromDetail('2')">忽略</a-button>
|
|
|
+ <a-button type="primary" style="background-color: #52c41a; border-color: #52c41a" @click="handleResolveFromDetail('1')">标记已处理</a-button>
|
|
|
</template>
|
|
|
- </el-dialog>
|
|
|
+ </a-modal>
|
|
|
|
|
|
<!-- 处理备注对话框 -->
|
|
|
- <el-dialog title="处理备注" v-model="resolveOpen" width="500px" append-to-body>
|
|
|
- <el-form ref="resolveRef" :model="resolveForm" label-width="80px">
|
|
|
- <el-form-item label="处理备注">
|
|
|
- <el-input v-model="resolveForm.remark" type="textarea" :rows="3" placeholder="请输入处理备注(可选)" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <a-modal title="处理备注" v-model:open="resolveOpen" width="500px">
|
|
|
+ <a-form ref="resolveRef" :model="resolveForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
|
|
|
+ <a-form-item label="处理备注">
|
|
|
+ <a-textarea v-model:value="resolveForm.remark" :rows="3" placeholder="请输入处理备注(可选)" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
<template #footer>
|
|
|
- <el-button @click="resolveOpen = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitResolve">确定</el-button>
|
|
|
+ <a-button @click="resolveOpen = false">取消</a-button>
|
|
|
+ <a-button type="primary" @click="submitResolve">确定</a-button>
|
|
|
</template>
|
|
|
- </el-dialog>
|
|
|
+ </a-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name="ErrorLog">
|
|
|
+import { SearchOutlined, ReloadOutlined, DeleteOutlined, CheckOutlined, CloseOutlined, EyeOutlined } from '@ant-design/icons-vue'
|
|
|
import { listErrorLog, getErrorLog, resolveError, batchResolve, delErrorLog, cleanErrorLog } from '@/api/monitor/errorLog'
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
@@ -177,6 +171,7 @@ const { proxy } = getCurrentInstance()
|
|
|
const loading = ref(true)
|
|
|
const showSearch = ref(true)
|
|
|
const errorList = ref([])
|
|
|
+const selectedRowKeys = ref([])
|
|
|
const ids = ref([])
|
|
|
const multiple = ref(true)
|
|
|
const total = ref(0)
|
|
|
@@ -195,6 +190,19 @@ const queryParams = ref({
|
|
|
status: null
|
|
|
})
|
|
|
|
|
|
+// 表格列配置
|
|
|
+const tableColumns = [
|
|
|
+ { title: '错误类型', key: 'errorType', width: 100, align: 'center' },
|
|
|
+ { title: '级别', key: 'errorLevel', width: 80, align: 'center' },
|
|
|
+ { title: '错误信息', dataIndex: 'errorMessage', key: 'errorMessage', ellipsis: true },
|
|
|
+ { title: '请求URL', dataIndex: 'requestUrl', key: 'requestUrl', width: 200, ellipsis: true },
|
|
|
+ { title: '操作人', dataIndex: 'userName', key: 'userName', width: 100, align: 'center' },
|
|
|
+ { title: '次数', key: 'occurCount', width: 70, align: 'center' },
|
|
|
+ { title: '状态', key: 'status', width: 80, align: 'center' },
|
|
|
+ { title: '发生时间', dataIndex: 'createTime', key: 'createTime', width: 160, align: 'center' },
|
|
|
+ { title: '操作', key: 'action', width: 180, align: 'center', fixed: 'right' }
|
|
|
+]
|
|
|
+
|
|
|
function getList() {
|
|
|
loading.value = true
|
|
|
listErrorLog(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
|
|
@@ -215,9 +223,10 @@ function resetQuery() {
|
|
|
handleQuery()
|
|
|
}
|
|
|
|
|
|
-function handleSelectionChange(selection) {
|
|
|
- ids.value = selection.map(item => item.errorId)
|
|
|
- multiple.value = !selection.length
|
|
|
+function handleSelectionChange(selectedKeys) {
|
|
|
+ selectedRowKeys.value = selectedKeys
|
|
|
+ ids.value = selectedKeys
|
|
|
+ multiple.value = !selectedKeys.length
|
|
|
}
|
|
|
|
|
|
function handleView(row) {
|
|
|
@@ -303,19 +312,19 @@ function handleClean() {
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
|
|
|
-function getErrorTypeTag(type) {
|
|
|
- const map = { SYSTEM: 'danger', BUSINESS: 'warning', API: 'info', SQL: 'danger', AUTH: 'warning' }
|
|
|
- return map[type] || 'info'
|
|
|
+function getErrorTypeColor(type) {
|
|
|
+ const map = { SYSTEM: 'red', BUSINESS: 'orange', API: 'blue', SQL: 'red', AUTH: 'orange' }
|
|
|
+ return map[type] || 'default'
|
|
|
}
|
|
|
|
|
|
-function getErrorLevelTag(level) {
|
|
|
- const map = { FATAL: 'danger', ERROR: 'danger', WARN: 'warning' }
|
|
|
- return map[level] || 'info'
|
|
|
+function getErrorLevelColor(level) {
|
|
|
+ const map = { FATAL: 'red', ERROR: 'red', WARN: 'orange' }
|
|
|
+ return map[level] || 'default'
|
|
|
}
|
|
|
|
|
|
-function getStatusTag(status) {
|
|
|
- const map = { '0': 'danger', '1': 'success', '2': 'info' }
|
|
|
- return map[status] || 'info'
|
|
|
+function getStatusColor(status) {
|
|
|
+ const map = { '0': 'red', '1': 'green', '2': 'default' }
|
|
|
+ return map[status] || 'default'
|
|
|
}
|
|
|
|
|
|
function getStatusText(status) {
|
|
|
@@ -326,22 +335,108 @@ function getStatusText(status) {
|
|
|
getList()
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-.search-form {
|
|
|
+<style lang="scss" scoped>
|
|
|
+// 搜索表单布局
|
|
|
+.search-form.ant-form-inline {
|
|
|
+ background: #fff;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 4px;
|
|
|
+
|
|
|
+ .ant-form-item {
|
|
|
+ margin-right: 16px;
|
|
|
+ margin-bottom: 16px;
|
|
|
+ display: inline-flex;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .ant-form-item-label {
|
|
|
+ padding-right: 8px;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ > label {
|
|
|
+ white-space: nowrap;
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-form-item-control {
|
|
|
+ flex: 0 0 auto;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-form-item-control-input {
|
|
|
+ min-height: 32px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 按钮工具栏
|
|
|
+.button-toolbar {
|
|
|
+ background: #fff;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 4px;
|
|
|
+
|
|
|
+ .ant-row {
|
|
|
+ margin: 0;
|
|
|
+
|
|
|
+ .ant-col {
|
|
|
+ .ant-btn {
|
|
|
+ margin-right: 8px;
|
|
|
+
|
|
|
+ &:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 表格容器
|
|
|
+.ant-table-wrapper {
|
|
|
background: #fff;
|
|
|
- padding: 20px 20px 0;
|
|
|
+ padding: 16px;
|
|
|
border-radius: 4px;
|
|
|
- margin-bottom: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+// 表格样式
|
|
|
+.ant-table {
|
|
|
+ .ant-table-thead > tr > th {
|
|
|
+ background-color: #fafafa;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #262626;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ant-table-tbody > tr > td {
|
|
|
+ padding: 12px 16px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 按钮图标间距
|
|
|
+.ant-btn {
|
|
|
+ .anticon + span,
|
|
|
+ span + .anticon {
|
|
|
+ margin-left: 4px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.stack-trace {
|
|
|
font-family: 'Consolas', 'Monaco', monospace;
|
|
|
font-size: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-:deep(.stack-trace .el-textarea__inner) {
|
|
|
background: #1e1e1e;
|
|
|
color: #d4d4d4;
|
|
|
- font-family: 'Consolas', 'Monaco', monospace;
|
|
|
+
|
|
|
+ :deep(.ant-input) {
|
|
|
+ background: #1e1e1e;
|
|
|
+ color: #d4d4d4;
|
|
|
+ font-family: 'Consolas', 'Monaco', monospace;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|