eleFireInner.js 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  1. /*
  2. 电气火灾打印页面 echarts配置 及打印
  3. */
  4. // 数据请求传参
  5. getListData(getSearchParamObj());
  6. // getListData();
  7. function getListData(queryParam = {}) {
  8. ajaxRequest(ELE_FIRE_DATA, "POST", queryParam, function(result) {
  9. if (result.totalCount != 0) {
  10. console.log(1)
  11. //项目情况
  12. var project_situation = result.RESULT[0].project_situation;
  13. var items = '';
  14. items = `<tr>
  15. <td>单位名称</td>
  16. <td colspan="5">${project_situation.company_name}</td>
  17. </tr>
  18. <tr>
  19. <td>进场日期</td>
  20. <td>${project_situation.entry_date} </td>
  21. <td>完工日期</td>
  22. <td>${project_situation.completion_date}</td>
  23. <td>验收日期</td>
  24. <td>${project_situation.acceptance_date}</td>
  25. </tr>`
  26. $('#project_situation').html(items);
  27. //设备清单
  28. var equipment_list = result.RESULT[0].equipment_list;
  29. var items2 = '';
  30. if (equipment_list) {
  31. equipment_list.forEach(function(item, key) {
  32. items2 += `<tr>
  33. <td>${item.device_name}</td>
  34. <td>${item.device_info}</td>
  35. <td>${item.device_code}</td>
  36. <td>${item.remarks}</td>
  37. </tr>`;
  38. })
  39. $('#equipment_list').html(items2)
  40. }
  41. //统计时段
  42. var statistical_period = result.RESULT[0].statistical_period;
  43. var items3 = '';
  44. items3 = `<div>统计起始日期:${statistical_period.start_date}</div>
  45. <div>统计截止日期:${statistical_period.closing_date}</div>
  46. <div>统计时段时长:${statistical_period.duration}</div>`;
  47. $('#statistical_period').html(items3)
  48. //数据统计计算
  49. var data_statistics = result.RESULT[0].data_statistics;
  50. var items4 = '';
  51. items4 = `<tr>
  52. <td>${data_statistics.alarm_number}</td>
  53. <td>${data_statistics.processing_number}</td>
  54. <td>${data_statistics.unprocessed_number}</td>
  55. <td>${data_statistics.treatment_rate}</td>
  56. <td>${data_statistics.untreated_rate}</td>
  57. </tr>`;
  58. $('#data_statistics').html(items4);
  59. // 数据离散率挖掘
  60. let dispersion_rate = result.RESULT[0].dispersion_rate;
  61. console.log(result.RESULT[0].dispersion_rate)
  62. // 结论数据渲染
  63. var items = '';
  64. var conclusion = dispersion_rate.conclusion
  65. for (x in conclusion) {
  66. xIndex = x.substr(x.length - 1, 1);
  67. items += `<div>${xIndex}、${conclusion[x]}</div>`
  68. }
  69. $('.exportBox .divergence .summaryDetail').html(items);
  70. // 数据离散率挖掘1
  71. (function() {
  72. // 三相电压
  73. let a = [];
  74. let b = [];
  75. let c = [];
  76. let lectric_current = dispersion_rate.electric_current;
  77. lectric_current.forEach(function(item, index) {
  78. a.push(item.variance)
  79. b.push(item.standard_deviation)
  80. c.push(item.average_value)
  81. });
  82. var sortData = [{
  83. sortName: "三相电压",
  84. data: [
  85. a, b, c
  86. ]
  87. }, ];
  88. var xData = function() {
  89. var data = [];
  90. for (var i = 1; i < lectric_current.length + 1; i++) {
  91. data.push(i);
  92. }
  93. return data;
  94. }();
  95. // 1. 实例化对象
  96. var myChart = echarts.init(document.querySelector("#divergenceChart1"));
  97. // 2.指定配置
  98. var option = {
  99. color: [{
  100. colorStops: [{
  101. offset: 0,
  102. color: '#F9860C' // 0% 处的颜色
  103. }, {
  104. offset: 1,
  105. color: '#fff' // 100% 处的颜色
  106. }],
  107. },
  108. {
  109. colorStops: [{
  110. offset: 0,
  111. color: '#07E1F1' // 0% 处的颜色
  112. }, {
  113. offset: 1,
  114. color: '#0456CB' // 100% 处的颜色
  115. }],
  116. },
  117. {
  118. colorStops: [{
  119. offset: 0,
  120. color: '#11F90C' // 0% 处的颜色
  121. }, {
  122. offset: 1,
  123. color: '#3FC713' // 100% 处的颜色
  124. }],
  125. }
  126. ],
  127. tooltip: {
  128. trigger: "axis",
  129. textStyle: {
  130. align: 'left' //图例左对齐
  131. },
  132. backgroundColor: '#12DFE0',
  133. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:' + chooseTime + ''
  134. },
  135. legend: {
  136. // 如果series 对象有name 值,则 legend可以不用写data
  137. itemGap: 20,
  138. itemHeight: 2,
  139. itemWidth: 15,
  140. icon: 'rect',
  141. textStyle: {
  142. color: "#aaa"
  143. },
  144. top: "bottom",
  145. },
  146. grid: {
  147. top: "0%",
  148. left: "1%",
  149. right: "1%",
  150. bottom: "15%",
  151. show: true, // 显示边框
  152. borderWidth: '0', //去除边框
  153. containLabel: true // 包含刻度文字在内
  154. },
  155. xAxis: {
  156. type: "category",
  157. boundaryGap: false,
  158. data: xData,
  159. axisTick: {
  160. show: false // 去除刻度线
  161. },
  162. axisLabel: {
  163. color: "#AADDFF" // 文本颜色
  164. },
  165. axisLine: {
  166. lineStyle: {
  167. color: 'rgba(255,255,255,.3)'
  168. }
  169. },
  170. splitLine: {
  171. show: false
  172. },
  173. splitArea: {
  174. show: true,
  175. areaStyle: {
  176. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  177. }
  178. }
  179. },
  180. yAxis: {
  181. splitNumber: 8,
  182. type: "value",
  183. axisTick: {
  184. show: false // 去除刻度线
  185. },
  186. axisLabel: {
  187. show: false // 去除文本
  188. },
  189. axisLine: {
  190. show: false // 去除轴线
  191. },
  192. splitLine: {
  193. lineStyle: {
  194. color: "#012f4a", // 分割线颜色
  195. opacity: .2
  196. }
  197. }
  198. },
  199. series: [{
  200. symbol: "none",
  201. name: "方差",
  202. type: "line",
  203. data: sortData[0].data[0]
  204. },
  205. {
  206. symbol: "none",
  207. name: "标准差",
  208. type: "line",
  209. data: sortData[0].data[1]
  210. }, {
  211. symbol: "none",
  212. name: "平均值",
  213. type: "line",
  214. data: sortData[0].data[2]
  215. }
  216. ]
  217. };
  218. myChart.setOption(option);
  219. //echarts赋值到src
  220. var img1 = document.getElementById('divergenceChart1_img');
  221. setTimeout(function() {
  222. img1.src = myChart.getDataURL();
  223. }, 1000)
  224. })();
  225. // 数据离散率挖掘2
  226. (function() {
  227. // 三相电流
  228. let a2 = [];
  229. let b2 = [];
  230. let c2 = [];
  231. let leakage_current = dispersion_rate.leakage_current;
  232. leakage_current.forEach(function(item, index) {
  233. a2.push(item.variance)
  234. b2.push(item.standard_deviation)
  235. c2.push(item.average_value)
  236. });
  237. var sortData = [{
  238. sortName: "三相电流",
  239. data: [
  240. a2, b2, c2
  241. ]
  242. },
  243. ];
  244. var xData = function() {
  245. var data = [];
  246. for (var i = 1; i < leakage_current.length + 1; i++) {
  247. data.push(i);
  248. }
  249. return data;
  250. }();
  251. // 1. 实例化对象
  252. var myChart = echarts.init(document.querySelector("#divergenceChart2"));
  253. // 2.指定配置
  254. var option = {
  255. color: [{
  256. colorStops: [{
  257. offset: 0,
  258. color: '#F9860C' // 0% 处的颜色
  259. }, {
  260. offset: 1,
  261. color: '#fff' // 100% 处的颜色
  262. }],
  263. },
  264. {
  265. colorStops: [{
  266. offset: 0,
  267. color: '#07E1F1' // 0% 处的颜色
  268. }, {
  269. offset: 1,
  270. color: '#0456CB' // 100% 处的颜色
  271. }],
  272. },
  273. {
  274. colorStops: [{
  275. offset: 0,
  276. color: '#11F90C' // 0% 处的颜色
  277. }, {
  278. offset: 1,
  279. color: '#3FC713' // 100% 处的颜色
  280. }],
  281. }
  282. ],
  283. tooltip: {
  284. trigger: "axis",
  285. textStyle: {
  286. align: 'left' //图例左对齐
  287. },
  288. backgroundColor: '#12DFE0',
  289. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:' + chooseTime + ''
  290. },
  291. legend: {
  292. // 如果series 对象有name 值,则 legend可以不用写data
  293. itemGap: 20,
  294. itemHeight: 2,
  295. itemWidth: 15,
  296. icon: 'rect',
  297. textStyle: {
  298. color: "#aaa"
  299. },
  300. top: "bottom",
  301. },
  302. grid: {
  303. top: "0%",
  304. left: "1%",
  305. right: "1%",
  306. bottom: "15%",
  307. show: true, // 显示边框
  308. borderWidth: '0', //去除边框
  309. containLabel: true // 包含刻度文字在内
  310. },
  311. xAxis: {
  312. type: "category",
  313. boundaryGap: false,
  314. data: xData,
  315. axisTick: {
  316. show: false // 去除刻度线
  317. },
  318. axisLabel: {
  319. color: "#AADDFF" // 文本颜色
  320. },
  321. axisLine: {
  322. lineStyle: {
  323. color: 'rgba(255,255,255,.3)'
  324. }
  325. },
  326. splitNumber: 8,
  327. splitLine: {
  328. show: false
  329. },
  330. splitArea: {
  331. show: true,
  332. areaStyle: {
  333. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  334. }
  335. }
  336. },
  337. yAxis: {
  338. type: "value",
  339. splitNumber: 8,
  340. axisTick: {
  341. show: false // 去除刻度线
  342. },
  343. axisLabel: {
  344. show: false // 去除文本
  345. },
  346. axisLine: {
  347. show: false // 去除轴线
  348. },
  349. splitLine: {
  350. lineStyle: {
  351. color: "#012f4a", // 分割线颜色
  352. opacity: .2
  353. }
  354. }
  355. },
  356. series: [{
  357. symbol: "none",
  358. name: "方差",
  359. type: "line",
  360. data: sortData[0].data[0]
  361. },
  362. {
  363. symbol: "none",
  364. name: "标准差",
  365. type: "line",
  366. data: sortData[0].data[1]
  367. }, {
  368. symbol: "none",
  369. name: "平均值",
  370. type: "line",
  371. data: sortData[0].data[2]
  372. }
  373. ]
  374. };
  375. myChart.setOption(option);
  376. //echarts赋值到src
  377. var img1 = document.getElementById('divergenceChart2_img');
  378. setTimeout(function() {
  379. img1.src = myChart.getDataURL();
  380. }, 1000)
  381. })();
  382. // 数据离散率挖掘3
  383. (function() {
  384. // 三相温度
  385. let a3 = [];
  386. let b3 = [];
  387. let c3 = [];
  388. let temperature = dispersion_rate.temperature;
  389. temperature.forEach(function(item, index) {
  390. a3.push(item.variance)
  391. b3.push(item.standard_deviation)
  392. c3.push(item.average_value)
  393. });
  394. var sortData = [{
  395. sortName: "三相温度",
  396. data: [
  397. a3, b3, c3
  398. ]
  399. }, ];
  400. var xData = function() {
  401. var data = [];
  402. for (var i = 1; i < temperature.length + 1; i++) {
  403. data.push(i);
  404. }
  405. return data;
  406. }();
  407. // 1. 实例化对象
  408. var myChart = echarts.init(document.querySelector("#divergenceChart3"));
  409. // 2.指定配置
  410. var option = {
  411. color: [{
  412. colorStops: [{
  413. offset: 0,
  414. color: '#F9860C' // 0% 处的颜色
  415. }, {
  416. offset: 1,
  417. color: '#fff' // 100% 处的颜色
  418. }],
  419. },
  420. {
  421. colorStops: [{
  422. offset: 0,
  423. color: '#07E1F1' // 0% 处的颜色
  424. }, {
  425. offset: 1,
  426. color: '#0456CB' // 100% 处的颜色
  427. }],
  428. },
  429. {
  430. colorStops: [{
  431. offset: 0,
  432. color: '#11F90C' // 0% 处的颜色
  433. }, {
  434. offset: 1,
  435. color: '#3FC713' // 100% 处的颜色
  436. }],
  437. }
  438. ],
  439. tooltip: {
  440. trigger: "axis",
  441. textStyle: {
  442. align: 'left' //图例左对齐
  443. },
  444. backgroundColor: '#12DFE0',
  445. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:' + chooseTime + ''
  446. },
  447. legend: {
  448. // 如果series 对象有name 值,则 legend可以不用写data
  449. itemGap: 20,
  450. itemHeight: 2,
  451. itemWidth: 15,
  452. icon: 'rect',
  453. textStyle: {
  454. color: "#aaa"
  455. },
  456. top: "bottom",
  457. },
  458. grid: {
  459. top: "0%",
  460. left: "1%",
  461. right: "1%",
  462. bottom: "15%",
  463. show: true, // 显示边框
  464. borderWidth: '0', //去除边框
  465. containLabel: true // 包含刻度文字在内
  466. },
  467. xAxis: {
  468. type: "category",
  469. boundaryGap: false,
  470. data: xData,
  471. axisTick: {
  472. show: false // 去除刻度线
  473. },
  474. axisLabel: {
  475. color: "#AADDFF" // 文本颜色
  476. },
  477. axisLine: {
  478. lineStyle: {
  479. color: 'rgba(255,255,255,.3)'
  480. }
  481. },
  482. splitNumber: 8,
  483. splitLine: {
  484. show: false
  485. },
  486. splitArea: {
  487. show: true,
  488. areaStyle: {
  489. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  490. }
  491. }
  492. },
  493. yAxis: {
  494. type: "value",
  495. axisTick: {
  496. show: false // 去除刻度线
  497. },
  498. axisLabel: {
  499. show: false // 去除文本
  500. },
  501. axisLine: {
  502. show: false // 去除轴线
  503. },
  504. splitLine: {
  505. lineStyle: {
  506. color: "#012f4a", // 分割线颜色
  507. opacity: .2
  508. }
  509. }
  510. },
  511. series: [{
  512. symbol: "none",
  513. name: "方差",
  514. type: "line",
  515. data: sortData[0].data[0]
  516. },
  517. {
  518. symbol: "none",
  519. name: "标准差",
  520. type: "line",
  521. data: sortData[0].data[1]
  522. }, {
  523. symbol: "none",
  524. name: "平均值",
  525. type: "line",
  526. data: sortData[0].data[2]
  527. }
  528. ]
  529. };
  530. myChart.setOption(option);
  531. //echarts赋值到src
  532. var img1 = document.getElementById('divergenceChart3_img');
  533. setTimeout(function() {
  534. img1.src = myChart.getDataURL();
  535. }, 1000)
  536. })();
  537. // 数据离散率挖掘4
  538. (function() {
  539. // 漏电电流
  540. let a4 = [];
  541. let b4 = [];
  542. let c4 = [];
  543. let voltage = dispersion_rate.voltage;
  544. voltage.forEach(function(item, index) {
  545. a4.push(item.variance)
  546. b4.push(item.standard_deviation)
  547. c4.push(item.average_value)
  548. });
  549. var sortData = [{
  550. sortName: "三相电流",
  551. data: [
  552. a4, b4, c4
  553. ]
  554. }, ];
  555. var xData = function() {
  556. var data = [];
  557. for (var i = 1; i < voltage.length + 1; i++) {
  558. data.push(i);
  559. }
  560. return data;
  561. }();
  562. // 1. 实例化对象
  563. var myChart = echarts.init(document.querySelector("#divergenceChart4"));
  564. // 2.指定配置
  565. var option = {
  566. color: [{
  567. colorStops: [{
  568. offset: 0,
  569. color: '#F9860C' // 0% 处的颜色
  570. }, {
  571. offset: 1,
  572. color: '#fff' // 100% 处的颜色
  573. }],
  574. },
  575. {
  576. colorStops: [{
  577. offset: 0,
  578. color: '#07E1F1' // 0% 处的颜色
  579. }, {
  580. offset: 1,
  581. color: '#0456CB' // 100% 处的颜色
  582. }],
  583. },
  584. {
  585. colorStops: [{
  586. offset: 0,
  587. color: '#11F90C' // 0% 处的颜色
  588. }, {
  589. offset: 1,
  590. color: '#3FC713' // 100% 处的颜色
  591. }],
  592. }
  593. ],
  594. tooltip: {
  595. trigger: "axis",
  596. textStyle: {
  597. align: 'left' //图例左对齐
  598. },
  599. backgroundColor: '#12DFE0',
  600. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:' + chooseTime + ''
  601. },
  602. legend: {
  603. // 如果series 对象有name 值,则 legend可以不用写data
  604. itemGap: 20,
  605. itemHeight: 2,
  606. itemWidth: 15,
  607. icon: 'rect',
  608. textStyle: {
  609. color: "#aaa"
  610. },
  611. top: "bottom",
  612. },
  613. grid: {
  614. top: "0%",
  615. left: "1%",
  616. right: "1%",
  617. bottom: "15%",
  618. show: true, // 显示边框
  619. borderWidth: '0', //去除边框
  620. containLabel: true // 包含刻度文字在内
  621. },
  622. xAxis: {
  623. type: "category",
  624. boundaryGap: false,
  625. data: xData,
  626. axisTick: {
  627. show: false // 去除刻度线
  628. },
  629. axisLabel: {
  630. color: "#AADDFF" // 文本颜色
  631. },
  632. axisLine: {
  633. lineStyle: {
  634. color: 'rgba(255,255,255,.3)'
  635. }
  636. },
  637. splitNumber: 8,
  638. splitLine: {
  639. show: false
  640. },
  641. splitArea: {
  642. show: true,
  643. areaStyle: {
  644. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  645. }
  646. }
  647. },
  648. yAxis: {
  649. type: "value",
  650. axisTick: {
  651. show: false // 去除刻度线
  652. },
  653. axisLabel: {
  654. show: false // 去除文本
  655. },
  656. axisLine: {
  657. show: false // 去除轴线
  658. },
  659. splitLine: {
  660. lineStyle: {
  661. color: "#012f4a", // 分割线颜色
  662. opacity: .2
  663. }
  664. }
  665. },
  666. series: [{
  667. symbol: "none",
  668. name: "方差",
  669. type: "line",
  670. data: sortData[0].data[0]
  671. },
  672. {
  673. symbol: "none",
  674. name: "标准差",
  675. type: "line",
  676. data: sortData[0].data[1]
  677. }, {
  678. symbol: "none",
  679. name: "平均值",
  680. type: "line",
  681. data: sortData[0].data[2]
  682. }
  683. ]
  684. };
  685. myChart.setOption(option);
  686. //echarts赋值到src
  687. var img1 = document.getElementById('divergenceChart4_img');
  688. setTimeout(function() {
  689. img1.src = myChart.getDataURL();
  690. }, 1000)
  691. })();
  692. // 电老化分析
  693. let electrical_aging = result.RESULT[0].electrical_aging;
  694. // 结论数据渲染
  695. var items = '';
  696. var conclusion = electrical_aging.conclusion
  697. for (x in conclusion) {
  698. xIndex = x.substr(x.length - 1, 1);
  699. items += `<div>${xIndex}、${conclusion[x]}</div>`
  700. }
  701. $('.exportBox .oldAnalysis .summaryDetail').html(items);
  702. // 电老化分析1
  703. (function() {
  704. // 异常设备监控电缆数据
  705. let a = [];
  706. let b = [];
  707. let abnormal_equipment = electrical_aging.abnormal_equipment;
  708. abnormal_equipment.forEach(function(item, index) {
  709. a.push(item.electric_current)
  710. b.push(item.voltage)
  711. });
  712. var sortData = [{
  713. sortName: "异常设备",
  714. data: [a, b]
  715. },
  716. ];
  717. var xData = function() {
  718. var data = [];
  719. for (var i = 1; i < abnormal_equipment.length + 1; i++) {
  720. data.push(i);
  721. }
  722. return data;
  723. }();
  724. // 1. 实例化对象
  725. var myChart = echarts.init(document.querySelector("#oldAnalysisChart1"));
  726. // 2.指定配置
  727. var option = {
  728. color: ["#FF9C00", "#0096FF"], // 通过这个color修改两条线的颜色
  729. tooltip: {
  730. trigger: "axis",
  731. textStyle: {
  732. align: 'left' //图例左对齐
  733. },
  734. backgroundColor: '#12DFE0',
  735. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />时间:' + chooseTime + ''
  736. },
  737. legend: {
  738. // 如果series 对象有name 值,则 legend可以不用写data
  739. itemGap: 20,
  740. itemHeight: 2,
  741. itemWidth: 15,
  742. icon: 'rect',
  743. textStyle: {
  744. color: "#aaa"
  745. },
  746. top: "bottom",
  747. },
  748. grid: {
  749. top: "0%",
  750. left: "1%",
  751. right: "1%",
  752. bottom: "15%",
  753. show: true, // 显示边框
  754. borderWidth: '0', //去除边框
  755. containLabel: true // 包含刻度文字在内
  756. },
  757. xAxis: {
  758. type: "category",
  759. boundaryGap: false,
  760. data: xData,
  761. axisTick: {
  762. show: false // 去除刻度线
  763. },
  764. axisLabel: {
  765. color: "#AADDFF" // 文本颜色
  766. },
  767. axisLine: {
  768. show: false // 去除轴线
  769. }
  770. },
  771. yAxis: {
  772. type: "value",
  773. axisTick: {
  774. show: false // 去除刻度线
  775. },
  776. axisLabel: {
  777. show: false // 去除文本
  778. },
  779. axisLine: {
  780. show: false // 去除轴线
  781. },
  782. splitLine: {
  783. lineStyle: {
  784. color: "#012f4a", // 分割线颜色
  785. opacity: .2
  786. }
  787. }
  788. },
  789. series: [{
  790. symbol: "none",
  791. name: "电流",
  792. type: "line",
  793. smooth: true, // true 可以让我们的折线显示带有弧度
  794. areaStyle: {
  795. normal: {
  796. color: new echarts.graphic.LinearGradient(
  797. 0,
  798. 0,
  799. 0,
  800. 1, [{
  801. offset: 0,
  802. color: "rgba(255,156,0, 0.4)"
  803. },
  804. {
  805. offset: 0.8,
  806. color: "rgba(255,156,0, 0.3)"
  807. }
  808. ],
  809. false
  810. ),
  811. shadowColor: "rgba(0, 0, 0, 0.1)"
  812. }
  813. },
  814. data: sortData[0].data[0]
  815. },
  816. {
  817. symbol: "none",
  818. name: "电压",
  819. type: "line",
  820. smooth: true,
  821. areaStyle: {
  822. normal: {
  823. color: new echarts.graphic.LinearGradient(
  824. 0,
  825. 0,
  826. 0,
  827. 1, [{
  828. offset: 0,
  829. color: "rgba(0,150,255,0.5)"
  830. },
  831. {
  832. offset: 0.8,
  833. color: "rgba(0,150,255, 0.1)"
  834. }
  835. ],
  836. false
  837. ),
  838. shadowColor: "rgba(0, 0, 0, 0.1)"
  839. }
  840. },
  841. data: sortData[0].data[1]
  842. }
  843. ]
  844. };
  845. myChart.setOption(option);
  846. var img1 = document.getElementById('oldAnalysisChart1_img');
  847. setTimeout(function() {
  848. img1.src = myChart.getDataURL();
  849. }, 1000)
  850. })();
  851. // 电老化分析2
  852. (function() {
  853. // 漏电告警数据
  854. let a2 = [];
  855. let b2 = [];
  856. let leakage_alarm = electrical_aging.leakage_alarm;
  857. leakage_alarm.forEach(function(item, index) {
  858. a2.push(item.electric_current)
  859. b2.push(item.voltage)
  860. });
  861. var sortData = [{
  862. sortName: "漏电告警",
  863. data: [a2, b2]
  864. }];
  865. var xData = function() {
  866. var data = [];
  867. for (var i = 1; i < leakage_alarm.length + 1; i++) {
  868. data.push(i);
  869. }
  870. return data;
  871. }();
  872. // 1. 实例化对象
  873. var myChart = echarts.init(document.querySelector("#oldAnalysisChart2"));
  874. // 2.指定配置
  875. var option = {
  876. color: ["#FF9C00", "#0096FF"], // 通过这个color修改两条线的颜色
  877. tooltip: {
  878. trigger: "axis",
  879. textStyle: {
  880. align: 'left' //图例左对齐
  881. },
  882. backgroundColor: '#12DFE0',
  883. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />时间:' + chooseTime + ''
  884. },
  885. legend: {
  886. // 如果series 对象有name 值,则 legend可以不用写data
  887. itemGap: 20,
  888. itemHeight: 2,
  889. itemWidth: 15,
  890. icon: 'rect',
  891. textStyle: {
  892. color: "#aaa"
  893. },
  894. top: "bottom",
  895. },
  896. grid: {
  897. top: "0%",
  898. left: "1%",
  899. right: "1%",
  900. bottom: "15%",
  901. show: true, // 显示边框
  902. borderWidth: '0', //去除边框
  903. containLabel: true // 包含刻度文字在内
  904. },
  905. xAxis: {
  906. type: "category",
  907. boundaryGap: false,
  908. data: xData,
  909. axisTick: {
  910. show: false // 去除刻度线
  911. },
  912. axisLabel: {
  913. color: "#AADDFF" // 文本颜色
  914. },
  915. axisLine: {
  916. show: false // 去除轴线
  917. }
  918. },
  919. yAxis: {
  920. type: "value",
  921. axisTick: {
  922. show: false // 去除刻度线
  923. },
  924. axisLabel: {
  925. show: false // 去除文本
  926. },
  927. axisLine: {
  928. show: false // 去除轴线
  929. },
  930. splitLine: {
  931. lineStyle: {
  932. color: "#012f4a", // 分割线颜色
  933. opacity: .2
  934. }
  935. }
  936. },
  937. series: [{
  938. symbol: "none",
  939. name: "电流",
  940. type: "line",
  941. smooth: true, // true 可以让我们的折线显示带有弧度
  942. areaStyle: {
  943. normal: {
  944. color: new echarts.graphic.LinearGradient(
  945. 0,
  946. 0,
  947. 0,
  948. 1, [{
  949. offset: 0,
  950. color: "rgba(255,156,0, 0.4)"
  951. },
  952. {
  953. offset: 0.8,
  954. color: "rgba(255,156,0, 0.3)"
  955. }
  956. ],
  957. false
  958. ),
  959. shadowColor: "rgba(0, 0, 0, 0.1)"
  960. }
  961. },
  962. data: sortData[0].data[0]
  963. },
  964. {
  965. symbol: "none",
  966. name: "电压",
  967. type: "line",
  968. smooth: true,
  969. areaStyle: {
  970. normal: {
  971. color: new echarts.graphic.LinearGradient(
  972. 0,
  973. 0,
  974. 0,
  975. 1, [{
  976. offset: 0,
  977. color: "rgba(0,150,255,0.5)"
  978. },
  979. {
  980. offset: 0.8,
  981. color: "rgba(0,150,255, 0.1)"
  982. }
  983. ],
  984. false
  985. ),
  986. shadowColor: "rgba(0, 0, 0, 0.1)"
  987. }
  988. },
  989. data: sortData[0].data[1]
  990. }
  991. ]
  992. };
  993. myChart.setOption(option);
  994. var img1 = document.getElementById('oldAnalysisChart2_img');
  995. setTimeout(function() {
  996. img1.src = myChart.getDataURL();
  997. }, 1000)
  998. })();
  999. // 热老化分析
  1000. let thermal_aging = result.RESULT[0].thermal_aging;
  1001. // 结论数据渲染
  1002. var items = '';
  1003. var conclusion = thermal_aging.conclusion
  1004. for (x in conclusion) {
  1005. xIndex = x.substr(x.length - 1, 1);
  1006. items += `<div>${xIndex}、${conclusion[x]}</div>`
  1007. }
  1008. $('.exportBox .hotAnalysis .summaryDetail').html(items);
  1009. // 热老化
  1010. (function() {
  1011. let a = [];
  1012. let b = [];
  1013. let c = [];
  1014. let visualization = thermal_aging.visualization;
  1015. visualization.forEach(function(item, index) {
  1016. a.push(item.generation_temperature)
  1017. b.push(item.ambient_temperature)
  1018. c.push(item.Cable_temperature)
  1019. });
  1020. var sortData = [{
  1021. data: [a, b, c]
  1022. }];
  1023. var xData = function() {
  1024. var data = [];
  1025. for (var i = 1; i < visualization.length + 1; i++) {
  1026. data.push(i);
  1027. }
  1028. return data;
  1029. }();
  1030. // 1. 实例化对象
  1031. var myChart = echarts.init(document.querySelector("#hotAnalysisChart1"));
  1032. // 2.指定配置
  1033. var option = {
  1034. color: ["#05EEE7", "#9999FF", "#FE92B3"], // 通过这个color修改三条线的颜色
  1035. tooltip: {
  1036. trigger: "axis",
  1037. textStyle: {
  1038. align: 'left' //图例左对齐
  1039. },
  1040. backgroundColor: '#12DFE0',
  1041. formatter: '{a0}: {c0}°C<br />{a1}: {c1}°C<br />{a2}: {c2}°C<br />时间:' + chooseTime + ''
  1042. },
  1043. legend: {
  1044. // 如果series 对象有name 值,则 legend可以不用写data
  1045. itemGap: 20,
  1046. itemHeight: 2,
  1047. itemWidth: 15,
  1048. icon: 'rect',
  1049. textStyle: {
  1050. color: "#aaa"
  1051. },
  1052. top: "bottom",
  1053. },
  1054. grid: {
  1055. top: "0%",
  1056. left: "1%",
  1057. right: "1%",
  1058. bottom: "15%",
  1059. show: true, // 显示边框
  1060. borderWidth: '0', //去除边框
  1061. containLabel: true // 包含刻度文字在内
  1062. },
  1063. xAxis: {
  1064. type: "category",
  1065. boundaryGap: false,
  1066. data: xData,
  1067. axisTick: {
  1068. show: false // 去除刻度线
  1069. },
  1070. axisLabel: {
  1071. color: "#AADDFF" // 文本颜色
  1072. },
  1073. axisLine: {
  1074. show: false // 去除轴线
  1075. }
  1076. },
  1077. yAxis: {
  1078. type: "value",
  1079. axisTick: {
  1080. show: false // 去除刻度线
  1081. },
  1082. axisLabel: {
  1083. show: false // 去除文本
  1084. },
  1085. axisLine: {
  1086. show: false // 去除轴线
  1087. },
  1088. splitLine: {
  1089. lineStyle: {
  1090. color: "#012f4a", // 分割线颜色
  1091. opacity: .2
  1092. }
  1093. }
  1094. },
  1095. series: [{
  1096. symbol: "none",
  1097. name: "线缆产生的温度",
  1098. type: "line",
  1099. smooth: true, // true 可以让我们的折线显示带有弧度
  1100. areaStyle: {
  1101. normal: {
  1102. color: new echarts.graphic.LinearGradient(
  1103. 0,
  1104. 0,
  1105. 0,
  1106. 1, [{
  1107. offset: 0,
  1108. color: "rgba(5,238,231,.6)"
  1109. },
  1110. {
  1111. offset: 0.8,
  1112. color: "rgba(5,238,231, 0.4)"
  1113. }
  1114. ],
  1115. false
  1116. ),
  1117. }
  1118. },
  1119. data: sortData[0].data[0]
  1120. },
  1121. {
  1122. symbol: "none",
  1123. name: "环境温度",
  1124. type: "line",
  1125. smooth: true,
  1126. areaStyle: {
  1127. normal: {
  1128. color: new echarts.graphic.LinearGradient(
  1129. 0,
  1130. 0,
  1131. 0,
  1132. 1, [{
  1133. offset: 0,
  1134. color: "rgba(153,153,255,.6)"
  1135. },
  1136. {
  1137. offset: 0.8,
  1138. color: "rgba(153,153,255, 0.4)"
  1139. }
  1140. ],
  1141. false
  1142. ),
  1143. }
  1144. },
  1145. data: sortData[0].data[1]
  1146. },
  1147. {
  1148. symbol: "none",
  1149. name: "线缆温度",
  1150. type: "line",
  1151. smooth: true,
  1152. areaStyle: {
  1153. normal: {
  1154. color: new echarts.graphic.LinearGradient(
  1155. 0,
  1156. 0,
  1157. 0,
  1158. 1, [{
  1159. offset: 0,
  1160. color: "rgba(255,147,180,.6)"
  1161. },
  1162. {
  1163. offset: 0.8,
  1164. color: "rgba(255,147,180, 0.4)"
  1165. }
  1166. ],
  1167. false
  1168. ),
  1169. }
  1170. },
  1171. data: sortData[0].data[2]
  1172. }
  1173. ]
  1174. };
  1175. myChart.setOption(option);
  1176. var img1 = document.getElementById('hotAnalysisChart1_img');
  1177. setTimeout(function() {
  1178. img1.src = myChart.getDataURL();
  1179. }, 1000)
  1180. })();
  1181. } else {
  1182. alert('暂无数据')
  1183. // layer.alert('暂无数据', { icon: 5 });
  1184. }
  1185. }, function(errorMsg) {
  1186. alert("请求数据失败!");
  1187. }, 2)
  1188. };
  1189. function getSearchParamObj() {
  1190. let queryParam = {};
  1191. let buildingVal = $('#building').val();
  1192. let chooseTime = $('#chooseTime').val();
  1193. queryParam.company_code = buildingVal;
  1194. queryParam.generation_time = chooseTime;
  1195. return queryParam;
  1196. }
  1197. // 打印
  1198. (function() {
  1199. $("#btnPrint").click(function() {
  1200. print_detail()
  1201. });
  1202. var print_detail = function() {
  1203. //打印前echarts图表转换成图片 start
  1204. $('#divergenceChart1_img,#divergenceChart2_img,#divergenceChart3_img,#divergenceChart4_img').show()
  1205. $('#divergenceChart1,#divergenceChart2,#divergenceChart3,#divergenceChart4').hide()
  1206. $('#oldAnalysisChart1_img,#oldAnalysisChart2_img').show()
  1207. $('#oldAnalysisChart1,#oldAnalysisChart2').hide()
  1208. $('#hotAnalysisChart1_img').show()
  1209. $('#hotAnalysisChart1').hide()
  1210. // end
  1211. var div1_label1 = document.getElementById('printArea').innerHTML;
  1212. var hkey_key;
  1213. var hkey_root = 'HKEY_CURRENT_USER';
  1214. var hkey_path = '\\Software\\Micorsoft\\Internet Explorer\\PageSetup\\';
  1215. var print_win = window.open('打印窗口', '_blank');
  1216. var div = document.createElement('div');
  1217. div.setAttribute('width', '100%');
  1218. div.setAttribute('height', '100%');
  1219. var div_print = document.createElement('div');
  1220. div_print.setAttribute('style', 'width:595px;height:842px;padding:50px 20px;margin:0px auto 0px auto');
  1221. div_print.innerHTML = div1_label1;
  1222. div.appendChild(div_print);
  1223. print_win.document.write(div.innerHTML);
  1224. print_win.document.close();
  1225. try {
  1226. var RegWsh = new ActiveXObject('WScript.Shell');
  1227. hkey_key = 'header';
  1228. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  1229. hkey_key = 'footer';
  1230. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  1231. } catch (e) {}
  1232. print_win.print();
  1233. print_win.close();
  1234. }
  1235. })()