From 4c7d5b56aefcc6e526266975086cde4c2b35f297 Mon Sep 17 00:00:00 2001 From: shaoleiliu-netizen123 <480188199@qq.com> Date: Wed, 29 Jul 2026 13:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=B6=88=E6=81=AF=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/errorNotification.ts | 110 +++++++------- src/api/message.ts | 7 +- src/components/ErrorReportModal.vue | 218 ++++++++++++++++++++++++++++ src/layout/index.vue | 54 +++++-- 4 files changed, 322 insertions(+), 67 deletions(-) create mode 100644 src/components/ErrorReportModal.vue diff --git a/src/api/errorNotification.ts b/src/api/errorNotification.ts index 5a81a83..526afaf 100644 --- a/src/api/errorNotification.ts +++ b/src/api/errorNotification.ts @@ -2,82 +2,82 @@ import { request } from '@/utils/request' // ErrorNotification 类型定义 export interface ErrorNotification { - id?: number + id?: number - subscriptionKey?: string + subscriptionKey?: string - title?: string + title?: string - subscriptionDeviceIds?: string + subscriptionDeviceIds?: string - subscriptionDiscoverField?: string + subscriptionDiscoverField?: string - sendingMethod?: string + sendingMethod?: string - discoverValue?: string + discoverValue?: string - detectionMethod?: string + detectionMethod?: string - notifier?: string + notifier?: string - createBy?: number + createBy?: number - crateTime?: string + crateTime?: string - notifierContent?: string + notifierContent?: string - abnormalReporting?: number + abnormalReporting?: number } // ErrorNotification API export const errorNotificationApi = { - // 分页查询 - page(params: { page: number; pageSize: number }) { - return request({ url: '/biz/errorNotification/page', method: 'get', params }) - }, + // 分页查询 + page(params: { page: number; pageSize: number }) { + return request({ url: '/biz/errorNotification/page', method: 'get', params }) + }, - // 获取详情 - detail(id: string) { - return request({ url: `/biz/errorNotification/${id}`, method: 'get' }) - }, + // 获取详情 + detail(id: number) { + return request({ url: `/biz/errorNotification/${id}`, method: 'get' }) + }, - // 新增 - create(data: ErrorNotification) { - return request({ url: '/biz/errorNotification', method: 'post', data }) - }, + // 新增 + create(data: ErrorNotification) { + return request({ url: '/biz/errorNotification', method: 'post', data }) + }, - // 修改 - update(data: ErrorNotification) { - return request({ url: '/biz/errorNotification', method: 'put', data }) - }, + // 修改 + update(data: ErrorNotification) { + return request({ url: '/biz/errorNotification', method: 'put', data }) + }, - // 删除 - delete(ids: string[]) { - return request({ url: `/biz/errorNotification/${ids.join(',')}`, method: 'delete' }) - }, + // 删除 + delete(ids: string[]) { + return request({ url: `/biz/errorNotification/${ids.join(',')}`, method: 'delete' }) + }, - // 导出 - export(params?: { ids?: string[] }) { - const p: Record = {} - if (params?.ids?.length) p.ids = params.ids.join(',') - return request({ url: `/biz/errorNotification/export`, method: 'get', params: p, responseType: 'blob' }) - }, + // 导出 + export(params?: { ids?: string[] }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + return request({ url: `/biz/errorNotification/export`, method: 'get', params: p, responseType: 'blob' }) + }, - // 导入 - importData(file: File) { - const formData = new FormData() - formData.append('file', file) - return request<{ success: number; fail: number; errors: string[] }>({ - url: `/biz/errorNotification/import`, - method: 'post', - data: formData, - headers: { 'Content-Type': 'multipart/form-data' } - }) - }, + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/errorNotification/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, - // 下载导入模板 - downloadTemplate() { - return request({ url: `/biz/errorNotification/template`, method: 'get', responseType: 'blob' }) - } -} + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/errorNotification/template`, method: 'get', responseType: 'blob' }) + } +} \ No newline at end of file diff --git a/src/api/message.ts b/src/api/message.ts index 00b66ad..1584360 100644 --- a/src/api/message.ts +++ b/src/api/message.ts @@ -13,7 +13,12 @@ export interface SysNotice { status: number createBy?: number createName?: string - createTime?: string + createTime?: string, + abnormalReporting?:number, + reportReason?:string, + errorNotificationId?:number, + filler?:number, + filingStatus?:number, } export interface NoticeChannelOption { diff --git a/src/components/ErrorReportModal.vue b/src/components/ErrorReportModal.vue new file mode 100644 index 0000000..35d2b19 --- /dev/null +++ b/src/components/ErrorReportModal.vue @@ -0,0 +1,218 @@ + + + + + \ No newline at end of file diff --git a/src/layout/index.vue b/src/layout/index.vue index a91bac8..1857970 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -331,6 +331,13 @@ + + + @@ -382,6 +389,8 @@ import TabBar from '@/components/TabBar.vue' import SiteLogoMark from '@/components/SiteLogoMark.vue' import { noticeApi, chatApi, type SysNotice, type ChatMessage } from '@/api/message' import { iconMap as externalIconMap } from '@/utils/icons' +import ErrorReportModal from "@/components/ErrorReportModal.vue"; +import {errorNotificationApi} from "@/api/errorNotification.ts"; const route = useRoute() const router = useRouter() @@ -405,6 +414,7 @@ window.$message = message const collapsed = ref(false) const showProfileModal = ref(false) const showPasswordModal = ref(false) +const showErrorReportModal = ref(false) const messageTab = ref('notice') // 消息相关 @@ -599,18 +609,40 @@ function stripHtml(html: string | undefined): string { } // 点击通知 +//异常订阅内容 +const errorNotifiaction = ref({ + title: '', + devices: '', + sendingMethodName: '', + notifierName: '', + notifierContent: '' +}) +//是否需要填报 +const notice = ref( {}) async function handleNoticeClick(item: SysNotice) { - // 标记已读 - if (item.id) { - try { - await noticeApi.markAsRead(item.id) - // 刷新未读数量 - loadUnreadCount() - } catch (error) { - // 忽略 - } - } - router.push({ path: '/message/notice', query: { id: item.id?.toString() } }) + + + const res = await errorNotificationApi.detail(item.errorNotificationId); + errorNotifiaction.value = {...res} + errorNotifiaction.value.noticeId = item.id + notice.value = item + //异常填报直接弹窗 + showErrorReportModal.value = true + // if (item.abnormalReporting) { + // + // }else { + // // 标记已读 + // if (item.id) { + // try { + // await noticeApi.markAsRead(item.id) + // // 刷新未读数量 + // loadUnreadCount() + // } catch (error) { + // // 忽略 + // } + // } + // router.push({ path: '/message/notice', query: { id: item.id?.toString() } }) + // } } // 点击聊天