diff --git a/src/api/home/operation/alarm.ts b/src/api/home/operation/alarm.ts new file mode 100644 index 0000000..2723ec8 --- /dev/null +++ b/src/api/home/operation/alarm.ts @@ -0,0 +1,41 @@ +/** + * 设备当前报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceCurrentListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/listPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查看 +export function deviceAlarmView(id: any) { + return request({ + url: '/maintenance/alarmRecords/deviceAlarmView', + method: 'post', + data: { + id, + }, + }) +} +// 挂起 +export function pendingDeviceAlarm(data: any) { + return request({ + url: '/maintenance/alarmRecords/suspend', + method: 'post', + data, + }) +} +// 批量删除 +export function batchRemoveRow(ids: any) { + return request({ + url: '/maintenance/alarmRecords/batchDelete', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/api/home/operation/alarm.ts b/src/api/home/operation/alarm.ts new file mode 100644 index 0000000..2723ec8 --- /dev/null +++ b/src/api/home/operation/alarm.ts @@ -0,0 +1,41 @@ +/** + * 设备当前报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceCurrentListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/listPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查看 +export function deviceAlarmView(id: any) { + return request({ + url: '/maintenance/alarmRecords/deviceAlarmView', + method: 'post', + data: { + id, + }, + }) +} +// 挂起 +export function pendingDeviceAlarm(data: any) { + return request({ + url: '/maintenance/alarmRecords/suspend', + method: 'post', + data, + }) +} +// 批量删除 +export function batchRemoveRow(ids: any) { + return request({ + url: '/maintenance/alarmRecords/batchDelete', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/api/home/operation/history.ts b/src/api/home/operation/history.ts new file mode 100644 index 0000000..a26ad3f --- /dev/null +++ b/src/api/home/operation/history.ts @@ -0,0 +1,14 @@ +/** + * 设备历史报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceHistoryListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/historyListPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} + diff --git a/src/api/home/operation/alarm.ts b/src/api/home/operation/alarm.ts new file mode 100644 index 0000000..2723ec8 --- /dev/null +++ b/src/api/home/operation/alarm.ts @@ -0,0 +1,41 @@ +/** + * 设备当前报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceCurrentListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/listPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查看 +export function deviceAlarmView(id: any) { + return request({ + url: '/maintenance/alarmRecords/deviceAlarmView', + method: 'post', + data: { + id, + }, + }) +} +// 挂起 +export function pendingDeviceAlarm(data: any) { + return request({ + url: '/maintenance/alarmRecords/suspend', + method: 'post', + data, + }) +} +// 批量删除 +export function batchRemoveRow(ids: any) { + return request({ + url: '/maintenance/alarmRecords/batchDelete', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/api/home/operation/history.ts b/src/api/home/operation/history.ts new file mode 100644 index 0000000..a26ad3f --- /dev/null +++ b/src/api/home/operation/history.ts @@ -0,0 +1,14 @@ +/** + * 设备历史报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceHistoryListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/historyListPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} + diff --git a/src/router/modules/pc.ts b/src/router/modules/pc.ts index ed722fb..6f58857 100644 --- a/src/router/modules/pc.ts +++ b/src/router/modules/pc.ts @@ -355,6 +355,19 @@ }, }, { + path: 'alarm/detail', + component: () => import('@/views/home/operation/alarm/components/detail.vue'), + name: 'operationAlarmDetail', + meta: { + title: '设备报警详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/operation/alarm', + auth: '/operation/alarm', + }, + }, + { path: 'history', component: () => import('@/views/home/operation/history/index.vue'), name: 'operationHistory', @@ -368,6 +381,19 @@ }, }, { + path: 'history/detail', + component: () => import('@/views/home/operation/alarm/components/detail.vue'), + name: 'operationHistoryDetail', + meta: { + title: '历史设备报警', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/operation/history', + auth: '/operation/history', + }, + }, + { path: 'trajectory', component: () => import('@/views/home/operation/trajectory/index.vue'), name: 'operationTrajectory', diff --git a/src/api/home/operation/alarm.ts b/src/api/home/operation/alarm.ts new file mode 100644 index 0000000..2723ec8 --- /dev/null +++ b/src/api/home/operation/alarm.ts @@ -0,0 +1,41 @@ +/** + * 设备当前报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceCurrentListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/listPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 查看 +export function deviceAlarmView(id: any) { + return request({ + url: '/maintenance/alarmRecords/deviceAlarmView', + method: 'post', + data: { + id, + }, + }) +} +// 挂起 +export function pendingDeviceAlarm(data: any) { + return request({ + url: '/maintenance/alarmRecords/suspend', + method: 'post', + data, + }) +} +// 批量删除 +export function batchRemoveRow(ids: any) { + return request({ + url: '/maintenance/alarmRecords/batchDelete', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/api/home/operation/history.ts b/src/api/home/operation/history.ts new file mode 100644 index 0000000..a26ad3f --- /dev/null +++ b/src/api/home/operation/history.ts @@ -0,0 +1,14 @@ +/** + * 设备历史报警 + */ +import request from '@/api/index' + +// 基础列表 +export function getDeviceHistoryListPage(data: any) { + return request({ + url: `/maintenance/alarmRecords/historyListPage?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} + diff --git a/src/router/modules/pc.ts b/src/router/modules/pc.ts index ed722fb..6f58857 100644 --- a/src/router/modules/pc.ts +++ b/src/router/modules/pc.ts @@ -355,6 +355,19 @@ }, }, { + path: 'alarm/detail', + component: () => import('@/views/home/operation/alarm/components/detail.vue'), + name: 'operationAlarmDetail', + meta: { + title: '设备报警详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/operation/alarm', + auth: '/operation/alarm', + }, + }, + { path: 'history', component: () => import('@/views/home/operation/history/index.vue'), name: 'operationHistory', @@ -368,6 +381,19 @@ }, }, { + path: 'history/detail', + component: () => import('@/views/home/operation/alarm/components/detail.vue'), + name: 'operationHistoryDetail', + meta: { + title: '历史设备报警', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/operation/history', + auth: '/operation/history', + }, + }, + { path: 'trajectory', component: () => import('@/views/home/operation/trajectory/index.vue'), name: 'operationTrajectory', diff --git a/src/views/home/alarm/current/components/detailInfoDialog.vue b/src/views/home/alarm/current/components/detailInfoDialog.vue index 7ac6332..30aa05e 100644 --- a/src/views/home/alarm/current/components/detailInfoDialog.vue +++ b/src/views/home/alarm/current/components/detailInfoDialog.vue @@ -9,6 +9,7 @@ import monitorDataDialog from './monitorDataDialog.vue' import processDialog from './processDialog.vue' import { detailAlarm } from '@/api/home/alarm/current' +import { deviceAlarmView } from '@/api/home/operation/alarm' import { toHumpObject } from '@/utils/String' const dialogFormVisible = ref(false) const overlay = ref() @@ -32,15 +33,20 @@ processContent: '', processStatus: '', id: '', + type: '', }) +const type = ref('') const initDialog = (e: any) => { console.log(e, '信息窗体接收的数据') overlay.value = e.overlay infoWindow.value = e.infoWindow dialogFormVisible.value = true - info.value = e.info - detailAlarm(e.info.id).then((res) => { + type.value = e.type + info.value = e.info; + + (type.value === 'data' ? detailAlarm : deviceAlarmView)(e.info.id).then((res) => { info.value = toHumpObject(res.data) as any + console.log(info.value, 'info.value') }) } @@ -53,13 +59,26 @@ const $router = useRouter() const moreData = () => { $router.push({ - name: 'AlarmCurrentDetail', + name: type.value === 'data' ? 'AlarmCurrentDetail' : 'operationAlarmDetail', query: { id: info.value.id, row: JSON.stringify(info.value), }, }) } +// 设备详情 +const goDevice = () => { + $router.push({ + path: '/manage/detail', + query: { + id: info.value.ledgerId, + row: JSON.stringify({ + ...info.value, + id: info.value.ledgerId, + }), + }, + }) +} // 提醒责任人 const remindRef = ref() const remind = () => { @@ -68,13 +87,18 @@ // 挂起 const pendingRef = ref() const pending = () => { - pendingRef.value.initDialog(info.value) + pendingRef.value.initDialog({ ...info.value, type: type.value }) } // 查看流程 const processRef = ref() const viewProcess = () => { processRef.value.initDialog(info.value) } +// 报警处置 +const handlerRef = ref() +const handler = () => { + handlerRef.value.initDialog(info.value) +} defineExpose({ initDialog, close }) @@ -94,7 +118,13 @@ >>更多
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@
-
+
+ 设备编号: + + {{ info.devcode }} + +
+
报警类别: {{ info.alarmCategory }} @@ -106,7 +136,13 @@ {{ info.alarmMsg }}
-
+
+ 设备类型: + + {{ info.devTypeName }} + +
+
报警设备: {{ info.devcode }} {{ info.confirmContent }} - + 流程图
@@ -176,9 +212,12 @@