diff --git a/src/api/ems/record/recordAlarmData.ts b/src/api/ems/record/recordAlarmData.ts index 5960a7c..09daa50 100644 --- a/src/api/ems/record/recordAlarmData.ts +++ b/src/api/ems/record/recordAlarmData.ts @@ -1,5 +1,14 @@ import request from '@/utils/request'; -import type { EmsActionResponse, EmsDetailResponse, EmsRecordAlarmDataVO, EmsId, EmsIdParam, EmsListResponse, EmsQuery } from '../types'; +import type { + AlarmOverviewSummaryVO, + EmsActionResponse, + EmsDetailResponse, + EmsRecordAlarmDataVO, + EmsId, + EmsIdParam, + EmsListResponse, + EmsQuery +} from '../types'; // 查询异常数据记录列表 export function listRecordAlarmData(query?: EmsQuery): Promise> { @@ -18,6 +27,15 @@ export function getRecordAlarmData(objId: EmsId): Promise> { + return request({ + url: '/ems/record/recordAlarmData/summary', + method: 'get', + params: query + }); +} + // 新增异常数据记录 export function addRecordAlarmData(data: EmsRecordAlarmDataVO): Promise> { return request({ diff --git a/src/api/ems/types.ts b/src/api/ems/types.ts index d8b82ad..98577f5 100644 --- a/src/api/ems/types.ts +++ b/src/api/ems/types.ts @@ -214,6 +214,8 @@ export interface EmsEntity extends BaseEntity { createdTime?: EmsDateValue; updatedAt?: EmsDateValue; updatedTime?: EmsDateValue; + createTime?: EmsDateValue; + updateTime?: EmsDateValue; parentId?: EmsId; parentName?: string; orderNum?: number; @@ -563,6 +565,16 @@ export interface EmsRecordAlarmDataVO extends EmsEntity { confirmRemark?: string; } +export interface AlarmOverviewSummaryVO extends EmsEntity { + totalCount?: EmsId; + unhandledCount?: EmsId; + handledCount?: EmsId; + pushPendingCount?: EmsId; + pushProcessingCount?: EmsId; + pushSuccessCount?: EmsId; + pushFailCount?: EmsId; +} + export interface EmsRecordAlarmRuleVO extends EmsEntity { objId?: EmsId; ruleId?: string; @@ -592,6 +604,140 @@ export interface EmsRecordAlarmRuleVO extends EmsEntity { isEnable?: string; } +export interface AlarmNotifyGroupVO extends EmsEntity { + id?: EmsId; + groupName?: string; + notifyChannel?: string; + webhookUrl?: string; + isEnable?: string; + remark?: string; + createTime?: EmsDateValue; +} + +export interface AlarmNotifyGroupUserVO extends EmsEntity { + id?: EmsId; + groupId?: EmsId; + groupName?: string; + userId?: EmsId; + userName?: string; + nickName?: string; + phone?: string; + email?: string; + isEnable?: string; + createTime?: EmsDateValue; +} + +export interface AlarmPushLogVO extends EmsEntity { + id?: EmsId; + alarmObjId?: EmsId; + alarmTitle?: string; + monitorCode?: string; + monitorName?: string; + channelType?: string; + targetValue?: string; + alarmLevel?: string; + pushContent?: string; + pushStatus?: string; + responseMsg?: string; + pushTime?: EmsDateValue; +} + +export interface MonitorMetricThresholdVO extends EmsEntity { + id?: EmsId; + monitorCode?: string; + monitorName?: string; + metricCode?: string; + warnUpper?: EmsDecimalValue; + warnLower?: EmsDecimalValue; + alarmUpper?: EmsDecimalValue; + alarmLower?: EmsDecimalValue; + hysteresis?: EmsDecimalValue; + durationSec?: EmsId; + alarmLevel?: string; + notifyGroupId?: EmsId; + notifyGroupName?: string; + isEnable?: string; + remark?: string; + createTime?: EmsDateValue; +} + +export interface DataExportTaskVO extends EmsEntity { + id?: EmsId; + exportType?: string; + monitorCode?: string; + monitorName?: string; + metricCode?: string; + timeStart?: EmsDateValue; + timeEnd?: EmsDateValue; + exportCondition?: string; + fileFormat?: string; + fileName?: string; + fileUrl?: string; + exportStatus?: string; + remark?: string; + createTime?: EmsDateValue; +} + +export interface IntegrationEndpointVO extends EmsEntity { + id?: EmsId; + endpointName?: string; + endpointType?: string; + accessMode?: string; + host?: string; + port?: EmsId; + configJson?: string; + status?: string; + createTime?: EmsDateValue; +} + +export interface IntegrationPointMapVO extends EmsEntity { + id?: EmsId; + endpointId?: EmsId; + endpointName?: string; + monitorCode?: string; + monitorName?: string; + metricCode?: string; + sourcePointCode?: string; + targetPointCode?: string; + transformScript?: string; + dataFormat?: string; + isEnable?: string; + createTime?: EmsDateValue; +} + +export interface ControlCommandLogVO extends EmsEntity { + id?: EmsId; + endpointId?: EmsId; + endpointName?: string; + monitorCode?: string; + monitorName?: string; + commandType?: string; + commandContent?: string; + executeStatus?: string; + responseContent?: string; + createTime?: EmsDateValue; +} + +export interface ReportPeriodSummaryVO extends EmsEntity { + id?: EmsId; + monitorCode?: string; + monitorName?: string; + metricCode?: string; + metricName?: string; + periodType?: string; + periodStart?: EmsDateValue; + periodEnd?: EmsDateValue; + beginValue?: EmsDecimalValue; + endValue?: EmsDecimalValue; + avgValue?: EmsDecimalValue; + maxValue?: EmsDecimalValue; + minValue?: EmsDecimalValue; + consumeValue?: EmsDecimalValue; + overLimitDuration?: EmsId; + alarmCount?: EmsId; + sampleCount?: EmsId; +} + export interface EmsRecordDnbInstantVO extends EmsEntity { objId?: EmsId; monitorCode?: string; diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index caffecc..4d5855a 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -19,11 +19,26 @@ export const listUser = (query: UserQuery): AxiosPromise => { /** * 通过用户ids查询用户 - * @param userIds + * 这里兼容两种调用方式: + * 1. 传用户ID数组,延续后端 Long[] userIds 原有的逗号串绑定方式 + * 2. 只传部门ID,便于部门切换场景直接复用同一个接口 */ -export const optionSelect = (userIds: (number | string)[]): AxiosPromise => { +export const optionSelect = (userIdsOrDeptId?: (number | string)[] | number | string, deptId?: number | string): AxiosPromise => { + const queryParts: string[] = []; + if (Array.isArray(userIdsOrDeptId)) { + if (userIdsOrDeptId.length > 0) { + queryParts.push('userIds=' + encodeURIComponent(userIdsOrDeptId.join(','))); + } + if (deptId !== undefined && deptId !== null && deptId !== '') { + queryParts.push('deptId=' + encodeURIComponent(String(deptId))); + } + } else if (userIdsOrDeptId !== undefined && userIdsOrDeptId !== null && userIdsOrDeptId !== '') { + queryParts.push('deptId=' + encodeURIComponent(String(userIdsOrDeptId))); + } + + const url = queryParts.length > 0 ? `/system/user/optionselect?${queryParts.join('&')}` : '/system/user/optionselect'; return request({ - url: '/system/user/optionselect?userIds=' + userIds, + url, method: 'get' }); }; diff --git a/src/views/ems/base/baseCollectDeviceInfo/index.vue b/src/views/ems/base/baseCollectDeviceInfo/index.vue index 39284b9..92e9ff2 100644 --- a/src/views/ems/base/baseCollectDeviceInfo/index.vue +++ b/src/views/ems/base/baseCollectDeviceInfo/index.vue @@ -12,16 +12,16 @@ - - - - - - - - - - + + + + + @@ -79,7 +79,7 @@ - + @@ -126,16 +126,16 @@ - - - - - - - - - - + + + + + @@ -356,16 +356,16 @@ const createFormData = (): BaseCollectDeviceInfoForm => ({ const form = ref(createFormData()); const rules = reactive({ - objId: [{ required: true, message: '自增标识不能为空', trigger: 'blur' }], collectDeviceId: [{ required: true, message: '采集设备编号不能为空', trigger: 'blur' }], - collectDeviceName: [{ required: true, message: '采集设备名称不能为空', trigger: 'blur' }] + collectDeviceName: [{ required: true, message: '采集设备名称不能为空', trigger: 'blur' }], + energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }] }); const columns: FieldOption[] = [ - { key: 0, label: '自增标识', visible: false }, + { key: 0, label: '序号', visible: true }, { key: 1, label: '采集设备编号', visible: true }, { key: 2, label: '采集设备名称', visible: true }, - { key: 3, label: '能源类型', visible: false }, + { key: 3, label: '能源类型', visible: true }, { key: 4, label: '型号', visible: true }, { key: 5, label: '生产厂家', visible: true }, { key: 6, label: '通讯地址', visible: true }, @@ -390,7 +390,7 @@ const getList = async () => { /** 查询能源类型下拉选项,避免页面初始化时出现空白下拉 */ const getEnergyTypeList = async () => { const response = await getBaseEnergyTypeList({}); - energyTypeList.value = (response.rows ?? []) as EnergyTypeOption[]; + energyTypeList.value = ((response.data ?? response.rows ?? []) as EnergyTypeOption[]) || []; }; // 取消按钮 diff --git a/src/views/ems/base/baseMonitorInfoIOTDevice/index.vue b/src/views/ems/base/baseMonitorInfoIOTDevice/index.vue index d0a7c2e..7a6fc6d 100644 --- a/src/views/ems/base/baseMonitorInfoIOTDevice/index.vue +++ b/src/views/ems/base/baseMonitorInfoIOTDevice/index.vue @@ -63,7 +63,7 @@ :default-expand-all="isExpandAll" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" > - + - - - - - + + + + - - + + - - + + - + diff --git a/src/views/ems/record/recordAlarmData/index.vue b/src/views/ems/record/recordAlarmData/index.vue index 9de942d..f9c9a0c 100644 --- a/src/views/ems/record/recordAlarmData/index.vue +++ b/src/views/ems/record/recordAlarmData/index.vue @@ -1,215 +1,349 @@