waterInner.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  1. /*
  2. 水系统打印页面echarts配置 及打印
  3. */
  4. // 数据请求传参
  5. getListData(getSearchParamObj());
  6. // getListData();
  7. function getListData(queryParam = {}) {
  8. ajaxRequest(WATER_DATA, "POST", queryParam, function(result) {
  9. if (result.totalCount != 0) {
  10. /**
  11. * 水系统导出数据对接 start
  12. * **/
  13. //项目情况
  14. var project_situation = result.RESULT[0].project_situation;
  15. var items = '';
  16. items = `<tr>
  17. <td>单位名称</td>
  18. <td colspan="5">${project_situation.company_name}</td>
  19. </tr>
  20. <tr>
  21. <td>进场日期</td>
  22. <td>${project_situation.entry_date} </td>
  23. <td>完工日期</td>
  24. <td>${project_situation.completion_date}</td>
  25. <td>验收日期</td>
  26. <td>${project_situation.acceptance_date}</td>
  27. </tr>`
  28. $('#project_situation').html(items);
  29. // //设备清单
  30. var equipment_list = result.RESULT[0].equipment_list;
  31. var items2 = '';
  32. if (equipment_list) {
  33. equipment_list.forEach(function(item, key) {
  34. items2 += `<tr>
  35. <td>${item.device_name}</td>
  36. <td>${item.device_info}</td>
  37. <td>${item.device_code}</td>
  38. <td>${item.remarks}</td>
  39. </tr>`;
  40. })
  41. $('#equipment_list').html(items2)
  42. }
  43. //统计时段
  44. var statistical_period = result.RESULT[0].statistical_period;
  45. var items3 = '';
  46. items3 = `<div>统计起始日期:${statistical_period.start_date}</div>
  47. <div>统计截止日期:${statistical_period.closing_date}</div>
  48. <div>统计时段时长:${statistical_period.duration}</div>`;
  49. $('#statistical_period').html(items3)
  50. //数据统计计算
  51. var data_statistics = result.RESULT[0].data_statistics;
  52. var items4 = '';
  53. items4 = `<tr>
  54. <td>${data_statistics.alarm_number}</td>
  55. <td>${data_statistics.processing_number}</td>
  56. <td>${data_statistics.unprocessed_number}</td>
  57. <td>${data_statistics.treatment_rate}</td>
  58. <td>${data_statistics.untreated_rate}</td>
  59. </tr>`;
  60. $('#data_statistics').html(items4);
  61. // 数据离散率挖掘
  62. let dispersion_rate = result.RESULT[0].dispersion_rate;
  63. console.log(result.RESULT[0].dispersion_rate)
  64. // 结论数据渲染
  65. var items = '';
  66. var conclusion = dispersion_rate.conclusion
  67. for (x in conclusion) {
  68. xIndex = x.substr(x.length - 1, 1);
  69. items += `<div>${xIndex}、${conclusion[x]}</div>`
  70. }
  71. $('.exportBox .divergence .summaryDetail').html(items);
  72. // 数据离散率挖掘1
  73. (function() {
  74. let dispersion_rate = result.RESULT[0].dispersion_rate;
  75. // 结论数据渲染
  76. var items = '';
  77. var conclusion = dispersion_rate.conclusion
  78. for (x in conclusion) {
  79. xIndex = x.substr(x.length - 1, 1);
  80. items += `<p>${xIndex}、${conclusion[x]}</p>`
  81. }
  82. $('.divergence .summaryDetail').html(items);
  83. let a = [];
  84. let b = [];
  85. let c = [];
  86. let hydraulic_pressure = dispersion_rate.hydraulic_pressure;
  87. hydraulic_pressure.forEach(function(item, index) {
  88. a.push(item.variance)
  89. b.push(item.standard_deviation)
  90. c.push(item.average_value)
  91. });
  92. var sortData = [{
  93. data: [a, b, c]
  94. }];
  95. var xData = function() {
  96. var data = [];
  97. for (var i = 1; i < hydraulic_pressure.length + 1; i++) {
  98. data.push(i);
  99. }
  100. return data;
  101. }();
  102. // 1. 实例化对象
  103. var myChart = echarts.init(document.querySelector("#divergenceChart1"));
  104. // 2.指定配置
  105. var option = {
  106. color: [{
  107. colorStops: [{
  108. offset: 0,
  109. color: '#F9860C' // 0% 处的颜色
  110. }, {
  111. offset: 1,
  112. color: '#fff' // 100% 处的颜色
  113. }],
  114. },
  115. {
  116. colorStops: [{
  117. offset: 0,
  118. color: '#07E1F1' // 0% 处的颜色
  119. }, {
  120. offset: 1,
  121. color: '#0456CB' // 100% 处的颜色
  122. }],
  123. },
  124. {
  125. colorStops: [{
  126. offset: 0,
  127. color: '#11F90C' // 0% 处的颜色
  128. }, {
  129. offset: 1,
  130. color: '#3FC713' // 100% 处的颜色
  131. }],
  132. }
  133. ],
  134. tooltip: {
  135. trigger: "axis",
  136. textStyle: {
  137. align: 'left' //图例左对齐
  138. },
  139. backgroundColor: '#12DFE0',
  140. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:2021年3月{b}日'
  141. },
  142. legend: {
  143. // 如果series 对象有name 值,则 legend可以不用写data
  144. itemGap: 20,
  145. itemHeight: 2,
  146. itemWidth: 15,
  147. icon: 'rect',
  148. textStyle: {
  149. color: "#aaa"
  150. },
  151. top: "bottom",
  152. },
  153. grid: {
  154. top: "0%",
  155. left: "1%",
  156. right: "1%",
  157. bottom: "15%",
  158. show: true, // 显示边框
  159. borderWidth: '0', //去除边框
  160. containLabel: true // 包含刻度文字在内
  161. },
  162. xAxis: {
  163. type: "category",
  164. boundaryGap: false,
  165. data: xData,
  166. axisTick: {
  167. show: false // 去除刻度线
  168. },
  169. axisLabel: {
  170. color: "#AADDFF" // 文本颜色
  171. },
  172. axisLine: {
  173. lineStyle: {
  174. color: 'rgba(255,255,255,.3)'
  175. }
  176. },
  177. splitNumber: 8,
  178. splitLine: {
  179. show: false
  180. },
  181. splitArea: {
  182. show: true,
  183. areaStyle: {
  184. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  185. }
  186. }
  187. },
  188. yAxis: {
  189. splitNumber: 8,
  190. type: "value",
  191. axisTick: {
  192. show: false // 去除刻度线
  193. },
  194. axisLabel: {
  195. show: false // 去除文本
  196. },
  197. axisLine: {
  198. show: false // 去除轴线
  199. },
  200. splitLine: {
  201. lineStyle: {
  202. color: "#aaa", // 分割线颜色
  203. opacity: '0.1'
  204. }
  205. }
  206. },
  207. series: [{
  208. symbol: "none",
  209. name: "方差",
  210. type: "line",
  211. data: sortData[0].data[0]
  212. },
  213. {
  214. symbol: "none",
  215. name: "标准差",
  216. type: "line",
  217. data: sortData[0].data[1]
  218. }, {
  219. symbol: "none",
  220. name: "平均值",
  221. type: "line",
  222. data: sortData[0].data[2]
  223. }
  224. ]
  225. };
  226. myChart.setOption(option);
  227. //echarts赋值到src
  228. var img1 = document.getElementById('divergenceChart1_img');
  229. setTimeout(function() {
  230. img1.src = myChart.getDataURL();
  231. }, 1000)
  232. })();
  233. // 渗漏隐患排查
  234. let leakage_investigation = result.RESULT[0].leakage_investigation;
  235. // 结论数据渲染
  236. var items = '';
  237. var conclusion = leakage_investigation.conclusion
  238. for (x in conclusion) {
  239. xIndex = x.substr(x.length - 1, 1);
  240. items += `<p>${xIndex}、${conclusion[x]}</p>`
  241. }
  242. $('.exportBox .hiddenCheck .summaryDetail').html(items);
  243. // 渗漏隐患排查1
  244. (function() {
  245. let abnormal_pressure = [];
  246. let location_description = [];
  247. let start_pressure = [];
  248. let end_pressure = [];
  249. let leakage_data = leakage_investigation.leakage_data;
  250. leakage_data.forEach(function(item, index) {
  251. //异常值
  252. abnormal_pressure.push(item.abnormal_pressure)
  253. //楼层
  254. location_description.push(item.location_description)
  255. //开始值
  256. start_pressure.push(item.start_pressure)
  257. //结束值
  258. end_pressure.push(item.end_pressure)
  259. });
  260. var xData = location_description;
  261. // 基于准备好的dom,初始化echarts实例
  262. var myChart = echarts.init(document.querySelector("#hiddenCheckChart1"));
  263. var option = {
  264. backgroundColor: 'transparent',
  265. color: ['rgba(0,150,255,.5)', 'rgba(255,156,0,.5)'],
  266. tooltip: {
  267. //提示框组件
  268. trigger: 'axis',
  269. formatter: function(params) {
  270. // console.log(params)
  271. var res = '位置:' + params[0].axisValue + '<br />异常水压值 :' + abnormal_pressure[params[0].dataIndex];
  272. return res;
  273. },
  274. axisPointer: {
  275. type: 'shadow',
  276. },
  277. textStyle: {
  278. fontStyle: 'normal',
  279. fontFamily: '微软雅黑',
  280. fontSize: 12,
  281. },
  282. },
  283. grid: {
  284. left: '0',
  285. right: '0',
  286. bottom: '40',
  287. top: '0',
  288. containLabel: true,
  289. },
  290. legend: {
  291. // 如果series 对象有name 值,则 legend可以不用写data
  292. itemGap: 20,
  293. itemHeight: 2,
  294. itemWidth: 15,
  295. icon: 'rect',
  296. textStyle: {
  297. color: "#AAA"
  298. },
  299. top: "bottom",
  300. },
  301. xAxis: [{
  302. type: 'category',
  303. // boundaryGap: true,//坐标轴两边留白
  304. data: xData,
  305. axisLabel: {
  306. interval: 0,
  307. rotate: 340,
  308. // formatter: function(val) {
  309. // return val.split("").join("\n");
  310. // }, //横轴信息文字竖直显示
  311. textStyle: {
  312. color: '#AAA',
  313. fontStyle: 'normal',
  314. fontFamily: '微软雅黑',
  315. fontSize: 12,
  316. },
  317. },
  318. axisTick: {
  319. //坐标轴刻度相关设置。
  320. show: false,
  321. },
  322. axisLine: {
  323. //坐标轴轴线相关设置
  324. },
  325. splitLine: {
  326. //坐标轴在 grid 区域中的分隔线。
  327. show: false,
  328. },
  329. }, ],
  330. yAxis: [{
  331. type: 'value',
  332. axisLabel: false,
  333. axisLine: {
  334. show: false,
  335. },
  336. axisTick: {
  337. show: false,
  338. },
  339. splitLine: {
  340. show: true,
  341. lineStyle: {
  342. color: "#aaa", // 分割线颜色
  343. opacity: '0.2'
  344. }
  345. },
  346. boundaryGap: ['0', '10%'],
  347. }],
  348. series: [{
  349. name: '起层',
  350. type: 'bar',
  351. data: start_pressure,
  352. barMaxWidth: '11',
  353. itemStyle: {
  354. borderColor: "#0096FF",
  355. },
  356. barGap: '50%',
  357. },
  358. {
  359. name: '始层',
  360. type: 'bar',
  361. data: end_pressure,
  362. barMaxWidth: '11',
  363. itemStyle: {
  364. borderColor: "#FF9C00",
  365. },
  366. },
  367. ],
  368. };
  369. myChart.setOption(option);
  370. //echarts赋值到src
  371. var img1 = document.getElementById('hiddenCheckChart1_img');
  372. setTimeout(function() {
  373. img1.src = myChart.getDataURL();
  374. }, 1000)
  375. })();
  376. // 跨设备数据关联
  377. let device_association = result.RESULT[0].device_association;
  378. // 结论数据渲染
  379. var items = '';
  380. var conclusion = device_association.conclusion
  381. for (x in conclusion) {
  382. xIndex = x.substr(x.length - 1, 1);
  383. items += `<p>${xIndex}、${conclusion[x]}</p>`
  384. }
  385. $('.exportBox .device_association .summaryDetail').html(items);
  386. // 跨设备数据关联1
  387. // 喷淋末端、消火栓与水泵启停关联
  388. let spray_end = [];
  389. let fire_hydrant = [];
  390. let pump_status = []
  391. let pump_associated_data = device_association.pump_associated_data;
  392. pump_associated_data.forEach(function(item, index) {
  393. spray_end.push(item.spray_end)
  394. fire_hydrant.push(item.fire_hydrant)
  395. pump_status.push(item.pump_status)
  396. });
  397. (function() {
  398. var sortData = [{
  399. sortName: "喷淋末端、消火栓与水泵启停关联",
  400. data: [
  401. spray_end, fire_hydrant
  402. ]
  403. }, ];
  404. var xData = function() {
  405. var data = [];
  406. for (var i = 1; i < spray_end.length + 1; i++) {
  407. data.push(i);
  408. }
  409. return data;
  410. }();
  411. // 1. 实例化对象
  412. var myChart = echarts.init(document.querySelector("#deviceLinkChart1"));
  413. // 2.指定配置
  414. var option = {
  415. color: ["#FF9C00", "#0096FF"], // 通过这个color修改两条线的颜色
  416. tooltip: {
  417. trigger: "axis",
  418. textStyle: {
  419. align: 'left' //图例左对齐
  420. },
  421. backgroundColor: '#12DFE0',
  422. formatter: function(params) {
  423. var res = params[0].seriesName + ':' + params[0].value + '<br />' + params[1].seriesName + ':' + params[1].value + '<br />水泵启动状态 :' + pump_status[params[0].dataIndex] + '<br />时间:' + chooseTime + '';
  424. return res;
  425. },
  426. },
  427. legend: {
  428. // 如果series 对象有name 值,则 legend可以不用写data
  429. itemGap: 20,
  430. itemHeight: 2,
  431. itemWidth: 15,
  432. icon: 'rect',
  433. textStyle: {
  434. color: "#fff"
  435. },
  436. top: "bottom",
  437. },
  438. grid: {
  439. top: "0%",
  440. left: "1%",
  441. right: "1%",
  442. bottom: "15%",
  443. show: true, // 显示边框
  444. borderWidth: '0', //去除边框
  445. containLabel: true // 包含刻度文字在内
  446. },
  447. xAxis: {
  448. type: "category",
  449. boundaryGap: false,
  450. data: xData,
  451. axisTick: {
  452. show: false // 去除刻度线
  453. },
  454. axisLabel: {
  455. color: "#AADDFF" // 文本颜色
  456. },
  457. axisLine: {
  458. show: false // 去除轴线
  459. }
  460. },
  461. yAxis: {
  462. type: "value",
  463. axisTick: {
  464. show: false // 去除刻度线
  465. },
  466. axisLabel: {
  467. show: false // 去除文本
  468. },
  469. axisLine: {
  470. show: false // 去除轴线
  471. },
  472. splitLine: {
  473. lineStyle: {
  474. color: "#aaa", // 分割线颜色
  475. opacity: '0.2'
  476. }
  477. }
  478. },
  479. series: [{
  480. symbol: "none",
  481. name: "喷淋末端",
  482. type: "line",
  483. smooth: true, // true 可以让我们的折线显示带有弧度
  484. areaStyle: {
  485. normal: {
  486. color: new echarts.graphic.LinearGradient(
  487. 0,
  488. 0,
  489. 0,
  490. 1, [{
  491. offset: 0,
  492. color: "rgba(255,156,0, 0.4)"
  493. },
  494. {
  495. offset: 0.8,
  496. color: "rgba(255,156,0, 0.3)"
  497. }
  498. ],
  499. false
  500. ),
  501. shadowColor: "rgba(0, 0, 0, 0.1)"
  502. }
  503. },
  504. data: sortData[0].data[0]
  505. },
  506. {
  507. symbol: "none",
  508. name: "消防栓",
  509. type: "line",
  510. smooth: true,
  511. areaStyle: {
  512. normal: {
  513. color: new echarts.graphic.LinearGradient(
  514. 0,
  515. 0,
  516. 0,
  517. 1, [{
  518. offset: 0,
  519. color: "rgba(0,150,255,0.5)"
  520. },
  521. {
  522. offset: 0.8,
  523. color: "rgba(0,150,255, 0.1)"
  524. }
  525. ],
  526. false
  527. ),
  528. shadowColor: "rgba(0, 0, 0, 0.1)"
  529. }
  530. },
  531. data: sortData[0].data[1]
  532. }
  533. ]
  534. };
  535. myChart.setOption(option);
  536. var img1 = document.getElementById('deviceLinkChart1_img');
  537. setTimeout(function() {
  538. img1.src = myChart.getDataURL();
  539. }, 1000)
  540. })();
  541. // 跨设备数据关联2
  542. // 喷淋末端、消火栓屋顶水箱液位关联
  543. let spray_end2 = [];
  544. let fire_hydrant2 = [];
  545. let water_tank_level = []
  546. let water_associated_data = device_association.water_associated_data;
  547. water_associated_data.forEach(function(item, index) {
  548. spray_end2.push(item.spray_end)
  549. fire_hydrant2.push(item.fire_hydrant)
  550. water_tank_level.push(item.water_tank_level)
  551. });
  552. (function() {
  553. var sortData = [{
  554. sortName: "喷淋末端、消火栓屋顶水箱液位关联",
  555. data: [
  556. spray_end2, fire_hydrant2
  557. ]
  558. }];
  559. var xData = function() {
  560. var data = [];
  561. for (var i = 1; i < water_associated_data.length + 1; i++) {
  562. data.push(i);
  563. }
  564. return data;
  565. }();
  566. // 1. 实例化对象
  567. var myChart = echarts.init(document.querySelector("#deviceLinkChart2"));
  568. // 2.指定配置
  569. var option = {
  570. color: ["#FF9C00", "#0096FF"], // 通过这个color修改两条线的颜色
  571. tooltip: {
  572. trigger: "axis",
  573. textStyle: {
  574. align: 'left' //图例左对齐
  575. },
  576. backgroundColor: '#12DFE0',
  577. formatter: function(params) {
  578. var res = params[0].seriesName + ':' + params[0].value + '<br />' + params[1].seriesName + ':' + params[1].value + '<br /> 水箱液位 :' + water_tank_level[params[0].dataIndex] + '<br />时间:' + chooseTime + '';
  579. return res;
  580. },
  581. },
  582. legend: {
  583. // 如果series 对象有name 值,则 legend可以不用写data
  584. itemGap: 20,
  585. itemHeight: 2,
  586. itemWidth: 15,
  587. icon: 'rect',
  588. textStyle: {
  589. color: "#fff"
  590. },
  591. top: "bottom",
  592. },
  593. grid: {
  594. top: "0%",
  595. left: "1%",
  596. right: "1%",
  597. bottom: "15%",
  598. show: true, // 显示边框
  599. borderWidth: '0', //去除边框
  600. containLabel: true // 包含刻度文字在内
  601. },
  602. xAxis: {
  603. type: "category",
  604. boundaryGap: false,
  605. data: xData,
  606. axisTick: {
  607. show: false // 去除刻度线
  608. },
  609. axisLabel: {
  610. color: "#AADDFF" // 文本颜色
  611. },
  612. axisLine: {
  613. show: false // 去除轴线
  614. }
  615. },
  616. yAxis: {
  617. type: "value",
  618. axisTick: {
  619. show: false // 去除刻度线
  620. },
  621. axisLabel: {
  622. show: false // 去除文本
  623. },
  624. axisLine: {
  625. show: false // 去除轴线
  626. },
  627. splitLine: {
  628. lineStyle: {
  629. color: "#aaa", // 分割线颜色
  630. opacity: '0.2'
  631. }
  632. }
  633. },
  634. series: [{
  635. symbol: "none",
  636. name: "喷淋末端",
  637. type: "line",
  638. smooth: true, // true 可以让我们的折线显示带有弧度
  639. areaStyle: {
  640. normal: {
  641. color: new echarts.graphic.LinearGradient(
  642. 0,
  643. 0,
  644. 0,
  645. 1, [{
  646. offset: 0,
  647. color: "rgba(255,156,0, 0.4)"
  648. },
  649. {
  650. offset: 0.8,
  651. color: "rgba(255,156,0, 0.3)"
  652. }
  653. ],
  654. false
  655. ),
  656. shadowColor: "rgba(0, 0, 0, 0.1)"
  657. }
  658. },
  659. data: sortData[0].data[0]
  660. },
  661. {
  662. symbol: "none",
  663. name: "消防栓",
  664. type: "line",
  665. smooth: true,
  666. areaStyle: {
  667. normal: {
  668. color: new echarts.graphic.LinearGradient(
  669. 0,
  670. 0,
  671. 0,
  672. 1, [{
  673. offset: 0,
  674. color: "rgba(0,150,255,0.5)"
  675. },
  676. {
  677. offset: 0.8,
  678. color: "rgba(0,150,255, 0.1)"
  679. }
  680. ],
  681. false
  682. ),
  683. shadowColor: "rgba(0, 0, 0, 0.1)"
  684. }
  685. },
  686. data: sortData[0].data[1]
  687. }
  688. ]
  689. };
  690. myChart.setOption(option);
  691. var img1 = document.getElementById('deviceLinkChart2_img');
  692. setTimeout(function() {
  693. img1.src = myChart.getDataURL();
  694. }, 1000)
  695. })();
  696. // 数据波动关联
  697. (function() {
  698. var sortData = [{
  699. data: [
  700. [30, 70, 100, 120, 130, 190, 200, 230, 120, 100, 90, 80, 59, 30],
  701. ]
  702. }];
  703. var xData = ['一到二层', '二到三层', '三到四层', '四到五层', '五到六层', '六到七层', '七到八层', '八到九层', '九到十层', '十到十一层', '十一到十二层', '十二到十三层']
  704. // 1. 实例化对象
  705. var myChart = echarts.init(document.querySelector("#dataChangeChart1"));
  706. // 2.指定配置
  707. var option = {
  708. color: ["#FE92B3"], // 通过这个color修改三条线的颜色
  709. tooltip: {
  710. trigger: "axis",
  711. textStyle: {
  712. align: 'left' //图例左对齐
  713. },
  714. // backgroundColor: '#12DFE0',
  715. // formatter: '{a0}: {c0}<br />{b}'
  716. },
  717. legend: false,
  718. grid: {
  719. top: "0%",
  720. left: "1%",
  721. right: "1%",
  722. bottom: "1%",
  723. show: true, // 显示边框
  724. borderWidth: '0', //去除边框
  725. containLabel: true, // 不包含刻度文字在内
  726. },
  727. xAxis: {
  728. type: "category",
  729. boundaryGap: false,
  730. data: xData,
  731. axisTick: {
  732. show: false // 去除刻度线
  733. },
  734. axisLabel: {
  735. color: "#AADDFF", // 文本颜色
  736. interval: 0,
  737. rotate: 340,
  738. // formatter: function(val) {
  739. // return val.split("").join("\n");
  740. // }, //横轴信息文字竖直显示
  741. },
  742. axisLine: {
  743. show: false // 去除轴线
  744. }
  745. },
  746. yAxis: {
  747. splitNumber: 8,
  748. type: "value",
  749. axisTick: {
  750. show: false // 去除刻度线
  751. },
  752. axisLabel: {
  753. show: false // 去除文本
  754. },
  755. axisLine: {
  756. show: false // 去除轴线
  757. },
  758. splitLine: {
  759. lineStyle: {
  760. color: "#012f4a", // 分割线颜色
  761. opacity: .2
  762. }
  763. }
  764. },
  765. series: [{
  766. symbol: "none",
  767. name: "异常水压值",
  768. type: "line",
  769. smooth: true,
  770. areaStyle: {
  771. normal: {
  772. color: new echarts.graphic.LinearGradient(
  773. 0,
  774. 0,
  775. 0,
  776. 1, [{
  777. offset: 0,
  778. color: "rgba(255,147,180,.6)"
  779. },
  780. {
  781. offset: 0.8,
  782. color: "rgba(255,147,180, 0.4)"
  783. }
  784. ],
  785. false
  786. ),
  787. }
  788. },
  789. data: sortData[0].data[0]
  790. }]
  791. };
  792. myChart.setOption(option);
  793. var img1 = document.getElementById('dataChangeChart1_img');
  794. setTimeout(function() {
  795. img1.src = myChart.getDataURL();
  796. }, 1000)
  797. })();
  798. /**水系统导出数据对接 end **/
  799. } else {
  800. alert('暂无数据')
  801. }
  802. }, function(errorMsg) {
  803. alert("请求数据失败!");
  804. }, 2)
  805. };
  806. function getSearchParamObj() {
  807. let queryParam = {};
  808. let buildingVal = $('#building').val();
  809. let chooseTime = $('#chooseTime').val();
  810. queryParam.company_code = buildingVal;
  811. queryParam.generation_time = chooseTime;
  812. return queryParam;
  813. }
  814. // 打印
  815. (function() {
  816. $("#btnPrint").click(function() {
  817. print_detail()
  818. });
  819. var print_detail = function() {
  820. //打印前echarts图表转换成图片 start
  821. $('#divergenceChart1_img').show()
  822. $('#divergenceChart1').hide()
  823. $('#hiddenCheckChart1_img').show()
  824. $('#hiddenCheckChart1').hide()
  825. $('#deviceLinkChart1_img,#deviceLinkChart2_img').show()
  826. $('#deviceLinkChart1,#deviceLinkChart2').hide()
  827. $('#dataChangeChart1_img').show()
  828. $('#dataChangeChart1').hide()
  829. // end
  830. var div1_label1 = document.getElementById('printArea').innerHTML;
  831. var hkey_key;
  832. var hkey_root = 'HKEY_CURRENT_USER';
  833. var hkey_path = '\\Software\\Micorsoft\\Internet Explorer\\PageSetup\\';
  834. var print_win = window.open('打印窗口', '_blank');
  835. var div = document.createElement('div');
  836. div.setAttribute('width', '100%');
  837. div.setAttribute('height', '100%');
  838. var div_print = document.createElement('div');
  839. div_print.setAttribute('style', 'width:595px;height:842px;padding:50px 20px;margin:0px auto 0px auto');
  840. div_print.innerHTML = div1_label1;
  841. div.appendChild(div_print);
  842. print_win.document.write(div.innerHTML);
  843. print_win.document.close();
  844. try {
  845. var RegWsh = new ActiveXObject('WScript.Shell');
  846. hkey_key = 'header';
  847. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  848. hkey_key = 'footer';
  849. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  850. } catch (e) {}
  851. print_win.print();
  852. print_win.close();
  853. }
  854. })()