index.js 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. import request from "@/tools/request";
  2. import JSONBIG from "json-bigint";
  3. //获取设备报警列表数据
  4. export function GetDeviceTableData(data, timeout = 5000) {
  5. return request({
  6. baseURL: process.env.VUE_APP_ALARM,
  7. url: `/alarminfo/findAlarmlist?begin=${data.begin}&end=${data.end
  8. }&alarmType=${data.alarmType}&stationid=${data.stationid}${data.alarmType == "windturbine" || data.alarmType == "inverter"
  9. ? `&deviceid=${data.deviceid}`
  10. : ""
  11. }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${data.description
  12. }&isclose=${data.isclose}`,
  13. method: "get",
  14. timeout,
  15. });
  16. }
  17. //获取报警列表数据
  18. export function GetTableData(data) {
  19. return request({
  20. baseURL: process.env.VUE_APP_ALARM,
  21. url: `/alarm/history/findAlarmlist?begin=${data.begin}&end=${data.end
  22. }&alarmType=${data.alarmType}&stationid=${data.stationid}${data.alarmType == "windturbine" || data.alarmType == "inverter"
  23. ? `&deviceid=${data.deviceid}`
  24. : ""
  25. }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${data.description
  26. }${data.id ? `&id=${data.id}` : ""}`,
  27. method: "get",
  28. });
  29. }
  30. //查询历史报警记录
  31. export const alarm_history = (params, timeout = 9000) => {
  32. return request({
  33. url: `alarm/history/findAlarmlist`,
  34. params: params,
  35. baseURL: process.env.VUE_APP_ALARM,
  36. timeout,
  37. });
  38. };
  39. export const confirmAlart = (data) => {
  40. return request({
  41. method: "post",
  42. baseURL: process.env.VUE_APP_ALARM,
  43. url: "alarm/history/updateAlarms",
  44. data,
  45. timeout: 60000,
  46. });
  47. };
  48. // 获取场站数据
  49. export function fetchStationListAll() {
  50. return request({
  51. baseURL: process.env.VUE_APP_ALARM,
  52. url: `alertrule/querywpllist`,
  53. method: "get",
  54. });
  55. }
  56. //获取部件及预警类型列表
  57. export function fetchRelatePartAndAlarmType() {
  58. return request({
  59. baseURL: process.env.VUE_APP_ALARM,
  60. url: "alertrule/queryalarmtypellist",
  61. method: "get",
  62. });
  63. }
  64. //获取型号列表
  65. export const fetchModel = () => {
  66. return request({
  67. baseURL: process.env.VUE_APP_ALARM,
  68. url: "alertrule/querywpbyymodellist",
  69. method: "get",
  70. });
  71. };
  72. //获取升压站列表
  73. export const fetchBooststation = () => {
  74. return request({
  75. baseURL: process.env.VUE_APP_ALARM,
  76. url: "alertrule/querysubllist",
  77. method: "get",
  78. });
  79. };
  80. //查询自定义预警列表
  81. export function custombj_fetchTableData(params) {
  82. return request({
  83. baseURL: process.env.VUE_APP_ALARM,
  84. url: "alertrule/page",
  85. method: "get",
  86. params,
  87. });
  88. }
  89. //根据场站编号,风机型号获取AI/DI测点
  90. export const fetchPointList = (wpId = "", modelId = "") => {
  91. return request({
  92. baseURL: process.env.VUE_APP_ALARM,
  93. url: `alertrule/querywtpointlist?wpId=${wpId}&modelId=${modelId}`,
  94. method: "get",
  95. });
  96. };
  97. //根据升压站编号获取AI/DI测点
  98. export const fetchPointListByBootst = (subId = "") => {
  99. return request({
  100. baseURL: process.env.VUE_APP_ALARM,
  101. url: `alertrule/querysubpointllist?subId=${subId}`,
  102. method: "get",
  103. });
  104. };
  105. //新增/修改自定义预警
  106. export const custombj_postSave = (form) => {
  107. return request({
  108. baseURL: process.env.VUE_APP_ALARM,
  109. url: "alertrule/save",
  110. method: "post",
  111. data: form,
  112. });
  113. };
  114. //自定义预警模板下载
  115. export const custombj_importTemplate = () => {
  116. return request({
  117. baseURL: process.env.VUE_APP_ALARM,
  118. url: "alertrule/get-import-template",
  119. method: "get",
  120. responseType: "blob",
  121. });
  122. };
  123. //根据风场id获取所有风机
  124. export const fetchWindturbineList = (wpId = "") => {
  125. return request({
  126. baseURL: process.env.VUE_APP_ALARM,
  127. url: `alertrule/querywtlist?wpId=${wpId}`,
  128. method: "get",
  129. });
  130. };
  131. //根据structcode获取AI.DI测点
  132. export const fetchAIDIPointList = (
  133. deviceId,
  134. structcode,
  135. stationId,
  136. windturbineId,
  137. pageNum,
  138. pageSize
  139. ) => {
  140. return request({
  141. baseURL: process.env.VUE_APP_ALARM,
  142. url: "info/point",
  143. method: "get",
  144. params: {
  145. deviceId,
  146. structcode,
  147. stationId,
  148. windturbineId,
  149. pageNum,
  150. pageSize,
  151. },
  152. });
  153. };
  154. //字典维护列表
  155. export const get_datadictionary = (pageNum, pageSize, name, category) => {
  156. return request({
  157. baseURL: process.env.VUE_APP_ALARM,
  158. method: "get",
  159. url: `datadictionary/page?pageNum=${pageNum}&pageSize=${pageSize}&name=${name}&category=${category}`,
  160. });
  161. };
  162. //字典维护 新增 修改
  163. export const post_saveorupdate = (data) => {
  164. return request({
  165. baseURL: process.env.VUE_APP_ALARM,
  166. method: "post",
  167. url: `datadictionary/save`,
  168. data,
  169. });
  170. };
  171. //实时报警列表
  172. export const alarm_snap_top = (params) => {
  173. return request({
  174. baseURL: process.env.VUE_APP_ALARM,
  175. method: "get",
  176. url: `alarm/history/findAlarmByTypelist`,
  177. params: params,
  178. });
  179. };
  180. //数据查询实时数据
  181. export const getAdapterLatest = (stationId, AIlist, stationType, baseURL) => {
  182. return request({
  183. url: `ts/latest?uniformCodes=${AIlist}&thingId=${stationId}&thingType=windturbine`,
  184. baseURL: `${baseURL}:801${/FDC/.test(stationType) ? "1" : "2"}/`,
  185. timeout: 10000,
  186. transformResponse: [
  187. function (data) {
  188. const json = JSONBIG({
  189. storeAsString: true,
  190. });
  191. const res = json.parse(data);
  192. return res;
  193. },
  194. ],
  195. });
  196. };
  197. //数据查询 历史数据
  198. export const getAdapterHistory = (
  199. stationId,
  200. AIpoint,
  201. startTs,
  202. endTs,
  203. cureentBaseUrl
  204. ) => {
  205. return request({
  206. url: `ts/history/raw?uniformCode=${AIpoint}&thingId=${stationId}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}`,
  207. baseURL: cureentBaseUrl,
  208. });
  209. };
  210. //数据查询 数据快照
  211. export const getAdapterHistorysnap = (
  212. stationId,
  213. AIpoint,
  214. startTs,
  215. endTs,
  216. interval,
  217. cureentBaseUrl
  218. ) => {
  219. return request({
  220. url: `ts/history/snap?uniformCode=${AIpoint}&thingId=${stationId}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}&interval=${interval}`,
  221. baseURL: cureentBaseUrl,
  222. });
  223. };
  224. // 风机原始数据统计
  225. // 列表接口
  226. export const getAlarmCountList = (params) => {
  227. return request({
  228. url: `alarm/history/findWtFeatureStat?pageNum=${params.pageNum}&pageSize=${params.pageSize}&timeType=${params.timeType}&begin=${params.begin}&end=${params.end}&stationid=${params.stationid}&components=${params.components}&modelId=${params.modelId}&alarmIds=${params.alarmIds}&alarmType=${params.alarmType}`,
  229. // url: 'alarm/history/findWtFeatureStat',
  230. baseURL: process.env.VUE_APP_ALARM,
  231. method: "get",
  232. // params: params
  233. });
  234. };
  235. // 获取报警描述列表
  236. export const GetAlarmId = (params) => {
  237. return request({
  238. url: `alarmconfiguration/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`,
  239. baseURL: process.env.VUE_APP_ALARM,
  240. method: "get",
  241. });
  242. };
  243. // 获取预警描述列表
  244. export const GetAlarmIdCustom = (params) => {
  245. return request({
  246. url: `alertrule/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`,
  247. baseURL: process.env.VUE_APP_ALARM,
  248. method: "get",
  249. });
  250. };
  251. //报警修改日志
  252. export const fetchruleventLogs = (pagenum, pagesize, ruleName, ruleType) => {
  253. return request({
  254. url: "ruleupdate/page",
  255. method: "get",
  256. baseURL: process.env.VUE_APP_ALARM,
  257. params: {
  258. pagenum,
  259. pagesize,
  260. ruleName,
  261. ruleType,
  262. },
  263. });
  264. };
  265. //风机报警列表
  266. export const windturbinebj_fetchTableData = (query) => {
  267. return request({
  268. url: "alarmconfiguration/page",
  269. method: "get",
  270. baseURL: process.env.VUE_APP_ALARM,
  271. params: query,
  272. });
  273. };
  274. //获取服务端公钥
  275. export const getPublickey = (query) => {
  276. return request({
  277. url: "info/publickey",
  278. });
  279. };
  280. // login
  281. export const loginRequest = (params) => {
  282. return request({
  283. url: "/admin-api/system/auth/login",
  284. baseURL: "http://10.81.3.127:48080",
  285. data: params,
  286. method: "post",
  287. });
  288. };
  289. export const Login = (params) => {
  290. return request({
  291. url: "auth/login",
  292. baseURL: process.env.VUE_APP_ALARM,
  293. data: params,
  294. method: "post",
  295. });
  296. };
  297. export function getUserinfo() {
  298. return request({
  299. baseURL: "http://10.81.3.127:48080",
  300. url: "/admin-api/system/auth/get-permission-info",
  301. method: "get",
  302. headers: {
  303. isUser: true,
  304. },
  305. });
  306. }
  307. export function logout(data) {
  308. return request({
  309. baseURL: process.env.VUE_APP_ALARM,
  310. url: `auth/logout`,
  311. method: "post",
  312. data,
  313. });
  314. }
  315. //register
  316. export const registerRequest = (params) => {
  317. return request.post("user/registers", params);
  318. };
  319. // 报警配置缓存清理
  320. export const getRestart = () => {
  321. return request({
  322. url: `custom/restart`,
  323. baseURL: "/custom/",
  324. });
  325. };
  326. export const getRestart2 = () => {
  327. return request({
  328. url: `windturbine/restart`,
  329. baseURL: "/windturbine/",
  330. });
  331. };
  332. export const getRestart3 = () => {
  333. return request({
  334. url: `scadas/restart`,
  335. baseURL: "/scadas/",
  336. });
  337. };
  338. //----------------------------------------homePAge------------------------------------------------
  339. //根据风场id获取所有风机
  340. export const getintellList = (query) => {
  341. return request({
  342. url: "home/early/latest",
  343. method: "get",
  344. params: {
  345. stationId: query,
  346. },
  347. });
  348. };
  349. export const getReportList = (params) => {
  350. return request({
  351. url: "earlyreport/list",
  352. method: "get",
  353. params: params,
  354. });
  355. };
  356. export const getreportReviewList = (query) => {
  357. return request({
  358. url: "inspectorder/port/list",
  359. method: "get",
  360. params: {
  361. stationId: query,
  362. },
  363. });
  364. };
  365. export const getHomeOrdercount = (query) => {
  366. return request({
  367. url: "home/ordercount",
  368. method: "get",
  369. });
  370. };
  371. //首页获取机型接口
  372. export const getHomeAlertrule = (params) => {
  373. return request({
  374. url: "home/alertrule",
  375. method: "get",
  376. params: params,
  377. });
  378. };
  379. export const getHomeDangerHidden = (params) => {
  380. return request({
  381. url: "home/hidden/danger",
  382. method: "get",
  383. });
  384. };
  385. export const getHomeDurationTotal = (params) => {
  386. return request({
  387. url: "home/total/duration",
  388. method: "get",
  389. });
  390. };
  391. // 巡检计划
  392. export const getCheckList = (params) => {
  393. return request({
  394. url: "inspectorder/order/page",
  395. method: "get",
  396. params: params,
  397. });
  398. };
  399. // 弹窗数据接口
  400. export const getDialogData = (params) => {
  401. return request.get(
  402. `windturbineAlarmCount/query/detail?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=${params.windturbineid}&parts=${params.parts}`
  403. );
  404. };
  405. // 设备隐患评审报告
  406. export const postSubmitReport = (params) => {
  407. return request.post("inspectorder/update", params);
  408. };
  409. // ----------------------------------------user------------------------------------------------
  410. export const getUserList = () => {
  411. return request.get(`user/getall`);
  412. };
  413. export const editRequest = (params) => {
  414. return request.post("user/edituser", params);
  415. };
  416. export const deleteUser = (data) => {
  417. return request.delete(`user/${data}`);
  418. };
  419. // ----------------------------------------user------------------------------------------------
  420. // ----------------------------------------system------------------------------------------------
  421. // 获取故障弹窗
  422. export const getjumpwindow = () => {
  423. return request.get(`userset/jumpwindow`);
  424. };
  425. // 获取语音播报
  426. export const getfaultread = () => {
  427. return request.get(`userset/faultread`);
  428. };
  429. // 保存是否故障弹窗
  430. export const postjumpwindow = (params) => {
  431. return request.post(`userset/jumpwindow?isjump=${params}`);
  432. };
  433. // 保存是否语音播报
  434. export const postfaultread = (params) => {
  435. return request.post(`userset/faultread?isread=${params}`);
  436. };
  437. // ----------------------------------------system------------------------------------------------
  438. //获取所有风场
  439. export const fetchStationList = () => {
  440. return request({
  441. url: "info/station",
  442. method: "get",
  443. });
  444. };
  445. // //获取所有风场光伏
  446. // export const fetchStationListAll = () => {
  447. // return request({
  448. // url: "info/station/all",
  449. // method: "get",
  450. // });
  451. // };
  452. // ----------------------------------------安全生产- 报警记录------------------------------------------------
  453. //导出历史报警记录
  454. export const new_alarm_history = (params) => {
  455. // return request.get(`alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`)
  456. return request({
  457. method: "get",
  458. url: `alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`,
  459. headers: {
  460. "Content-Type": "application/json",
  461. },
  462. responseType: "blob",
  463. timeout: 99999999,
  464. });
  465. };
  466. //查报警
  467. export const alarm_snap = (params) => {
  468. return request({
  469. url: `alarm/snap`,
  470. params: params,
  471. });
  472. };
  473. // ----------------------------------------安全生产- 实时报警------------------------------------------------
  474. //实时故障 最高级
  475. export const alarm_fault_recent = (params) => {
  476. return request({
  477. url: `fault/recent`,
  478. params: params,
  479. transformResponse: [
  480. function (data) {
  481. const json = JSONBIG({
  482. storeAsString: true,
  483. });
  484. const res = json.parse(data);
  485. return res;
  486. },
  487. ],
  488. });
  489. };
  490. //实时故障 第一次请求
  491. export const alarm_fault_top = (params) => {
  492. return request({
  493. url: `fault/snap/top`,
  494. params: params,
  495. });
  496. };
  497. //报警确认
  498. export const get_fault_confirm = (params) => {
  499. return request({
  500. url: `fault/confirm`,
  501. params: params,
  502. });
  503. };
  504. // ----------------------------------------安全生产- 实时数据查询------------------------------------------------
  505. // get 实时data
  506. // 批量导出
  507. export const AdapterHistoryExport = (activeAI, activeWT, startTs, endTs) => {
  508. return request({
  509. url: `ts/history/raw?uniformCode=${activeAI}&thingId=${activeWT}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}`,
  510. baseURL: "/adapter/",
  511. });
  512. };
  513. // ----------------------------------------基础数据- 设备管理------------------------------------------------
  514. //查询全部设备型号接口
  515. export const device_list = () => {
  516. return request({
  517. baseURL: process.env.VUE_APP_ALARM,
  518. method: "get",
  519. url: `device/model/list`,
  520. });
  521. };
  522. //获取结构tree
  523. export function tree(params) {
  524. return request({
  525. baseURL: process.env.VUE_APP_ALARM,
  526. url: "device/structure/tree/windturbine",
  527. method: "get",
  528. transformResponse: [
  529. function (data) {
  530. const json = JSONBIG({
  531. storeAsString: true,
  532. });
  533. const res = json.parse(data);
  534. return res;
  535. },
  536. ],
  537. });
  538. }
  539. //根据结构获取测点
  540. export function point(
  541. code,
  542. pagenum,
  543. pagesize,
  544. categorydata,
  545. keyword,
  546. deviceId,
  547. model
  548. ) {
  549. return request({
  550. baseURL: process.env.VUE_APP_ALARM,
  551. url: `device/metrics/page?pageNum=${pagenum}&pageSize=${pagesize}&deviceId=${deviceId}&categorydata=${categorydata}&keyword=${keyword}&model=${model}&structureCode=${code}`,
  552. method: "get",
  553. });
  554. }
  555. //测点新增
  556. export function metrics(data) {
  557. return request({
  558. method: "post",
  559. url: `device/metrics/single`,
  560. data,
  561. baseURL: process.env.VUE_APP_ALARM,
  562. });
  563. // return request.post(`device/metrics/single`, data);
  564. }
  565. //测点删除
  566. export function delmetrics(params) {
  567. return request({
  568. baseURL: process.env.VUE_APP_ALARM,
  569. method: "delete",
  570. url: `device/metrics/single/delete/${params}`,
  571. });
  572. }
  573. //测点导入
  574. //tree新增 添加一个设备结构节点
  575. export function treeAdd(data) {
  576. return request({
  577. method: "post",
  578. baseURL: process.env.VUE_APP_ALARM,
  579. url: `device/structure`,
  580. data,
  581. });
  582. }
  583. //tree删除 tree删除一个设备结构节点
  584. export function treeDel(params) {
  585. return request({
  586. method: "delete",
  587. baseURL: process.env.VUE_APP_ALARM,
  588. url: `device/structure/delete/${params}`,
  589. });
  590. }
  591. // 故障模式
  592. // get All
  593. export const faultmode_windturbine = () => {
  594. return request({
  595. method: "get",
  596. baseURL: process.env.VUE_APP_ALARM,
  597. url: `device/faultmode/windturbine`,
  598. });
  599. };
  600. // 根据 structurecode get
  601. export const faultmode_structureCode = (params) => {
  602. return request({
  603. baseURL: process.env.VUE_APP_ALARM,
  604. url: `device/faultmode/windturbine/${params}`,
  605. method: "get",
  606. });
  607. };
  608. // 根据 id delete
  609. export const faultmode_delete = (params) => {
  610. return request({
  611. method: "delete",
  612. baseURL: process.env.VUE_APP_ALARM,
  613. url: `device/faultmode/delete/${params}`,
  614. });
  615. };
  616. // 新增 修改
  617. export const faultmode_add_edit = (data) => {
  618. return request({
  619. method: "post",
  620. baseURL: process.env.VUE_APP_ALARM,
  621. url: `device/faultmode`,
  622. data,
  623. });
  624. };
  625. // ---------------------------------------- 报警配置- 自定义预警------------------------------------------------
  626. // 获取机型
  627. export function getStationinfo(params) {
  628. return request({
  629. url: `info/stationinfo?stationId=${params}`,
  630. method: "get",
  631. });
  632. }
  633. // 获取规则
  634. export function alertrule2_list() {
  635. return request.get(`alertrule2/list/`);
  636. }
  637. //根据场站编号,风机型号获取DI测点new
  638. export const getDIPointList = (minModel) => {
  639. return request({
  640. url: "testingpointDI/point",
  641. method: "get",
  642. params: {
  643. minModel,
  644. },
  645. });
  646. };
  647. //根据场站编号,获取电气DI测点
  648. export const fetchElectricDIPointList = (stationId) => {
  649. return request({
  650. url: "info/electrical_point_di",
  651. method: "get",
  652. params: {
  653. stationId: stationId,
  654. },
  655. });
  656. };
  657. //根据电气测点,获取测点信息
  658. export const fetchElectricDIPointByPointId = (pointId) => {
  659. return request({
  660. url: "info/electrical_point_di/byId",
  661. method: "get",
  662. params: {
  663. pointId: pointId,
  664. },
  665. });
  666. };
  667. //根据风场编号获取电气AI测点
  668. export const fetch_electrical_point_ai = (stationId, modelId) => {
  669. return request({
  670. baseURL: process.env.VUE_APP_ALARM,
  671. url: "info/testing_point_ai",
  672. method: "get",
  673. params: {
  674. stationId,
  675. modelId
  676. },
  677. });
  678. };
  679. //根据风场编号获取电气DI测点
  680. export const fetch_electrical_point_di = (stationId, modelId) => {
  681. return request({
  682. baseURL: process.env.VUE_APP_ALARM,
  683. url: "info/testing_point_di",
  684. method: "get",
  685. params: {
  686. stationId,
  687. modelId
  688. },
  689. });
  690. };
  691. //获取报警类型
  692. export const fetchWarningType = () => {
  693. return request({
  694. url: "info/warning_type",
  695. method: "get",
  696. });
  697. };
  698. //获取报警种类
  699. export const fetchWarningClassify = () => {
  700. return request({
  701. url: "info/warning_classify",
  702. method: "get",
  703. });
  704. };
  705. export const custombj_batchImport = (list) => {
  706. return request.post("alertrule2/save-batch", list);
  707. };
  708. //******************************end****************************************//
  709. //******************************升压站报警API************************************//
  710. export const scadabj_fetchTableData = (query) => {
  711. return request({
  712. url: "scadabj/page",
  713. method: "get",
  714. params: query,
  715. timeout: 20000,
  716. transformResponse: [
  717. // 处理17位数字精度问题
  718. function (data) {
  719. const json = JSONBIG({
  720. storeAsString: true,
  721. });
  722. const res = json.parse(data);
  723. return res;
  724. },
  725. ],
  726. });
  727. };
  728. export const scadabj_postSave = (objData) => {
  729. return request.post("scadabj/save", objData);
  730. };
  731. export const scadabj_batchImport = (list) => {
  732. return request.post("scadabj/save-batch", list);
  733. };
  734. //********************************************end********************************//\
  735. //********************************************报警记录日志********************************//\
  736. //********************************************end********************************//\
  737. //******************************风机报警API************************************//
  738. export const windturbinebj_postSave = (form) => {
  739. return request.post("warning2/save", form);
  740. };
  741. export const windturbinebj_batchImport = (list) => {
  742. return request.post("warning2/save-batch", list);
  743. };
  744. export const fetchLeaf = () => {
  745. return request({
  746. url: "warning2/page",
  747. method: "get",
  748. params: {
  749. pagenum: 1,
  750. pagesize: 10000,
  751. isLeaf: 0,
  752. },
  753. });
  754. };
  755. //根据风机型号获取DI测点统一编码相关数据 testingpointdi2
  756. export const getDIPointByModelId = (query) => {
  757. return request({
  758. url: "info/testing_point_di",
  759. method: "get",
  760. params: query,
  761. });
  762. };
  763. //******************************end*******************************************//
  764. //******************************预警统计*******************************************//
  765. export const statistics_querymap = (params) => {
  766. return request.get(`alarm/count/querymap2`, { params: params });
  767. };
  768. export const statistics_querybyname = (params) => {
  769. return request.get("alarm/count/querybyname2", { params: params });
  770. };
  771. export const statistics_lineandproject = (params) => {
  772. return request.get("alarm/count/lineandproject2", { params: params });
  773. };
  774. //******************************end*******************************************//
  775. //******************************预警分析*******************************************//
  776. export const warning_query_new = (params) => {
  777. return request.get(`alarm/count/query/new2`, { params: params });
  778. };
  779. export const warning_detail = (params) => {
  780. return request({
  781. url: `analysis/detail`,
  782. params: params,
  783. timeout: 60000,
  784. });
  785. };
  786. // export const statistics_lineandproject = params => {
  787. // return request.get('alarm/count/lineandproject', { params: params })
  788. // };
  789. //******************************end*******************************************//
  790. //*****************************旧诊断报告*******************************************//
  791. export const earlywarnscore_list = (params) => {
  792. return request.get(`earlywarnscore/list`, { params: params });
  793. };
  794. export const warning_query_new3 = (params) => {
  795. return request.get(`alarm/count/query/new3`, { params: params });
  796. };
  797. //******************************end*******************************************//
  798. //*****************************新诊断报告*******************************************//
  799. export const getList = (params) => {
  800. return request.get(
  801. `earlyreport/list?pagenum=${params.pagenum}&pagesize=${params.pagesize}&stationId=${params.stationId}&keyword=&starttime=&endtime=`
  802. );
  803. };
  804. export const getReportDetail = (id) => {
  805. return request({
  806. url: `earlyreport/info?id=${id}`,
  807. method: "get",
  808. });
  809. };
  810. //******************************end*******************************************//
  811. export const getAlarmConfig = () => {
  812. // return request.get(`/alertrule/queryalarmtypellist`);
  813. return request({
  814. method: "get",
  815. baseURL: process.env.VUE_APP_ALARM,
  816. url: "alertrule/queryalarmtypellist",
  817. });
  818. };
  819. export const getAlartConfig = () => {
  820. return request({
  821. method: "get",
  822. baseURL: process.env.VUE_APP_ALARM,
  823. url: "alarmswitch/queryAll",
  824. });
  825. };
  826. export const saveAlartConfig = (data) => {
  827. return request({
  828. method: "post",
  829. baseURL: process.env.VUE_APP_ALARM,
  830. url: "alarmswitch/save",
  831. data,
  832. });
  833. };
  834. export const getWtModel = (wpId = "") => {
  835. return request({
  836. baseURL: process.env.VUE_APP_ALARM,
  837. method: "get",
  838. url: `alertrule/querymodellist?wpId=${wpId}`,
  839. });
  840. };
  841. export const getWpList = (types = "") => {
  842. return request({
  843. method: "get",
  844. baseURL: process.env.VUE_APP_ALARM,
  845. url: `alertrule/querywpllist?types=${types}`,
  846. });
  847. };
  848. export const getWtList = (params) => {
  849. return request({
  850. method: "get",
  851. baseURL: process.env.VUE_APP_API,
  852. url: `/benchmarking/wtByWplist?wpId=${params.wpId}`,
  853. });
  854. };
  855. export const getBpList = () => {
  856. return request({
  857. baseURL: process.env.VUE_APP_ALARM,
  858. method: "get",
  859. url: `alertrule/querysubllist`,
  860. });
  861. };
  862. export const getPointList = (params) => {
  863. return request({
  864. method: "get",
  865. baseURL: process.env.VUE_APP_ALARM,
  866. url: "alertrule/querysubpointllist",
  867. params,
  868. });
  869. };
  870. export const saveAlarmconfiguration = (data) => {
  871. return request({
  872. method: "post",
  873. baseURL: process.env.VUE_APP_ALARM,
  874. url: "alarmconfiguration/save",
  875. data,
  876. });
  877. };
  878. export const getStopQueryTableData = (params) => {
  879. return request({
  880. method: "get",
  881. baseURL: process.env.VUE_APP_ALARM,
  882. url: "shutdownevent2/queryshutdowneventlist",
  883. params,
  884. });
  885. };
  886. export const getWarningCountList = (params) => {
  887. return request({
  888. url: `alarm/history/findCtFeatureStat?timeType=${params.timeType}&begin=${params.begin
  889. }&end=${params.end}&stationid=${params.stationid
  890. }&components=${params.components.toString()}&modelId=${params.modelId
  891. }&alarmIds=${params.alarmIds}&deviceType=${params.deviceType}`,
  892. baseURL: process.env.VUE_APP_ALARM,
  893. method: "get",
  894. });
  895. };
  896. //查询所有场站
  897. export function getAllStation() {
  898. return request({
  899. baseURL: process.env.VUE_APP_ALARM,
  900. url: `/electricity/czlist`,
  901. method: "GET",
  902. });
  903. }
  904. export function getAlarmMap(url = "/alarmplan/queryAlarmPlanMap", params = {}) {
  905. return request({
  906. baseURL: process.env.VUE_APP_ALARM,
  907. url,
  908. params,
  909. method: "GET",
  910. });
  911. }
  912. export function getAlarmMapById(params) {
  913. return request({
  914. baseURL: process.env.VUE_APP_ALARM,
  915. url: "/alarmplan/alarmPlanlistById",
  916. params,
  917. method: "GET",
  918. });
  919. }
  920. export function getAlarmTypeList() {
  921. return request({
  922. baseURL: process.env.VUE_APP_ALARM,
  923. url: `/alarmplan/alarmPlanTypelist`,
  924. method: "GET",
  925. });
  926. }
  927. export function addAlarmItem(data) {
  928. return request({
  929. baseURL: process.env.VUE_APP_ALARM,
  930. url: `/alarmplan/save`,
  931. method: "POST",
  932. data
  933. });
  934. }
  935. export function deleteAlarmItem(params) {
  936. return request({
  937. baseURL: process.env.VUE_APP_ALARM,
  938. url: `/alarmplan/delete`,
  939. method: "delete",
  940. params
  941. });
  942. }
  943. export function getAlarmExcelTemplate() {
  944. return request({
  945. baseURL: process.env.VUE_APP_ALARM,
  946. url: `/alarmplan/importtemplate`,
  947. method: "get",
  948. responseType: "blob",
  949. });
  950. }
  951. // 风电数据准备页面
  952. export function apiGetbaseStation() {
  953. return request({
  954. baseURL: process.env.VUE_APP_ALARM,
  955. url: 'base/station',
  956. method: 'get'
  957. })
  958. }
  959. // 风电数据准备页面
  960. export function apiGeWarningReport(params) {
  961. return request({
  962. baseURL: process.env.VUE_APP_API,
  963. url: `WarningReport/report?time=${params.reportParamDate}&wpid=${params.reportStation}`,
  964. method: 'get'
  965. })
  966. }
  967. export function apiGeWarningeconreportReport(params) {
  968. return request({
  969. baseURL: process.env.VUE_APP_API,
  970. url: `WarningReport/econreport?time=${params.reportParamDate}&wtid=${params.windStation}`,
  971. method: 'get'
  972. })
  973. }
  974. export function apiGetwinddirection(params) {
  975. return request({
  976. baseURL: process.env.VUE_APP_API,
  977. url: `winddirecton/machine?wpid=${params.wpid}`,
  978. method: 'get'
  979. })
  980. }