|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <content-wrap>
|
|
|
|
|
|
+ <ContentWrap>
|
|
<!-- 搜索工作栏 -->
|
|
<!-- 搜索工作栏 -->
|
|
<el-form
|
|
<el-form
|
|
class="-mb-15px"
|
|
class="-mb-15px"
|
|
@@ -25,10 +25,10 @@
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in getDictOptions(DICT_TYPE.USER_TYPE)"
|
|
|
|
- :key="parseInt(dict.value)"
|
|
|
|
|
|
+ v-for="dict in getIntDictOptions(DICT_TYPE.USER_TYPE)"
|
|
|
|
+ :key="dict.value"
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
- :value="parseInt(dict.value)"
|
|
|
|
|
|
+ :value="dict.value"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -53,12 +53,17 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="处理状态" prop="processStatus">
|
|
<el-form-item label="处理状态" prop="processStatus">
|
|
- <el-select v-model="queryParams.processStatus" placeholder="请选择处理状态" clearable>
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="queryParams.processStatus"
|
|
|
|
+ placeholder="请选择处理状态"
|
|
|
|
+ clearable
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
- v-for="dict in getDictOptions(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS)"
|
|
|
|
- :key="parseInt(dict.value)"
|
|
|
|
|
|
+ v-for="dict in getIntDictOptions(DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS)"
|
|
|
|
+ :key="dict.value"
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
- :value="parseInt(dict.value)"
|
|
|
|
|
|
+ :value="dict.value"
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -76,9 +81,10 @@
|
|
</el-button>
|
|
</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- </content-wrap>
|
|
|
|
|
|
+ </ContentWrap>
|
|
|
|
+
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
- <content-wrap>
|
|
|
|
|
|
+ <ContentWrap>
|
|
<el-table v-loading="loading" :data="list">
|
|
<el-table v-loading="loading" :data="list">
|
|
<el-table-column label="日志编号" align="center" prop="id" />
|
|
<el-table-column label="日志编号" align="center" prop="id" />
|
|
<el-table-column label="用户编号" align="center" prop="userId" />
|
|
<el-table-column label="用户编号" align="center" prop="userId" />
|
|
@@ -87,15 +93,17 @@
|
|
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
|
|
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="应用名" align="center" prop="applicationName" />
|
|
|
|
- <el-table-column label="请求方法名" align="center" prop="requestMethod" />
|
|
|
|
- <el-table-column label="请求地址" align="center" prop="requestUrl" width="250" />
|
|
|
|
- <el-table-column label="异常发生时间" align="center" prop="exceptionTime" width="180">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <span>{{ scope.row.exceptionTime }}</span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="异常名" align="center" prop="exceptionName" width="250" />
|
|
|
|
|
|
+ <el-table-column label="应用名" align="center" prop="applicationName" width="200" />
|
|
|
|
+ <el-table-column label="请求方法" align="center" prop="requestMethod" width="80" />
|
|
|
|
+ <el-table-column label="请求地址" align="center" prop="requestUrl" width="180" />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="异常发生时间"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="exceptionTime"
|
|
|
|
+ width="180"
|
|
|
|
+ :formatter="dateFormatter"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column label="异常名" align="center" prop="exceptionName" width="180" />
|
|
<el-table-column label="处理状态" align="center" prop="processStatus">
|
|
<el-table-column label="处理状态" align="center" prop="processStatus">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<dict-tag
|
|
<dict-tag
|
|
@@ -104,12 +112,12 @@
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="200">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
- @click="openModal(scope.row)"
|
|
|
|
|
|
+ @click="openDetail(scope.row)"
|
|
v-hasPermi="['infra:api-access-log:query']"
|
|
v-hasPermi="['infra:api-access-log:query']"
|
|
>
|
|
>
|
|
详细
|
|
详细
|
|
@@ -118,9 +126,7 @@
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
v-if="scope.row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT"
|
|
v-if="scope.row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT"
|
|
- @click="
|
|
|
|
- handleProcessClick(InfraApiErrorLogProcessStatusEnum.DONE, '已处理', scope.row.id)
|
|
|
|
- "
|
|
|
|
|
|
+ @click="handleProcess(scope.row.id, InfraApiErrorLogProcessStatusEnum.DONE)"
|
|
v-hasPermi="['infra:api-error-log:update-status']"
|
|
v-hasPermi="['infra:api-error-log:update-status']"
|
|
>
|
|
>
|
|
已处理
|
|
已处理
|
|
@@ -128,11 +134,8 @@
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
- icon="el-icon-check"
|
|
|
|
v-if="scope.row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT"
|
|
v-if="scope.row.processStatus === InfraApiErrorLogProcessStatusEnum.INIT"
|
|
- @click="
|
|
|
|
- handleProcessClick(InfraApiErrorLogProcessStatusEnum.IGNORE, '已忽略', scope.row.id)
|
|
|
|
- "
|
|
|
|
|
|
+ @click="handleProcess(scope.row.id, InfraApiErrorLogProcessStatusEnum.IGNORE)"
|
|
v-hasPermi="['infra:api-error-log:update-status']"
|
|
v-hasPermi="['infra:api-error-log:update-status']"
|
|
>
|
|
>
|
|
已忽略
|
|
已忽略
|
|
@@ -140,7 +143,6 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
-
|
|
|
|
<!-- 分页组件 -->
|
|
<!-- 分页组件 -->
|
|
<Pagination
|
|
<Pagination
|
|
:total="total"
|
|
:total="total"
|
|
@@ -148,18 +150,20 @@
|
|
v-model:limit="queryParams.pageSize"
|
|
v-model:limit="queryParams.pageSize"
|
|
@pagination="getList"
|
|
@pagination="getList"
|
|
/>
|
|
/>
|
|
- </content-wrap>
|
|
|
|
|
|
+ </ContentWrap>
|
|
|
|
|
|
<!-- 表单弹窗:详情 -->
|
|
<!-- 表单弹窗:详情 -->
|
|
- <api-error-log-detail ref="modalRef" />
|
|
|
|
|
|
+ <ApiErrorLogDetail ref="detailRef" />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="ApiErrorLog">
|
|
<script setup lang="ts" name="ApiErrorLog">
|
|
-import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
|
|
|
|
|
+import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
|
|
+import { dateFormatter } from '@/utils/formatTime'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
import * as ApiErrorLogApi from '@/api/infra/apiErrorLog'
|
|
import * as ApiErrorLogApi from '@/api/infra/apiErrorLog'
|
|
-import ApiErrorLogDetail from './detail.vue'
|
|
|
|
|
|
+import ApiErrorLogDetail from './ApiErrorLogDetail.vue'
|
|
import { InfraApiErrorLogProcessStatusEnum } from '@/utils/constants'
|
|
import { InfraApiErrorLogProcessStatusEnum } from '@/utils/constants'
|
|
|
|
+
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
const loading = ref(true) // 列表的加载中
|
|
@@ -182,13 +186,14 @@ const exportLoading = ref(false) // 导出的加载中
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
loading.value = true
|
|
loading.value = true
|
|
try {
|
|
try {
|
|
- const data = await ApiErrorLogApi.getApiErrorLogPageApi(queryParams)
|
|
|
|
|
|
+ const data = await ApiErrorLogApi.getApiErrorLogPage(queryParams)
|
|
list.value = data.list
|
|
list.value = data.list
|
|
total.value = data.total
|
|
total.value = data.total
|
|
} finally {
|
|
} finally {
|
|
loading.value = false
|
|
loading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
queryParams.pageNo = 1
|
|
queryParams.pageNo = 1
|
|
@@ -202,18 +207,19 @@ const resetQuery = () => {
|
|
}
|
|
}
|
|
|
|
|
|
/** 详情操作 */
|
|
/** 详情操作 */
|
|
-const modalRef = ref()
|
|
|
|
-const openModal = (data: ApiErrorLogApi.ApiErrorLogVO) => {
|
|
|
|
- modalRef.value.openModal(data)
|
|
|
|
|
|
+const detailRef = ref()
|
|
|
|
+const openDetail = (data: ApiErrorLogApi.ApiErrorLogVO) => {
|
|
|
|
+ detailRef.value.open(data)
|
|
}
|
|
}
|
|
|
|
|
|
/** 处理已处理 / 已忽略的操作 **/
|
|
/** 处理已处理 / 已忽略的操作 **/
|
|
-const handleProcessClick = async (processStatus: number, type: string, id: number) => {
|
|
|
|
|
|
+const handleProcess = async (id: number, processStatus: number) => {
|
|
try {
|
|
try {
|
|
// 操作的二次确认
|
|
// 操作的二次确认
|
|
|
|
+ const type = processStatus === InfraApiErrorLogProcessStatusEnum.DONE ? '已处理' : '已忽略'
|
|
await message.confirm('确认标记为' + type + '?')
|
|
await message.confirm('确认标记为' + type + '?')
|
|
// 执行操作
|
|
// 执行操作
|
|
- await ApiErrorLogApi.updateApiErrorLogPageApi(id, processStatus)
|
|
|
|
|
|
+ await ApiErrorLogApi.updateApiErrorLogPage(id, processStatus)
|
|
await message.success(type)
|
|
await message.success(type)
|
|
// 刷新列表
|
|
// 刷新列表
|
|
await getList()
|
|
await getList()
|
|
@@ -227,8 +233,8 @@ const handleExport = async () => {
|
|
await message.exportConfirm()
|
|
await message.exportConfirm()
|
|
// 发起导出
|
|
// 发起导出
|
|
exportLoading.value = true
|
|
exportLoading.value = true
|
|
- const data = await ApiErrorLogApi.exportApiErrorLogApi(queryParams)
|
|
|
|
- download.excel(data, '操作日志.xls')
|
|
|
|
|
|
+ const data = await ApiErrorLogApi.exportApiErrorLog(queryParams)
|
|
|
|
+ download.excel(data, '异常日志.xls')
|
|
} catch {
|
|
} catch {
|
|
} finally {
|
|
} finally {
|
|
exportLoading.value = false
|
|
exportLoading.value = false
|