diff --git a/src/api/errorNotification.ts b/src/api/errorNotification.ts new file mode 100644 index 0000000..5a81a83 --- /dev/null +++ b/src/api/errorNotification.ts @@ -0,0 +1,83 @@ +import { request } from '@/utils/request' + +// ErrorNotification 类型定义 +export interface ErrorNotification { + id?: number + + subscriptionKey?: string + + title?: string + + subscriptionDeviceIds?: string + + subscriptionDiscoverField?: string + + sendingMethod?: string + + discoverValue?: string + + detectionMethod?: string + + notifier?: string + + createBy?: number + + crateTime?: string + + notifierContent?: string + + abnormalReporting?: number + +} + +// ErrorNotification API +export const errorNotificationApi = { + // 分页查询 + 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' }) + }, + + // 新增 + create(data: ErrorNotification) { + return request({ url: '/biz/errorNotification', method: 'post', data }) + }, + + // 修改 + update(data: ErrorNotification) { + return request({ url: '/biz/errorNotification', method: 'put', data }) + }, + + // 删除 + 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' }) + }, + + // 导入 + 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' }) + } +} diff --git a/src/router/index.ts b/src/router/index.ts index b2c625a..731ea1b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -301,6 +301,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/views/biz/callingMaterials/index.vue'), meta: { title: '叫料记录', icon: 'ListOutline' } }, + { + path: 'biz/errorNotification', + name: 'errorNotification', + component: () => import('@/views/biz/errorNotification/index.vue'), + meta: { title: 'ErrorNotification', icon: 'ListOutline' } + }, { // 开发工具 path: 'tool/gen', diff --git a/src/views/biz/errorNotification/index.vue b/src/views/biz/errorNotification/index.vue new file mode 100644 index 0000000..bd47e00 --- /dev/null +++ b/src/views/biz/errorNotification/index.vue @@ -0,0 +1,449 @@ + + + + +