diff --git a/hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts b/hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts index b659c51..b78f725 100644 --- a/hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts +++ b/hx-ai-intelligent/src/api/alarmSettings/deviceAlarms.ts @@ -1,5 +1,9 @@ export enum deviceAlarms { getTableList = '/carbon-smart/api/AlarmEquipment/selectAlarmEquipment', //设备告警分页 - addOrUpNewData = '/carbon-smart/api/AlarmEquipment/creatOrUpdate', //设备告警添加 修海 + addOrUpNewData = '/carbon-smart/api/AlarmEquipment/creatOrUpdate', //设备告警添加 修改 del = '/carbon-smart/api/AlarmEquipment/delete', //设备告警删除 + configGetTableList = '/carbon-smart/api/AlarmEquipmentRule/selectAlarmEquipmentRule', //配置设备告警分页 + configAddOrUpNewData = '/carbon-smart/api/AlarmEquipmentRule/creatOrUpdate', //配置设备告警添加 修改 + configFindById = '/carbon-smart/api/AlarmEquipmentRule/findById', //配置设备告警 查询详情 + configDel = '/carbon-smart/api/AlarmEquipmentRule/delete', //配置设备告警删除 } diff --git a/hx-ai-intelligent/src/api/alarmSettings/energyAlarm.ts b/hx-ai-intelligent/src/api/alarmSettings/energyAlarm.ts new file mode 100644 index 0000000..0ea6ebc --- /dev/null +++ b/hx-ai-intelligent/src/api/alarmSettings/energyAlarm.ts @@ -0,0 +1,9 @@ +export enum energyAlarms { + getTableList = '/carbon-smart/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption', //能耗告警分页 + addOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumption/creatOrUpdate', //能耗告警添加 修改 + del = '/carbon-smart/api/AlarmEnergyConsumption/delete', //能耗删除 + configGetTableList = '/carbon-smart/api/AlarmEquipmentRule/selectAlarmEquipmentRule', //配置设备告警分页 + configAddOrUpNewData = '/carbon-smart/api/AlarmEquipmentRule/creatOrUpdate', //配置设备告警添加 修改 + configFindById = '/carbon-smart/api/AlarmEquipmentRule/findById', //配置设备告警 查询详情 + configDel = '/carbon-smart/api/AlarmEquipmentRule/delete', //配置设备告警删除 +} diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index eecf57e..8f30f9a 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -11,5 +11,10 @@ export enum carbonEmissionFactorLibrary { } // 碳排管理-碳排统计接口 export enum energyConsumption { + getDicList = '/carbon-smart/client/dict/list', pageList = '/carbon-smart/api/carbon/stats/pageList', + findById = '/carbon-smart/api/carbon/stats/findById', + creat = '/carbon-smart/api/carbon/stats/creat', + update = '/carbon-smart/api/carbon/stats/update', + del = '/carbon-smart/api/carbon/stats/del', } \ No newline at end of file diff --git a/hx-ai-intelligent/src/api/index.ts b/hx-ai-intelligent/src/api/index.ts index 22478b4..9f32029 100644 --- a/hx-ai-intelligent/src/api/index.ts +++ b/hx-ai-intelligent/src/api/index.ts @@ -38,3 +38,46 @@ export const dict = async ({ } return Promise.resolve({ data: { data: get(dictMap, key) } }); }; + +/** + * 获取所有枚举(无需传参) + */ +export const getAllEnum = async ({ + api = `${BASE_URL}/operation/enum/getAllEnum`, + params = {}, + keyField = 'dicKey', + transform = (res: any) => res, +}: dictHttpConfig) => { + const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object; + const key = get(params, keyField) as keyof typeof dictMap; + + if (!dictMap.hasOwnProperty(key)) { + const res = await http.post(api, params); + const options = get(transform(res), `data.${key}`); + dictMap[key] = options; + sessionStorage.setItem('dictMap', JSON.stringify(dictMap)); + } + return Promise.resolve({ data: { data: get(dictMap, key) } }); +}; + + +/** + * 获取单个枚举(需传参,参数 enumType) + */ +export const getEnum = async ({ + api = `${BASE_URL}/operation/enum/getEnum`, + params = {}, + keyField = 'dicKey', + transform = (res: any) => res, +}: dictHttpConfig) => { + const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object; + const key = get(params, keyField) as keyof typeof dictMap; + + if (!dictMap.hasOwnProperty(key)) { + const res = await http.post(api, params); + const options = get(transform(res), `data.${key}`); + dictMap[key] = options; + sessionStorage.setItem('dictMap', JSON.stringify(dictMap)); + } + return Promise.resolve({ data: { data: get(dictMap, key) } }); +}; \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue index 31acf84..bf0c008 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue +++ b/hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue @@ -25,19 +25,339 @@ -
+
1.仅支持pdf格式文件或文件夹
+2.文件命名规则为【能源种类_年份】
+3.每次上传自动覆盖
+ +