index.js 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  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?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. baseURL: process.env.VUE_APP_ALARM,
  230. method: "get",
  231. });
  232. };
  233. // 获取报警描述列表
  234. export const GetAlarmId = (params) => {
  235. return request({
  236. url: `alarmconfiguration/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`,
  237. baseURL: process.env.VUE_APP_ALARM,
  238. method: "get",
  239. });
  240. };
  241. // 获取预警描述列表
  242. export const GetAlarmIdCustom = (params) => {
  243. return request({
  244. url: `alertrule/querywtalarmdesclist?components=${params.components}&modelId=${params.modelId}&wpId=${params.wpId}`,
  245. baseURL: process.env.VUE_APP_ALARM,
  246. method: "get",
  247. });
  248. };
  249. //报警修改日志
  250. export const fetchruleventLogs = (pagenum, pagesize, ruleName, ruleType) => {
  251. return request({
  252. url: "ruleupdate/page",
  253. method: "get",
  254. baseURL: process.env.VUE_APP_ALARM,
  255. params: {
  256. pagenum,
  257. pagesize,
  258. ruleName,
  259. ruleType,
  260. },
  261. });
  262. };
  263. //风机报警列表
  264. export const windturbinebj_fetchTableData = (query) => {
  265. return request({
  266. url: "alarmconfiguration/page",
  267. method: "get",
  268. baseURL: process.env.VUE_APP_ALARM,
  269. params: query,
  270. });
  271. };
  272. //获取服务端公钥
  273. export const getPublickey = (query) => {
  274. return request({
  275. url: "info/publickey",
  276. });
  277. };
  278. // login
  279. export const loginRequest = (params) => {
  280. return request({
  281. url: "/admin-api/system/auth/login",
  282. baseURL: "http://10.81.3.127:48080",
  283. data: params,
  284. method: "post",
  285. });
  286. };
  287. export const Login = (params) => {
  288. return request({
  289. url: "auth/login",
  290. baseURL: process.env.VUE_APP_ALARM,
  291. data: params,
  292. method: "post",
  293. });
  294. };
  295. export function getUserinfo() {
  296. return request({
  297. baseURL: "http://10.81.3.127:48080",
  298. url: "/admin-api/system/auth/get-permission-info",
  299. method: "get",
  300. headers: {
  301. isUser: true,
  302. },
  303. });
  304. }
  305. export function logout(data) {
  306. return request({
  307. baseURL: process.env.VUE_APP_ALARM,
  308. url: `auth/logout`,
  309. method: "post",
  310. data,
  311. });
  312. }
  313. //register
  314. export const registerRequest = (params) => {
  315. return request.post("user/registers", params);
  316. };
  317. // 报警配置缓存清理
  318. export const getRestart = () => {
  319. return request({
  320. url: `custom/restart`,
  321. baseURL: "/custom/",
  322. });
  323. };
  324. export const getRestart2 = () => {
  325. return request({
  326. url: `windturbine/restart`,
  327. baseURL: "/windturbine/",
  328. });
  329. };
  330. export const getRestart3 = () => {
  331. return request({
  332. url: `scadas/restart`,
  333. baseURL: "/scadas/",
  334. });
  335. };
  336. //----------------------------------------homePAge------------------------------------------------
  337. //根据风场id获取所有风机
  338. export const getintellList = (query) => {
  339. return request({
  340. url: "home/early/latest",
  341. method: "get",
  342. params: {
  343. stationId: query,
  344. },
  345. });
  346. };
  347. export const getReportList = (params) => {
  348. return request({
  349. url: "earlyreport/list",
  350. method: "get",
  351. params: params,
  352. });
  353. };
  354. export const getreportReviewList = (query) => {
  355. return request({
  356. url: "inspectorder/port/list",
  357. method: "get",
  358. params: {
  359. stationId: query,
  360. },
  361. });
  362. };
  363. export const getHomeOrdercount = (query) => {
  364. return request({
  365. url: "home/ordercount",
  366. method: "get",
  367. });
  368. };
  369. //首页获取机型接口
  370. export const getHomeAlertrule = (params) => {
  371. return request({
  372. url: "home/alertrule",
  373. method: "get",
  374. params: params,
  375. });
  376. };
  377. export const getHomeDangerHidden = (params) => {
  378. return request({
  379. url: "home/hidden/danger",
  380. method: "get",
  381. });
  382. };
  383. export const getHomeDurationTotal = (params) => {
  384. return request({
  385. url: "home/total/duration",
  386. method: "get",
  387. });
  388. };
  389. // 巡检计划
  390. export const getCheckList = (params) => {
  391. return request({
  392. url: "inspectorder/order/page",
  393. method: "get",
  394. params: params,
  395. });
  396. };
  397. // 弹窗数据接口
  398. export const getDialogData = (params) => {
  399. return request.get(
  400. `windturbineAlarmCount/query/detail?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=${params.windturbineid}&parts=${params.parts}`
  401. );
  402. };
  403. // 设备隐患评审报告
  404. export const postSubmitReport = (params) => {
  405. return request.post("inspectorder/update", params);
  406. };
  407. // ----------------------------------------user------------------------------------------------
  408. export const getUserList = () => {
  409. return request.get(`user/getall`);
  410. };
  411. export const editRequest = (params) => {
  412. return request.post("user/edituser", params);
  413. };
  414. export const deleteUser = (data) => {
  415. return request.delete(`user/${data}`);
  416. };
  417. // ----------------------------------------user------------------------------------------------
  418. // ----------------------------------------system------------------------------------------------
  419. // 获取故障弹窗
  420. export const getjumpwindow = () => {
  421. return request.get(`userset/jumpwindow`);
  422. };
  423. // 获取语音播报
  424. export const getfaultread = () => {
  425. return request.get(`userset/faultread`);
  426. };
  427. // 保存是否故障弹窗
  428. export const postjumpwindow = (params) => {
  429. return request.post(`userset/jumpwindow?isjump=${params}`);
  430. };
  431. // 保存是否语音播报
  432. export const postfaultread = (params) => {
  433. return request.post(`userset/faultread?isread=${params}`);
  434. };
  435. // ----------------------------------------system------------------------------------------------
  436. //获取所有风场
  437. export const fetchStationList = () => {
  438. return request({
  439. url: "info/station",
  440. method: "get",
  441. });
  442. };
  443. // //获取所有风场光伏
  444. // export const fetchStationListAll = () => {
  445. // return request({
  446. // url: "info/station/all",
  447. // method: "get",
  448. // });
  449. // };
  450. // ----------------------------------------安全生产- 报警记录------------------------------------------------
  451. //导出历史报警记录
  452. export const new_alarm_history = (params) => {
  453. // return request.get(`alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`)
  454. return request({
  455. method: "get",
  456. url: `alarm/history/export?stationid=${params.stationid}&starttime=${params.starttime}&endtime=${params.endtime}&windturbineid=&category1=&category2=&rank=&modelid=&snapid=&messagetype=&keyword=`,
  457. headers: {
  458. "Content-Type": "application/json",
  459. },
  460. responseType: "blob",
  461. timeout: 99999999,
  462. });
  463. };
  464. //查报警
  465. export const alarm_snap = (params) => {
  466. return request({
  467. url: `alarm/snap`,
  468. params: params,
  469. });
  470. };
  471. // ----------------------------------------安全生产- 实时报警------------------------------------------------
  472. //实时故障 最高级
  473. export const alarm_fault_recent = (params) => {
  474. return request({
  475. url: `fault/recent`,
  476. params: params,
  477. transformResponse: [
  478. function (data) {
  479. const json = JSONBIG({
  480. storeAsString: true,
  481. });
  482. const res = json.parse(data);
  483. return res;
  484. },
  485. ],
  486. });
  487. };
  488. //实时故障 第一次请求
  489. export const alarm_fault_top = (params) => {
  490. return request({
  491. url: `fault/snap/top`,
  492. params: params,
  493. });
  494. };
  495. //报警确认
  496. export const get_fault_confirm = (params) => {
  497. return request({
  498. url: `fault/confirm`,
  499. params: params,
  500. });
  501. };
  502. // ----------------------------------------安全生产- 实时数据查询------------------------------------------------
  503. // get 实时data
  504. // 批量导出
  505. export const AdapterHistoryExport = (activeAI, activeWT, startTs, endTs) => {
  506. return request({
  507. url: `ts/history/raw?uniformCode=${activeAI}&thingId=${activeWT}&thingType=windturbine&startTs=${startTs}&endTs=${endTs}`,
  508. baseURL: "/adapter/",
  509. });
  510. };
  511. // ----------------------------------------基础数据- 设备管理------------------------------------------------
  512. //查询全部设备型号接口
  513. export const device_list = () => {
  514. return request({
  515. baseURL: process.env.VUE_APP_ALARM,
  516. method: "get",
  517. url: `device/model/list`,
  518. });
  519. };
  520. //获取结构tree
  521. export function tree(params) {
  522. return request({
  523. baseURL: process.env.VUE_APP_ALARM,
  524. url: "device/structure/tree/windturbine",
  525. method: "get",
  526. transformResponse: [
  527. function (data) {
  528. const json = JSONBIG({
  529. storeAsString: true,
  530. });
  531. const res = json.parse(data);
  532. return res;
  533. },
  534. ],
  535. });
  536. }
  537. //根据结构获取测点
  538. export function point(
  539. code,
  540. pagenum,
  541. pagesize,
  542. categorydata,
  543. keyword,
  544. deviceId,
  545. model
  546. ) {
  547. return request({
  548. baseURL: process.env.VUE_APP_ALARM,
  549. url: `device/metrics/page?pageNum=${pagenum}&pageSize=${pagesize}&deviceId=${deviceId}&categorydata=${categorydata}&keyword=${keyword}&model=${model}&structureCode=${code}`,
  550. method: "get",
  551. });
  552. }
  553. //测点新增
  554. export function metrics(data) {
  555. return request({
  556. method: "post",
  557. url: `device/metrics/single`,
  558. data,
  559. baseURL: process.env.VUE_APP_ALARM,
  560. });
  561. // return request.post(`device/metrics/single`, data);
  562. }
  563. //测点删除
  564. export function delmetrics(params) {
  565. return request({
  566. baseURL: process.env.VUE_APP_ALARM,
  567. method: "delete",
  568. url: `device/metrics/single/delete/${params}`,
  569. });
  570. }
  571. //测点导入
  572. //tree新增 添加一个设备结构节点
  573. export function treeAdd(data) {
  574. return request({
  575. method: "post",
  576. baseURL: process.env.VUE_APP_ALARM,
  577. url: `device/structure`,
  578. data,
  579. });
  580. }
  581. //tree删除 tree删除一个设备结构节点
  582. export function treeDel(params) {
  583. return request({
  584. method: "delete",
  585. baseURL: process.env.VUE_APP_ALARM,
  586. url: `device/structure/delete/${params}`,
  587. });
  588. }
  589. // 故障模式
  590. // get All
  591. export const faultmode_windturbine = () => {
  592. return request({
  593. method: "get",
  594. baseURL: process.env.VUE_APP_ALARM,
  595. url: `device/faultmode/windturbine`,
  596. });
  597. };
  598. // 根据 structurecode get
  599. export const faultmode_structureCode = (params) => {
  600. return request({
  601. baseURL: process.env.VUE_APP_ALARM,
  602. url: `device/faultmode/windturbine/${params}`,
  603. method: "get",
  604. });
  605. };
  606. // 根据 id delete
  607. export const faultmode_delete = (params) => {
  608. return request({
  609. method: "delete",
  610. baseURL: process.env.VUE_APP_ALARM,
  611. url: `device/faultmode/delete/${params}`,
  612. });
  613. };
  614. // 新增 修改
  615. export const faultmode_add_edit = (data) => {
  616. return request({
  617. method: "post",
  618. baseURL: process.env.VUE_APP_ALARM,
  619. url: `device/faultmode`,
  620. data,
  621. });
  622. };
  623. // ---------------------------------------- 报警配置- 自定义预警------------------------------------------------
  624. // 获取机型
  625. export function getStationinfo(params) {
  626. return request({
  627. url: `info/stationinfo?stationId=${params}`,
  628. method: "get",
  629. });
  630. }
  631. // 获取规则
  632. export function alertrule2_list() {
  633. return request.get(`alertrule2/list/`);
  634. }
  635. //根据场站编号,风机型号获取DI测点new
  636. export const getDIPointList = (minModel) => {
  637. return request({
  638. url: "testingpointDI/point",
  639. method: "get",
  640. params: {
  641. minModel,
  642. },
  643. });
  644. };
  645. //根据场站编号,获取电气DI测点
  646. export const fetchElectricDIPointList = (stationId) => {
  647. return request({
  648. url: "info/electrical_point_di",
  649. method: "get",
  650. params: {
  651. stationId: stationId,
  652. },
  653. });
  654. };
  655. //根据电气测点,获取测点信息
  656. export const fetchElectricDIPointByPointId = (pointId) => {
  657. return request({
  658. url: "info/electrical_point_di/byId",
  659. method: "get",
  660. params: {
  661. pointId: pointId,
  662. },
  663. });
  664. };
  665. //根据风场编号获取电气AI测点
  666. export const fetch_electrical_point_ai = (stationId, modelId) => {
  667. return request({
  668. baseURL: process.env.VUE_APP_ALARM,
  669. url: "info/testing_point_ai",
  670. method: "get",
  671. params: {
  672. stationId,
  673. modelId
  674. },
  675. });
  676. };
  677. //根据风场编号获取电气DI测点
  678. export const fetch_electrical_point_di = (stationId, modelId) => {
  679. return request({
  680. baseURL: process.env.VUE_APP_ALARM,
  681. url: "info/testing_point_di",
  682. method: "get",
  683. params: {
  684. stationId,
  685. modelId
  686. },
  687. });
  688. };
  689. //获取报警类型
  690. export const fetchWarningType = () => {
  691. return request({
  692. url: "info/warning_type",
  693. method: "get",
  694. });
  695. };
  696. //获取报警种类
  697. export const fetchWarningClassify = () => {
  698. return request({
  699. url: "info/warning_classify",
  700. method: "get",
  701. });
  702. };
  703. export const custombj_batchImport = (list) => {
  704. return request.post("alertrule2/save-batch", list);
  705. };
  706. //******************************end****************************************//
  707. //******************************升压站报警API************************************//
  708. export const scadabj_fetchTableData = (query) => {
  709. return request({
  710. url: "scadabj/page",
  711. method: "get",
  712. params: query,
  713. timeout: 20000,
  714. transformResponse: [
  715. // 处理17位数字精度问题
  716. function (data) {
  717. const json = JSONBIG({
  718. storeAsString: true,
  719. });
  720. const res = json.parse(data);
  721. return res;
  722. },
  723. ],
  724. });
  725. };
  726. export const scadabj_postSave = (objData) => {
  727. return request.post("scadabj/save", objData);
  728. };
  729. export const scadabj_batchImport = (list) => {
  730. return request.post("scadabj/save-batch", list);
  731. };
  732. //********************************************end********************************//\
  733. //********************************************报警记录日志********************************//\
  734. //********************************************end********************************//\
  735. //******************************风机报警API************************************//
  736. export const windturbinebj_postSave = (form) => {
  737. return request.post("warning2/save", form);
  738. };
  739. export const windturbinebj_batchImport = (list) => {
  740. return request.post("warning2/save-batch", list);
  741. };
  742. export const fetchLeaf = () => {
  743. return request({
  744. url: "warning2/page",
  745. method: "get",
  746. params: {
  747. pagenum: 1,
  748. pagesize: 10000,
  749. isLeaf: 0,
  750. },
  751. });
  752. };
  753. //根据风机型号获取DI测点统一编码相关数据 testingpointdi2
  754. export const getDIPointByModelId = (query) => {
  755. return request({
  756. url: "info/testing_point_di",
  757. method: "get",
  758. params: query,
  759. });
  760. };
  761. //******************************end*******************************************//
  762. //******************************预警统计*******************************************//
  763. export const statistics_querymap = (params) => {
  764. return request.get(`alarm/count/querymap2`, { params: params });
  765. };
  766. export const statistics_querybyname = (params) => {
  767. return request.get("alarm/count/querybyname2", { params: params });
  768. };
  769. export const statistics_lineandproject = (params) => {
  770. return request.get("alarm/count/lineandproject2", { params: params });
  771. };
  772. //******************************end*******************************************//
  773. //******************************预警分析*******************************************//
  774. export const warning_query_new = (params) => {
  775. return request.get(`alarm/count/query/new2`, { params: params });
  776. };
  777. export const warning_detail = (params) => {
  778. return request({
  779. url: `analysis/detail`,
  780. params: params,
  781. timeout: 60000,
  782. });
  783. };
  784. // export const statistics_lineandproject = params => {
  785. // return request.get('alarm/count/lineandproject', { params: params })
  786. // };
  787. //******************************end*******************************************//
  788. //*****************************旧诊断报告*******************************************//
  789. export const earlywarnscore_list = (params) => {
  790. return request.get(`earlywarnscore/list`, { params: params });
  791. };
  792. export const warning_query_new3 = (params) => {
  793. return request.get(`alarm/count/query/new3`, { params: params });
  794. };
  795. //******************************end*******************************************//
  796. //*****************************新诊断报告*******************************************//
  797. export const getList = (params) => {
  798. return request.get(
  799. `earlyreport/list?pagenum=${params.pagenum}&pagesize=${params.pagesize}&stationId=${params.stationId}&keyword=&starttime=&endtime=`
  800. );
  801. };
  802. export const getReportDetail = (id) => {
  803. return request({
  804. url: `earlyreport/info?id=${id}`,
  805. method: "get",
  806. });
  807. };
  808. //******************************end*******************************************//
  809. export const getAlarmConfig = () => {
  810. // return request.get(`/alertrule/queryalarmtypellist`);
  811. return request({
  812. method: "get",
  813. baseURL: process.env.VUE_APP_ALARM,
  814. url: "alertrule/queryalarmtypellist",
  815. });
  816. };
  817. export const getAlartConfig = () => {
  818. return request({
  819. method: "get",
  820. baseURL: process.env.VUE_APP_ALARM,
  821. url: "alarmswitch/queryAll",
  822. });
  823. };
  824. export const saveAlartConfig = (data) => {
  825. return request({
  826. method: "post",
  827. baseURL: process.env.VUE_APP_ALARM,
  828. url: "alarmswitch/save",
  829. data,
  830. });
  831. };
  832. export const getWtModel = (wpId = "") => {
  833. return request({
  834. baseURL: process.env.VUE_APP_ALARM,
  835. method: "get",
  836. url: `alertrule/querymodellist?wpId=${wpId}`,
  837. });
  838. };
  839. export const getWpList = (types = "") => {
  840. return request({
  841. method: "get",
  842. baseURL: process.env.VUE_APP_ALARM,
  843. url: `alertrule/querywpllist?types=${types}`,
  844. });
  845. };
  846. export const getWtList = (params) => {
  847. return request({
  848. method: "get",
  849. baseURL: process.env.VUE_APP_API,
  850. url: `/benchmarking/wtByWplist?wpId=${params.wpId}`,
  851. });
  852. };
  853. export const getBpList = () => {
  854. return request({
  855. baseURL: process.env.VUE_APP_ALARM,
  856. method: "get",
  857. url: `alertrule/querysubllist`,
  858. });
  859. };
  860. export const getPointList = (params) => {
  861. return request({
  862. method: "get",
  863. baseURL: process.env.VUE_APP_ALARM,
  864. url: "alertrule/querysubpointllist",
  865. params,
  866. });
  867. };
  868. export const saveAlarmconfiguration = (data) => {
  869. return request({
  870. method: "post",
  871. baseURL: process.env.VUE_APP_ALARM,
  872. url: "alarmconfiguration/save",
  873. data,
  874. });
  875. };
  876. export const getStopQueryTableData = (params) => {
  877. return request({
  878. method: "get",
  879. baseURL: process.env.VUE_APP_ALARM,
  880. url: "shutdownevent2/queryshutdowneventlist",
  881. params,
  882. });
  883. };
  884. export const getWarningCountList = (params) => {
  885. return request({
  886. url: `alarm/history/findCtFeatureStat?timeType=${params.timeType}&begin=${params.begin
  887. }&end=${params.end}&stationid=${params.stationid
  888. }&components=${params.components.toString()}&modelId=${params.modelId
  889. }&alarmIds=${params.alarmIds}&deviceType=${params.deviceType}`,
  890. baseURL: process.env.VUE_APP_ALARM,
  891. method: "get",
  892. });
  893. };
  894. //查询所有场站
  895. export function getAllStation() {
  896. return request({
  897. baseURL: process.env.VUE_APP_ALARM,
  898. url: `/electricity/czlist`,
  899. method: "GET",
  900. });
  901. }
  902. export function getAlarmMap(url = "/alarmplan/queryAlarmPlanMap", params = {}) {
  903. return request({
  904. baseURL: process.env.VUE_APP_ALARM,
  905. url,
  906. params,
  907. method: "GET",
  908. });
  909. }
  910. export function getAlarmMapById(params) {
  911. return request({
  912. baseURL: process.env.VUE_APP_ALARM,
  913. url: "/alarmplan/alarmPlanlistById",
  914. params,
  915. method: "GET",
  916. });
  917. }
  918. export function getAlarmTypeList() {
  919. return request({
  920. baseURL: process.env.VUE_APP_ALARM,
  921. url: `/alarmplan/alarmPlanTypelist`,
  922. method: "GET",
  923. });
  924. }
  925. export function addAlarmItem(data) {
  926. return request({
  927. baseURL: process.env.VUE_APP_ALARM,
  928. url: `/alarmplan/save`,
  929. method: "POST",
  930. data
  931. });
  932. }
  933. export function deleteAlarmItem(params) {
  934. return request({
  935. baseURL: process.env.VUE_APP_ALARM,
  936. url: `/alarmplan/delete`,
  937. method: "delete",
  938. params
  939. });
  940. }
  941. export function getAlarmExcelTemplate() {
  942. return request({
  943. baseURL: process.env.VUE_APP_ALARM,
  944. url: `/alarmplan/importtemplate`,
  945. method: "get",
  946. responseType: "blob",
  947. });
  948. }
  949. // 风电数据准备页面
  950. export function apiGetbaseStation() {
  951. return request({
  952. baseURL: process.env.VUE_APP_ALARM,
  953. url: 'base/station',
  954. method: 'get'
  955. })
  956. }
  957. // 风电数据准备页面
  958. export function apiGeWarningReport(params) {
  959. return request({
  960. baseURL: process.env.VUE_APP_API,
  961. url: `WarningReport/report?time=${params.reportParamDate}&wpid=${params.reportStation}`,
  962. method: 'get'
  963. })
  964. }
  965. export function apiGeWarningeconreportReport(params) {
  966. return request({
  967. baseURL: process.env.VUE_APP_API,
  968. url: `WarningReport/econreport?time=${params.reportParamDate}&wtid=${params.windStation}`,
  969. method: 'get'
  970. })
  971. }