diff --git a/src/api/faultQuery.ts b/src/api/faultQuery.ts new file mode 100644 index 0000000..2952f86 --- /dev/null +++ b/src/api/faultQuery.ts @@ -0,0 +1,76 @@ +import { api } from 'src/boot/axios'; +import { PageDto, PageQueryDto } from './ApiCommon'; + +const faultQueryUriBase = '/api/fault/query'; + +export interface FaultQueryListItem { + id: number; + lineId: number; + faultType: string; + faultNameShower: string; + faultDriverShower: string; + resultMsg: string; +} + +export interface FaultQueryInfo { + data: T; +} + +export class PagingQueryParams extends PageQueryDto { + lineId?: string; + faultType?: string; + faultName?: string; +} + +/** + * 分页查询故障查询 + * @param params + * @returns + */ +export async function faultQueryPageQuery( + params: PagingQueryParams +): Promise> { + const response = await api.get(`${faultQueryUriBase}/page`, { + params: params, + }); + return response.data; +} + +/** + * 创建或编辑故障查询 + * @param params + * @returns + */ +export function createFaultQuery(faultData: FaultQueryListItem) { + return api.post(`${faultQueryUriBase}`, faultData); +} + +/** + * 删除故障查询 + * @param id 草稿id + */ +export function deleteFaultQueryById(id: number) { + return api.delete(`${faultQueryUriBase}/${id}`); +} + +/** + * 根据id获取故障查询 + * @param id 草稿id + */ +export function faultQueryById( + id: number +): Promise> { + return api.get(`${faultQueryUriBase}/${id}`); +} + +export interface FaultTypeItem { + faultType: string; + typeName: string; +} + +/** + * 获取故障类型 + */ +export function faultQueryType() { + return api.get(`${faultQueryUriBase}/type`); +} diff --git a/src/components/SysMenu.vue b/src/components/SysMenu.vue index 0bf85b9..57eabd0 100644 --- a/src/components/SysMenu.vue +++ b/src/components/SysMenu.vue @@ -77,6 +77,11 @@ const list = reactive([ label: '决策信息管理', icon: 'format_align_center', }, + { + path: '/dataManage/faultQuery', + label: '故障查询管理', + icon: 'disabled_by_default', + }, { path: '/dataManage/thresholdValue', label: '报警故障阈值配置', diff --git a/src/components/dialog/FaultQueryDialog.vue b/src/components/dialog/FaultQueryDialog.vue new file mode 100644 index 0000000..e944d0d --- /dev/null +++ b/src/components/dialog/FaultQueryDialog.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index a8013cc..1315359 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -15,7 +15,20 @@ 西安NCC调度辅助决策系统 - + + { socket = webSocketConnect(destination, handler); }); +function openFaultQueryDialog(dialogTitle: string) { + $q.dialog({ + component: FaultQueryDialog, + componentProps: { + dialogTitle, + }, + }); +} + //模拟报警 const $q = useQuasar(); function openSetAlarmMockDialog() { diff --git a/src/pages/FaultQueryManage.vue b/src/pages/FaultQueryManage.vue new file mode 100644 index 0000000..a75dc75 --- /dev/null +++ b/src/pages/FaultQueryManage.vue @@ -0,0 +1,434 @@ + + + + + diff --git a/src/router/routes.ts b/src/router/routes.ts index 0568314..4ddbeba 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -46,6 +46,11 @@ const routes: RouteRecordRaw[] = [ name: 'decisionInfo', component: () => import('pages/DecisionInfoManage.vue'), }, + { + path: 'faultQuery', + name: 'faultQuery', + component: () => import('pages/FaultQueryManage.vue'), + }, { path: 'thresholdValue', name: 'thresholdValue',