From 5a087f3a8f6db1f6344dc4a79af2e4c85d27cf1b Mon Sep 17 00:00:00 2001 From: whyczyk <525500596@qq.com> Date: 星期四, 05 五月 2022 17:14:22 +0800 Subject: [PATCH] 2.0 接口对接 --- src/pages/monitoring/js/api.js | 228 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 127 insertions(+), 101 deletions(-) diff --git a/src/pages/monitoring/js/api.js b/src/pages/monitoring/js/api.js index 9269373..bfa41da 100644 --- a/src/pages/monitoring/js/api.js +++ b/src/pages/monitoring/js/api.js @@ -1,117 +1,137 @@ import axios from "@/assets/js/axios"; /** - * 鏌ヨ鏈烘埧淇℃伅 - * 鍙傛暟锛歫son = {"StationName1":"鍖椾含甯�","StationName2":"甯傝緰鍖�","StationName5":"娴锋穩鍖�"} + * 鏌ヨ绔欑偣鍚� 甯tationId fbsdeviceId (鍚寘鏈虹粍杩囨护) + * stationName1 + * stationName2 + * stationName5 + * BattInfAction!serchAllStationName // 鏃� */ -export const searchStation = (params) => { +export const getAllStations = (params) => { return axios({ - method: "post", - url: "BattInfAction!serchAllStationName", - data: "json=" + JSON.stringify(params) + method: 'GET', + url: 'battInf/searchAllStationName', + params }) } /** - * 鏌ヨ鐢垫睜缁勪俊鎭� - * 鍙傛暟锛歫son = {"StationName1":"鍖椾含甯�","StationName2":"甯傝緰鍖�","StationName5":"娴锋穩鍖�","StationName3":"绱櫠绉戞妧鏈烘埧"} + * 鏍规嵁鏈烘埧id鑾峰彇鐢垫睜淇℃伅 鏈烘埧涓嬬殑鐢垫睜缁勫垪琛� + * stationId + * BattInfAction!serchAllBattinf // 鏃� */ -export const searchBattInfo = (params) => { +export const getBattList = (stationId) => { return axios({ - method: "post", - url: "BattInfAction!serchAllBattinf", - data: "json=" + JSON.stringify(params) - }) + method: "GET", + url: "battInf/findBattInfByStationId", + params: { + stationId + } + }); } /** * 鏍规嵁鐢垫睜缁処D鏌ヨ鐢垫睜缁勪俊鎭� - * @param data + * BattInfAction!findByBattGroupId // 鏃� * @returns {AxiosPromise} */ -export const getBattGroupInfo = (params) => { +export const getBattGroupInfo = (battGroupId) => { return axios({ - method: 'post', - url: 'BattInfAction!findByBattGroupId', - data: 'bif.BattGroupId=' + params, - }) + method: 'GET', + url: 'battInf/findByBattGroupId', + params: { + battGroupId + } + }); + } /** * 鏌ヨ鐢垫睜鍛婅鍙傛暟 - * 鍙傛暟锛歫son={"dev_id":910000022} + * Dev_paramAction!serchParamById // 鏃� + * {devId} */ export const realTimeAlarm = (params) => { return axios({ - method: "post", - url: "Dev_paramAction!serchParamById", - data: "json=" + JSON.stringify(params) + method: "GET", + url: "Dev_paramAction/serchParamById", + params }) } /** * 鏍规嵁璁惧id鏌ヨ璁惧褰撳墠鐨勫紑鍏崇姸鎬� - * json={"dev_id":910000022} + * {devId} + * Fbs9100_stateAction_action_serchContactorState // 鏃� */ export const realTimePowerOff = (params) => { return axios({ - method: "post", - url: "Fbs9100_stateAction_action_serchContactorState", - data: "json=" + JSON.stringify(params) + method: "GET", + url: "Fbs9100_stateAction/serchContactorState", + params }) } /** * 鏍规嵁鐢垫睜缁刬d鏌ヨ璇ョ數姹犵粍涓墍鏈夌數姹犱俊鎭� (鍥捐〃鏁版嵁) + * Batt_rtdataAction_serchByCondition // 鏃� * json={"BattGroupId":1005074} */ export const realTimeSearch = (params) => { return axios({ - method: "post", - url: "Batt_rtdataAction_serchByCondition", - data: "json=" + JSON.stringify(params) + method: "GET", + url: "Batt_rtdataAction/serchByCondition", + params }) } /** * 鏍规嵁鐢垫睜缁刬d鏌ヨ鐢垫睜缁勫疄鏃剁粍绔俊鎭� - * 鍙傛暟锛歳tstate.battGroupId=1005074 + * Batt_rtstateAction_serchByCondition // 鏃� */ -export const realTimeGroup = (params) => { +export const realTimeGroup = (battGroupId) => { return axios({ - method: "post", - url: "Batt_rtstateAction_serchByCondition", - data: "rtstate.battGroupId=" + params + method: "GET", + url: "BattRtstate/serchByCondition", + params: { + battGroupId + } }) } /** * 鏌ヨ鍘嗗彶瀹炴椂鏁版嵁 - * @param json:{"dev_id":618500002} - * @returns {AxiosPromise} + * JhStateAction_action_serchByCondition // 鏃� + * {devId} */ export const JhStateActionSerchByCondition = (params) => { // 鏌ヨ鍚庡彴 return axios({ - method: "post", - url: "JhStateAction_action_serchByCondition", - data: "json=" + JSON.stringify(params) - }); -} - -export const searchAll_lowAction = () => { - return axios({ - method: "post", - url: "Batt_param_lowAction_searchAll", - data: null - }); -} - -export const searchBattresdata = (BattGroupId) => { - return axios({ - method: "post", - url: "Batt_rtdataAction!serchResById", - data: "json=" + JSON.stringify({ - BattGroupId: BattGroupId, - }) + method: "GET", + url: "JhStateAction/serchByCondition", + params }); } /** + * Batt_param_lowAction_searchAll // 鏃� + */ +export const searchAll_lowAction = () => { + return axios({ + method: "GET", + url: "Batt_param_lowAction/searchAll" + }); +} + +/** + * 鏌ヨ鍐呴樆淇℃伅 + * Batt_rtdataAction!serchResById // 鏃� + */ +export const searchBattresdata = (battGroupId) => { + return axios({ + method: "GET", + url: "Batt_rtdataAction/serchResById", + params: { + battGroupId + } + }); +} +/** * 鑾峰彇鍏呮斁鐢佃褰� + * Batttestdata_infAction_searchBattTestInfDataById // 鏃� * 鍙傛暟锛歫son={"num":910000119,"BattGroupId":1005129} * 杩斿洖缁撴灉璇存槑锛� * test_type==3&&test_starttype==3?鏍稿鏀剧數:鐩戞祴鏀剧數 @@ -123,22 +143,22 @@ export const searchBattTestData = (params) => { return axios({ - method: "post", - url: "Batttestdata_infAction_searchBattTestInfDataById", - data: "json=" + JSON.stringify(params) + method: "POST", + url: "Batttestdata_infAction/searchBattTestInfDataById", + params }) } /** * 鏌ヨLD9娴嬭瘯鏁版嵁鍒楄〃 - * Ld9testdata_infAction_ld9action_searchInfList - * 鍙傛暟锛歫son={"BattGroupId":1005129} + * {battGroupId} + * Ld9testdata_infAction_ld9action_searchInfList // 鏃� */ -export const getLD9TestList = (data) => { +export const getLD9TestList = (params) => { return axios({ - method: "post", - url: "Ld9testdata_infAction_ld9action_searchInfList", - data: 'json=' + JSON.stringify(data) + method: "GET", + url: "Ld9testdata_infAction/searchInfList", + params }); } @@ -156,60 +176,66 @@ /** * 鏌ヨ鍘嗗彶鏁版嵁 - * 鍙傛暟锛� json={"BattGroupId":1005129,"test_record_count":"7"} + * BatttestdataAction!findhistory // 鏃� + * {"battGroupId":1005129,"testRecordCount":"7"} */ export const searchHistory = (params) => { - params.data_new = params.data_new ? params.data_new : 1000; return axios({ - method: "post", - url: "BatttestdataAction!findhistory", - data: "json=" + JSON.stringify(params) + method: "GET", + url: "BatttestdataAction/findhistory", + params }) } + /** * 鏌ヨLD9 鍗曚綋娴嬭瘯鏁版嵁 - * Ld9testdataAction_ld9action_serchByCondition - * 鍙傛暟锛歫son={"BattGroupId":1000061,"test_record_count":39,"record_num":3,"test_monnum":1} + * Ld9testdataAction_ld9action_serchByCondition // 鏃� + * {"battGroupId":1000061,"testRecordCount":39,"recordNum":3,"testMonNum":1} */ -export const getLD9Testdata = (data) => { +export const getLD9Testdata = (params) => { return axios({ - method: "post", - url: "Ld9testdataAction_ld9action_serchByCondition", - data: 'json=' + JSON.stringify(data) + method: "GET", + url: "Ld9testdataAction/serchByCondition", + params }); } /** -* 鏌ヨLD9娴嬭瘯缁勭鏁版嵁 -* Ld9testdatastopAction_ld9action_serchByInfo -* 鍙傛暟锛歫son={"BattGroupId":1000061,"test_record_count":39,"record_num":3,"test_monnum":1} -*/ -export const getLD9GrpTestdata = (data) => { + * 鏌ヨLD9娴嬭瘯缁勭鏁版嵁 + * Ld9testdatastopAction_ld9action_serchByInfo // 鏃� + * {"battGroupId":1000061,"testRecordCount":39,"record_num":3,"testMonNum":1} + */ +export const getLD9GrpTestdata = (params) => { return axios({ - method: "post", - url: "Ld9testdatastopAction_ld9action_serchByInfo", - data: 'json=' + JSON.stringify(data) + method: "GET", + url: "Ld9testdatastopAction/serchByInfo", + params + }); +} +/** + * 鏌ヨLD9 涓�娆℃祴璇曚腑鎵�鏈夊崟浣撶殑瀹為檯瀹归噺 + * Ld9testdatastopAction_ld9action_serchByCondition // 鏃� + * {"battGroupId":1000061,"testRecordCount":39} + */ +export const getLD9MonCaps = (params) => { + return axios({ + method: "GET", + url: "Ld9testdatastopAction/serchByCondition", + params }); } /** -* 鏌ヨLD9 涓�娆℃祴璇曚腑鎵�鏈夊崟浣撶殑瀹為檯瀹归噺 -* Ld9testdatastopAction_ld9action_serchByCondition -* 鍙傛暟锛歫son={"BattGroupId":1000061,"test_record_count":39} -*/ -export const getLD9MonCaps = (data) => { - return axios({ - method: "post", - url: "Ld9testdatastopAction_ld9action_serchByCondition", - data: 'json=' + JSON.stringify(data) - }); -} - + * 閫氳繃璁惧id鏌ヨLD9鏁版嵁 + * {devId} + * LD9_stateAction_ld9action_searchByDevId // 鏃� + * @returns + */ export const realTimeLd9Data = (params) => { return axios({ - method: "post", - url: "LD9_stateAction_ld9action_searchByDevId", - data: "json=" + JSON.stringify(params) + method: "GET", + url: "LD9_stateAction/searchByDevId", + params }) } \ No newline at end of file -- Gitblit v1.9.1