feat: add message hook

This commit is contained in:
xingyu
2022-07-21 17:42:25 +08:00
parent 0cb6dd585b
commit 1179ca1a8a
8 changed files with 128 additions and 79 deletions

View File

@ -8,7 +8,8 @@ import type { ApiErrorLogVO } from '@/api/infra/apiErrorLog/types'
import { allSchemas } from './apiErrorLog.data'
import * as ApiErrorLogApi from '@/api/infra/apiErrorLog'
import { InfraApiErrorLogProcessStatusEnum } from '@/utils/constants'
import { ElMessage, ElMessageBox } from 'element-plus'
import { useMessage } from '@/hooks/web/useMessage'
const message = useMessage()
const { t } = useI18n() // 国际化
// ========== 列表相关 ==========
@ -36,14 +37,11 @@ const handleDetail = (row: ApiErrorLogVO) => {
}
// 异常处理操作
const handleProcessClick = (row: ApiErrorLogVO, processSttatus: number, type: string) => {
ElMessageBox.confirm('确认标记为' + type + '?', t('common.reminder'), {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
type: 'warning'
})
message
.confirm('确认标记为' + type + '?', t('common.reminder'))
.then(async () => {
ApiErrorLogApi.updateApiErrorLogPageApi(row.id, processSttatus).then(() => {
ElMessage.success(t('common.updateSuccess'))
message.success(t('common.updateSuccess'))
getList()
})
})