import request from "@/tools/request"; import JSONBIG from "json-bigint"; //获取设备报警列表数据 export function GetDeviceTableData(data, timeout = 5000) { return request({ baseURL: process.env.VUE_APP_ALARM, url: `/alarminfo/findAlarmlist?begin=${data.begin}&end=${ data.end }&alarmType=${data.alarmType}&stationid=${data.stationid}${ data.alarmType == "windturbine" || data.alarmType == "inverter" ? `&deviceid=${data.deviceid}` : "" }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${ data.description }&isclose=${data.isclose}`, method: "get", timeout, }); } //获取报警列表数据 export function GetTableData(data) { return request({ baseURL: process.env.VUE_APP_ALARM, url: `/alarm/history/findAlarmlist?begin=${data.begin}&end=${ data.end }&alarmType=${data.alarmType}&stationid=${data.stationid}${ data.alarmType == "windturbine" || data.alarmType == "inverter" ? `&deviceid=${data.deviceid}` : "" }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${ data.description }${data.id ? `&id=${data.id}` : ""}`, method: "get", }); } //查询历史报警记录 export const alarm_history = (params, timeout = 9000) => { return request({ url: `alarm/history/findAlarmlist`, params: params, baseURL: process.env.VUE_APP_ALARM, timeout, }); }; export const confirmAlart = (data) => { return request({ method: "post", baseURL: process.env.VUE_APP_ALARM, url: "alarm/history/updateAlarms", data, timeout: 60000, }); }; // 获取场站数据 export function fetchStationListAll() { return request({ baseURL: process.env.VUE_APP_ALARM, url: `alertrule/querywpllist`, method: "get", }); } //获取部件及预警类型列表 export function fetchRelatePartAndAlarmType() { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/queryalarmtypellist", method: "get", }); } //获取型号列表 export const fetchModel = () => { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/querywpbyymodellist", method: "get", }); }; //获取升压站列表 export const fetchBooststation = () => { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/querysubllist", method: "get", }); }; //查询自定义预警列表 export function custombj_fetchTableData(params) { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/page", method: "get", params, }); } //根据场站编号,风机型号获取AI/DI测点 export const fetchPointList = (wpId = "", modelId = "") => { return request({ baseURL: process.env.VUE_APP_ALARM, url: `alertrule/querywtpointlist?wpId=${wpId}&modelId=${modelId}`, method: "get", }); }; //根据升压站编号获取AI/DI测点 export const fetchPointListByBootst = (subId = "") => { return request({ baseURL: process.env.VUE_APP_ALARM, url: `alertrule/querysubpointllist?subId=${subId}`, method: "get", }); }; //新增/修改自定义预警 export const custombj_postSave = (form) => { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/save", method: "post", data: form, }); }; //自定义预警模板下载 export const custombj_importTemplate = () => { return request({ baseURL: process.env.VUE_APP_ALARM, url: "alertrule/get-import-template", method: "get", responseType: "blob", }); }; //根据风场id获取所有风机 export const fetchWindturbineList = (wpId = "") => { return request({ baseURL: process.env.VUE_APP_ALARM, url: `alertrule/querywtlist?wpId=${wpId}`, method: "get", }); }; //根据structcode获取AI.DI测点 export const fetchAIDIPointList = ( deviceId, structcode, stationId, windturbineId, pageNum, pageSize ) => { return request({ baseURL: process.env.VUE_APP_ALARM, url: "info/point", method: "get", params: { deviceId, structcode, stationId, windturbineId, pageNum, pageSize, }, }); }; //字典维护列表 export const get_datadictionary = (pageNum, pageSize, name, category) => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "get", url: `datadictionary/page?pageNum=${pageNum}&pageSize=${pageSize}&name=${name}&category=${category}`, }); }; //字典维护 新增 修改 export const post_saveorupdate = (data) => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "post", url: `datadictionary/save`, data, }); }; //实时报警列表 export const alarm_snap_top = (params) => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "get", url: `alarm/history/findAlarmByTypelist`, params: params, }); }; //数据查询实时数据 export const getAdapterLatest = (stationId, AIlist, stationType) => { return request({ url: `ts/latest?uniformCodes=${AIlist}&thingId=${stationId}&thingType=windturbine`, baseURL: `http://10.81.3.162:801${/FDC/.test(stationType) ? "1" : "2"}/`, showLoading: { statu: false, }, timeout: 10000, transformResponse: [ function (data) { const json = JSONBIG({ storeAsString: true, }); const res = json.parse(data); return res; }, ], }); }; //数据查询 历史数据 export const getAdapterHistory = ( stationId, AIpoint, startTs, endTs, cureentBaseUrl ) => { return request({ url: `ts/history/raw?uniformCode=${AIpoint}&thingId=${stationId}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}`, baseURL: cureentBaseUrl, }); }; //数据查询 数据快照 export const getAdapterHistorysnap = ( stationId, AIpoint, startTs, endTs, interval, cureentBaseUrl ) => { return request({ url: `ts/history/snap?uniformCode=${AIpoint}&thingId=${stationId}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}&interval=${interval}`, baseURL: cureentBaseUrl, }); }; // 风机原始数据统计 // 列表接口 export const getAlarmCountList = (params) => { return request({ url: `alarm/history/findWtFeatureStat?timeType=${params.timeType}&begin=${params.begin}&end=${params.end}&stationid=${params.stationid}&components=${params.components}&modelId=${params.modelId}&alarmIds=${params.alarmIds}&alarmType=${params.alarmType}`, baseURL: process.env.VUE_APP_ALARM, method: "get", }); }; // 获取报警描述列表 export const GetAlarmId = (params) => { return request({ url: `alarmconfiguration/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`, baseURL: process.env.VUE_APP_ALARM, method: "get", }); }; // 获取预警描述列表 export const GetAlarmIdCustom = (params) => { return request({ url: `alertrule/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`, baseURL: process.env.VUE_APP_ALARM, method: "get", }); }; //报警修改日志 export const fetchruleventLogs = (pagenum, pagesize, ruleName, ruleType) => { return request({ url: "ruleupdate/page", method: "get", baseURL: process.env.VUE_APP_ALARM, params: { pagenum, pagesize, ruleName, ruleType, }, }); }; //风机报警列表 export const windturbinebj_fetchTableData = (query) => { console.log(111, query); return request({ url: "alarmconfiguration/page", method: "get", baseURL: process.env.VUE_APP_ALARM, params: query, }); }; //获取服务端公钥 export const getPublickey = (query) => { return request({ url: "info/publickey", }); }; // login export const loginRequest = (params) => { return request({ url: "/admin-api/system/auth/login", baseURL: "http://10.81.3.127:48080", data: params, method: "post", }); }; export const Login = (params) => { return request({ url: "auth/login", baseURL: process.env.VUE_APP_ALARM, data: params, method: "post", }); }; export function getUserinfo() { return request({ baseURL: "http://10.81.3.127:48080", url: "/admin-api/system/auth/get-permission-info", method: "get", headers: { isUser: true, }, }); } export function logout(data) { return request({ baseURL: process.env.VUE_APP_ALARM, url: `auth/logout`, method: "post", data, }); } //register export const registerRequest = (params) => { return request.post("user/registers", params); }; // 报警配置缓存清理 export const getRestart = () => { return request({ url: `custom/restart`, baseURL: "/custom/", }); }; export const getRestart2 = () => { return request({ url: `windturbine/restart`, baseURL: "/windturbine/", }); }; export const getRestart3 = () => { return request({ url: `scadas/restart`, baseURL: "/scadas/", }); }; //----------------------------------------homePAge------------------------------------------------ //根据风场id获取所有风机 export const getintellList = (query) => { return request({ url: "home/early/latest", method: "get", params: { stationId: query, }, showLoading: { statu: false, }, }); }; export const getReportList = (params) => { return request({ url: "earlyreport/list", method: "get", params: params, showLoading: { statu: false, }, }); }; export const getreportReviewList = (query) => { return request({ url: "inspectorder/port/list", method: "get", params: { stationId: query, }, }); }; export const getHomeOrdercount = (query) => { return request({ url: "home/ordercount", method: "get", showLoading: { statu: false, }, }); }; //首页获取机型接口 export const getHomeAlertrule = (params) => { return request({ url: "home/alertrule", method: "get", params: params, showLoading: { statu: false, }, }); }; export const getHomeDangerHidden = (params) => { return request({ url: "home/hidden/danger", method: "get", showLoading: { statu: false, }, }); }; export const getHomeDurationTotal = (params) => { return request({ url: "home/total/duration", method: "get", showLoading: { statu: false, }, }); }; // 巡检计划 export const getCheckList = (params) => { return request({ url: "inspectorder/order/page", method: "get", params: params, }); }; // 弹窗数据接口 export const getDialogData = (params) => { return request.get( `windturbineAlarmCount/query/detail?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=${params.windturbineid}&parts=${params.parts}` ); }; // 设备隐患评审报告 export const postSubmitReport = (params) => { return request.post("inspectorder/update", params); }; // ----------------------------------------user------------------------------------------------ export const getUserList = () => { return request.get(`user/getall`); }; export const editRequest = (params) => { return request.post("user/edituser", params); }; export const deleteUser = (data) => { return request.delete(`user/${data}`); }; // ----------------------------------------user------------------------------------------------ // ----------------------------------------system------------------------------------------------ // 获取故障弹窗 export const getjumpwindow = () => { return request.get(`userset/jumpwindow`); }; // 获取语音播报 export const getfaultread = () => { return request.get(`userset/faultread`); }; // 保存是否故障弹窗 export const postjumpwindow = (params) => { return request.post(`userset/jumpwindow?isjump=${params}`); }; // 保存是否语音播报 export const postfaultread = (params) => { return request.post(`userset/faultread?isread=${params}`); }; // ----------------------------------------system------------------------------------------------ //获取所有风场 export const fetchStationList = () => { return request({ url: "info/station", method: "get", }); }; // //获取所有风场光伏 // export const fetchStationListAll = () => { // return request({ // url: "info/station/all", // method: "get", // }); // }; // ----------------------------------------安全生产- 报警记录------------------------------------------------ //导出历史报警记录 export const new_alarm_history = (params) => { // return request.get(`alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`) return request({ method: "get", url: `alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`, headers: { "Content-Type": "application/json", }, responseType: "blob", showLoading: { text: "拼命下载中...", }, timeout: 99999999, }); }; //查报警 export const alarm_snap = (params) => { return request({ url: `alarm/snap`, params: params, }); }; // ----------------------------------------安全生产- 实时报警------------------------------------------------ //实时故障 最高级 export const alarm_fault_recent = (params) => { return request({ url: `fault/recent`, params: params, showLoading: { statu: false, }, transformResponse: [ function (data) { const json = JSONBIG({ storeAsString: true, }); const res = json.parse(data); return res; }, ], }); }; //实时故障 第一次请求 export const alarm_fault_top = (params) => { return request({ url: `fault/snap/top`, params: params, }); }; //报警确认 export const get_fault_confirm = (params) => { return request({ url: `fault/confirm`, params: params, }); }; // ----------------------------------------安全生产- 实时数据查询------------------------------------------------ // get 实时data // 批量导出 export const AdapterHistoryExport = (activeAI, activeWT, startTs, endTs) => { return request({ url: `ts/history/raw?uniformCode=${activeAI}&thingId=${activeWT}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}`, baseURL: "/adapter/", }); }; // ----------------------------------------基础数据- 设备管理------------------------------------------------ //查询全部设备型号接口 export const device_list = () => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "get", url: `device/model/list`, }); }; //获取结构tree export function tree(params) { return request({ baseURL: process.env.VUE_APP_ALARM, url: "device/structure/tree/windturbine", method: "get", transformResponse: [ function (data) { const json = JSONBIG({ storeAsString: true, }); const res = json.parse(data); return res; }, ], }); } //根据结构获取测点 export function point( code, pagenum, pagesize, categorydata, keyword, deviceId, model ) { return request({ baseURL: process.env.VUE_APP_ALARM, url: `device/metrics/page?pageNum=${pagenum}&pageSize=${pagesize}&deviceId=${deviceId}&categorydata=${categorydata}&keyword=${keyword}&model=${model}&structureCode=${code}`, method: "get", }); } //测点新增 export function metrics(data) { return request.post(`device/metrics/single`, data); } //测点删除 export function delmetrics(params) { return request({ method: "delete", baseURL: process.env.VUE_APP_ALARM, url: `device/metrics/single/delete/${params}`, }); } //测点导入 //tree新增 添加一个设备结构节点 export function treeAdd(data) { return request({ method: "post", baseURL: process.env.VUE_APP_ALARM, url: `device/structure`, data, }); } //tree删除 tree删除一个设备结构节点 export function treeDel(params) { return request({ method: "delete", baseURL: process.env.VUE_APP_ALARM, url: `device/structure/delete/${params}`, }); } // 故障模式 // get All export const faultmode_windturbine = () => { return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: `device/faultmode/windturbine`, }); }; // 根据 structurecode get export const faultmode_structurecode = (params) => { return request({ baseURL: process.env.VUE_APP_ALARM, url: `device/faultmode/windturbine/${params}`, method: "get", }); }; // 根据 id delete export const faultmode_delete = (params) => { return request({ method: "delete", baseURL: process.env.VUE_APP_ALARM, url: `device/faultmode/delete/${params}`, }); }; // 新增 修改 export const faultmode_add_edit = (data) => { return request({ method: "post", baseURL: process.env.VUE_APP_ALARM, url: `device/faultmode`, data, }); }; // ---------------------------------------- 报警配置- 自定义预警------------------------------------------------ // 获取机型 export function getStationinfo(params) { return request({ url: `info/stationinfo?stationId=${params}`, method: "get", showLoading: { statu: false, }, }); } // 获取规则 export function alertrule2_list() { return request.get(`alertrule2/list/`); } //根据场站编号,风机型号获取DI测点new export const getDIPointList = (minModel) => { return request({ url: "testingpointDI/point", method: "get", params: { minModel, }, }); }; //根据场站编号,获取电气DI测点 export const fetchElectricDIPointList = (stationId) => { return request({ url: "info/electrical_point_di", method: "get", params: { stationId: stationId, }, }); }; //根据电气测点,获取测点信息 export const fetchElectricDIPointByPointId = (pointId) => { return request({ url: "info/electrical_point_di/byId", method: "get", params: { pointId: pointId, }, }); }; //根据风场编号获取电气AI测点 export const fetch_electrical_point_ai = (stationId) => { return request({ url: "info/electrical_point_ai", method: "get", params: { stationId: stationId, }, }); }; //根据风场编号获取电气DI测点 export const fetch_electrical_point_di = (stationId) => { return request({ url: "info/electrical_point_di", method: "get", params: { stationId: stationId, }, }); }; //获取报警类型 export const fetchWarningType = () => { return request({ url: "info/warning_type", method: "get", }); }; //获取报警种类 export const fetchWarningClassify = () => { return request({ url: "info/warning_classify", method: "get", }); }; export const custombj_batchImport = (list) => { return request.post("alertrule2/save-batch", list); }; //******************************end****************************************// //******************************升压站报警API************************************// export const scadabj_fetchTableData = (query) => { return request({ url: "scadabj/page", method: "get", params: query, timeout: 20000, transformResponse: [ // 处理17位数字精度问题 function (data) { const json = JSONBIG({ storeAsString: true, }); const res = json.parse(data); return res; }, ], }); }; export const scadabj_postSave = (objData) => { return request.post("scadabj/save", objData); }; export const scadabj_batchImport = (list) => { return request.post("scadabj/save-batch", list); }; //********************************************end********************************//\ //********************************************报警记录日志********************************//\ //********************************************end********************************//\ //******************************风机报警API************************************// export const windturbinebj_postSave = (form) => { return request.post("warning2/save", form); }; export const windturbinebj_batchImport = (list) => { return request.post("warning2/save-batch", list); }; export const fetchLeaf = () => { return request({ url: "warning2/page", method: "get", params: { pagenum: 1, pagesize: 10000, isLeaf: 0, }, }); }; //根据风机型号获取DI测点统一编码相关数据 testingpointdi2 export const getDIPointByModelId = (query) => { return request({ url: "info/testing_point_di", method: "get", params: query, }); }; //******************************end*******************************************// //******************************预警统计*******************************************// export const statistics_querymap = (params) => { return request.get(`alarm/count/querymap2`, { params: params }); }; export const statistics_querybyname = (params) => { return request.get("alarm/count/querybyname2", { params: params }); }; export const statistics_lineandproject = (params) => { return request.get("alarm/count/lineandproject2", { params: params }); }; //******************************end*******************************************// //******************************预警分析*******************************************// export const warning_query_new = (params) => { return request.get(`alarm/count/query/new2`, { params: params }); }; export const warning_detail = (params) => { return request({ url: `analysis/detail`, params: params, timeout: 60000, }); }; // export const statistics_lineandproject = params => { // return request.get('alarm/count/lineandproject', { params: params }) // }; //******************************end*******************************************// //*****************************旧诊断报告*******************************************// export const earlywarnscore_list = (params) => { return request.get(`earlywarnscore/list`, { params: params }); }; export const warning_query_new3 = (params) => { return request.get(`alarm/count/query/new3`, { params: params }); }; //******************************end*******************************************// //*****************************新诊断报告*******************************************// export const getList = (params) => { return request.get( `earlyreport/list?pagenum=${params.pagenum}&pagesize=${params.pagesize}&stationId=${params.stationId}&keyword=&starttime=&endtime=` ); }; export const getReportDetail = (id) => { return request({ url: `earlyreport/info?id=${id}`, method: "get", showLoading: { statu: false, }, }); }; //******************************end*******************************************// export const getAlarmConfig = () => { // return request.get(`/alertrule/queryalarmtypellist`); return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: "alertrule/queryalarmtypellist", }); }; export const getAlartConfig = () => { return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: "alarmswitch/queryAll", }); }; export const saveAlartConfig = (data) => { return request({ method: "post", baseURL: process.env.VUE_APP_ALARM, url: "alarmswitch/save", data, }); }; export const getWtModel = (wpId = "") => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "get", url: `alertrule/querymodellist?wpId=${wpId}`, }); }; export const getWpList = (types = "") => { return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: `alertrule/querywpllist?types=${types}`, }); }; export const getBpList = () => { return request({ baseURL: process.env.VUE_APP_ALARM, method: "get", url: `alertrule/querysubllist`, }); }; export const getPointList = (params) => { return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: "alertrule/querysubpointllist", params, }); }; export const saveAlarmconfiguration = (data) => { return request({ method: "post", baseURL: process.env.VUE_APP_ALARM, url: "alarmconfiguration/save", data, }); }; export const getStopQueryTableData = (params) => { return request({ method: "get", baseURL: process.env.VUE_APP_ALARM, url: "shutdownevent2/queryshutdowneventlist", params, }); }; export const getWarningCountList = (params) => { return request({ url: `alarm/history/findCtFeatureStat?timeType=${params.timeType}&begin=${ params.begin }&end=${params.end}&stationid=${ params.stationid }&components=${params.components.toString()}&modelId=${ params.modelId }&alarmIds=${params.alarmIds}&deviceType=${params.deviceType}`, baseURL: process.env.VUE_APP_ALARM, method: "get", }); };