monthReport.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  1. // 筛选弹框
  2. var layer = layui.layer;
  3. var layerCreateIndex = '';
  4. var layerCreateIndex2 = '';
  5. layui.use('layer', function() {
  6. layerCreateIndex = layer.open({
  7. type: 1,
  8. // title: false,
  9. closeBtn: 0,
  10. // shadeClose: true,
  11. skin: 'yourclass',
  12. area: [
  13. '380px', '300px'
  14. ],
  15. content: $(".reportOut"),
  16. success: function() {
  17. $('.clsBtn,.cancel').click(function() {
  18. layer.close(layerCreateIndex);
  19. })
  20. }
  21. })
  22. })
  23. //时间日期选择
  24. layui.use([
  25. 'form', 'layedit', 'laydate'
  26. ], function() {});
  27. layui.use('laydate', function() {
  28. var laydate = layui.laydate;
  29. // 开始日期
  30. var insStart = laydate.render({
  31. elem: '#startTime',
  32. trigger: 'click',
  33. value: '2021-04-01',
  34. isInitValue: true,
  35. done: function(value, date) { // 更新结束日期的最小日期
  36. insEnd.config.min = lay.extend({}, date, {
  37. month: date.month - 1
  38. });
  39. // 自动弹出结束日期的选择器
  40. insEnd.config.elem[0].focus();
  41. }
  42. });
  43. // 结束日期
  44. var insEnd = laydate.render({
  45. elem: '#endTime',
  46. trigger: 'click',
  47. value: '2021-04-30',
  48. done: function(value, date) { // 更新开始日期的最大日期
  49. insStart.config.max = lay.extend({}, date, {
  50. month: date.month - 1
  51. });
  52. }
  53. });
  54. });
  55. // 单位下拉 ajax请求
  56. getNameList()
  57. function getNameList() {
  58. ajaxRequest(DEVICE_TYPE_COMPANYLIST, "POST", {}, function(result) {
  59. let data = result.RESULT;
  60. let items = '';
  61. data.forEach(function(item, key) {
  62. items += `<option value=''>请选择</option><option value="${
  63. item.owner_id
  64. }">${
  65. item.owner_name
  66. }</option>`
  67. })
  68. $('#getNameList').html(items);
  69. }, function(errorMsg) {
  70. alert("请求数据失败!");
  71. })
  72. }
  73. /* 筛选提交发送请求 */
  74. $('#nextStep').click(function() {
  75. //获取表单的值 并转换成对象
  76. let allParam = serializeArrayToObj($("#reportOutForm").serializeArray());
  77. //验证数据是否为空
  78. let res = validParamIsEmpty(allParam, {
  79. "startTime": "请选择开始日期",
  80. "endTime": "请选择结束日期",
  81. "companyId": "请选择建筑物",
  82. });
  83. if (res.code == -1) {
  84. alert(res.msg);
  85. return;
  86. }
  87. // //验证通过 请求ajax
  88. // ajaxRequest(MONTH_REPORT, "POST", allParam, function(result) {
  89. // layer.close(layerCreateIndex);
  90. // layer.msg('添加成功!', { icon: 6 });
  91. // $('#reportOutForm')[0].reset();
  92. // layui.use('layer', function () {
  93. // layerCreateIndex2 = layer.open({
  94. // type: 1,
  95. // title: false,
  96. // closeBtn: 0,
  97. // skin: 'yourclass',
  98. // area: [
  99. // '700px', '800px'
  100. // ],
  101. // content: $(".reportContentOut"),
  102. // success: function () {
  103. // console.log(result.data);
  104. // var data=result.data;
  105. // var deviceStatistic=data.deviceStatistic;//告警处理情况统计
  106. // var deviceOnly=data.deviceOnly; //设备离线情况统计
  107. // (function(){
  108. // var companyInfo=data.companyInfo; //单位信息
  109. // $('#companyName').html(companyInfo.ownerName);
  110. // })();
  111. // (function(){
  112. // var typeList=data.typeList; //设备类型统计信息
  113. // let items = '';
  114. // console.log(typeList)
  115. // typeList.forEach(function(item, key) {
  116. // items+= `
  117. // <tr>
  118. // <td>${item.TypeName} </td>
  119. // <td>${item.Num}</td>
  120. // <td>${item.TransmissionModel}</td>
  121. // <td>${item.Business}</td>
  122. // </tr>`
  123. // })
  124. // $('#typeList').html(items);
  125. // })()
  126. // //关闭弹框
  127. // $('.clsBtn,.cancel').click(function () {
  128. // window.open("./index.html");
  129. // })
  130. // }
  131. // })
  132. // })
  133. // }, function(errorMsg) {
  134. // alert("异常错误!");
  135. // })
  136. })
  137. //验证通过 请求ajax
  138. ajaxRequest(MONTH_REPORT, "POST", {
  139. 'companyId': 10012,
  140. 'startTime': 2021 - 04 - 01,
  141. 'endTime': 2021 - 04 - 30
  142. }, function(result) {
  143. // layer.close(layerCreateIndex);
  144. // layer.msg('添加成功!', { icon: 6 });
  145. $('#reportOutForm')[0].reset();
  146. layui.use('layer', function() {
  147. layerCreateIndex2 = layer.open({
  148. type: 1,
  149. title: false,
  150. closeBtn: 0,
  151. skin: 'yourclass',
  152. area: [
  153. '700px', '800px'
  154. ],
  155. content: $(".reportContentOut"),
  156. success: function() {
  157. console.log(result.data);
  158. var data = result.data;
  159. var deviceOnly = data.deviceOnly; //设备离线情况统计
  160. var companyInfo = data.companyInfo; //单位信息
  161. // 大标题
  162. (function() {
  163. $('#companyName').html(companyInfo.ownerName);
  164. })();
  165. //设备类型统计信息
  166. (function() {
  167. var typeList = data.typeList.deviceType;
  168. let items = '';
  169. let items2 = ''
  170. typeList.forEach(function(item, key) {
  171. items += ` <tr>
  172. <td>${item.TypeName} </td>
  173. <td>${item.Num}</td>
  174. <td>${item.TransmissionModel}</td>
  175. <td>${item.Business}</td>
  176. </tr>`
  177. })
  178. items2 = ` <tr>
  179. <td>统计总数</td>
  180. <td>${data.typeList.deviceNum} </td>
  181. <td ></td>
  182. <td ></td>
  183. </tr>`
  184. $('#typeList').html(items + items2);
  185. })();
  186. //单位信息
  187. (function() {
  188. let items = '';
  189. items = ` <tr>
  190. <td>${companyInfo.ownerName}</td>
  191. <td>${companyInfo.ownerAddress} </td>
  192. </tr>`
  193. $('#companyData').html(items);
  194. })();
  195. //告警处理情况统计
  196. (function() {
  197. var deviceStatistic = data.deviceStatistic; //告警处理情况统计
  198. var waterAlarm = deviceStatistic.waterAlarm;
  199. })();
  200. // 告警处理水系统折线图
  201. (function() {
  202. var myChart = echarts.init(document.querySelector("#waterChart1"));
  203. var option = {
  204. tooltip: {
  205. trigger: "axis",
  206. },
  207. legend: {
  208. data: ["水系统"],
  209. bottom: "0",
  210. textStyle: {
  211. color: "#0184d5",
  212. fontSize: "12",
  213. },
  214. },
  215. grid: {
  216. left: "10",
  217. right: "10",
  218. top: "30",
  219. bottom: "30",
  220. containLabel: true,
  221. },
  222. xAxis: [{
  223. type: "category",
  224. boundaryGap: false,
  225. data: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "26", "28", "29", "30"],
  226. axisLabel: {
  227. textStyle: {
  228. color: "rgba(255, 255, 255, .3)",
  229. fontSize: 12,
  230. },
  231. axisLine: {
  232. lineStyle: {
  233. color: "rgba(255, 255, 255, .1)",
  234. },
  235. },
  236. },
  237. }, ],
  238. yAxis: [{
  239. type: "value",
  240. // 去除刻度线
  241. axisTick: {
  242. show: false,
  243. },
  244. // y轴的线颜色
  245. axisLine: {
  246. lineStyle: {
  247. color: "rgba(255, 255, 255, .1)",
  248. },
  249. },
  250. // 文字的颜色
  251. axisLabel: {
  252. textStyle: {
  253. color: "rgba(255, 255, 255, .6)",
  254. fontSize: 12,
  255. },
  256. },
  257. // 修改分割线的颜色
  258. splitLine: {
  259. lineStyle: {
  260. color: "#aaa", // 分割线颜色
  261. opacity: .5
  262. }
  263. },
  264. }, ],
  265. series: [{
  266. name: "水系统",
  267. type: "line",
  268. smooth: true,
  269. // 单独修改当前线条的样式
  270. lineStyle: {
  271. color: "#0184d5",
  272. width: 2,
  273. },
  274. areaStyle: {
  275. // 渐变色,只需要复制即可
  276. color: new echarts.graphic.LinearGradient(
  277. 0,
  278. 0,
  279. 0,
  280. 1, [{
  281. offset: 0,
  282. color: "rgba(1, 132, 213, 0.4)", // 渐变色的起始颜色
  283. },
  284. {
  285. offset: 0.8,
  286. color: "rgba(1, 132, 213, 0.1)", // 渐变线的结束颜色
  287. },
  288. ],
  289. false
  290. ),
  291. // 影子效果
  292. shadowColor: "rgba(0, 0, 0, 0.1)",
  293. },
  294. // 设置拐点形状
  295. symbol: "circle",
  296. // 拐点大小
  297. symbolSize: 8,
  298. // 刚开始时不显示拐点,鼠标经过才显示
  299. showSymbol: false,
  300. // 设置拐点颜色以及边框
  301. itemStyle: {
  302. color: "#0184d5",
  303. borderColor: "rgba(221, 220, 107, .1)",
  304. borderWidth: 12,
  305. },
  306. data: [30, 40, 30, 40, 30, 40, 30, 60, 20, 40, 30, 40, 30, 40, 30, 40, 30, 60, 20, 40, 30, 40, 30, 40, 30, 40, 20, 50, 40, 30, 40, 20, 50, 40, 30, ]
  307. }],
  308. };
  309. myChart.setOption(option);
  310. //echarts赋值到src
  311. var img1 = document.getElementById('waterChart1_img');
  312. setTimeout(function() {
  313. img1.src = myChart.getDataURL();
  314. }, 1200)
  315. })();
  316. // 告警处理火系统折线图
  317. (function() {
  318. var myChart = echarts.init(document.querySelector("#fireChart1"));
  319. var option = {
  320. tooltip: {
  321. trigger: "axis",
  322. },
  323. legend: {
  324. data: ["火系统"],
  325. bottom: "0",
  326. textStyle: {
  327. color: "#ed3f35",
  328. fontSize: "12",
  329. },
  330. },
  331. grid: {
  332. left: "10",
  333. right: "10",
  334. top: "30",
  335. bottom: "30",
  336. containLabel: true,
  337. },
  338. xAxis: [{
  339. type: "category",
  340. boundaryGap: false,
  341. data: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "26", "28", "29", "30"],
  342. axisLabel: {
  343. textStyle: {
  344. color: "rgba(255, 255, 255, .3)",
  345. fontSize: 12,
  346. },
  347. axisLine: {
  348. lineStyle: {
  349. color: "red",
  350. },
  351. },
  352. },
  353. }, ],
  354. yAxis: [{
  355. type: "value",
  356. // 去除刻度线
  357. axisTick: {
  358. show: false,
  359. },
  360. // y轴的线颜色
  361. axisLine: {
  362. lineStyle: {
  363. color: "rgba(255, 255, 255, .1)",
  364. },
  365. },
  366. // 文字的颜色
  367. axisLabel: {
  368. textStyle: {
  369. color: "rgba(255, 255, 255, .6)",
  370. fontSize: 12,
  371. },
  372. },
  373. // 修改分割线的颜色
  374. splitLine: {
  375. lineStyle: {
  376. color: "#aaa", // 分割线颜色
  377. opacity: .5
  378. }
  379. },
  380. }, ],
  381. series: [{
  382. name: "火系统",
  383. type: "line",
  384. smooth: true,
  385. // 单独修改当前线条的样式
  386. lineStyle: {
  387. color: "#ed3f35",
  388. width: 2,
  389. },
  390. areaStyle: {
  391. // 渐变色,只需要复制即可
  392. color: new echarts.graphic.LinearGradient(
  393. 0,
  394. 0,
  395. 0,
  396. 1, [{
  397. offset: 0,
  398. color: "rgba(237,63,53, 0.4)", // 渐变色的起始颜色
  399. },
  400. {
  401. offset: 0.8,
  402. color: "rgba(237,63,53, 0.1)", // 渐变线的结束颜色
  403. },
  404. ],
  405. false
  406. ),
  407. // 影子效果
  408. shadowColor: "rgba(0, 0, 0, 0.1)",
  409. },
  410. // 设置拐点形状
  411. symbol: "circle",
  412. // 拐点大小
  413. symbolSize: 8,
  414. // 刚开始时不显示拐点,鼠标经过才显示
  415. showSymbol: false,
  416. // 设置拐点颜色以及边框
  417. itemStyle: {
  418. color: "#ed3f35",
  419. borderColor: "rgba(221, 220, 107, .1)",
  420. borderWidth: 12,
  421. },
  422. data: [130, 10, 20, 40, 30, 40, 80, 60, 20, 40, 90, 40, 20, 140, 30, 40, 130, 20, 20, 40, 80, 70, 30, 40, 30, 120, 20, 99, 50, 20, ],
  423. }, ],
  424. };
  425. myChart.setOption(option);
  426. //echarts赋值到src
  427. var img1 = document.getElementById('fireChart1_img');
  428. setTimeout(function() {
  429. img1.src = myChart.getDataURL();
  430. }, 1200)
  431. })();
  432. // 设备离线水系统折线图
  433. (function() {
  434. var myChart = echarts.init(document.querySelector("#waterOnlyChart"));
  435. var option = {
  436. tooltip: {
  437. trigger: "axis",
  438. },
  439. legend: {
  440. data: ["水系统"],
  441. bottom: "0",
  442. textStyle: {
  443. color: "#0184d5",
  444. fontSize: "12",
  445. },
  446. },
  447. grid: {
  448. left: "10",
  449. right: "10",
  450. top: "30",
  451. bottom: "30",
  452. containLabel: true,
  453. },
  454. xAxis: [{
  455. type: "category",
  456. boundaryGap: false,
  457. data: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "26", "28", "29", "30"],
  458. axisLabel: {
  459. textStyle: {
  460. color: "rgba(255, 255, 255, .3)",
  461. fontSize: 12,
  462. },
  463. axisLine: {
  464. lineStyle: {
  465. color: "red",
  466. },
  467. },
  468. },
  469. }, ],
  470. yAxis: [{
  471. type: "value",
  472. // 去除刻度线
  473. axisTick: {
  474. show: false,
  475. },
  476. // y轴的线颜色
  477. axisLine: {
  478. lineStyle: {
  479. color: "rgba(255, 255, 255, .1)",
  480. },
  481. },
  482. // 文字的颜色
  483. axisLabel: {
  484. textStyle: {
  485. color: "rgba(255, 255, 255, .6)",
  486. fontSize: 12,
  487. },
  488. },
  489. // 修改分割线的颜色
  490. splitLine: {
  491. lineStyle: {
  492. color: "#aaa", // 分割线颜色
  493. opacity: .5
  494. }
  495. },
  496. }, ],
  497. series: [{
  498. name: "水系统",
  499. type: "line",
  500. smooth: true,
  501. // 单独修改当前线条的样式
  502. lineStyle: {
  503. color: "#0184d5",
  504. width: 2,
  505. },
  506. areaStyle: {
  507. // 渐变色,只需要复制即可
  508. color: new echarts.graphic.LinearGradient(
  509. 0,
  510. 0,
  511. 0,
  512. 1, [{
  513. offset: 0,
  514. color: "rgba(1, 132, 213, 0.4)", // 渐变色的起始颜色
  515. },
  516. {
  517. offset: 0.8,
  518. color: "rgba(1, 132, 213, 0.1)", // 渐变线的结束颜色
  519. },
  520. ],
  521. false
  522. ),
  523. // 影子效果
  524. shadowColor: "rgba(0, 0, 0, 0.1)",
  525. },
  526. // 设置拐点形状
  527. symbol: "circle",
  528. // 拐点大小
  529. symbolSize: 8,
  530. // 刚开始时不显示拐点,鼠标经过才显示
  531. showSymbol: false,
  532. // 设置拐点颜色以及边框
  533. itemStyle: {
  534. color: "#0184d5",
  535. borderColor: "rgba(221, 220, 107, .1)",
  536. borderWidth: 12,
  537. },
  538. data: [30, 40, 30, 40, 30, 40, 30, 60, 20, 40, 30, 40, 30, 40, 30, 40, 30, 60, 20, 40, 30, 40, 30, 40, 30, 40, 20, 50, 40, 30]
  539. }],
  540. };
  541. myChart.setOption(option);
  542. //echarts赋值到src
  543. var img1 = document.getElementById('waterOnlyChart_img');
  544. setTimeout(function() {
  545. img1.src = myChart.getDataURL();
  546. }, 1200)
  547. })();
  548. // 设备离线火系统折线图
  549. (function() {
  550. var myChart = echarts.init(document.querySelector("#fireOnlyChart"));
  551. var option = {
  552. tooltip: {
  553. trigger: "axis",
  554. },
  555. legend: {
  556. data: ["火系统"],
  557. bottom: "0",
  558. textStyle: {
  559. color: "#ed3f35",
  560. fontSize: "12",
  561. },
  562. },
  563. grid: {
  564. left: "10",
  565. right: "10",
  566. top: "30",
  567. bottom: "30",
  568. containLabel: true,
  569. },
  570. xAxis: [{
  571. type: "category",
  572. boundaryGap: false,
  573. data: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "26", "28", "29", "30"],
  574. axisLabel: {
  575. textStyle: {
  576. color: "rgba(255, 255, 255, .3)",
  577. fontSize: 12,
  578. },
  579. axisLine: {
  580. lineStyle: {
  581. color: "red",
  582. },
  583. },
  584. },
  585. }, ],
  586. yAxis: [{
  587. type: "value",
  588. // 去除刻度线
  589. axisTick: {
  590. show: false,
  591. },
  592. // y轴的线颜色
  593. axisLine: {
  594. lineStyle: {
  595. color: "rgba(255, 255, 255, .1)",
  596. },
  597. },
  598. // 文字的颜色
  599. axisLabel: {
  600. textStyle: {
  601. color: "rgba(255, 255, 255, .6)",
  602. fontSize: 12,
  603. },
  604. },
  605. // 修改分割线的颜色
  606. splitLine: {
  607. lineStyle: {
  608. color: "#aaa", // 分割线颜色
  609. opacity: .5
  610. }
  611. },
  612. }, ],
  613. series: [{
  614. name: "火系统",
  615. type: "line",
  616. smooth: true,
  617. // 单独修改当前线条的样式
  618. lineStyle: {
  619. color: "#ed3f35",
  620. width: 2,
  621. },
  622. areaStyle: {
  623. // 渐变色,只需要复制即可
  624. color: new echarts.graphic.LinearGradient(
  625. 0,
  626. 0,
  627. 0,
  628. 1, [{
  629. offset: 0,
  630. color: "rgba(237,63,53, 0.4)", // 渐变色的起始颜色
  631. },
  632. {
  633. offset: 0.8,
  634. color: "rgba(237,63,53, 0.1)", // 渐变线的结束颜色
  635. },
  636. ],
  637. false
  638. ),
  639. // 影子效果
  640. shadowColor: "rgba(0, 0, 0, 0.1)",
  641. },
  642. // 设置拐点形状
  643. symbol: "circle",
  644. // 拐点大小
  645. symbolSize: 8,
  646. // 刚开始时不显示拐点,鼠标经过才显示
  647. showSymbol: false,
  648. // 设置拐点颜色以及边框
  649. itemStyle: {
  650. color: "#ed3f35",
  651. borderColor: "rgba(221, 220, 107, .1)",
  652. borderWidth: 12,
  653. },
  654. data: [130, 10, 20, 40, 30, 40, 80, 60, 20, 40, 90, 40, 20, 140, 30, 40, 130, 20, 20, 40, 80, 70, 30, 40, 30, 120, 20, 99, 50, 20, ],
  655. }, ],
  656. };
  657. myChart.setOption(option);
  658. //echarts赋值到src
  659. var img1 = document.getElementById('fireOnlyChart_img');
  660. setTimeout(function() {
  661. img1.src = myChart.getDataURL();
  662. }, 1200)
  663. })();
  664. // 设备离线烟感折线图
  665. (function() {
  666. var myChart = echarts.init(document.querySelector("#smokeOnlyChart"));
  667. var option = {
  668. tooltip: {
  669. trigger: "axis",
  670. },
  671. legend: {
  672. data: ["烟感"],
  673. bottom: "0",
  674. textStyle: {
  675. color: "#F4A460",
  676. fontSize: "12",
  677. },
  678. },
  679. grid: {
  680. left: "10",
  681. right: "10",
  682. top: "30",
  683. bottom: "30",
  684. containLabel: true,
  685. },
  686. xAxis: [{
  687. type: "category",
  688. boundaryGap: false,
  689. data: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "26", "28", "29", "30"],
  690. axisLabel: {
  691. textStyle: {
  692. color: "rgba(255, 255, 255, .3)",
  693. fontSize: 12,
  694. },
  695. axisLine: {
  696. lineStyle: {
  697. color: "red",
  698. },
  699. },
  700. },
  701. }, ],
  702. yAxis: [{
  703. type: "value",
  704. // 去除刻度线
  705. axisTick: {
  706. show: false,
  707. },
  708. // y轴的线颜色
  709. axisLine: {
  710. lineStyle: {
  711. color: "rgba(255, 255, 255, .1)",
  712. },
  713. },
  714. // 文字的颜色
  715. axisLabel: {
  716. textStyle: {
  717. color: "rgba(255, 255, 255, .6)",
  718. fontSize: 12,
  719. },
  720. },
  721. // 修改分割线的颜色
  722. splitLine: {
  723. lineStyle: {
  724. color: "#aaa", // 分割线颜色
  725. opacity: .5
  726. }
  727. },
  728. }, ],
  729. series: [{
  730. name: "烟感",
  731. type: "line",
  732. smooth: true,
  733. // 单独修改当前线条的样式
  734. lineStyle: {
  735. color: "#F4A460",
  736. width: 2,
  737. },
  738. areaStyle: {
  739. // 渐变色,只需要复制即可
  740. color: new echarts.graphic.LinearGradient(
  741. 0,
  742. 0,
  743. 0,
  744. 1, [{
  745. offset: 0,
  746. color: "rgba(244,164,96, 0.4)", // 渐变色的起始颜色
  747. },
  748. {
  749. offset: 0.8,
  750. color: "rgba(244,164,96, 0.1)", // 渐变线的结束颜色
  751. },
  752. ],
  753. false
  754. ),
  755. // 影子效果
  756. shadowColor: "rgba(0, 0, 0, 0.1)",
  757. },
  758. // 设置拐点形状
  759. symbol: "circle",
  760. // 拐点大小
  761. symbolSize: 8,
  762. // 刚开始时不显示拐点,鼠标经过才显示
  763. showSymbol: false,
  764. // 设置拐点颜色以及边框
  765. itemStyle: {
  766. color: "#F4A460",
  767. borderColor: "rgba(221, 220, 107, .1)",
  768. borderWidth: 12,
  769. },
  770. data: [130, 10, 20, 40, 30, 40, 80, 60, 20, 40, 90, 40, 20, 140, 30, 40, 130, 20, 20, 40, 80, 70, 30, 40, 30, 120, 20, 99, 50, 20, ],
  771. }, ],
  772. };
  773. myChart.setOption(option);
  774. //echarts赋值到src
  775. var img1 = document.getElementById('smokeOnlyChart_img');
  776. setTimeout(function() {
  777. img1.src = myChart.getDataURL();
  778. }, 1200)
  779. })();
  780. //关闭弹框
  781. $('.clsBtn,.cancel').click(function() {
  782. window.open("./index.html");
  783. })
  784. }
  785. })
  786. })
  787. }, function(errorMsg) {
  788. alert("异常错误!");
  789. });
  790. // 打印
  791. (function() {
  792. $("#btnPrint").click(function() {
  793. print_detail()
  794. });
  795. var print_detail = function() {
  796. //打印前echarts图表转换成图片 start
  797. $('#waterChart1_img,#fireChart1_img,#waterOnlyChart_img,#fireOnlyChart_img,#smokeOnlyChart_img').show()
  798. $('waterChart1,#fireChart1,#waterOnlyChart,#fireOnlyChart,#smokeOnlyChart').hide()
  799. // end
  800. var div1_label1 = document.getElementById('printArea').innerHTML;
  801. var hkey_key;
  802. var hkey_root = 'HKEY_CURRENT_USER';
  803. var hkey_path = '\\Software\\Micorsoft\\Internet Explorer\\PageSetup\\';
  804. var print_win = window.open('打印窗口', '_blank');
  805. var div = document.createElement('div');
  806. div.setAttribute('width', '100%');
  807. div.setAttribute('height', '100%');
  808. var div_print = document.createElement('div');
  809. div_print.setAttribute('style', 'width:595px;height:842px;padding:50px 20px;margin:0px auto 0px auto');
  810. div_print.innerHTML = div1_label1;
  811. div.appendChild(div_print);
  812. print_win.document.write(div.innerHTML);
  813. print_win.document.close();
  814. try {
  815. var RegWsh = new ActiveXObject('WScript.Shell');
  816. hkey_key = 'header';
  817. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  818. hkey_key = 'footer';
  819. RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
  820. } catch (e) {}
  821. print_win.print();
  822. print_win.close();
  823. }
  824. })()