index.js 25 KB

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