123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939 |
- // 筛选弹框
- var layer = layui.layer;
- var layerCreateIndex = '';
- var layerCreateIndex2 = '';
- layui.use('layer', function() {
- layerCreateIndex = layer.open({
- type: 1,
- title: false,
- closeBtn: 0,
- // shadeClose: true,
- skin: 'yourclass',
- area: [
- '380px', '300px'
- ],
- content: $(".reportOut"),
- success: function() {
- $('.clsBtn,.cancel').click(function() {
- layer.close(layerCreateIndex);
- //关闭弹框
- window.open("./index.html");
- })
- }
- })
- })
- //时间日期选择
- layui.use([
- 'form', 'layedit', 'laydate'
- ], function() {});
- layui.use('laydate', function() {
- var laydate = layui.laydate;
- // 开始日期
- var insStart = laydate.render({
- elem: '#startTime',
- trigger: 'click',
- value: '2021-04-01',
- isInitValue: true,
- done: function(value, date) { // 更新结束日期的最小日期
- insEnd.config.min = lay.extend({}, date, {
- month: date.month - 1
- });
- // 自动弹出结束日期的选择器
- insEnd.config.elem[0].focus();
- }
- });
- // 结束日期
- var insEnd = laydate.render({
- elem: '#endTime',
- trigger: 'click',
- value: '2021-04-30',
- done: function(value, date) { // 更新开始日期的最大日期
- insStart.config.max = lay.extend({}, date, {
- month: date.month - 1
- });
- }
- });
- });
- // 单位下拉 ajax请求
- getNameList()
- function getNameList() {
- ajaxRequest(DEVICE_TYPE_COMPANYLIST, "POST", {}, function(result) {
- let data = result.RESULT;
- let items = '';
- data.forEach(function(item, key) {
- items += `<option value=''>请选择</option><option value="${
- item.owner_id
- }">${
- item.owner_name
- }</option>`
- })
- $('#getNameList').html(items);
- }, function(errorMsg) {
- alert("请求数据失败!");
- })
- }
- /* 筛选提交发送请求 */
- $('#nextStep').click(function() {
- var startTimes = $('#startTime').val();
- var endTimes = $('#endTime').val();
- //获取表单的值 并转换成对象
- let allParam = serializeArrayToObj($("#reportOutForm").serializeArray());
- //验证数据是否为空
- let res = validParamIsEmpty(allParam, {
- "startTime": "请选择开始日期",
- "endTime": "请选择结束日期",
- "companyId": "请选择建筑物",
- });
- if (res.code == -1) {
- alert(res.msg);
- return;
- }
- //验证通过 请求ajax
- ajaxRequest(MONTH_REPORT, "POST", allParam, function(result) {
- // layer.close(layerCreateIndex);
- $('#reportOutForm')[0].reset();
- layui.use('layer', function() {
- layerCreateIndex2 = layer.open({
- type: 1,
- title: false,
- closeBtn: 0,
- skin: 'yourclass',
- area: [
- '700px', '700px'
- ],
- content: $(".reportContentOut"),
- success: function() {
- var data = result.data;
- var companyInfo = data.companyInfo; //单位信息
- var deviceStatistic = data.deviceStatistic; //告警处理
- var deviceOnly = data.deviceOnly; //设备离线情况统计
- //大标题和时间动态赋值
- (function() {
- $('#companyName').html(companyInfo.ownerName);
- $('#staticTime').text(`${startTimes}日 到 ${endTimes}日`);
- })();
- //单位信息
- (function() {
- let items = '';
- items = ` <tr>
- <td>${companyInfo.ownerName}</td>
- <td>${companyInfo.ownerAddress} </td>
- </tr>`
- $('#companyData').html(items);
- $('#staticTime').html()
- })();
- //设备类型统计信息
- (function() {
- var typeList = data.typeList.deviceType;
- let items = '';
- let items2 = ''
- typeList.forEach(function(item, key) {
- items += ` <tr>
- <td>${item.TypeName} </td>
- <td>${item.Num}</td>
- <td>${item.TransmissionModel}</td>
- <td>${item.Business}</td>
- </tr>`
- })
- items2 = ` <tr>
- <td>统计总数</td>
- <td>${data.typeList.deviceNum} </td>
- <td ></td>
- <td ></td>
- </tr>`
- $('#typeList').html(items + items2);
- })();
- // 告警处理水系统
- (function() {
- var waterAlarm = JSON.parse(deviceStatistic.waterAlarm);
- waterAlarm = waterAlarm.RESULT[0];
- var waterAlarmRate = waterAlarm.count ? (waterAlarm.sum / waterAlarm.count) * 100 : 100;
- if (waterAlarmRate == 100) {
- $('.waterSummary').html(` 目前数据反应:统计时段内水系统告警报告数量:<span>${waterAlarm.count}</span>条。报告数量良好。<br> 提示:消防水设备状态良好,需要保持。`)
- } else {
- $('.waterSummary').html(` 目前数据反应:统计时段内水系统告警报告数量:<span>${waterAlarm.count}</span>条。报告数量良好。<br> 提示:有一定的火系统隐患或存在系统故障,需要排查。`)
- }
- let items = '';
- items = ` <tr>
- <td>${waterAlarm.count}</td>
- <td>${waterAlarm.sum} </td>
- <td>${waterAlarm.count- waterAlarm.sum} </td>
- <td>${waterAlarmRate}% </td>
- </tr>`
- $('#water_statistics').html(items);
- (function() {
- var myChart = echarts.init(document.querySelector("#waterChart1"));
- var option = {
- tooltip: {
- trigger: "axis",
- },
- legend: {
- data: ["水系统"],
- bottom: "0",
- textStyle: {
- color: "#0184d5",
- fontSize: "12",
- },
- },
- grid: {
- left: "10",
- right: "10",
- top: "30",
- bottom: "30",
- containLabel: true,
- },
- xAxis: [{
- type: "category",
- boundaryGap: false,
- data: waterAlarm.day_list,
- // 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"],
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .3)",
- fontSize: 12,
- },
- axisLine: {
- lineStyle: {
- color: "rgba(255, 255, 255, .1)",
- },
- },
- },
- }, ],
- yAxis: [{
- type: "value",
- // 去除刻度线
- axisTick: {
- show: false,
- },
- // y轴的线颜色
- axisLine: {
- lineStyle: {
- color: "#444",
- opacity: .3
- },
- },
- // 文字的颜色
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .6)",
- fontSize: 12,
- },
- },
- // 修改分割线的颜色
- splitLine: {
- lineStyle: {
- color: "#aaa", // 分割线颜色
- opacity: .5
- }
- },
- }, ],
- series: [{
- name: "水系统",
- type: "line",
- smooth: true,
- // 单独修改当前线条的样式
- lineStyle: {
- color: "#0184d5",
- width: 2,
- },
- areaStyle: {
- // 渐变色,只需要复制即可
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1, [{
- offset: 0,
- color: "rgba(1, 132, 213, 0.4)", // 渐变色的起始颜色
- },
- {
- offset: 0.8,
- color: "rgba(1, 132, 213, 0.1)", // 渐变线的结束颜色
- },
- ],
- false
- ),
- // 影子效果
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- // 设置拐点形状
- symbol: "circle",
- // 拐点大小
- symbolSize: 8,
- // 刚开始时不显示拐点,鼠标经过才显示
- showSymbol: false,
- // 设置拐点颜色以及边框
- itemStyle: {
- color: "#0184d5",
- borderColor: "rgba(221, 220, 107, .1)",
- borderWidth: 12,
- },
- data: waterAlarm.count_list
- // 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, ]
- }],
- };
- myChart.setOption(option);
- //echarts赋值到src
- var img1 = document.getElementById('waterChart1_img');
- setTimeout(function() {
- img1.src = myChart.getDataURL();
- }, 1200)
- })();
- })();
- // 告警处理火系统
- (function() {
- var fireAlarm = JSON.parse(deviceStatistic.fireAlarm);
- fireAlarm = fireAlarm.RESULT[0];
- $('#fireCount').html(fireAlarm.count)
- var fireAlarmRate = fireAlarm.count ? (fireAlarm.sum / fireAlarm.count) * 100 : 100;
- if (fireAlarmRate == 100) {
- $('.fireSummary').html(` 目前数据反应:火系统告警报告数量:<span>${fireAlarm.count}</span>条。报告数量良好。<br> 提示:消防火设备状态良好,需要保持 。`)
- } else {
- $('.fireSummary').html(` 目前数据反应:火系统告警报告数量:<span>${fireAlarm.count}</span>条。报告数量良好。<br> 提示:提示:有一定的火系统隐患或存在系统故障,需要排查。`)
- }
- let items = '';
- items = ` <tr>
- <td>${ fireAlarm.count}</td>
- <td>${ fireAlarm.sum} </td>
- <td>${ fireAlarm.count- fireAlarm.sum} </td>
- <td>${ fireAlarmRate}% </td>
- </tr>`
- $('#fire_statistics').html(items);
- (function() {
- var myChart = echarts.init(document.querySelector("#fireChart1"));
- var option = {
- tooltip: {
- trigger: "axis",
- },
- legend: {
- data: ["火系统"],
- bottom: "0",
- textStyle: {
- color: "#ed3f35",
- fontSize: "12",
- },
- },
- grid: {
- left: "10",
- right: "10",
- top: "30",
- bottom: "30",
- containLabel: true,
- },
- xAxis: [{
- type: "category",
- boundaryGap: false,
- data: fireAlarm.day_list,
- // 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"],
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .3)",
- fontSize: 12,
- },
- axisLine: {
- lineStyle: {
- color: "red",
- },
- },
- },
- }, ],
- yAxis: [{
- type: "value",
- // 去除刻度线
- axisTick: {
- show: false,
- },
- // y轴的线颜色
- axisLine: {
- lineStyle: {
- color: "#444",
- opacity: .3
- },
- },
- // 文字的颜色
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .6)",
- fontSize: 12,
- },
- },
- // 修改分割线的颜色
- splitLine: {
- lineStyle: {
- color: "#aaa", // 分割线颜色
- opacity: .5
- }
- },
- }, ],
- series: [{
- name: "火系统",
- type: "line",
- smooth: true,
- // 单独修改当前线条的样式
- lineStyle: {
- color: "#ed3f35",
- width: 2,
- },
- areaStyle: {
- // 渐变色,只需要复制即可
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1, [{
- offset: 0,
- color: "rgba(237,63,53, 0.4)", // 渐变色的起始颜色
- },
- {
- offset: 0.8,
- color: "rgba(237,63,53, 0.1)", // 渐变线的结束颜色
- },
- ],
- false
- ),
- // 影子效果
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- // 设置拐点形状
- symbol: "circle",
- // 拐点大小
- symbolSize: 8,
- // 刚开始时不显示拐点,鼠标经过才显示
- showSymbol: false,
- // 设置拐点颜色以及边框
- itemStyle: {
- color: "#ed3f35",
- borderColor: "rgba(221, 220, 107, .1)",
- borderWidth: 12,
- },
- data: fireAlarm.count_list
- // 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, ],
- }, ],
- };
- myChart.setOption(option);
- //echarts赋值到src
- var img1 = document.getElementById('fireChart1_img');
- setTimeout(function() {
- img1.src = myChart.getDataURL();
- }, 1200)
- })();
- })();
- // 设备离线水系统
- (function() {
- var waterDeviceOnly = JSON.parse(deviceOnly.waterDeviceOnly);
- waterDeviceOnly = waterDeviceOnly.RESULT[0];
- var waterOnlyRate = waterDeviceOnly.count ? (waterDeviceOnly.sum / waterDeviceOnly.count) * 100 : 100;
- if (waterOnlyRate == 100) {
- $('.waterOnlySummary').html(` 目前数据反应:统计时段内水系统告警报告数量:<span>${waterDeviceOnly.count}</span>条。报告数量良好。<br> 提示:数据接收情况稳定,需要保持。`)
- } else {
- $('.waterOnlySummary').html(` 目前数据反应:统计时段内水系统告警报告数量:<span>${waterDeviceOnly.count}</span>条。报告数量良好。<br> 提示:有一定的水系统隐患或存在系统故障,需要排查。`)
- }
- let items = '';
- items = ` <tr>
- <td>${ waterDeviceOnly.count}</td>
- <td>${ waterDeviceOnly.sum} </td>
- <td>${ waterDeviceOnly.count- waterDeviceOnly.sum} </td>
- <td>${ waterOnlyRate}% </td>
- </tr>`
- $('#waterDeviceOnly').html(items);
- (function() {
- var myChart = echarts.init(document.querySelector("#waterOnlyChart"));
- var option = {
- tooltip: {
- trigger: "axis",
- },
- legend: {
- data: ["水系统"],
- bottom: "0",
- textStyle: {
- color: "#0184d5",
- fontSize: "12",
- },
- },
- grid: {
- left: "10",
- right: "10",
- top: "30",
- bottom: "30",
- containLabel: true,
- },
- xAxis: [{
- type: "category",
- boundaryGap: false,
- data: waterDeviceOnly.day_list,
- // 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"],
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .3)",
- fontSize: 12,
- },
- axisLine: {
- lineStyle: {
- color: "red",
- },
- },
- },
- }, ],
- yAxis: [{
- type: "value",
- // 去除刻度线
- axisTick: {
- show: false,
- },
- // y轴的线颜色
- axisLine: {
- lineStyle: {
- color: "#444",
- opacity: .3
- },
- },
- // 文字的颜色
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .6)",
- fontSize: 12,
- },
- },
- // 修改分割线的颜色
- splitLine: {
- lineStyle: {
- color: "#aaa", // 分割线颜色
- opacity: .5
- }
- },
- }, ],
- series: [{
- name: "水系统",
- type: "line",
- smooth: true,
- // 单独修改当前线条的样式
- lineStyle: {
- color: "#0184d5",
- width: 2,
- },
- areaStyle: {
- // 渐变色,只需要复制即可
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1, [{
- offset: 0,
- color: "rgba(1, 132, 213, 0.4)", // 渐变色的起始颜色
- },
- {
- offset: 0.8,
- color: "rgba(1, 132, 213, 0.1)", // 渐变线的结束颜色
- },
- ],
- false
- ),
- // 影子效果
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- // 设置拐点形状
- symbol: "circle",
- // 拐点大小
- symbolSize: 8,
- // 刚开始时不显示拐点,鼠标经过才显示
- showSymbol: false,
- // 设置拐点颜色以及边框
- itemStyle: {
- color: "#0184d5",
- borderColor: "rgba(221, 220, 107, .1)",
- borderWidth: 12,
- },
- data: waterDeviceOnly.count_list,
- // 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]
- }],
- };
- myChart.setOption(option);
- //echarts赋值到src
- var img1 = document.getElementById('waterOnlyChart_img');
- setTimeout(function() {
- img1.src = myChart.getDataURL();
- }, 1200)
- })();
- })();
- // 设备离线火系统
- (function() {
- var fireOnly = JSON.parse(deviceOnly.fireOnly);
- fireOnly = fireOnly.RESULT[0];
- $('#fireOnlyCount').html(fireOnly.count);
- var fireOnlyRate = fireOnly.count ? (fireOnly.sum / fireOnly.count) * 100 : 100;
- if (fireOnlyRate == 100) {
- $('.fireOnlySummary').html(` 目前数据反应:统计时段内火系统告警报告数量:<span>${fireOnlyRate}</span>条。报告数量良好。<br> 提示:数据接收情况稳定,需要保持。`)
- } else {
- $('.fireOnlySummary').html(` 目前数据反应:统计时段内火系统告警报告数量:<span>${fireOnlyRate}</span>条。报告数量良好。<br> 提示:有一定的火系统隐患或存在系统故障,需要排查。`)
- }
- let items = '';
- items = ` <tr>
- <td>${ fireOnly.count}</td>
- <td>${ fireOnly.sum} </td>
- <td>${ fireOnly.count- fireOnly.sum} </td>
- <td>${fireOnlyRate}% </td>
- </tr>`
- $('#fireOnly').html(items);
- (function() {
- var myChart = echarts.init(document.querySelector("#fireOnlyChart"));
- var option = {
- tooltip: {
- trigger: "axis",
- },
- legend: {
- data: ["火系统"],
- bottom: "0",
- textStyle: {
- color: "#ed3f35",
- fontSize: "12",
- },
- },
- grid: {
- left: "10",
- right: "10",
- top: "30",
- bottom: "30",
- containLabel: true,
- },
- xAxis: [{
- type: "category",
- boundaryGap: false,
- data: fireOnly.day_list,
- // 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"],
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .3)",
- fontSize: 12,
- },
- axisLine: {
- lineStyle: {
- color: "red",
- },
- },
- },
- }, ],
- yAxis: [{
- type: "value",
- // 去除刻度线
- axisTick: {
- show: false,
- },
- // y轴的线颜色
- axisLine: {
- lineStyle: {
- color: "#444",
- opacity: .3
- },
- },
- // 文字的颜色
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .6)",
- fontSize: 12,
- },
- },
- // 修改分割线的颜色
- splitLine: {
- lineStyle: {
- color: "#aaa", // 分割线颜色
- opacity: .5
- }
- },
- }, ],
- series: [{
- name: "火系统",
- type: "line",
- smooth: true,
- // 单独修改当前线条的样式
- lineStyle: {
- color: "#ed3f35",
- width: 2,
- },
- areaStyle: {
- // 渐变色,只需要复制即可
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1, [{
- offset: 0,
- color: "rgba(237,63,53, 0.4)", // 渐变色的起始颜色
- },
- {
- offset: 0.8,
- color: "rgba(237,63,53, 0.1)", // 渐变线的结束颜色
- },
- ],
- false
- ),
- // 影子效果
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- // 设置拐点形状
- symbol: "circle",
- // 拐点大小
- symbolSize: 8,
- // 刚开始时不显示拐点,鼠标经过才显示
- showSymbol: false,
- // 设置拐点颜色以及边框
- itemStyle: {
- color: "#ed3f35",
- borderColor: "rgba(221, 220, 107, .1)",
- borderWidth: 12,
- },
- data: fireOnly.count_list,
- // 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, ],
- }, ],
- };
- myChart.setOption(option);
- //echarts赋值到src
- var img1 = document.getElementById('fireOnlyChart_img');
- setTimeout(function() {
- img1.src = myChart.getDataURL();
- }, 1200)
- })();
- })();
- // 设备离线烟感
- (function() {
- var smokeOnly = JSON.parse(deviceOnly.smokeOnly);
- smokeOnly = smokeOnly.RESULT[0];
- $('#somkeOnlyCount').html(smokeOnly.count);
- var smokeOnlyRate = smokeOnly.count ? (smokeOnly.sum / smokeOnly.count) * 100 : 100;
- if (smokeOnlyRate == 100) {
- $('.smokeOnlySummary').html(` 目前数据反应:统计时段内烟感告警报告数量:<span>${smokeOnly.count}</span>条。报告数量良好。<br> 提示:数据接收情况稳定,需要保持。`)
- } else {
- $('.smokeOnlySummary').html(` 目前数据反应:统计时段内烟感告警报告数量:<span>${smokeOnly.count}</span>条。报告数量良好。<br> 提示:有一定的烟感隐患或存在系统故障,需要排查。`)
- }
- let items = '';
- items = ` <tr>
- <td>${ smokeOnly.count}</td>
- <td>${ smokeOnly.sum} </td>
- <td>${ smokeOnly.count- smokeOnly.sum} </td>
- <td>${ smokeOnlyRate}% </td>
- </tr>`
- $('#smokeOnly').html(items);
- (function() {
- var myChart = echarts.init(document.querySelector("#smokeOnlyChart"));
- var option = {
- tooltip: {
- trigger: "axis",
- },
- legend: {
- data: ["烟感"],
- bottom: "0",
- textStyle: {
- color: "#F4A460",
- fontSize: "12",
- },
- },
- grid: {
- left: "10",
- right: "10",
- top: "30",
- bottom: "30",
- containLabel: true,
- },
- xAxis: [{
- type: "category",
- boundaryGap: false,
- data: smokeOnly.day_list,
- // 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"],
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .3)",
- fontSize: 12,
- },
- axisLine: {
- lineStyle: {
- color: "red",
- },
- },
- },
- }, ],
- yAxis: [{
- type: "value",
- // 去除刻度线
- axisTick: {
- show: false,
- },
- // y轴的线颜色
- axisLine: {
- lineStyle: {
- color: "#444",
- opacity: .3
- },
- },
- // 文字的颜色
- axisLabel: {
- textStyle: {
- color: "rgba(255, 255, 255, .6)",
- fontSize: 12,
- },
- },
- // 修改分割线的颜色
- splitLine: {
- lineStyle: {
- color: "#aaa", // 分割线颜色
- opacity: .5
- }
- },
- }, ],
- series: [{
- name: "烟感",
- type: "line",
- smooth: true,
- // 单独修改当前线条的样式
- lineStyle: {
- color: "#F4A460",
- width: 2,
- },
- areaStyle: {
- // 渐变色,只需要复制即可
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1, [{
- offset: 0,
- color: "rgba(244,164,96, 0.4)", // 渐变色的起始颜色
- },
- {
- offset: 0.8,
- color: "rgba(244,164,96, 0.1)", // 渐变线的结束颜色
- },
- ],
- false
- ),
- // 影子效果
- shadowColor: "rgba(0, 0, 0, 0.1)",
- },
- // 设置拐点形状
- symbol: "circle",
- // 拐点大小
- symbolSize: 8,
- // 刚开始时不显示拐点,鼠标经过才显示
- showSymbol: false,
- // 设置拐点颜色以及边框
- itemStyle: {
- color: "#F4A460",
- borderColor: "rgba(221, 220, 107, .1)",
- borderWidth: 12,
- },
- data: smokeOnly.count_list,
- // 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, ],
- }, ],
- };
- myChart.setOption(option);
- //echarts赋值到src
- var img1 = document.getElementById('smokeOnlyChart_img');
- setTimeout(function() {
- img1.src = myChart.getDataURL();
- }, 1200)
- })();
- })();
- //关闭弹框
- $('.clsBtn,.cancel').click(function() {
- window.open("./index.html");
- })
- }
- })
- })
- }, function(errorMsg) {
- alert("异常错误!");
- });
- });
- // 打印
- (function() {
- $("#btnPrint").click(function() {
- print_detail()
- });
- var print_detail = function() {
- //打印前echarts图表转换成图片 start
- $('#waterChart1_img,#fireChart1_img,#waterOnlyChart_img,#fireOnlyChart_img,#smokeOnlyChart_img').show()
- $('#waterChart1,#fireChart1,#waterOnlyChart,#fireOnlyChart,#smokeOnlyChart').hide()
- // end
- var div1_label1 = document.getElementById('printArea').innerHTML;
- var hkey_key;
- var hkey_root = 'HKEY_CURRENT_USER';
- var hkey_path = '\\Software\\Micorsoft\\Internet Explorer\\PageSetup\\';
- var print_win = window.open('打印窗口', '_blank');
- var div = document.createElement('div');
- div.setAttribute('width', '100%');
- div.setAttribute('height', '100%');
- var div_print = document.createElement('div');
- div_print.setAttribute('style', 'width:595px;height:842px;padding:50px 20px;margin:0px auto 0px auto');
- div_print.innerHTML = div1_label1;
- div.appendChild(div_print);
- print_win.document.write(div.innerHTML);
- print_win.document.close();
- try {
- var RegWsh = new ActiveXObject('WScript.Shell');
- hkey_key = 'header';
- RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
- hkey_key = 'footer';
- RegWsh.RegWrite(hkey_root + hkey_path + hkey_key, '');
- } catch (e) {}
- print_win.print();
- print_win.close();
- }
- })()
|