var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, {value: value, enumerable: true, configurable: true, writable: true}); } else { obj[key] = value; } return obj; } /////////////////////////////////////////////////////////////////////////// // Copyright © 2019 zhongsong. All Rights Reserved. // 模块描述:风险预警 /////////////////////////////////////////////////////////////////////////// define(['dojo/_base/declare', 'dojo/_base/lang', 'dojo/_base/array', 'dojo/_base/html', 'dojo/topic', 'jimu/BaseWidget', 'libs/laydate/laydate.js', 'libs/layer/layer.js'], function (declare, lang, array, html, topic, BaseWidget, laydate, layer) { return declare([BaseWidget], { baseClass: 'jimu-widget-RiskEarlyWarning', name: 'RiskEarlyWarning', // 记录右侧点击下标 ind: 0, btnClickInd: 0, btnInd: 0, arrOne: [], arrTwo: [], skzArr: [], hdzArr: [], flagfour: false, flagfive: false, flagsix: false, flagseven: false, // 记录导出 excel 文件名称 excelFileName: '山洪灾害' + '.xlsx', // 预测实时切换状态 forecastRealTime: true, mountainHandler: null, // 实时与预测状态切换开关阀 flag: false, // 代表勾选的哪几个 flagone: true, flagtwo: false, flagthree: false, // 代表的勾选项是否完成 completeone: false, completetwo: false, completethree: false, // 记录表格内元素 tableOneArr: [], entityOneContent: [], tableTwoArr: [], entityTwoContent: [], tableThreeArr: [], entityThreeContent: [], addOneEntitys: null, addTwoEntitys: null, addThreeEntitys: null, // 图例移动 isDown: false, x: 0, SpaceObj: null, y: 0, offset: null, moveThis: null, layerUi: null, layerDate: null, timesArray: [], msglayer: null, msgLoading: null, openOrClose: false, // 保存是18还是13库的变量,默认13 libraryNoOneEight: 13, riskEarlyWarningDate: null, startup: function () { var that = this; topic.subscribe("closeRiskEarlyWarning", lang.hitch(this, this.closeRiskEarlyWarning)); topic.subscribe("openRiskEarlyWarning", lang.hitch(this, this.openRiskEarlyWarning)); function loading() { // 加载中 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(1)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(1)').stop().show().siblings().stop().hide(); } function closeRealTime(e) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(' + e + ') div button').prop('disabled', 'disabled'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(' + e + ') div button').removeClass('navli-clk-change'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(' + e + ')>div>div>div').stop().hide(); } // 导出 excel 按钮事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .exportExcelFile').click(function () { if (that.excelFileName == '未选中.xlsx') return; var arr = [[]]; var showIndex = null; var divList = $('.jimu-widget-RiskEarlyWarning .table-box>div>div'); for (var i = 0; i < divList.length; i++) { if (!$(divList[i]).is(":hidden")) { showIndex = i; } } for (var i = 0; i < $('.jimu-widget-RiskEarlyWarning .table-box>div>div:eq(' + showIndex + ') .thead th').length - 1; i++) { arr[0].push($($('.jimu-widget-RiskEarlyWarning .table-box>div>div:eq(' + showIndex + ') .thead th')[i]).text()); } for (var i = 0; i < $('.jimu-widget-RiskEarlyWarning .table-box>div>div:eq(' + showIndex + ') .tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.jimu-widget-RiskEarlyWarning .table-box>div>div:eq(' + showIndex + ') .tbody tr')[i]).children('td').length - 1; j++) { arr[i + 1].push($($($('.jimu-widget-RiskEarlyWarning .table-box>div>div:eq(' + showIndex + ') .tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); // 主模块,父类得点击事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); that.layerLoad(); $(this).addClass('nav-active').children('ul').stop().show().end().children('div').stop().show().end().siblings().removeClass('nav-active').children('ul').stop().hide().end().children('div').stop().hide(); var ind = $(this).index(); var timeAvailable = that.getTimeAvailable(); loading(); that.btnInd = 0; // 所有图例全部隐藏 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image>div').stop().hide(); if (that.tableOneArr.length > 0) { that.clearOneAll(); } if (that.tableTwoArr.length > 0) { that.clearTwoAll(); } if (that.tableThreeArr.length > 0) { that.clearThreeAll(); } that.btnClickInd = $(this).index(); that.flag == false; $(this).find('ul li:eq(0)').children('input').prop('checked', true).end().siblings().children('input').prop('checked', false); that.flagone = false; that.flagtwo = false; that.flagthree = false; if (ind == 0) {//危险区 // 首次打开时,禁用实时预测选择 // closeRealTime(0); // $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .shzhtl').stop().show(); // that.flagone = true; // that.excelFileName = '山洪灾害' + '.xlsx'; // that.mountainFloodDisaster(timeAvailable.changeTime, timeAvailable.month); // that.childrenShowOne(); that.btnInd = 1 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').text('实时').stop().show().css('left', 0); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .shzhtl').stop().show(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); that.flagone = true that.excelFileName = '山洪灾害' + '.xlsx' that.mountainFloodDisaster(timeAvailable.changeTime, timeAvailable.month) that.childrenShowOne() } else if (ind == 1) {//风景区 that.btnInd = 1; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1)>div>div>div').text('实时').stop().show().css('left', 0); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .fjqswtl').stop().show(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); that.flagone = true; that.excelFileName = '风景区水位' + '.xlsx'; that.scenicSpot(timeAvailable.month, timeAvailable.dateTime); that.childrenShowOne(); } else if (ind == 2) {//监测站 // 首次打开时,禁用实时预测选择 // closeRealTime(2); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').text('实时').stop().show().css('left', 0); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .ylztl').stop().show(); that.flagone = true; that.excelFileName = '雨量站' + '.xlsx'; that.rainfallStation(timeAvailable.dateTime); that.childrenShowOne(); } } }); // 危险区子类得勾选事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul input').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { var time = that.getTime(); var timeAvailable = that.getTimeAvailable(); // $('#riskEarlyWarningDateChoice').val(that.getCurrentTime()); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); // 山洪灾害得复选框 if ($(this).parent().index() == 0) { // 勾选 if ($(this).prop('checked') == true) { that.layerLoad(); loading(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .shzhtl').stop().show(); that.flagone = true; that.excelFileName = '山洪灾害' + '.xlsx'; // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change') == false) { // 水库站加载实时函数 that.mountainFloodDisaster(timeAvailable.changeTime, timeAvailable.month) that.btnInd = 1 that.flag = false $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').addClass('navli-clk-change') $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').text('实时').css('left', 0).stop().show() } else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change')) { // 水库站加载实时函数 that.mountainFloodDisaster(timeAvailable.changeTime, timeAvailable.month) } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change')) { // 水库站加载预测函数 that.forecastMountainFloodDisaster(time.current) } } that.childrenShowOne() } // 未勾选 else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .shzhtl').stop().hide(); that.flagone = false; // 清除自身 that.clearOneAll(); // 判断主要河流是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(2) input').prop('checked') == true) { that.childrenShowThree() that.excelFileName = '主要河流' + '.xlsx' // 判断实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('主要河流') } } else { // 判断中小河流是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(1) input').prop('checked') == true) { that.childrenShowTwo() that.excelFileName = '中小河流' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('中小河流') } } else { closeRealTime(0) that.excelFileName = '未选中.xlsx'; } } } } // 中小河流得复选框 else if ($(this).parent().index() == 1) { // 勾选 if ($(this).prop('checked') == true) { that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .zxhltl').stop().show(); that.flagtwo = true; loading(); that.excelFileName = '中小河流' + '.xlsx'; // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change') == false) { that.mediumAndSmallRivers(timeAvailable.month, timeAvailable.dateTime); openRealTime(); } // 实时与预测其中有一个有选中效果 else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change')) { that.mediumAndSmallRivers(timeAvailable.month, timeAvailable.dateTime); } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change')) { that.forecastMediumAndSmallRivers(time.tomorrow, time.current); } } that.childrenShowTwo(); } // 未勾选 else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .zxhltl').stop().hide(); that.flagtwo = false; that.clearTwoAll(); // 判断主要河流是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(2) input').prop('checked') == true) { that.childrenShowThree() that.excelFileName = '主要河流' + '.xlsx' if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('主要河流') } } else { if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.childrenShowOne() that.excelFileName = '山洪灾害' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('山洪灾害') } } else { closeRealTime(0) that.excelFileName = '未选中.xlsx' } } } } // 主要河流得复选框 else if ($(this).parent().index() == 2) { if ($(this).prop('checked') == true) { that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .zyhltl').stop().show(); that.flagthree = true; loading(); that.excelFileName = '主要河流' + '.xlsx'; if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change') == false) { that.bigRiver(timeAvailable.month, timeAvailable.dateTime); openRealTime(); } else { if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').hasClass('navli-clk-change')) { that.bigRiver(timeAvailable.month, timeAvailable.dateTime); } else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(1)').hasClass('navli-clk-change')) { that.forecastBigRiver(time.tomorrow, time.current); } } that.childrenShowThree(); } else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .zyhltl').stop().hide(); that.flagthree = false; that.clearThreeAll(); // 判断中小河流是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(1) input').prop('checked') == true) { that.childrenShowTwo() that.excelFileName = '中小河流' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('中小河流') } } else { // 判断水库站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.childrenShowOne() that.excelFileName = '山洪灾害' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('山洪灾害') } } else { closeRealTime(0) that.excelFileName = '未选中.xlsx' } } } } function numOne() { closeRealTime(0); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.showLibraryOrDate(); that.childrenShowOne(); } else { that.excelFileName = '未选中.xlsx'; } } function numTwo() { that.childrenShowThree(); that.excelFileName = '主要河流' + '.xlsx'; if (that.btnInd == 1) { that.showLibraryOrDate(); } else if (that.btnInd == 2) { that.hideLibraryOrDate(); } } function numThree() { that.childrenShowTwo(); if (that.btnInd == 1) { that.showLibraryOrDate(); } else if (that.btnInd == 2) { that.hideLibraryOrDate(); } that.excelFileName = '中小河流' + '.xlsx'; } function openRealTime() { // 实时与预测都无选中效果 that.btnInd = 1; that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').addClass('navli-clk-change'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').text('实时').css('left', 0).stop().show(); } } }); // 危险区对应得实时与预测切换 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { if (that.btnInd == $(this).index()) return; that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); var time = that.getTime(); var timeAvailable = that.getTimeAvailable(); loading(); $(this).addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); that.clearOneAll() that.clearTwoAll(); that.clearThreeAll(); if ($(this).index() == 0) { that.showLibraryOrDate(); } else { if ($('#nav_menu>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.hideLibraryOrDate('山洪灾害') } else { that.hideLibraryOrDate('') } } // 实时 if ($(this).index() == 1) { that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').stop().animate({left: 0}, 200, 'linear', function () { $(this).text('实时'); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.mountainFloodDisaster(timeAvailable.dateTime, timeAvailable.month) } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(1) input').prop('checked') == true) { that.mediumAndSmallRivers(timeAvailable.month, timeAvailable.dateTime); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(2) input').prop('checked') == true) { that.bigRiver(timeAvailable.month, timeAvailable.dateTime); } } // 预测 else if ($(this).index() == 2) { that.flag = true; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').stop().animate({left: '50%'}, 200, 'linear', function () { $(this).text('预测'); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0) input').prop('checked') == true) { that.forecastMountainFloodDisaster(time.current) } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(1) input').prop('checked') == true) { that.forecastMediumAndSmallRivers(time.tomorrow, time.current); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(2) input').prop('checked') == true) { that.forecastBigRiver(time.tomorrow, time.current); } } that.btnInd = $(this).index(); } }); // 风景区子类得勾选事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul input').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { var time = that.getTime() var timeAvailable = that.getTimeAvailable(); // $('#riskEarlyWarningDateChoice').val(that.getCurrentTime()); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); // 水位勾选的事件函数 if ($(this).parent().index() == 0) { // 勾选 if ($(this).prop('checked') == true) { // 实时预测启用 that.layerLoad() loading() $('#fjqsw_tl').stop().show() that.flagone = true that.excelFileName = '风景区水位' + '.xlsx' // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(1)').hasClass('navli-clk-change') == false) { // 水库站加载实时函数 that.scenicSpot(timeAvailable.month, timeAvailable.dateTime) that.btnInd = 1 that.flag = false $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button').prop('disabled', false) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').addClass('navli-clk-change') $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1)>div>div>div').text('实时').css('left', 0).stop().show() } // 实时与预测其中有一个有选中效果 else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').hasClass('navli-clk-change')) { // 水库站加载实时函数 that.scenicSpot(timeAvailable.month, timeAvailable.dateTime) } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(1)').hasClass('navli-clk-change')) { // 水库站加载预测函数 that.forecastScenicSpot(time) } } that.childrenShowOne() } // 未勾选 else { $('#fjqsw_tl').stop().hide() that.flagone = false; that.clearOneAll(); // 判断风景区雨量站是否预警 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(1) input').prop('checked') == true) { that.childrenShowTwo() that.excelFileName = '风景区雨量' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('风景区雨量') } } else { closeRealTime(1) that.excelFileName = '未选中.xlsx' } } } // 雨量勾选的事件函数 else if ($(this).parent().index() == 1) { // 勾选 if ($(this).prop('checked') == true) { // 实时预测启用 that.layerLoad() loading(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .fjqyltl').stop().show(); that.flagtwo = true; that.excelFileName = '风景区雨量' + '.xlsx'; // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(1)').hasClass('navli-clk-change') == false) { // 水库站加载实时函数 that.rainfallInScenicSpots(timeAvailable.changeTime) that.btnInd = 1 that.flag = false $('#nav_menu>li:eq(1) div button').prop('disabled', false) $('#nav_menu>li:eq(1) div button:eq(0)').addClass('navli-clk-change') $('#nav_menu>li:eq(1)>div>div>div').text('实时').css('left', 0).stop().show() } // 实时与预测其中有一个有选中效果 else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(0)').hasClass('navli-clk-change')) { // 水库站加载实时函数 that.rainfallInScenicSpots(timeAvailable.changeTime) } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button:eq(1)').hasClass('navli-clk-change')) { // 水库站加载预测函数 that.forecastRainfallInScenicSpots(time.current) } } that.childrenShowTwo(); } // 未勾选 else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .fjqyltl').stop().hide(); that.flagtwo = false that.clearTwoAll() if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(0) input').prop('checked') == true) { that.childrenShowOne() that.excelFileName = '风景区水位' + '.xlsx' if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('风景区水位') } } else { closeRealTime(1) that.excelFileName = '未选中.xlsx' } } } } }); // 风景区对应得实时与预测切换 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) div button').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { if (that.btnInd == $(this).index()) return; that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); var time = that.getTime(); var timeAvailable = that.getTimeAvailable(); loading(); $(this).addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); that.clearOneAll(); that.clearTwoAll(); if ($(this).index() == 0) { that.showLibraryOrDate(); } else { if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(0) input').prop('checked') == true) { that.hideLibraryOrDate('风景区水位') } else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(1) input').prop('checked') == true) { that.hideLibraryOrDate('风景区雨量') } } // 实时 if ($(this).index() == 1) { that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1)>div>div>div').stop().animate({left: 0}, 200, 'linear', function () { $(this).text('实时'); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(0) input').prop('checked') == true) { that.scenicSpot(timeAvailable.month, timeAvailable.dateTime); } } // 预测 else if ($(this).index() == 2) { console.log(1); that.flag = true; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1)>div>div>div').stop().animate({left: '50%'}, 200, 'linear', function () { $(this).text('预测'); console.log(2); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(0) input').prop('checked') == true) { that.forecastScenicSpot(time); console.log(3); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(1) ul li:eq(1) input').prop('checked') == true) { that.forecastRainfallInScenicSpots(time.current) } } that.btnInd = $(this).index(); } }); // 监测站子类得勾选事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul input').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { var time = that.getTime(); var timeAvailable = that.getTimeAvailable(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); // 雨量站的复选框 if ($(this).parent().index() == 0) { // 勾选 if ($(this).prop('checked') == true) { that.layerLoad() loading() $('#ylz_tl').stop().show() that.flagone = true that.excelFileName = '雨量站' + '.xlsx' $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .ylztl').stop().show(); // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change') == false) { // 水库站加载实时函数 that.rainfallStation(timeAvailable.dateTime) that.btnInd = 1 that.flag = false $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').prop('disabled', false) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').addClass('navli-clk-change') $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').text('实时').css('left', 0).stop().show() } // 实时与预测其中有一个有选中效果 else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change')) { // 水库站加载实时函数 that.rainfallStation(timeAvailable.dateTime) } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change')) { // 水库站加载预测函数 that.forecastRainfallStation(time.current) } } that.childrenShowOne() } // 未勾选 else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .ylztl').stop().hide(); that.flagone = false; // 清除自身 that.clearOneAll(); // 判断河道站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(2) input').prop('checked') == true) { that.childrenShowThree(); that.excelFileName = '河道站' + '.xlsx'; // 判断实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate(); } else if (that.btnInd == 2) { that.hideLibraryOrDate(); } } else { // 判断水库站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(1) input').prop('checked') == true) { that.childrenShowTwo(); that.excelFileName = '水库站' + '.xlsx'; // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate(); } else if (that.btnInd == 2) { that.hideLibraryOrDate(); } } else { closeRealTime(2) that.excelFileName = '未选中.xlsx'; } } } } // 水库站的复选框 else if ($(this).parent().index() == 1) { // 勾选 if ($(this).prop('checked') == true) { that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .skztl').stop().show(); that.flagtwo = true; loading(); that.excelFileName = '水库站' + '.xlsx'; // 实时与预测都无选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change') == false) { // 水库站加载实时函数 that.reservoirStation(timeAvailable.month, timeAvailable.dateTime); that.btnInd = 1; that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').prop('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').addClass('navli-clk-change'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').text('实时').css('left', 0).stop().show(); } // 实时与预测其中有一个有选中效果 else { // 实时有选中效果 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change')) { // 水库站加载实时函数 that.reservoirStation(timeAvailable.month, timeAvailable.dateTime); } // 预测有选中效果 else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change')) { // 水库站加载预测函数 that.forecastReservoirStation(time); } } that.childrenShowTwo(); } // 未勾选 else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .skztl').stop().hide(); that.flagtwo = false; that.clearTwoAll(); // 判断河道站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(2) input').prop('checked') == true) { that.childrenShowThree() that.excelFileName = '河道站' + '.xlsx' if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('河道站') } } else { // 判断雨量站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(0) input').prop('checked') == true) { that.childrenShowOne() that.excelFileName = '雨量站' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('雨量站') } } else { closeRealTime(2) that.excelFileName = '未选中.xlsx'; } } } } // 河道站的复选框 else if ($(this).parent().index() == 2) { if ($(this).prop('checked') == true) { that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .hdztl').stop().show(); that.flagthree = true; loading(); that.excelFileName = '河道站' + '.xlsx'; if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change') == false && $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change') == false) { that.riverStation(timeAvailable.month, timeAvailable.dateTime); that.btnInd = 1; that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').attr('disabled', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').addClass('navli-clk-change'); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').text('实时').css('left', 0).stop().show(); } else { if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(0)').hasClass('navli-clk-change')) { that.riverStation(timeAvailable.month, timeAvailable.dateTime); } else if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button:eq(1)').hasClass('navli-clk-change')) { that.forecastRiverStation(time); } } that.childrenShowThree(); } else { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .hdztl').stop().hide(); that.flagthree = false; that.clearThreeAll(); // 判断水库站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(1) input').prop('checked') == true) { that.childrenShowTwo(); // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate(); } else if (that.btnInd == 2) { that.hideLibraryOrDate('水库站') } } else { // 判断雨量站是否勾选 if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(0) input').prop('checked') == true) { that.childrenShowOne() that.excelFileName = '雨量站' + '.xlsx' // 判断是实时还是预测 if (that.btnInd == 1) { that.showLibraryOrDate() } else if (that.btnInd == 2) { that.hideLibraryOrDate('雨量站') } } else { closeRealTime(2) that.excelFileName = '未选中.xlsx'; } } } } } }); // 监测站对应得实时与预测切换 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) div button').click(function (event) { event.stopPropagation(); if (event.target == event.currentTarget) { if (that.btnInd == $(this).index()) return; that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) p').scrollTop(0); var time = that.getTime(); var timeAvailable = that.getTimeAvailable(); loading(); $(this).addClass('navli-clk-change').siblings().removeClass('navli-clk-change'); that.clearOneAll() that.clearTwoAll(); that.clearThreeAll(); if ($(this).index() == 0) { that.showLibraryOrDate(); } else { if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(0) input').prop('checked') == true) { that.hideLibraryOrDate('雨量站') } else { that.hideLibraryOrDate('') } } // 实时 if ($(this).index() == 1) { that.flag = false; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').stop().animate({left: 0}, 200, 'linear', function () { $(this).text('实时'); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(0) input').prop('checked') == true) { that.rainfallStation(timeAvailable.dateTime) } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(1) input').prop('checked') == true) { that.reservoirStation(timeAvailable.month, timeAvailable.dateTime); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(2) input').prop('checked') == true) { that.riverStation(timeAvailable.month, timeAvailable.dateTime); } } // 预测 else if ($(this).index() == 2) { that.flag = true; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2)>div>div>div').stop().animate({left: '50%'}, 200, 'linear', function () { $(this).text('预测'); }); if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(0) input').prop('checked') == true) { that.forecastRainfallStation(time.current); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(1) input').prop('checked') == true) { that.forecastReservoirStation(time); } if ($('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(2) ul li:eq(2) input').prop('checked') == true) { that.forecastRiverStation(time); } } that.btnInd = $(this).index(); } }); // 短信的点击事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom').on('click', '.tbody input', function (event) { layer.config({ extend: 'myskin/style.css' }); // 获取点击元素的类名 var inputClassName = $(this).attr('class'); //layer.msg('hello'); var year = null; var month = null; var day = null; var hour = null; if (that.btnInd == 0) { if ($('.early-warning-date').is(':hidden')) { var date = new Date(); //实例一个时间对象; year = date.getFullYear(); //获取系统的年; month = date.getMonth() + 1; //获取系统月份,由于月份是从0开始计算,所以要加1 day = date.getDate(); hour = date.getHours(); } else { var changeTime = $('#riskEarlyWarningDateChoice').val(); year = changeTime.substr(0, 4); //获取系统的年; month = changeTime.substr(5, 2); //获取系统月份,由于月份是从0开始计算,所以要加1 day = changeTime.substr(8, 2); hour = changeTime.substr(11, 2); } } else if (that.btnInd == 1) { var date = new Date(Date.parse(new Date()) - 60 * 60 * 24 * 1000); //实例一个时间对象; year = date.getFullYear(); //获取系统的年; month = date.getMonth() + 1; //获取系统月份,由于月份是从0开始计算,所以要加1 day = date.getDate(); hour = date.getHours(); } else if (that.btnInd == 2) { var date = new Date(); //实例一个时间对象; year = date.getFullYear(); //获取系统的年; month = date.getMonth() + 1; //获取系统月份,由于月份是从0开始计算,所以要加1 day = date.getDate(); hour = date.getHours(); } // 获取点击元素所在行的行政县 var county = $($(this).parent().parent().children()[0]).text(); if (inputClassName == 'shzh-dx') { var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0, r = 0, rr = 0; var text = null; if (county == '赣州市') { for (var i = 0; i < that.entityOneContent.length; i++) { text = that.entityOneContent[i].List.township + that.entityOneContent[i].List.village + that.entityOneContent[i].List.village_group; if (that.entityOneContent[i].Max == 1) { e += text + '、'; r += parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)); a += 1; } else if (that.entityOneContent[i].Max == 2) { f += text + '、'; rr += parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)); b += 1; } j += 1; } } else { for (var i = 0; i < that.entityOneContent.length; i++) { text = that.entityOneContent[i].List.township + that.entityOneContent[i].List.village + that.entityOneContent[i].List.village_group; if (that.entityOneContent[i].List.county == county) { if (that.entityOneContent[i].Max == 1) { e += text + '、'; r += parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)); a += 1; } else if (that.entityOneContent[i].Max == 2) { f += text + '、'; rr += parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)); b += 1; } j += 1; } } } if (a != 0 || b != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u5C71\u6D2A\u707E\u5BB3\u5371\u9669\u533A\u4E2D' + (a > 0 ? ',有准备转移点' + a + '个(' + e.substr(0, e.length - 1) + ')' : '') + (b > 0 ? ',有立即转移点' + b + '个(' + f.substr(0, f.length - 1) + '),' : ',') + ((r + rr) > 0 ? '共涉及人口' + (r + rr) + '人。' : '') + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } else if (inputClassName == 'skz-dx') { // 水库站的短信点击事件 that.createLayerShortMessageContent(that.entityTwoContent, county, '水库站', year, month, day, hour, 'yj', 'STNM'); } else if (inputClassName == 'hdz-dx') { // 河道站的短信点击事件 that.createLayerShortMessageContent(that.entityThreeContent, county, '河道站', year, month, day, hour, 'yuc', 'STNM'); } else if (inputClassName == 'zyhl-dx') { // 主要河流的短信点击事件 var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0, rkhz = 0, fwhz = 0, gdhz = 0; var text = null; if (county == '赣州市') { for (var i = 0; i < that.entityThreeContent.length; i++) { text = that.entityThreeContent[i].List.township + that.entityThreeContent[i].List.village + (that.entityThreeContent[i].List.villagegroup == undefined ? '' : that.entityThreeContent[i].List.villagegroup); if (that.entityThreeContent[i].yj == '蓝色预警') { e += text + '、'; a += 1; } else if (that.entityThreeContent[i].yj == '黄色预警') { f += text + '、'; b += 1; } else if (that.entityThreeContent[i].yj == '橙色预警') { g += text + '、'; c += 1; } else if (that.entityThreeContent[i].yj == '红色预警') { h += text + '、'; d += 1; } if (that.entityThreeContent[i].yj == '蓝色预警' || that.entityThreeContent[i].yj == '黄色预警' || that.entityThreeContent[i].yj == '橙色预警' || that.entityThreeContent[i].yj == '红色预警') { rkhz += ((that.entityThreeContent[i].List.fpopulation ? parseInt(Number(that.entityThreeContent[i].List.fpopulation)) : 0) + (that.entityThreeContent[i].List.tpopulation ? parseInt(Number(that.entityThreeContent[i].List.tpopulation)) : 0) + (that.entityThreeContent[i].List.ftpopulation ? parseInt(Number(that.entityThreeContent[i].List.ftpopulation)) : 0)) fwhz += ((that.entityThreeContent[i].List.fhouseholds ? Number(that.entityThreeContent[i].List.fhouseholds) : 0) + (that.entityThreeContent[i].List.thouseholds ? Number(that.entityThreeContent[i].List.thouseholds) : 0) + (that.entityThreeContent[i].List.fthouseholds ? Number(that.entityThreeContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityThreeContent[i].List.ftill ? Number(that.entityThreeContent[i].List.ftill) : 0) + (that.entityThreeContent[i].List.tTill ? Number(that.entityThreeContent[i].List.tTill) : 0) + (that.entityThreeContent[i].List.fttill ? Number(that.entityThreeContent[i].List.fttill) : 0)); } j += 1; } } else { for (var i = 0; i < that.entityThreeContent.length; i++) { text = that.entityThreeContent[i].List.township + that.entityThreeContent[i].List.village + (that.entityThreeContent[i].List.villagegroup == undefined ? '' : that.entityThreeContent[i].List.villagegroup); if (that.entityThreeContent[i].List.district == county) { if (that.entityThreeContent[i].yj == '蓝色预警') { e += text + '、'; a += 1; } else if (that.entityThreeContent[i].yj == '黄色预警') { f += text + '、'; b += 1; } else if (that.entityThreeContent[i].yj == '橙色预警') { g += text + '、'; c += 1; } else if (that.entityThreeContent[i].yj == '红色预警') { h += text + '、'; d += 1; } if (that.entityThreeContent[i].yj == '蓝色预警' || that.entityThreeContent[i].yj == '黄色预警' || that.entityThreeContent[i].yj == '橙色预警' || that.entityThreeContent[i].yj == '红色预警') { rkhz += ((that.entityThreeContent[i].List.fpopulation ? parseInt(Number(that.entityThreeContent[i].List.fpopulation)) : 0) + (that.entityThreeContent[i].List.tpopulation ? parseInt(Number(that.entityThreeContent[i].List.tpopulation)) : 0) + (that.entityThreeContent[i].List.ftpopulation ? parseInt(Number(that.entityThreeContent[i].List.ftpopulation)) : 0)) fwhz += ((that.entityThreeContent[i].List.fhouseholds ? Number(that.entityThreeContent[i].List.fhouseholds) : 0) + (that.entityThreeContent[i].List.thouseholds ? Number(that.entityThreeContent[i].List.thouseholds) : 0) + (that.entityThreeContent[i].List.fthouseholds ? Number(that.entityThreeContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityThreeContent[i].List.ftill ? Number(that.entityThreeContent[i].List.ftill) : 0) + (that.entityThreeContent[i].List.tTill ? Number(that.entityThreeContent[i].List.tTill) : 0) + (that.entityThreeContent[i].List.fttill ? Number(that.entityThreeContent[i].List.fttill) : 0)); } j += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u4E3B\u8981\u6CB3\u6D41\u5371\u9669\u533A\u4E2D' + (a > 0 ? ',有' + a + '个危险区(' + e.substr(0, e.length - 1) + ')达到蓝色预警' : '') + ' ' + (b > 0 ? ',有' + b + '个危险区(' + f.substr(0, f.length - 1) + ')达到黄色预警' : '') + ' ' + (c > 0 ? ',有' + c + '个危险区(' + g.substr(0, g.length - 1) + ')达到橙色预警' : '') + ' ' + (d > 0 ? ',有' + d + '个危险区(' + h.substr(0, h.length - 1) + ')达到红色预警,' : ',') + '共涉及人口' + rkhz + '人、房屋' + fwhz + '座、耕地' + gdhz.toFixed(2) + '亩。' + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } else if (inputClassName == 'zxhl-dx') { // 主要河流的短信点击事件 var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0, rkhz = 0, fwhz = 0, gdhz = 0; var text = null; if (county == '赣州市') { for (var i = 0; i < that.entityTwoContent.length; i++) { text = that.entityTwoContent[i].List.township + that.entityTwoContent[i].List.village + (that.entityTwoContent[i].List.villagegroup == undefined ? '' : that.entityTwoContent[i].List.villagegroup); var tyxb = 0; if (that.entityTwoContent[i].yj == '蓝色预警') { tyxb = 1; e += text + '、'; a += 1; } else if (that.entityTwoContent[i].yj == '黄色预警') { tyxb = 1; f += text + '、'; b += 1; } else if (that.entityTwoContent[i].yj == '橙色预警') { tyxb = 1; g += text + '、'; c += 1; } else if (that.entityTwoContent[i].yj == '红色预警') { tyxb = 1; h += text + '、'; d += 1; } if (tyxb == 1) { rkhz += ((that.entityTwoContent[i].List.fpopulation ? parseInt(Number(that.entityTwoContent[i].List.fpopulation)) : 0) + (that.entityTwoContent[i].List.tpopulation ? parseInt(Number(that.entityTwoContent[i].List.tpopulation)) : 0) + (that.entityTwoContent[i].List.ftpopulation ? parseInt(Number(that.entityTwoContent[i].List.ftpopulation)) : 0)); fwhz += ((that.entityTwoContent[i].List.fhouseholds ? Number(that.entityTwoContent[i].List.fhouseholds) : 0) + (that.entityTwoContent[i].List.thouseholds ? Number(that.entityTwoContent[i].List.thouseholds) : 0) + (that.entityTwoContent[i].List.fthouseholds ? Number(that.entityTwoContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityTwoContent[i].List.ftill ? Number(that.entityTwoContent[i].List.ftill) : 0) + (that.entityTwoContent[i].List.tTill ? Number(that.entityTwoContent[i].List.tTill) : 0) + (that.entityTwoContent[i].List.fttill ? Number(that.entityTwoContent[i].List.fttill) : 0)); } tyxb = 0; j += 1; } } else { for (var i = 0; i < that.entityTwoContent.length; i++) { text = that.entityTwoContent[i].List.township + that.entityTwoContent[i].List.village + (that.entityTwoContent[i].List.villagegroup == undefined ? '' : that.entityTwoContent[i].List.villagegroup); if (that.entityTwoContent[i].List.district == county) { var tyxb = 0; if (that.entityTwoContent[i].yj == '蓝色预警') { tyxb = 1; e += text + '、'; a += 1; } else if (that.entityTwoContent[i].yj == '黄色预警') { tyxb = 1; f += text + '、'; b += 1; } else if (that.entityTwoContent[i].yj == '橙色预警') { tyxb = 1; g += text + '、'; c += 1; } else if (that.entityTwoContent[i].yj == '红色预警') { tyxb = 1; h += text + '、'; d += 1; } if (tyxb == 1) { rkhz += ((that.entityTwoContent[i].List.fpopulation ? parseInt(Number(that.entityTwoContent[i].List.fpopulation)) : 0) + (that.entityTwoContent[i].List.tpopulation ? parseInt(Number(that.entityTwoContent[i].List.tpopulation)) : 0) + (that.entityTwoContent[i].List.ftpopulation ? parseInt(Number(that.entityTwoContent[i].List.ftpopulation)) : 0)); fwhz += ((that.entityTwoContent[i].List.fhouseholds ? Number(that.entityTwoContent[i].List.fhouseholds) : 0) + (that.entityTwoContent[i].List.thouseholds ? Number(that.entityTwoContent[i].List.thouseholds) : 0) + (that.entityTwoContent[i].List.fthouseholds ? Number(that.entityTwoContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityTwoContent[i].List.ftill ? Number(that.entityTwoContent[i].List.ftill) : 0) + (that.entityTwoContent[i].List.tTill ? Number(that.entityTwoContent[i].List.tTill) : 0) + (that.entityTwoContent[i].List.fttill ? Number(that.entityTwoContent[i].List.fttill) : 0)); } tyxb = 0; j += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u4E2D\u5C0F\u6CB3\u6D41\u5371\u9669\u533A\u4E2D' + (a > 0 ? ',有' + a + '个危险区(' + e.substr(0, e.length - 1) + ')达到蓝色预警' : '') + ' ' + (b > 0 ? ',有' + b + '个危险区(' + f.substr(0, f.length - 1) + ')达到黄色预警' : '') + ' ' + (c > 0 ? ',有' + c + '个危险区(' + g.substr(0, g.length - 1) + ')达到橙色预警' : '') + ' ' + (d > 0 ? ',有' + d + '个危险区(' + h.substr(0, h.length - 1) + ')达到红色预警,' : ',') + '共涉及人口' + rkhz + '人、房屋' + fwhz + '座、耕地' + gdhz.toFixed(2) + '亩。' + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } else if (inputClassName == 'ylz-dx') { // 雨量站的短信点击事件 var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0; var text = null; if (county == '赣州市') { for (var i = 0; i < that.entityOneContent.length; i++) { text = that.entityOneContent[i].STLC; if (that.entityOneContent[i].YJ == '一级预警') { e += text + '、'; a += 1; } else if (that.entityOneContent[i].YJ == '二级预警') { f += text + '、'; b += 1; } else if (that.entityOneContent[i].YJ == '三级预警') { g += text + '、'; c += 1; } j += 1; } } else { for (var i = 0; i < that.entityOneContent.length; i++) { text = that.entityOneContent[i].STLC; if (that.entityOneContent[i].ADDVCD5 == county) { if (that.entityOneContent[i].YJ == '一级预警') { e += text + '、'; a += 1; } else if (that.entityOneContent[i].YJ == '二级预警') { f += text + '、'; b += 1; } else if (that.entityOneContent[i].YJ == '三级预警') { g += text + '、'; c += 1; } j += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u96E8\u91CF\u7AD9\u4E2D' + (a > 0 ? ',有' + a + '个站(' + e.substr(0, e.length - 1) + ')达到一级预警' : '') + ' ' + (b > 0 ? ',有' + b + '个站(' + f.substr(0, f.length - 1) + ')达到二级预警' : '') + ' ' + (c > 0 ? ',有' + c + '个站(' + g.substr(0, g.length - 1) + ')达到三级预警。' : '。') + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } else if (inputClassName == 'fjq-dx') { // 水库站的短信点击事件 var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0, aa = 0, ee = 0, ff = 0, bb = 0, gg = 0, cc = 0, hh = 0, dd = 0, jj = 0; if (county == '赣州市') { for (var i = 0; i < that.skzArr.length; i++) { if (that.skzArr[i].yj == '蓝色预警') { e += that.skzArr[i].spotname + '风景区、'; a += 1; } else if (that.skzArr[i].yj == '黄色预警') { f += that.skzArr[i].spotname + '风景区、'; b += 1; } else if (that.skzArr[i].yj == '橙色预警') { g += that.skzArr[i].spotname + '风景区、'; c += 1; } else if (that.skzArr[i].yj == '红色预警') { h += that.skzArr[i].spotname + '风景区、'; d += 1; } j += 1; } for (var i = 0; i < that.hdzArr.length; i++) { if (that.hdzArr[i].yuc == '蓝色预警') { ee += that.hdzArr[i].spotname + '、'; aa += 1; } else if (that.hdzArr[i].yuc == '黄色预警') { ff += that.hdzArr[i].spotname + '、'; bb += 1; } else if (that.hdzArr[i].yuc == '橙色预警') { gg += that.hdzArr[i].spotname + '、'; cc += 1; } else if (that.hdzArr[i].yuc == '红色预警') { hh += that.hdzArr[i].spotname + '、'; dd += 1; } jj += 1; } } else { for (var i = 0; i < that.skzArr.length; i++) { if (county == that.skzArr[i].county) { if (that.skzArr[i].yj == '蓝色预警') { e += that.skzArr[i].spotname + '、'; a += 1; } else if (that.skzArr[i].yj == '黄色预警') { f += that.skzArr[i].spotname + '、'; b += 1; } else if (that.skzArr[i].yj == '橙色预警') { g += that.skzArr[i].spotname + '、'; c += 1; } else if (that.skzArr[i].yj == '红色预警') { h += that.skzArr[i].spotname + '、'; d += 1; } j += 1; } } for (var i = 0; i < that.hdzArr.length; i++) { if (county == that.hdzArr[i].county) { if (that.hdzArr[i].yuc == '蓝色预警') { ee += that.hdzArr[i].spotname + '、'; aa += 1; } else if (that.hdzArr[i].yuc == '黄色预警') { ff += that.hdzArr[i].spotname + '、'; bb += 1; } else if (that.hdzArr[i].yuc == '橙色预警') { gg += that.hdzArr[i].spotname + '、'; cc += 1; } else if (that.hdzArr[i].yuc == '红色预警') { hh += that.hdzArr[i].spotname + '、'; dd += 1; } jj += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0 || aa != 0 || bb != 0 || cc != 0 || dd != 0) { var skzcontent = null; var hdzcontent = null; if (a != 0 || b != 0 || c != 0 || d != 0) { skzcontent = year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u5173\u8054\u6C34\u5E93\u7AD9\u98CE\u666F\u533A\u4E2D' + (a > 0 ? ',有' + a + '个站点(' + e.substr(0, e.length - 1) + ')达到蓝色预警' : '') + ' ' + (b > 0 ? ',有' + b + '个站点(' + f.substr(0, f.length - 1) + ')达到黄色预警' : '') + ' ' + (c > 0 ? ',有' + c + '个站点(' + g.substr(0, g.length - 1) + ')达到橙色预警' : '') + ' ' + (d > 0 ? ',有' + d + '个站点(' + h.substr(0, h.length - 1) + ')达到红色预警。' : '。'); } else { skzcontent = ''; } if (aa != 0 || bb != 0 || cc != 0 || dd != 0) { hdzcontent = year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + jj + '\u4E2A\u5173\u8054\u6CB3\u9053\u7AD9\u98CE\u666F\u533A\u4E2D' + (aa > 0 ? ',有' + aa + '个站点(' + ee.substr(0, ee.length - 1) + ')达到蓝色预警' : '') + ' ' + (bb > 0 ? ',有' + bb + '个站点(' + ff.substr(0, ff.length - 1) + ')达到黄色预警' : '') + ' ' + (cc > 0 ? ',有' + cc + '个站点(' + gg.substr(0, gg.length - 1) + ')达到橙色预警' : '') + ' ' + (dd > 0 ? ',有' + dd + '个站点(' + hh.substr(0, hh.length - 1) + ')达到红色预警。' : '。'); } else { hdzcontent = ''; } layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

  ' + skzcontent + '
  ' + hdzcontent + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } else if (inputClassName == 'fjq-ylz-dx') { // 雨量站的短信点击事件 var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0; var text = null; if (county == '赣州市') { for (var i = 0; i < that.entityTwoContent.length; i++) { text = that.entityTwoContent[i].spotname; if (that.entityTwoContent[i].YJ == '一级预警') { e += text + '、'; a += 1; } else if (that.entityTwoContent[i].YJ == '二级预警') { f += text + '、'; b += 1; } else if (that.entityTwoContent[i].YJ == '三级预警') { g += text + '、'; c += 1; } j += 1; } } else { for (var i = 0; i < that.entityTwoContent.length; i++) { text = that.entityTwoContent[i].spotname; if (that.entityTwoContent[i].county == county) { if (that.entityTwoContent[i].YJ == '一级预警') { e += text + '、'; a += 1; } else if (that.entityTwoContent[i].YJ == '二级预警') { f += text + '、'; b += 1; } else if (that.entityTwoContent[i].YJ == '三级预警') { g += text + '、'; c += 1; } j += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A\u5173\u8054\u96E8\u91CF\u7AD9\u7684\u98CE\u666F\u533A\u4E2D' + (a > 0 ? ',有' + a + '个站(' + e.substr(0, e.length - 1) + ')达到一级预警' : '') + ' ' + (b > 0 ? ',有' + b + '个站(' + f.substr(0, f.length - 1) + ')达到二级预警' : '') + ' ' + (c > 0 ? ',有' + c + '个站(' + g.substr(0, g.length - 1) + ')达到三级预警。' : '。') + '

', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } } }); // 表格内td的点击事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom').on('click', '.tbody td', function () { // 获取td类名 var className = $(this).attr('class'); // 获取td所在行的行政县名称 var county = $(this).parent().children('.yj-county').text(); var num = $(this).text(); if (className != undefined && num > 0) { $('.layui-layer').addClass('fxyj-layui-layer'); layer.config({ extend: 'myskin/style.css' }); var ind = 0; var index = $(this).index(); var ealyWaringType = ''; var tableList = $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)>div'); for (var i = 0; i < tableList.length; i++) { if (!$(tableList[i]).is(':hidden')) { ealyWaringType = $(tableList[i]).find('table tr th:eq(' + index + ')').text(); } } if (ealyWaringType == '红色' || ealyWaringType == '黄色' || ealyWaringType == '蓝色' || ealyWaringType == '橙色') { ealyWaringType = ealyWaringType + '预警'; } var table = $("
"); var tbody = $(""); if (className == 'skz-red' || className == 'skz-blue' || className == 'skz-yellow' || className == 'skz-orange' || className == 'skz-skz') { var waterLevel; if (that.btnInd == 2) { waterLevel = '预测水位'; } else if (that.btnInd == 1) { waterLevel = '实时水位'; } var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u6C34\u5E93\u540D\u79F0 \u6CB3\u540D \u5730\u5740 ' + waterLevel + '(m) \u6C5B\u9650\u6C34\u4F4D(m) \u9632\u6D2A\u9AD8\u6C34\u4F4D(m) \u8BBE\u8BA1\u6C34\u4F4D(m) \u9884\u8B66\u7EA7\u522B \n\t\t\t\t\t\t\t '); table.append(thead); console.log(county, that.entityTwoContent); for (var i = 0; i < that.entityTwoContent.length; i++) { if (county == '赣州市' && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || that.entityTwoContent[i].ADDVCD5 == county && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || county == '赣州市' && className == 'skz-skz' || that.entityTwoContent[i].ADDVCD5 == county && className == 'skz-skz') { tbody.append($(' ' + (ind += 1) + ' ' + that.entityTwoContent[i].ADDVCD5 + ' ' + that.entityTwoContent[i].STNM + ' ' + that.entityTwoContent[i].RVNM + ' ' + that.entityTwoContent[i].STLC + ' ' + Number(Number(that.entityTwoContent[i].RZ).toFixed(2)) + ' ' + Number(Number(that.entityTwoContent[i].FSLTDZ).toFixed(2)) + ' ' + Number(Number(that.entityTwoContent[i].NORMZ).toFixed(2)) + ' ' + Number(Number(that.entityTwoContent[i].DSFLZ).toFixed(2)) + ' ' + (that.entityTwoContent[i].yj ? that.entityTwoContent[i].yj : that.entityTwoContent[i].yuc) + ' ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'hdz-red' || className == 'hdz-blue' || className == 'hdz-yellow' || className == 'hdz-orange' || className == 'hdz-swz') { var waterLevel; if (that.btnInd == 2) { waterLevel = '预测水位'; } else if (that.btnInd == 1) { waterLevel = '实时水位'; } var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u6C34\u4F4D\u7AD9\u540D\u79F0 \u6CB3\u540D \u5730\u5740 ' + waterLevel + '(m) \u8B66\u6212\u6C34\u4F4D(m) \u9884\u8B66\u7EA7\u522B \n\t\t\t\t\t\t\t '); table.append(thead); for (var i = 0; i < that.entityThreeContent.length; i++) { if (county == '赣州市' && that.entityThreeContent[i].yuc && that.entityThreeContent[i].yuc == ealyWaringType || that.entityThreeContent[i].ADDVCD5 == county && that.entityThreeContent[i].yuc && that.entityThreeContent[i].yuc == ealyWaringType || county == '赣州市' && className == 'hdz-swz' || that.entityThreeContent[i].ADDVCD5 == county && className == 'hdz-swz') { tbody.append($(' ' + (ind += 1) + ' ' + that.entityThreeContent[i].ADDVCD5 + ' ' + that.entityThreeContent[i].STNM + ' ' + that.entityThreeContent[i].RVNM + ' ' + that.entityThreeContent[i].STLC + ' ' + Number(Number(that.entityThreeContent[i].Z).toFixed(2)) + ' ' + Number(Number(that.entityThreeContent[i].WRZ).toFixed(2)) + ' ' + that.entityThreeContent[i].yuc + ' ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'zxhl-red' || className == 'zxhl-blue' || className == 'zxhl-yellow' || className == 'zxhl-orange' || className == 'zxhl-wxq') { var waterLevel; if (that.btnInd == 2) { waterLevel = '预测河道水位'; } else if (that.btnInd == 1) { waterLevel = '实时河道水位'; } var table = $("
"); var thead = $(' \t \t\t \u5E8F\u53F7 \t\t \u6C34\u6587(\u4F4D)\u7AD9 \t\t \u6CB3\u540D \t\t \u53BF(\u533A) \t\t \u4E61\u9547 \t\t \u884C\u653F\u6751 \t\t \u6751\u5C0F\u7EC4 \t\t ' + waterLevel + '(m) \t\t \u6210\u707E\u6C34\u4F4D(m) \t\t \u4EBA\u53E3(\u4EBA) \t\t \u623F\u5C4B(\u5EA7) \t\t \u8015\u5730(\u4EA9) \t '); table.append(thead); var tbody = $(""); var rkhz = 0; var fwhz = 0; var gdhz = 0; for (var i = 0; i < that.entityTwoContent.length; i++) { if (county == '赣州市' && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || that.entityTwoContent[i].List.district == county && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || county == '赣州市' && className == 'zxhl-wxq' || county == that.entityTwoContent[i].List.district && className == 'zxhl-wxq') { rkhz += ((that.entityTwoContent[i].List.fpopulation ? parseInt(Number(that.entityTwoContent[i].List.fpopulation)) : 0) + (that.entityTwoContent[i].List.tpopulation ? parseInt(Number(that.entityTwoContent[i].List.tpopulation)) : 0) + (that.entityTwoContent[i].List.ftpopulation ? parseInt(Number(that.entityTwoContent[i].List.ftpopulation)) : 0)); fwhz += ((that.entityTwoContent[i].List.fhouseholds ? Number(that.entityTwoContent[i].List.fhouseholds) : 0) + (that.entityTwoContent[i].List.thouseholds ? Number(that.entityTwoContent[i].List.thouseholds) : 0) + (that.entityTwoContent[i].List.fthouseholds ? Number(that.entityTwoContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityTwoContent[i].List.ftill ? Number(that.entityTwoContent[i].List.ftill) : 0) + (that.entityTwoContent[i].List.tTill ? Number(that.entityTwoContent[i].List.tTill) : 0) + (that.entityTwoContent[i].List.fttill ? Number(that.entityTwoContent[i].List.fttill) : 0)); } } var wxqxb = 0; for (var i = 0; i < that.entityTwoContent.length; i++) { if (county == '赣州市' && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || that.entityTwoContent[i].List.district == county && that.entityTwoContent[i].yj && that.entityTwoContent[i].yj == ealyWaringType || county == '赣州市' && className == 'zxhl-wxq' || county == that.entityTwoContent[i].List.district && className == 'zxhl-wxq') { if (wxqxb == 0) { wxqxb = 1; tbody.append($(' \t\t ' + (ind += 1) + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + county + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + rkhz + ' \t\t ' + fwhz + ' \t\t ' + gdhz.toFixed(2) + ' \t ')); } tbody.append($(' \t\t ' + (ind += 1) + ' \t\t ' + that.entityTwoContent[i].List.STNM + ' \t\t ' + that.entityTwoContent[i].List.river_name + ' \t\t ' + that.entityTwoContent[i].List.district + ' \t\t ' + that.entityTwoContent[i].List.township + ' \t\t ' + that.entityTwoContent[i].List.village + ' \t\t ' + (that.entityTwoContent[i].List.villagegroup == undefined ? '' : that.entityTwoContent[i].List.villagegroup) + ' \t\t ' + Number(Number(that.entityTwoContent[i].List.aDouble).toFixed(2)) + ' \t\t ' + Number(Number(that.entityTwoContent[i].List.hz).toFixed(2)) + ' \t\t ' + ((that.entityTwoContent[i].List.fpopulation ? parseInt(Number(that.entityTwoContent[i].List.fpopulation)) : 0) + (that.entityTwoContent[i].List.tpopulation ? parseInt(Number(that.entityTwoContent[i].List.tpopulation)) : 0) + (that.entityTwoContent[i].List.ftpopulation ? parseInt(Number(that.entityTwoContent[i].List.ftpopulation)) : 0)) + ' \t\t ' + ((that.entityTwoContent[i].List.fhouseholds ? Number(that.entityTwoContent[i].List.fhouseholds) : 0) + (that.entityTwoContent[i].List.thouseholds ? Number(that.entityTwoContent[i].List.thouseholds) : 0) + (that.entityTwoContent[i].List.fthouseholds ? Number(that.entityTwoContent[i].List.fthouseholds) : 0)) + ' \t\t ' + ((that.entityTwoContent[i].List.ftill ? Number(Number(that.entityTwoContent[i].List.ftill).toFixed(2)) : 0) + (that.entityTwoContent[i].List.tTill ? Number(Number(that.entityTwoContent[i].List.tTill).toFixed(2)) : 0) + (that.entityTwoContent[i].List.fttill ? Number(Number(that.entityTwoContent[i].List.fttill).toFixed(2)) : 0)).toFixed(2) + ' \t ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'zyhl-red' || className == 'zyhl-blue' || className == 'zyhl-yellow' || className == 'zyhl-orange' || className == 'zyhl-wxq') { var waterLevel; if (that.btnInd == 2) { waterLevel = '预测河道水位'; } else if (that.btnInd == 1) { waterLevel = '实时河道水位'; } var table = $("
"); var thead = $(' \t \t\t \u5E8F\u53F7 \t\t \u6C34\u6587(\u4F4D)\u7AD9 \t\t \u6CB3\u540D \t\t \u53BF(\u533A) \t\t \u4E61\u9547 \t\t \u884C\u653F\u6751 \t\t \u6751\u5C0F\u7EC4 \t\t ' + waterLevel + '(m) \t\t \u6210\u707E\u6C34\u4F4D(m) \t\t \u4EBA\u53E3(\u4EBA) \t\t \u623F\u5C4B(\u5EA7) \t\t \u8015\u5730(\u4EA9) \t '); table.append(thead); var tbody = $(""); var rkhz = 0; var fwhz = 0; var gdhz = 0; for (var i = 0; i < that.entityThreeContent.length; i++) { if (county == '赣州市' && that.entityThreeContent[i].yj && that.entityThreeContent[i].yj == ealyWaringType || that.entityThreeContent[i].List.district == county && that.entityThreeContent[i].yj && that.entityThreeContent[i].yj == ealyWaringType || county == '赣州市' && className == 'zyhl-wxq' || county == that.entityThreeContent[i].List.district && className == 'zyhl-wxq') { rkhz += ((that.entityThreeContent[i].List.fpopulation ? parseInt(Number(that.entityThreeContent[i].List.fpopulation)) : 0) + (that.entityThreeContent[i].List.tpopulation ? parseInt(Number(that.entityThreeContent[i].List.tpopulation)) : 0) + (that.entityThreeContent[i].List.ftpopulation ? parseInt(Number(that.entityThreeContent[i].List.ftpopulation)) : 0)) fwhz += ((that.entityThreeContent[i].List.fhouseholds ? Number(that.entityThreeContent[i].List.fhouseholds) : 0) + (that.entityThreeContent[i].List.thouseholds ? Number(that.entityThreeContent[i].List.thouseholds) : 0) + (that.entityThreeContent[i].List.fthouseholds ? Number(that.entityThreeContent[i].List.fthouseholds) : 0)); gdhz += ((that.entityThreeContent[i].List.ftill ? Number(that.entityThreeContent[i].List.ftill) : 0) + (that.entityThreeContent[i].List.tTill ? Number(that.entityThreeContent[i].List.tTill) : 0) + (that.entityThreeContent[i].List.fttill ? Number(that.entityThreeContent[i].List.fttill) : 0)); } } var wxqxb = 0; for (var i = 0; i < that.entityThreeContent.length; i++) { if (county == '赣州市' && that.entityThreeContent[i].yj && that.entityThreeContent[i].yj == ealyWaringType || that.entityThreeContent[i].List.district == county && that.entityThreeContent[i].yj && that.entityThreeContent[i].yj == ealyWaringType || county == '赣州市' && className == 'zyhl-wxq' || county == that.entityThreeContent[i].List.district && className == 'zyhl-wxq') { if (wxqxb == 0) { wxqxb = 1; tbody.append($(' \t\t ' + (ind += 1) + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + county + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + "/" + ' \t\t ' + rkhz + ' \t\t ' + fwhz + ' \t\t ' + gdhz.toFixed(2) + ' \t ')); } tbody.append($(' \t\t\t\t ' + (ind += 1) + ' \t\t\t\t ' + (that.entityThreeContent[i].List.STNM ? that.entityThreeContent[i].List.STNM : '') + ' \t\t\t\t ' + that.entityThreeContent[i].List.river_name + ' \t\t\t\t ' + that.entityThreeContent[i].List.district + ' \t\t\t\t ' + that.entityThreeContent[i].List.township + ' \t\t\t\t ' + that.entityThreeContent[i].List.village + ' \t\t\t\t ' + (that.entityThreeContent[i].List.villagegroup == undefined ? '' : that.entityThreeContent[i].List.villagegroup) + ' \t\t\t\t ' + Number(Number(that.entityThreeContent[i].List.aDouble).toFixed(2)) + ' \t\t\t\t ' + Number(Number(that.entityThreeContent[i].List.hz).toFixed(2)) + ' \t\t\t\t ' + ((that.entityThreeContent[i].List.fpopulation ? parseInt(Number(that.entityThreeContent[i].List.fpopulation)) : 0) + (that.entityThreeContent[i].List.tpopulation ? parseInt(Number(that.entityThreeContent[i].List.tpopulation)) : 0) + (that.entityThreeContent[i].List.ftpopulation ? parseInt(Number(that.entityThreeContent[i].List.ftpopulation)) : 0)) + ' \t\t\t\t ' + ((that.entityThreeContent[i].List.fhouseholds ? Number(that.entityThreeContent[i].List.fhouseholds) : 0) + (that.entityThreeContent[i].List.thouseholds ? Number(that.entityThreeContent[i].List.thouseholds) : 0) + (that.entityThreeContent[i].List.fthouseholds ? Number(that.entityThreeContent[i].List.fthouseholds) : 0)) + ' \t\t\t\t ' + ((that.entityThreeContent[i].List.ftill ? Number(Number(that.entityThreeContent[i].List.ftill).toFixed(2)) : 0) + (that.entityThreeContent[i].List.tTill ? Number(Number(that.entityThreeContent[i].List.tTill).toFixed(2)) : 0) + (that.entityThreeContent[i].List.fttill ? Number(Number(that.entityThreeContent[i].List.fttill).toFixed(2)) : 0)).toFixed(2) + ' \t\t\t ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'ylz-red' || className == 'ylz-yellow' || className == 'ylz-orange' || className == 'ylz-ylz') { var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u96E8\u91CF\u7AD9 \u5730\u5740 \t
\t\t\t1h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t3h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t6h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t\u65E5\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\u9884\u8B66\u7EA7\u522B \n\t\t\t\t\t\t\t '); table.append(thead); var firstIndex = null; var secondIndex = null; var thirdIndex = null; var dayIndex = null; for (var i = 0; i < that.entityOneContent.length; i++) { if (that.entityOneContent[i].YJ == '一级预警') { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } else if (that.entityOneContent[i].YJ == '二级预警') { firstIndex = 50; secondIndex = 80; thirdIndex = 100; dayIndex = 100; } else if (that.entityOneContent[i].YJ == '三级预警') { firstIndex = 80; secondIndex = 100; thirdIndex = 120; dayIndex = 120; } else { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } if (county == '赣州市' && that.entityOneContent[i].YJ && that.entityOneContent[i].YJ == ealyWaringType || that.entityOneContent[i].ADDVCD5 == county && that.entityOneContent[i].YJ && that.entityOneContent[i].YJ == ealyWaringType || county == '赣州市' && className == 'ylz-ylz' || that.entityOneContent[i].ADDVCD5 == county && className == 'ylz-ylz') { tbody.append($(' ' + (ind += 1) + ' ' + that.entityOneContent[i].ADDVCD5 + ' ' + that.entityOneContent[i].STNM + ' ' + that.entityOneContent[i].STLC + ' \t
\t\t ' + firstIndex + ' \t\t ' + Number(Number(that.entityOneContent[i].drp1).toFixed(2)) + ' \t
\t
\t\t ' + secondIndex + ' \t\t ' + Number(Number(that.entityOneContent[i].drp3).toFixed(2)) + ' \t
\t
\t\t ' + thirdIndex + ' \t\t ' + Number(Number(that.entityOneContent[i].drp6).toFixed(2)) + ' \t
\t
\t\t ' + dayIndex + ' \t\t ' + Number(Number(that.entityOneContent[i].dyp).toFixed(2)) + ' \t
' + that.entityOneContent[i].YJ + ' ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [['序号', '县(区)', '雨量站', '地址', '1h雨量(mm)', null, '3h雨量(mm)', null, '6h雨量(mm)', null, '日雨量(mm)', null, '预警级别'], [null, null, null, null, '预警指标', '实时雨量', '预警指标', '实时雨量', '预警指标', '实时雨量', '预警指标', '实时雨量', null]]; for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { 1; if ($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span').length > 0) { arr[i + 2].push($($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[0]).text(), $($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[1]).text()); } else { arr[i + 2].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } } var sheet = XLSX.utils.aoa_to_sheet(arr); sheet['!merges'] = [{s: {r: 0, c: 0}, e: {r: 1, c: 0}}, { s: {r: 0, c: 1}, e: {r: 1, c: 1} }, {s: {r: 0, c: 2}, e: {r: 1, c: 2}}, { s: {r: 0, c: 3}, e: {r: 1, c: 3} }, {s: {r: 0, c: 4}, e: {r: 0, c: 5}}, { s: {r: 0, c: 6}, e: {r: 0, c: 7} }, {s: {r: 0, c: 8}, e: {r: 0, c: 9}}, { s: {r: 0, c: 10}, e: {r: 0, c: 11} }, {s: {r: 0, c: 12}, e: {r: 1, c: 12}}]; that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'shzh-red' || className == 'shzh-yellow' || className == 'shzh-wxq') { var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u5371\u9669\u533A\u540D\u79F0 \u9884\u8B66\u7C7B\u578B \t
\t\t\t1h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t3h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t6h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\u4EBA\u53E3(\u4EBA) \n\t\t\t\t\t\t\t '); table.append(thead); var type = null; var oneHourIndicator = null; var twoHourIndicator = null; var threeHourIndicator = null; var rkhz = 0; for (var i = 0; i < that.entityOneContent.length; i++) { if (that.entityOneContent[i].Max == 0) { type = '正常'; } else if (that.entityOneContent[i].Max == 1) { type = '准备转移'; } else if (that.entityOneContent[i].Max == 2) { type = '立即转移'; } if (county == '赣州市' && that.entityOneContent[i].Max && type == ealyWaringType || that.entityOneContent[i].List.county == county && that.entityOneContent[i].Max && type == ealyWaringType || that.entityOneContent[i].List.county == county && className == 'shzh-wxq' || '赣州市' == county && className == 'shzh-wxq') { rkhz += parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)); } } var tybs = 0; for (var i = 0; i < that.entityOneContent.length; i++) { if (that.entityOneContent[i].Max == 0) { type = '正常'; oneHourIndicator = that.entityOneContent[i].List.gohour; twoHourIndicator = that.entityOneContent[i].List.gthour; threeHourIndicator = that.entityOneContent[i].List.gshour; } else if (that.entityOneContent[i].Max == 1) { type = '准备转移'; oneHourIndicator = that.entityOneContent[i].List.gohour; twoHourIndicator = that.entityOneContent[i].List.gthour; threeHourIndicator = that.entityOneContent[i].List.gshour; } else if (that.entityOneContent[i].Max == 2) { type = '立即转移'; oneHourIndicator = that.entityOneContent[i].List.imohour; twoHourIndicator = that.entityOneContent[i].List.imthour; threeHourIndicator = that.entityOneContent[i].List.imshour; } if (county == '赣州市' && that.entityOneContent[i].Max && type == ealyWaringType || that.entityOneContent[i].List.county == county && that.entityOneContent[i].Max && type == ealyWaringType || that.entityOneContent[i].List.county == county && className == 'shzh-wxq' || '赣州市' == county && className == 'shzh-wxq') { if (tybs == 0) { tbody.append($(' \t\t\t\t ' + (ind += 1) + ' \t\t\t\t ' + county + ' \t\t\t\t ' + "/" + ' \t\t\t\t ' + "/" + ' \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t\t ' + "/" + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t ' + rkhz + ' \t\t\t ')); tybs = 1; } tbody.append($(' \t\t\t\t ' + (ind += 1) + ' \t\t\t\t ' + that.entityOneContent[i].List.county + ' \t\t\t\t ' + (that.entityOneContent[i].List.township + that.entityOneContent[i].List.village + that.entityOneContent[i].List.village_group) + ' \t\t\t\t ' + type + ' \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + oneHourIndicator + ' \t\t\t\t\t\t ' + Number(Number(that.entityOneContent[i].List.drp1).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + twoHourIndicator + ' \t\t\t\t\t\t ' + Number(Number(that.entityOneContent[i].List.drp3).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + threeHourIndicator + ' \t\t\t\t\t\t ' + Number(Number(that.entityOneContent[i].List.drp6).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t ' + parseInt(Number(that.entityOneContent[i].List.fyear) + Number(that.entityOneContent[i].List.tyear) + Number(that.entityOneContent[i].List.oyear)) + ' \t\t\t ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [['序号', '县(区)', '危险区名称', '预警类型', '1h雨量(mm)', null, '3h雨量(mm)', null, '6h雨量(mm)', null, '人口(人)'], [null, null, null, null, '预警指标', '实时雨量', '预警指标', '实时雨量', '预警指标', '实时雨量', null]]; for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { 1; if ($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span').length > 0) { arr[i + 2].push($($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[0]).text(), $($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[1]).text()); } else { arr[i + 2].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } } var sheet = XLSX.utils.aoa_to_sheet(arr); sheet['!merges'] = [{s: {r: 0, c: 0}, e: {r: 1, c: 0}}, { s: {r: 0, c: 1}, e: {r: 1, c: 1} }, {s: {r: 0, c: 2}, e: {r: 1, c: 2}}, { s: {r: 0, c: 3}, e: {r: 1, c: 3} }, {s: {r: 0, c: 4}, e: {r: 0, c: 5}}, { s: {r: 0, c: 6}, e: {r: 0, c: 7} }, {s: {r: 0, c: 8}, e: {r: 0, c: 9}}, {s: {r: 0, c: 10}, e: {r: 1, c: 10}}]; that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'fjq-red' || className == 'fjq-blue' || className == 'fjq-yellow' || className == 'fjq-orange' || className == 'fjq-fjq') { var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u666F\u70B9\u540D\u79F0 \u666F\u70B9\u7EA7\u522B \u5173\u8054\u6C34\u5E93(\u6CB3\u9053)\u7AD9 \u5B9E\u65F6\u6C34\u4F4D(m) \u8B66\u6212\u6C34\u4F4D(m) \u9884\u8B66\u7EA7\u522B \n\t\t\t\t\t\t\t '); table.append(thead); for (var i = 0; i < that.entityOneContent.length; i++) { if (county == '赣州市' || that.entityOneContent[i].county == county) { if (that.entityOneContent[i].yuc && that.entityOneContent[i].yuc == ealyWaringType || that.entityOneContent[i].yj && that.entityOneContent[i].yj == ealyWaringType || className == 'fjq-fjq') { tbody.append($(' \t ' + (ind += 1) + ' \t ' + that.entityOneContent[i].county + ' \t ' + that.entityOneContent[i].spotname + ' \t ' + (that.entityOneContent[i].spottype ? that.entityOneContent[i].spottype : '') + ' \t ' + (that.entityOneContent[i].yuc ? that.entityOneContent[i].swname + '(河道站)' : that.entityOneContent[i].swname + '(水库站)') + ' \t ' + Number(Number(that.entityOneContent[i].yuc ? that.entityOneContent[i].Z ? that.entityOneContent[i].Z : 0 : that.entityOneContent[i].RZ ? that.entityOneContent[i].RZ : 0).toFixed(2)) + ' \t ' + Number(Number(that.entityOneContent[i].yuc ? that.entityOneContent[i].WRZ ? that.entityOneContent[i].WRZ : 0 : that.entityOneContent[i].NORMZ ? that.entityOneContent[i].NORMZ : 0).toFixed(2)) + ' \t ' + (that.entityOneContent[i].yj ? that.entityOneContent[i].yj : that.entityOneContent[i].yuc) + ' ')); } } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } else if (className == 'fjq-ylz-red' || className == 'fjq-ylz-yellow' || className == 'fjq-ylz-orange' || className == 'fjq-ylz-fjq') { var thead = $(' \u5E8F\u53F7 \u53BF(\u533A) \u666F\u70B9\u540D\u79F0 \u666F\u70B9\u7EA7\u522B \t
\t\t\t1h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t3h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t6h\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\t
\t\t\t\u65E5\u96E8\u91CF \t\t\t(mm) \t
\t
\t\t \u9884\u8B66\u6307\u6807 \t\t \u5B9E\u65F6\u96E8\u91CF \t
\u9884\u8B66\u7EA7\u522B \n\t\t\t\t\t\t\t '); table.append(thead); var firstIndex = null; var secondIndex = null; var thirdIndex = null; var dayIndex = null; for (var i = 0; i < that.entityTwoContent.length; i++) { if (that.entityTwoContent[i].YJ == '一级预警') { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } else if (that.entityTwoContent[i].YJ == '二级预警') { firstIndex = 50; secondIndex = 80; thirdIndex = 100; dayIndex = 100; } else if (that.entityTwoContent[i].YJ == '三级预警') { firstIndex = 80; secondIndex = 100; thirdIndex = 120; dayIndex = 120; } else { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } if (county == '赣州市' && that.entityTwoContent[i].YJ && that.entityTwoContent[i].YJ == ealyWaringType || that.entityTwoContent[i].county == county && that.entityTwoContent[i].YJ && that.entityTwoContent[i].YJ == ealyWaringType || that.entityTwoContent[i].county == county && className == 'fjq-ylz-fjq' || county == '赣州市' && className == 'fjq-ylz-fjq') { tbody.append($(' \t\t\t\t ' + (ind += 1) + ' \t\t\t\t ' + that.entityTwoContent[i].county + ' \t\t\t\t ' + that.entityTwoContent[i].spotname + ' \t\t\t\t ' + ' ' + ' \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + firstIndex + ' \t\t\t\t\t\t ' + Number(Number(that.entityTwoContent[i].drp1).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + secondIndex + ' \t\t\t\t\t\t ' + Number(Number(that.entityTwoContent[i].drp3).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + thirdIndex + ' \t\t\t\t\t\t ' + Number(Number(that.entityTwoContent[i].drp6).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t \t\t\t\t\t
\t\t\t\t\t\t ' + dayIndex + ' \t\t\t\t\t\t ' + Number(Number(that.entityTwoContent[i].dyp).toFixed(2)) + ' \t\t\t\t\t
\t\t\t\t \t\t\t\t ' + that.entityTwoContent[i].YJ + ' \t\t\t ')); } } table.append(tbody); layer.open({ type: 0, title: county, content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [['序号', '县(区)', '雨量站', '地址', '1h雨量(mm)', null, '3h雨量(mm)', null, '6h雨量(mm)', null, '日雨量(mm)', null, '预警级别'], [null, null, null, null, '预警指标', '实时雨量', '预警指标', '实时雨量', '预警指标', '实时雨量', '预警指标', '实时雨量', null]]; for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { 1; if ($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span').length > 0) { arr[i + 2].push($($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[0]).text(), $($($($('.fxyj-table tbody tr')[i]).children('td')[j]).find('span')[1]).text()); } else { arr[i + 2].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } } var sheet = XLSX.utils.aoa_to_sheet(arr); sheet['!merges'] = [{s: {r: 0, c: 0}, e: {r: 1, c: 0}}, { s: {r: 0, c: 1}, e: {r: 1, c: 1} }, {s: {r: 0, c: 2}, e: {r: 1, c: 2}}, { s: {r: 0, c: 3}, e: {r: 1, c: 3} }, {s: {r: 0, c: 4}, e: {r: 0, c: 5}}, { s: {r: 0, c: 6}, e: {r: 0, c: 7} }, {s: {r: 0, c: 8}, e: {r: 0, c: 9}}, { s: {r: 0, c: 10}, e: {r: 0, c: 11} }, {s: {r: 0, c: 12}, e: {r: 1, c: 12}}]; that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } } }); // 中间部分文字 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-title-box .rainwater-query').click(function () { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content div').scrollTop(0); var dateBegin = $('#rainwater_Query_Start_Time').val(); var dateEnd = $('#rainwater_Query_End_Time').val(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content div:eq(0)').stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .loading').stop().show(); that.getPointRain(dateBegin, dateEnd); }); // 文字预警中预警的点击事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div').on('click', 'span', function () { var ind = $(this).attr('ii'); var liText = that.excelFileName.substr(0, that.excelFileName.length - 5); if (Number($(this).text()) == 0) return; if (liText == '山洪灾害') { if (ind == 0) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(1)').trigger('click'); } else if (ind == 1) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(2)').trigger('click'); } else if (ind == 2) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(3)').trigger('click'); } } else if (liText == '河道站' || liText == '水库站' || liText == '中小河流' || liText == '主要河流') { if (ind == 0) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(1)').trigger('click'); } else if (ind == 1) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(5)').trigger('click'); } else if (ind == 2) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(4)').trigger('click'); } else if (ind == 3) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(3)').trigger('click'); } else if (ind == 4) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(2)').trigger('click'); } } else if (liText == '风景区水位') { var nodeClass = null; nodeClass = $(this).attr('class'); var text = null; var inds = 0; layer.config({ extend: 'myskin/style.css' }); if (nodeClass && nodeClass != undefined) { var table = $("
"); var tbody = $(""); var thead = $(' \t\t \t\t\t \u5E8F\u53F7 \t\t\t \u53BF(\u533A) \t\t\t \u666F\u70B9\u540D\u79F0 \t\t\t \u666F\u70B9\u7EA7\u522B \t\t\t \u5173\u8054\u6C34\u5E93(\u6CB3\u9053)\u7AD9 \t\t\t \u5B9E\u65F6\u6C34\u4F4D(m) \t\t\t \u8B66\u6212\u6C34\u4F4D(m) \t\t\t \u9884\u8B66\u7EA7\u522B \t\t \t '); table.append(thead); if (nodeClass == 'fjq-skz-red' || nodeClass == 'fjq-skz-orange' || nodeClass == 'fjq-skz-yellow' || nodeClass == 'fjq-skz-blue' || nodeClass == 'fjq-skz-fjq') { if (nodeClass == 'fjq-skz-red') text = '红色预警'; if (nodeClass == 'fjq-skz-orange') text = '橙色预警'; if (nodeClass == 'fjq-skz-yellow') text = '黄色预警'; if (nodeClass == 'fjq-skz-blue') text = '蓝色预警'; for (var i = 0; i < that.skzArr.length; i++) { if (that.skzArr[i].yj == text || nodeClass == 'fjq-skz-fjq') { tbody.append($(' \t\t ' + (inds += 1) + ' \t\t ' + that.skzArr[i].county + ' \t\t ' + that.skzArr[i].spotname + ' \t\t ' + (that.skzArr[i].spottype ? that.skzArr[i].spottype : '') + ' \t\t ' + (that.skzArr[i].swname + '(水库站)') + ' \t\t ' + Number(that.skzArr[i].RZ ? that.skzArr[i].RZ : 0) + ' \t\t ' + Number(that.skzArr[i].NORMZ ? that.skzArr[i].NORMZ : 0) + ' \t\t ' + that.skzArr[i].yj + ' \t ')); } } } else if (nodeClass == 'fjq-hdz-red' || nodeClass == 'fjq-hdz-orange' || nodeClass == 'fjq-hdz-yellow' || nodeClass == 'fjq-hdz-blue' || nodeClass == 'fjq-hdz-fjq') { if (nodeClass == 'fjq-hdz-red') { text = '红色预警'; } ; if (nodeClass == 'fjq-hdz-orange') { text = '橙色预警'; } ; if (nodeClass == 'fjq-hdz-yellow') { text = '黄色预警'; } ; if (nodeClass == 'fjq-hdz-blue') { text = '蓝色预警'; } ; for (var i = 0; i < that.hdzArr.length; i++) { if (that.hdzArr[i].yuc == text || nodeClass == 'fjq-hdz-fjq') { tbody.append($(' \t\t ' + (inds += 1) + ' \t\t ' + that.hdzArr[i].county + ' \t\t ' + that.hdzArr[i].spotname + ' \t\t ' + (that.hdzArr[i].spottype ? that.hdzArr[i].spottype : '') + ' \t\t ' + (that.hdzArr[i].swname + '(河道站)') + ' \t\t ' + Number(that.hdzArr[i].Z ? that.hdzArr[i].Z : 0) + ' \t\t ' + Number(that.hdzArr[i].WRZ ? that.hdzArr[i].WRZ : 0) + ' \t\t ' + that.hdzArr[i].yuc + ' \t ')); } } } table.append(tbody); layer.open({ type: 0, title: '赣州市', content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } } else if (liText == '风景区雨量' || liText == '雨量站') { if (ind == 0) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(1)').trigger('click'); } else if (ind == 1) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(2)').trigger('click'); } else if (ind == 2) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(3)').trigger('click'); } else if (ind == 3) { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .tbody tbody tr:eq(0) td:eq(4)').trigger('click'); } } }); // 图例的关闭按钮事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image > div .legend-title .lefend-close i').click(function (event) { event.stopPropagation(); $(this).parent().parent().parent().stop().hide(); }); // 中间文字的点击事件 $('.jimu-widget-RiskEarlyWarning .rain-content').on('click', 'a', function () { var acode = $(this).attr('acode'); var aname = $(this).attr('aname'); that.rainOpenWindow({STNM: aname, STCD: acode}); }); $('.jimu-widget-RiskEarlyWarning .reservoir-water-regime-content').on('click', 'a', function () { var acode = $(this).attr('acode'); var aname = $(this).attr('aname'); that.reservoirOpenWindow({STNM: aname, stcd: acode}); }); $('.jimu-widget-RiskEarlyWarning .water-regime-content').on('click', 'a', function () { var acode = $(this).attr('acode'); var aname = $(this).attr('aname'); that.riverCourseOpenWindow({STNM: aname, id: acode}); }); // 阻止冒泡 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li ul li').click(function (event) { event.stopPropagation(); }); // 图例移动 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image>div .legend-title').mousedown(function (event) { event.stopPropagation(); that.offset = $(this).parent().offset(); if (document.setCapture) this.setCapture(); if (window.captureEvents) window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP); that.isDown = true; that.moveThis = this; that.x = event.clientX - that.offset.left; that.y = event.clientY - that.offset.top; }); $(document).mousemove(function (event) { event.stopPropagation(); if (that.isDown) { var a = parseInt(event.clientX - that.x); var b = parseInt(event.clientY - that.y); if (a < that.x) { a = 0; } if (b < that.y) { b = 0; } $(that.moveThis).parent().css({ 'left': a > $(window).width() - $(that.moveThis).parent().width() ? $(window).width() - $(that.moveThis).parent().width() + 'px' : a + 'px', 'top': b > $(window).height() - $(that.moveThis).parent().height() ? $(window).height() - $(that.moveThis).parent().height() + 'px' : b + 'px', 'bottom': 'auto' }); } else { return null; } }); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image>div .legend-title').mouseup(function (event) { event.stopPropagation(); if (document.releaseCapture) this.releaseCapture(); if (window.releaseEvents) window.releaseEvents(Event.MOUSEMOVE | Event.MOUSEUP); that.isDown = false; that.moveThis = null; }); // 文字预警括号中的点击事件 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div').on('click', 'p div strong', function (event) { event.stopPropagation(); var county = $(this).parent().children('i').text(); var earlyWarning = $(this).attr('t'); var liText = that.excelFileName.substr(0, that.excelFileName.length - 5); var ind = null; var tableList = $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)>div'); for (var i = 0; i < tableList.length; i++) { if (!$(tableList[i]).is(':hidden')) { for (var k = 0; k < $(tableList[i]).find('.tbody tbody tr').length; k++) { if (county == $($(tableList[i]).find('.tbody tbody tr:eq(' + k + ')').children('td')[0]).text()) { ind = k; } } } } if (liText == '山洪灾害') { if (earlyWarning == '准备转移') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .one .tbody tbody tr:eq(' + ind + ') td:eq(2)').trigger('click'); } else if (earlyWarning == '立即转移') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .one .tbody tbody tr:eq(' + ind + ') td:eq(3)').trigger('click'); } } else if (liText == '水库站' || liText == '中小河流') { if (earlyWarning == '蓝色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(2)').trigger('click'); } else if (earlyWarning == '黄色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(3)').trigger('click'); } else if (earlyWarning == '橙色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(4)').trigger('click'); } else if (earlyWarning == '红色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(5)').trigger('click'); } } else if (liText == '河道站' || liText == '主要河流') { if (earlyWarning == '蓝色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .three .tbody tbody tr:eq(' + ind + ') td:eq(2)').trigger('click'); } else if (earlyWarning == '黄色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .three .tbody tbody tr:eq(' + ind + ') td:eq(3)').trigger('click'); } else if (earlyWarning == '橙色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .three .tbody tbody tr:eq(' + ind + ') td:eq(4)').trigger('click'); } else if (earlyWarning == '红色预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .three .tbody tbody tr:eq(' + ind + ') td:eq(5)').trigger('click'); } } else if (liText == '雨量站') { if (earlyWarning == '一级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .one .tbody tbody tr:eq(' + ind + ') td:eq(1)').trigger('click'); } else if (earlyWarning == '二级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .one .tbody tbody tr:eq(' + ind + ') td:eq(2)').trigger('click'); } else if (earlyWarning == '三级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .one .tbody tbody tr:eq(' + ind + ') td:eq(3)').trigger('click'); } } else if (liText == '风景区雨量') { if (earlyWarning == '一级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(1)').trigger('click'); } else if (earlyWarning == '二级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(2)').trigger('click'); } else if (earlyWarning == '三级预警') { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .two .tbody tbody tr:eq(' + ind + ') td:eq(3)').trigger('click'); } } else if (liText == '风景区水位') { var nodeClass = null; nodeClass = $(this).attr('r'); var inds = 0; layer.config({ extend: 'myskin/style.css' }); if (nodeClass && nodeClass != undefined) { var table = $("
"); var tbody = $(""); var thead = $(' \t\t \t\t\t \u5E8F\u53F7 \t\t\t \u53BF(\u533A) \t\t\t \u666F\u70B9\u540D\u79F0 \t\t\t \u666F\u70B9\u7EA7\u522B \t\t\t \u5173\u8054\u6C34\u5E93(\u6CB3\u9053)\u7AD9 \t\t\t \u5B9E\u65F6\u6C34\u4F4D(m) \t\t\t \u8B66\u6212\u6C34\u4F4D(m) \t\t\t \u9884\u8B66\u7EA7\u522B \t\t \t '); table.append(thead); if (nodeClass == 'skz') { for (var i = 0; i < that.skzArr.length; i++) { if (that.skzArr[i].yj == earlyWarning && that.skzArr[i].county == county) { tbody.append($(' \t\t ' + (inds += 1) + ' \t\t ' + that.skzArr[i].county + ' \t\t ' + that.skzArr[i].spotname + ' \t\t ' + (that.skzArr[i].spottype ? that.skzArr[i].spottype : '') + ' \t\t ' + (that.skzArr[i].swname + '(水库站)') + ' \t\t ' + Number(that.skzArr[i].RZ ? that.skzArr[i].RZ : 0) + ' \t\t ' + Number(that.skzArr[i].NORMZ ? that.skzArr[i].NORMZ : 0) + ' \t\t ' + that.skzArr[i].yj + ' \t ')); } } } else if (nodeClass == 'hdz') { for (var i = 0; i < that.hdzArr.length; i++) { if (that.hdzArr[i].yuc == earlyWarning && that.hdzArr[i].county == county) { tbody.append($(' \t\t ' + (inds += 1) + ' \t\t ' + that.hdzArr[i].county + ' \t\t ' + that.hdzArr[i].spotname + ' \t\t ' + (that.hdzArr[i].spottype ? that.hdzArr[i].spottype : '') + ' \t\t ' + (that.hdzArr[i].swname + '(河道站)') + ' \t\t ' + Number(that.hdzArr[i].Z ? that.hdzArr[i].Z : 0) + ' \t\t ' + Number(that.hdzArr[i].WRZ ? that.hdzArr[i].WRZ : 0) + ' \t\t ' + that.hdzArr[i].yuc + ' \t ')); } } } table.append(tbody); layer.open({ type: 0, title: '赣州市', content: '' + table.html() + '
', area: ['800px', '400px'], btn: ['确定', '导出'], skin: 'fxyj-layui-layer', resize: false, btn2: function btn2(index, layero) { layero.click(function () { var arr = [[]]; for (var i = 0; i < $('.fxyj-table thead th').length; i++) { arr[0].push($($('.fxyj-table thead th')[i]).text()); } for (var i = 0; i < $('.fxyj-table tbody tr').length; i++) { arr.push([]); for (var j = 0; j < $($('.fxyj-table tbody tr')[i]).children('td').length; j++) { arr[i + 1].push($($($('.fxyj-table tbody tr')[i]).children('td')[j]).text()); } } var sheet = XLSX.utils.aoa_to_sheet(arr); that.openDownloadDialog(that.sheet2blob(sheet), that.excelFileName); }); }, success: function success(layero, index) { } }); } } }); // 是否为.18库的复选框 // $('.jimu-widget-RiskEarlyWarning .text-title-box .library-changes input').off('click').click(function () { // if ($(this).prop('checked') == true) { // that.libraryNoOneEight = 18; // } else { // that.libraryNoOneEight = 13; // } // that.getTimeQuery(); // }) //复选框改为下拉选框 $("#dataSelect").change(function () { if ($("#dataSelect").val() == 0) { that.libraryNoOneEight = 13; } else { that.libraryNoOneEight = 18; } that.getTimeQuery(); }); $("#real_time_y").change(function () { that.futureOfRealTime = $("#real_time_y").val() that.getRealTimeQuery() }) }, onOpen: function () { if (this.openOrClose == false) return; var that = this; that.layerLoad(); var time = this.getTime(); // 第一个dataSource var dataSourceOne = new Cesium.CustomDataSource('dataSourceOne'); this.addOneEntitys = dataSourceOne.entities; this.map.dataSources.add(dataSourceOne); // 第二个dataSource var dataSourceTwo = new Cesium.CustomDataSource('dataSourceTwo'); this.addTwoEntitys = dataSourceTwo.entities; this.map.dataSources.add(dataSourceTwo); // 第三个dataSource var dataSourceThree = new Cesium.CustomDataSource('dataSourceThree'); this.addThreeEntitys = dataSourceThree.entities; this.map.dataSources.add(dataSourceThree); // 加载中 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(1)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(1)').stop().show().siblings().stop().hide(); // 首次打开时,禁用实时预测选择 // $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', 'disabled'); // $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').removeClass('navli-clk-change'); // $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content div:eq(0)').stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .loading').stop().show(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)>div>div>div').text('实时').stop().show().css('left', 0) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button').prop('disabled', false) $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) div button:eq(0)').addClass('navli-clk-change').siblings().removeClass('navli-clk-change') this.btnInd = 1; this.btnClickInd = 0; this.flag = false; this.flagone = true; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0)').addClass('nav-active').children('ul').stop().show().end().children('div').stop().show().end().siblings().removeClass('nav-active').children('ul').stop().hide().end().children('div').stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .nav>li:eq(0) ul li:eq(0)').children('input').prop('checked', true).end().siblings().children('input').prop('checked', false); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-right-tab .early-warning-image .shzhtl').stop().show().siblings().stop().hide(); this.showLibraryOrDate(); this.mountainFloodDisaster(time.current, time.month); this.childrenShowOne(); this.movehandLer(); Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "H+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) { if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)); } return fmt; }; var hours = Number(new Date().Format("HH")) + 1; var time1 = new Date().Format("yyyy-MM-dd"); var dateBegin = time1 + ' 08'; var dateEnd = time1 + ' ' + hours; $('#rainwater_Query_Start_Time').val(dateBegin); laydate.render({}); laydate.render({ elem: '#rainwater_Query_Start_Time', //指定元素 type: "datetime", format: 'yyyy-MM-dd HH', btns: ['confirm'], trigger: 'click' }); $('#rainwater_Query_End_Time').val(dateEnd); laydate.render({ elem: '#rainwater_Query_End_Time', //指定元素 type: "datetime", format: 'yyyy-MM-dd HH', btns: ['confirm'], trigger: 'click' }); that.getPointRain(dateBegin, dateEnd); $('#riskEarlyWarningDateChoice').val(that.getCurrentTime()); laydate.render({ elem: '#riskEarlyWarningDateChoice', //指定元素 type: "datetime", format: 'yyyy-MM-dd HH:mm:ss', btns: ['confirm'], trigger: 'click', done: function (value, date, endDate) { that.riskEarlyWarningDate = value; that.getTimeQuery(); } }); $('#real_time_warning').val(that.getCurrentTime()) laydate.render({ elem: '#real_time_warning', //指定元素 type: "datetime", format: 'yyyy-MM-dd HH:mm:ss', btns: ['confirm'], trigger: 'click', done: function (value, date, endDate) { that.realTimeWarningY = value that.getRealTimeQuery() } }) }, // 导出文件 openDownloadDialog: function (url, saveName) { if (typeof url == 'object' && url instanceof Blob) { url = URL.createObjectURL(url); // 创建blob地址 } var aLink = document.createElement('a'); aLink.href = url; aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效 var event; if (window.MouseEvent) event = new MouseEvent('click'); else { event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); } aLink.dispatchEvent(event); }, // 同导出文件得相关函数 sheet2blob: function (sheet, sheetName) { sheetName = sheetName || 'sheet1'; var workbook = { SheetNames: [sheetName], Sheets: {} }; workbook.Sheets[sheetName] = sheet; // 生成excel的配置项 var wopts = { bookType: 'xlsx', // 要生成的文件类型 bookSST: false, // 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性 type: 'binary' }; var wbout = XLSX.write(workbook, wopts); var blob = new Blob([s2ab(wbout)], {type: "application/octet-stream"}); // 字符串转ArrayBuffer function s2ab(s) { var buf = new ArrayBuffer(s.length); var view = new Uint8Array(buf); for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; return buf; } return blob; }, // 山洪灾害事件函数 mountainFloodDisaster: function (time, mou) { var that = this; that.completeone = false; that.showLibraryOrDate(); var url = null; var times = that.getOneThreeSixTime(time) if (that.libraryNoOneEight == 13) { url = 'http://127.0.0.1:82/blade-ycreal/mountainrain/ss?type=0&mou=' + mou + '&time=' + time + '&k=13' + '&dateEnds1=' + times[0] + '&dateEnds3=' + times[1] + '&dateEnds6=' + times[2] + '&dateEnds24=' + times[4] + '&timei=' + times[5] } else { url = 'http://127.0.0.1:82/blade-ycreal/mountainrain/ss?type=1&time=' + time + '&dateEnds1=' + times[0] + '&dateEnds3=' + times[1] + '&dateEnds6=' + times[2] + '&dateEnds24=' + times[4] + '&k=18&timei=' + times[5] } $.ajax({ url: url, type: 'get', dataType: 'JSON', success: function success(data) { var outlineColors = null; var twinkleColor = null; that.clearOneAll(); data.data.forEach(function (item, index) { if (item.List.county && item.List.village && item.List.township && item.List.dj && item.List.bw) { if (that.tableOneArr.length > 0) { var a = 0 that.tableOneArr.forEach(function (it, index) { if (item.List.county != it.行政县) { a += 1 } else { it.危险区 += 1 } }) if (a == that.tableOneArr.length) { that.tableOneArr.push({ "行政县": item.List.county, "危险区": 1, "准备转移": 0, "立即转移": 0 }) } } else { that.tableOneArr.push({ "行政县": item.List.county, "危险区": 1, "准备转移": 0, "立即转移": 0 }) } // 表格数据填充 that.tableOneArr.forEach(function (it, index) { if (it.行政县 == item.List.county) { if (item.Max == 1) { it.准备转移 += 1 } else if (item.Max == 2) { it.立即转移 += 1 } } }) if (item.Max == 0) { outlineColors = 'green' twinkleColor = null } else if (item.Max == 2) { outlineColors = 'red' twinkleColor = 'red-transparent' } else if (item.Max == 1) { outlineColors = 'yellow' twinkleColor = 'yellow-transparent' } that.createEntitys(that.addOneEntitys, that.entityOneContent, '山洪灾害', item, item.List.dj, item.List.bw, outlineColors, that.entityOneName, item.List.village_group, that.addOneNameEntitys) that.createTwinkleEntitys('山洪灾害', that.addOneEntitys, item, item.List.dj, item.List.bw, twinkleColor) } }) var textContentOne = ''; var textContentTwo = ''; for (var j = 0, a = 0, b = 0, c = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].危险区 b += that.tableOneArr[j].准备转移 c += that.tableOneArr[j].立即转移 if (that.tableOneArr[j].准备转移 > 0) { textContentOne += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].准备转移 + ' \u4E2A\uFF1B
' } if (that.tableOneArr[j].立即转移 > 0) { textContentTwo += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].立即转移 + ' \u4E2A\uFF1B
' } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u5C71\u6D2A\u707E\u5BB3\u5371\u9669\u533A\uFF0C \u5176\u4E2D\u51C6\u5907\u8F6C\u79FB' + b + '\u4E2A' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + ' \uFF0C\u7ACB\u5373\u8F6C\u79FB' + c + '\u4E2A' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\u3002') that.tableOneArr.unshift({"行政县": "赣州市", '危险区': a, "准备转移": b, "立即转移": c}); var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u5371\u9669\u533A \u51C6\u5907\u8F6C\u79FB \u7ACB\u5373\u8F6C\u79FB \u77ED\u4FE1 ')) // 生成表格体(内容) var shortMessagebcgrd = null that.tableOneArr.forEach(function (item, index) { if (item.准备转移 == 0 && item.立即转移 == 0) { shortMessagebcgrd = '#ccc' } else { shortMessagebcgrd = 'rgb(37, 129, 235)' } tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.危险区 + ' ' + item.准备转移 + ' ' + item.立即转移 + ' \n\t\t\t\t\t\t\t ')) }) // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
") that.completeProgram('completeone', 'flagtwo', 'completetwo', 'flagthree', 'completethree') }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 山洪灾害事件函数 forecastMountainFloodDisaster: function (time) { var that = this that.hideLibraryOrDate('山洪灾害') that.completeone = false var url = null if (that.futureOfRealTime == 0) { url = 'http://127.0.0.1:82/blade-ycreal/mountainrain/yc?time=' + time } else { url = 'http://127.0.0.1:82/blade-ycreal/mountainrain/dyc?time=' + time } $.ajax({ url: url, type: 'get', dataType: 'JSON', success: function success(data) { var outlineColors = null var twinkleColor = null that.clearOneAll() data.data.forEach(function (item, index) { if (item.List.county && item.List.village && item.List.township && item.List.dj && item.List.bw) { if (that.tableOneArr.length > 0) { var a = 0 that.tableOneArr.forEach(function (it, index) { if (item.List.county != it.行政县) { a += 1 } else { it.危险区 += 1 } }) if (a == that.tableOneArr.length) { that.tableOneArr.push({ "行政县": item.List.county, "危险区": 1, "准备转移": 0, "立即转移": 0 }) } } else { that.tableOneArr.push({ "行政县": item.List.county, "危险区": 1, "准备转移": 0, "立即转移": 0 }) } // 表格数据填充 that.tableOneArr.forEach(function (it, index) { if (it.行政县 == item.List.county) { if (item.Max == 1) { it.准备转移 += 1 } else if (item.Max == 2) { it.立即转移 += 1 } } }) if (item.Max == 0) { outlineColors = 'green' twinkleColor = null } else if (item.Max == 2) { outlineColors = 'red' twinkleColor = 'red-transparent' } else if (item.Max == 1) { outlineColors = 'yellow' twinkleColor = 'yellow-transparent' } if (item.List.identification == undefined) { that.createEntitys(that.addOneEntitys, that.entityOneContent, '山洪灾害', item, item.List.dj, item.List.bw, outlineColors, that.entityOneName, item.List.village_group, that.addOneNameEntitys) that.createTwinkleEntitys('山洪灾害', that.addOneEntitys, item, item.List.dj, item.List.bw, twinkleColor) } else { outlineColors = 'grey' twinkleColor = 'grey-transparent' that.createEntitys(that.addOneEntitys, that.entityOneContent, '山洪灾害', item, item.List.dj, item.List.bw, outlineColors, that.entityOneName, item.List.village_group, that.addOneNameEntitys) } } }) var textContentOne = '' var textContentTwo = '' for (var j = 0, a = 0, b = 0, c = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].危险区 b += that.tableOneArr[j].准备转移 c += that.tableOneArr[j].立即转移 if (that.tableOneArr[j].准备转移 > 0) { textContentOne += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].准备转移 + ' \u4E2A\uFF1B
' } if (that.tableOneArr[j].立即转移 > 0) { textContentTwo += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].立即转移 + ' \u4E2A\uFF1B
' } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u5C71\u6D2A\u707E\u5BB3\u5371\u9669\u533A\uFF0C \u5176\u4E2D\u51C6\u5907\u8F6C\u79FB' + b + '\u4E2A' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + ' \uFF0C\u7ACB\u5373\u8F6C\u79FB' + c + '\u4E2A' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\u3002') that.tableOneArr.unshift({ "行政县": "赣州市", '危险区': a, "准备转移": b, "立即转移": c }) var theadDiv = $("
").html($('
')) var tbodyDiv = $("
").html($('
')) theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u5371\u9669\u533A \u51C6\u5907\u8F6C\u79FB \u7ACB\u5373\u8F6C\u79FB \u77ED\u4FE1 ')) // 生成表格体(内容) var shortMessagebcgrd = null that.tableOneArr.forEach(function (item, index) { if (item.准备转移 == 0 && item.立即转移 == 0) { shortMessagebcgrd = '#ccc' } else { shortMessagebcgrd = 'rgb(37, 129, 235)' } tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.危险区 + ' ' + item.准备转移 + ' ' + item.立即转移 + ' \n\t\t\t\t\t\t\t ')) }) // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
") that.completeProgram('completeone', 'flagtwo', 'completetwo', 'flagthree', 'completethree') }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading) } }) }, // 中小河流事件函数 mediumAndSmallRivers: function (mou, datetime) { var that = this; that.completetwo = false; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/floodinundation/selectC?code=2&mou=' + mou + '×=' + datetime + '&k=' + that.libraryNoOneEight, type: 'GET', dataType: 'JSON', success: function success(data) { var color = null; that.clearTwoAll(); data.data.forEach(function (item, index) { if (item.List.district && item.List.dj && item.List.bw) { that.addToTableArr(that.tableTwoArr, item.List.district, item.yj, "危险区"); color = that.getColors(item.yj); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '中小河流', item, item.List.dj, item.List.bw, color.outlineColors); } }); that.createTable(that.tableTwoArr, '.two', 'zxhl-wxq', checkOrNot, '中小河流危险区', '危险区', 'zxhl', '其中'); function checkOrNot() { that.showLibraryOrDate(); that.completeProgram('completetwo', 'flagone', 'completeone', 'flagthree', 'completethree'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 中小河流预测事件函数 forecastMediumAndSmallRivers: function (tomorrow, current) { console.log(tomorrow, current); var that = this; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/floodinundation/selectCyc?code=2&begintime=' + tomorrow + '&endtime=' + current, type: 'GET', dataType: 'JSON', success: function success(data) { var color = null; that.clearTwoAll(); data.data.forEach(function (item, index) { if (item.List.district && item.List.dj && item.List.bw) { that.addToTableArr(that.tableTwoArr, item.List.district, item.yj, "危险区"); color = that.getColors(item.yj); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '中小河流', item, item.List.dj, item.List.bw, color.outlineColors); } }); that.createTable(that.tableTwoArr, '.two', 'zxhl-wxq', checkOrNot, '中小河流危险区', '危险区', 'zxhl', '预计将有'); function checkOrNot() { that.hideLibraryOrDate('中小河流') that.completeProgram('completetwo', 'flagone', 'completeone', 'flagthree', 'completethree') layer.close(that.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(0)').stop().show().siblings().stop().hide(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 主要河流事件函数 bigRiver: function (mou, datetime) { var that = this; that.completethree = false; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/floodinundation/selectC?code=1&mou=' + mou + '×=' + datetime + '&k=' + that.libraryNoOneEight, type: 'GET', dataType: 'JSON', success: function success(data) { var color = null; that.clearThreeAll(); data.data.forEach(function (item, index) { if (item.List.district && item.List.dj && item.List.bw) { that.addToTableArr(that.tableThreeArr, item.List.district, item.yj, "危险区"); color = that.getColors(item.yj); that.createEntitys(that.addThreeEntitys, that.entityThreeContent, '主要河流', item, item.List.dj, item.List.bw, color.outlineColors); // that.createTwinkleEntitys('主要河流', that.addThreeEntitys, item.List.dj, item.List.bw, color.twinkleColor); } }); that.createTable(that.tableThreeArr, '.three', 'zyhl-wxq', checkOrNot, '主要河流危险区', '危险区', 'zyhl', '其中'); function checkOrNot() { that.showLibraryOrDate(); that.completeProgram('completethree', 'flagone', 'completeone', 'flagtwo', 'completetwo'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 主要河流预测事件函数 forecastBigRiver: function (tomorrow, current) { var that = this; that.completethree = false $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/floodinundation/selectCyc?code=1&begintime=' + tomorrow + '&endtime=' + current, type: 'GET', dataType: 'JSON', success: function success(data) { var color = null; that.clearThreeAll(); data.data.forEach(function (item, index) { if (item.List.district && item.List.dj && item.List.bw) { that.addToTableArr(that.tableThreeArr, item.List.district, item.yj, "危险区"); color = that.getColors(item.yj); that.createEntitys(that.addThreeEntitys, that.entityThreeContent, '主要河流', item, item.List.dj, item.List.bw, color.outlineColors); // that.createTwinkleEntitys('主要河流', that.addThreeEntitys, item.List.dj, item.List.bw, color.twinkleColor); } }); that.createTable(that.tableThreeArr, '.three', 'zyhl-wxq', checkOrNot, '主要河流危险区', '危险区', 'zyhl', '预计将有'); function checkOrNot() { that.hideLibraryOrDate('主要河流') that.completeProgram('completethree', 'flagone', 'completeone', 'flagtwo', 'completetwo') layer.close(that.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(0)').stop().show().siblings().stop().hide(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 风景区事件函数 scenicSpot: function (mou, datetime) { var that = this; that.completeone = false; that.showLibraryOrDate(); $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/stop/selectskYj', type: 'post', dataType: 'JSON', data: { mou: mou, times: datetime, k: that.libraryNoOneEight }, success: function success(data) { that.clearOneAll(); // 清除表格内容 that.arrOne = []; that.arrTwo = []; that.skzArr = []; that.hdzArr = []; var color = null; if (data.data[0].Listsk.length > 0) { data.data[0].Listsk.forEach(function (item, index) { if (item.county && item.yj != undefined && item.dj && item.bw) { that.addToTableArr(that.tableOneArr, item.county, item.yj, '风景区'); if (that.arrOne.length > 0) { var a = 0; that.arrOne.forEach(function (it, index) { if (item.county != it.行政县) { a += 1; } else { it.风景区 += 1; } }); if (a == that.arrOne.length) { that.arrOne.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } } else { that.arrOne.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } // 表格数据填充 that.arrOne.forEach(function (it, index) { if (it.行政县 == item.county) { if (item.yj == '红色预警') { it.红色预警 += 1; } else if (item.yj == '黄色预警') { it.黄色预警 += 1; } else if (item.yj == '蓝色预警') { it.蓝色预警 += 1; } else if (item.yj == '橙色预警') { it.橙色预警 += 1; } } }); color = that.getColors(item.yj); // that.createTwinkleEntitys('风景区水库水位', that.addOneEntitys, item, item.dj, item.bw, color.twinkleColor); that.createEntitys(that.addOneEntitys, that.entityOneContent, '风景区水库水位', item, item.dj, item.bw, color.outlineColors, that.entityOneName, item.spotname, that.addOneNameEntitys) that.skzArr.push(item); } }); } if (data.data[1].Listhd.length > 0) { data.data[1].Listhd.forEach(function (item, index) { if (item.county && item.yuc != undefined && item.dj && item.bw) { that.addToTableArr(that.tableOneArr, item.county, item.yuc, '风景区'); if (that.arrTwo.length > 0) { var a = 0; that.arrTwo.forEach(function (it, index) { if (item.county != it.行政县) { a += 1; } else { it.风景区 += 1; } }); if (a == that.arrTwo.length) { that.arrTwo.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } } else { that.arrTwo.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } // 表格数据填充 that.arrTwo.forEach(function (it, index) { if (it.行政县 == item.county) { if (item.yuc == '红色预警') { it.红色预警 += 1; } else if (item.yuc == '黄色预警') { it.黄色预警 += 1; } else if (item.yuc == '蓝色预警') { it.蓝色预警 += 1; } else if (item.yuc == '橙色预警') { it.橙色预警 += 1; } } }); color = that.getColors(item.yuc); // that.createTwinkleEntitys('风景区河道水位', that.addOneEntitys, item, item.dj, item.bw, color.twinkleColor); that.createEntitys(that.addOneEntitys, that.entityOneContent, '风景区河道水位', item, item.dj, item.bw, color.outlineColors, that.entityOneName, item.spotname, that.addOneNameEntitys) that.hdzArr.push(item); } }); } var texta = ''; var textb = ''; var textc = ''; var textd = ''; var textaa = ''; var textbb = ''; var textcc = ''; var textdd = ''; for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].风景区; b += that.tableOneArr[j].蓝色预警; c += that.tableOneArr[j].黄色预警; d += that.tableOneArr[j].橙色预警; e += that.tableOneArr[j].红色预警; } for (var jj = 0, aa = 0, bb = 0, cc = 0, dd = 0, ee = 0; jj < that.arrOne.length; jj++) { aa += that.arrOne[jj].风景区; bb += that.arrOne[jj].蓝色预警; cc += that.arrOne[jj].黄色预警; dd += that.arrOne[jj].橙色预警; ee += that.arrOne[jj].红色预警; if (that.arrOne[jj].蓝色预警 > 0) { texta += '
' + that.arrOne[jj].行政县 + '\uFF1A ' + that.arrOne[jj].蓝色预警 + ' \u4E2A\uFF1B
'; } if (that.arrOne[jj].黄色预警 > 0) { textb += '
' + that.arrOne[jj].行政县 + '\uFF1A ' + that.arrOne[jj].黄色预警 + ' \u4E2A\uFF1B
'; } if (that.arrOne[jj].橙色预警 > 0) { textc += '
' + that.arrOne[jj].行政县 + '\uFF1A ' + that.arrOne[jj].橙色预警 + ' \u4E2A\uFF1B
'; } if (that.arrOne[jj].红色预警 > 0) { textd += '
' + that.arrOne[jj].行政县 + '\uFF1A ' + that.arrOne[jj].红色预警 + ' \u4E2A\uFF1B
'; } } for (var jjj = 0, aaa = 0, bbb = 0, ccc = 0, ddd = 0, eee = 0; jjj < that.arrTwo.length; jjj++) { aaa += that.arrTwo[jjj].风景区; bbb += that.arrTwo[jjj].蓝色预警; ccc += that.arrTwo[jjj].黄色预警; ddd += that.arrTwo[jjj].橙色预警; eee += that.arrTwo[jjj].红色预警; if (that.arrTwo[jjj].蓝色预警 > 0) { textaa += '
' + that.arrTwo[jjj].行政县 + '\uFF1A ' + that.arrTwo[jjj].蓝色预警 + ' \u4E2A\uFF1B
'; } if (that.arrTwo[jjj].黄色预警 > 0) { textbb += '
' + that.arrTwo[jjj].行政县 + '\uFF1A ' + that.arrTwo[jjj].黄色预警 + ' \u4E2A\uFF1B
'; } if (that.arrTwo[jjj].橙色预警 > 0) { textcc += '
' + that.arrTwo[jjj].行政县 + '\uFF1A ' + that.arrTwo[jjj].橙色预警 + ' \u4E2A\uFF1B
'; } if (that.arrTwo[jjj].红色预警 > 0) { textdd += '
' + that.arrTwo[jjj].行政县 + '\uFF1A ' + that.arrTwo[jjj].红色预警 + ' \u4E2A\uFF1B
'; } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + aa + ' \u4E2A\u5173\u8054\u6C34\u5E93\u7AD9\u98CE\u666F\u533A\uFF0C\n\t\t\t\t\t\t\u5176\u4E2D\u7EA2\u8272\u9884\u8B66 ' + ee + ' \u4E2A' + (textd.length > 0 ? '(' + textd + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u6A59\u8272\u9884\u8B66 ' + dd + ' \u4E2A' + (textc.length > 0 ? '(' + textc + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u9EC4\u8272\u9884\u8B66 ' + cc + ' \u4E2A' + (textb.length > 0 ? '(' + textb + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u84DD\u8272\u9884\u8B66 ' + bb + ' \u4E2A' + (texta.length > 0 ? '(' + texta + ')' : '') + '\uFF1B\n\t\t\t\t\t\t\u8D63\u5DDE\u5E02\u5171\u6709 ' + aaa + ' \u4E2A\u5173\u8054\u6CB3\u9053\u7AD9\u98CE\u666F\u533A\uFF0C\n\t\t\t\t\t\t\u5176\u4E2D\u7EA2\u8272\u9884\u8B66 ' + eee + ' \u4E2A' + (textdd.length > 0 ? '(' + textdd + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u6A59\u8272\u9884\u8B66 ' + ddd + ' \u4E2A' + (textcc.length > 0 ? '(' + textcc + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u9EC4\u8272\u9884\u8B66 ' + ccc + ' \u4E2A' + (textbb.length > 0 ? '(' + textbb + ')' : '') + '\uFF0C\n\t\t\t\t\t\t\u84DD\u8272\u9884\u8B66 ' + bbb + ' \u4E2A' + (textaa.length > 0 ? '(' + textaa + ')' : '') + '\u3002'); that.tableOneArr.unshift({"行政县": "赣州市", '风景区': a, "蓝色预警": b, "黄色预警": c, "橙色预警": d, "红色预警": e}); var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u98CE\u666F\u533A \u84DD\u8272 \u9EC4\u8272 \u6A59\u8272 \u7EA2\u8272 \u77ED\u4FE1 ')); // 生成表格体(内容) var shortMessagebcgrd = null; that.tableOneArr.forEach(function (item, index) { if (item.蓝色预警 == 0 && item.黄色预警 == 0 && item.橙色预警 == 0 && item.红色预警 == 0) { shortMessagebcgrd = '#ccc'; } else { shortMessagebcgrd = 'rgb(37, 129, 235)'; } tbodyDiv.find('tbody').append($(' \n\t\t\t\t\t\t\t ' + item.行政县 + ' \n\t\t\t\t\t\t\t ' + item.风景区 + ' \n\t\t\t\t\t\t\t ' + item.蓝色预警 + '\n\t\t\t\t\t\t\t ' + item.黄色预警 + '\n\t\t\t\t\t\t\t ' + item.橙色预警 + '\n\t\t\t\t\t\t\t ' + item.红色预警 + '\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t ')); }); // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
"); that.completeProgram('completeone', 'flagone', 'completeone', 'flagtwo', 'completetwo'); }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 风景区预测事件函数 forecastScenicSpot: function (time) { var that = this; that.completeone = false $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/stop/selectYc', type: 'post', dataType: 'JSON', data: { begintime: time.tomorrow, endtime: time.current, mou: time.month }, success: function success(data) { that.clearOneAll(); that.arrOne = []; that.arrTwo = []; that.skzArr = []; that.hdzArr = []; var color = null; if (data.data[0].Listsk.length > 0) { data.data[0].Listsk.forEach(function (item, index) { if (item.county && item.yj != undefined && item.dj && item.bw) { that.addToTableArr(that.tableOneArr, item.county, item.yj, '风景区'); if (that.arrOne.length > 0) { var a = 0; that.arrOne.forEach(function (it, index) { if (item.county != it.行政县) { a += 1; } else { it.风景区 += 1; } }); if (a == that.arrOne.length) { that.arrOne.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } } else { that.arrOne.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } // 表格数据填充 that.arrOne.forEach(function (it, index) { if (it.行政县 == item.county) { if (item.yj == '红色预警') { it.红色预警 += 1; } else if (item.yj == '黄色预警') { it.黄色预警 += 1; } else if (item.yj == '蓝色预警') { it.蓝色预警 += 1; } else if (item.yj == '橙色预警') { it.橙色预警 += 1; } } }); color = that.getColors(item.yj); // that.createTwinkleEntitys('风景区水库水位', that.addOneEntitys, item, item.dj, item.bw, color.twinkleColor); that.createEntitys(that.addOneEntitys, that.entityOneContent, '风景区水库水位', item, item.dj, item.bw, color.outlineColors, that.entityOneName, item.spotname, that.addOneNameEntitys) that.skzArr.push(item); } }); } if (data.data[1].Listhd.length > 0) { data.data[1].Listhd.forEach(function (item, index) { if (item.county && item.yuc != undefined && item.dj && item.bw) { that.addToTableArr(that.tableOneArr, item.county, item.yuc, '风景区'); if (that.arrTwo.length > 0) { var a = 0; that.arrTwo.forEach(function (it, index) { if (item.county != it.行政县) { a += 1; } else { it.风景区 += 1; } }); if (a == that.arrTwo.length) { that.arrTwo.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } } else { that.arrTwo.push({ "行政县": item.county, '风景区': 1, "蓝色预警": 0, "黄色预警": 0, "橙色预警": 0, "红色预警": 0 }); } // 表格数据填充 that.arrTwo.forEach(function (it, index) { if (it.行政县 == item.county) { if (item.yuc == '红色预警') { it.红色预警 += 1; } else if (item.yuc == '黄色预警') { it.黄色预警 += 1; } else if (item.yuc == '蓝色预警') { it.蓝色预警 += 1; } else if (item.yuc == '橙色预警') { it.橙色预警 += 1; } } }); color = that.getColors(item.yuc); // that.createTwinkleEntitys('风景区河道水位', that.addOneEntitys, item, item.dj, item.bw, color.twinkleColor); that.createEntitys(that.addOneEntitys, that.entityOneContent, '风景区河道水位', item, item.dj, item.bw, color.outlineColors, that.entityOneName, item.spotname, that.addOneNameEntitys) that.hdzArr.push(item); } }); } for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].风景区; b += that.tableOneArr[j].蓝色预警; c += that.tableOneArr[j].黄色预警; d += that.tableOneArr[j].橙色预警; e += that.tableOneArr[j].红色预警; } for (var jj = 0, aa = 0, bb = 0, cc = 0, dd = 0, ee = 0; jj < that.arrOne.length; jj++) { aa += that.arrOne[jj].风景区; bb += that.arrOne[jj].蓝色预警; cc += that.arrOne[jj].黄色预警; dd += that.arrOne[jj].橙色预警; ee += that.arrOne[jj].红色预警; } for (var jjj = 0, aaa = 0, bbb = 0, ccc = 0, ddd = 0, eee = 0; jjj < that.arrTwo.length; jjj++) { aaa += that.arrTwo[jjj].风景区; bbb += that.arrTwo[jjj].蓝色预警; ccc += that.arrTwo[jjj].黄色预警; ddd += that.arrTwo[jjj].橙色预警; eee += that.arrTwo[jjj].红色预警; } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + aa + ' \u4E2A\u5173\u8054\u6C34\u5E93\u7AD9\u98CE\u666F\u533A\uFF0C\u9884\u8BA1\u7EA2\u8272\u9884\u8B66 ' + ee + ' \u4E2A\uFF0C\u6A59\u8272\u9884\u8B66 ' + dd + ' \u4E2A\uFF0C\u9EC4\u8272\u9884\u8B66 ' + cc + ' \u4E2A\u3001\u84DD\u8272\u9884\u8B66 ' + bb + ' \u4E2A\uFF1B\n\t\t\t\t\t\t\u8D63\u5DDE\u5E02\u5171\u6709 ' + aaa + ' \u4E2A\u5173\u8054\u6CB3\u9053\u7AD9\u98CE\u666F\u533A\uFF0C\u9884\u8BA1\u7EA2\u8272\u9884\u8B66 ' + eee + ' \u4E2A\uFF0C\u6A59\u8272\u9884\u8B66 ' + ddd + ' \u4E2A\uFF0C\u9EC4\u8272\u9884\u8B66 ' + ccc + ' \u4E2A\u3001\u84DD\u8272\u9884\u8B66 ' + bbb + ' \u4E2A'); that.tableOneArr.unshift({"行政县": "赣州市", '风景区': a, "蓝色预警": b, "黄色预警": c, "橙色预警": d, "红色预警": e}); // 生成表格头部 var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u98CE\u666F\u533A \u84DD\u8272 \u9EC4\u8272 \u6A59\u8272 \u7EA2\u8272 \u77ED\u4FE1 ')); // 生成表格体(内容) var shortMessagebcgrd = null; that.tableOneArr.forEach(function (item, index) { if (item.蓝色预警 == 0 && item.黄色预警 == 0 && item.橙色预警 == 0 && item.红色预警 == 0) { shortMessagebcgrd = '#ccc'; } else { shortMessagebcgrd = 'rgb(37, 129, 235)'; } tbodyDiv.find('tbody').append($(' \n\t\t\t\t\t\t\t ' + item.行政县 + ' \n\t\t\t\t\t\t\t ' + item.风景区 + ' \n\t\t\t\t\t\t\t ' + item.蓝色预警 + '\n\t\t\t\t\t\t\t ' + item.黄色预警 + '\n\t\t\t\t\t\t\t ' + item.橙色预警 + '\n\t\t\t\t\t\t\t ' + item.红色预警 + '\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t ')); }); // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
"); that.completeProgram('completeone', 'flagone', 'completeone', 'flagtwo', 'completetwo') layer.close(that.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(0)').stop().show().siblings().stop().hide(); }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 风景区预测雨量站 forecastRainfallInScenicSpots: function (time) { var that = this that.hideLibraryOrDate('风景区雨量') that.completetwo = false var url = null if (that.futureOfRealTime == 0) { url = 'http://192.168.0.207:82/blade-ycreal/stop/selectYlyc' } else { url = 'http://192.168.0.207:82/blade-ycreal/stop/selectYldyc' } $.ajax({ url: url, type: 'POST', dataType: 'JSON', data: { time: time }, success: function success(data) { that.clearTwoAll() var color = null data.data.forEach(function (item, index) { if (item.YjList.county && item.YjList.STNM && item.YjList.dj && item.YjList.bw) { if (that.tableTwoArr.length > 0) { var a = 0 that.tableTwoArr.forEach(function (it, index) { if (item.YjList.county != it.行政县) { a += 1 } else { it.风景区 += 1 } }) if (a == that.tableTwoArr.length) { that.tableTwoArr.push({ "行政县": item.YjList.county, "风景区": 1, "一级预警": 0, "二级预警": 0 // "三级预警": 0 }) } } else { that.tableTwoArr.push({ "行政县": item.YjList.county, "风景区": 1, "一级预警": 0, "二级预警": 0 //"三级预警": 0 }) } // 表格数据填充 that.tableTwoArr.forEach(function (it, index) { if (it.行政县 == item.YjList.county) { if (item.YjList.YJ == '一级预警') { it.一级预警 += 1 } else if (item.YjList.YJ == '二级预警') { it.二级预警 += 1 } //else if (item.YjList.YJ == '三级预警') { // it.三级预警 += 1 //} } }) color = that.getColors(item.YjList.YJ) if (item.YjList.identification == undefined) { that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '风景区雨量', item.YjList, item.YjList.dj, item.YjList.bw, color.outlineColors, that.entityTwoName, item.YjList.spotname, that.addTwoNameEntitys) that.createTwinkleEntitys('风景区雨量', that.addTwoEntitys, item.YjList, item.YjList.dj, item.YjList.bw, color.twinkleColor) } else { color.outlineColors = 'grey' color.twinkleColor = 'grey-transparent' that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '风景区雨量', item.YjList, item.YjList.dj, item.YjList.bw, color.outlineColors, that.entityTwoName, item.YjList.spotname, that.addTwoNameEntitys) } } }) var textContentOne = '' var textContentTwo = '' var textContentThree = '' for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableTwoArr.length; j++) { a += that.tableTwoArr[j].风景区 b += that.tableTwoArr[j].一级预警 c += that.tableTwoArr[j].二级预警 // d += that.tableTwoArr[j].三级预警 if (that.tableTwoArr[j].一级预警 > 0) { textContentOne += '
' + that.tableTwoArr[j].行政县 + '\uFF1A ' + that.tableTwoArr[j].一级预警 + ' \u4E2A\uFF1B
' } if (that.tableTwoArr[j].二级预警 > 0) { textContentTwo += '
' + that.tableTwoArr[j].行政县 + '\uFF1A ' + that.tableTwoArr[j].二级预警 + ' \u4E2A\uFF1B
' } } // 生成文字预警信息 $('#text_content_box > div:eq(0) .two').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u5173\u8054\u96E8\u91CF\u7AD9\u7684\u98CE\u666F\u533A\uFF0C \u6709' + b + '\u4E2A\u8FBE\u5230\u4E00\u7EA7\u9884\u8B66' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + '\uFF0C\u6709' + c + '\u4E2A\u8FBE\u5230\u4E8C\u7EA7\u9884\u8B66' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\u3002') that.tableTwoArr.unshift({ "行政县": "赣州市", '风景区': a, "一级预警": b, "二级预警": c }) // 生成表格头部 var theadDiv = $("
").html($('
')) var tbodyDiv = $("
").html($('
')) theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u98CE\u666F\u533A \u4E00\u7EA7\u9884\u8B66 \u4E8C\u7EA7\u9884\u8B66 \u77ED\u4FE1 ')) // 生成表格体(内容) var shortMessagebcgrd = null that.tableTwoArr.forEach(function (item, index) { // && item.三级预警 == 0 if (item.一级预警 == 0 && item.二级预警 == 0) { shortMessagebcgrd = '#ccc' } else { shortMessagebcgrd = 'rgb(37, 129, 235)' } // ' + item.三级预警 + ' tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.风景区 + ' ' + item.一级预警 + ' ' + item.二级预警 + ' \n\t\t\t\t\t\t\t ')) }) // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .two').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
") that.completeProgram('completetwo', 'flagtwo', 'completetwo', 'flagone', 'completeone') }, error: function (XMLHttpRequest, textStatus, errorThrown) { that.msglayer.close(that.msgLoading) } }) }, // 风景区雨量站 rainfallInScenicSpots: function (time) { var that = this; that.completetwo = false; var rquestData = null; if (that.libraryNoOneEight == 13) { rquestData = { type: 0, k: 13 }; } else { var times = that.getOneThreeSixTime(time); rquestData = { type: 1, timez: time, dateBegin1: times[0], dateBegin3: times[1], dateBegin6: times[2], timet: times[3], k: 18 }; } $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/stop/selectYlyj?type=0', type: 'POST', dataType: 'JSON', data: rquestData, success: function success(data) { that.clearTwoAll(); var color = null; data.data.forEach(function (item, index) { if (item.YjList.county && item.YjList.STNM && item.YjList.dj && item.YjList.bw) { if (that.tableTwoArr.length > 0) { var a = 0; that.tableTwoArr.forEach(function (it, index) { if (item.YjList.county != it.行政县) { a += 1; } else { it.风景区 += 1; } }); if (a == that.tableTwoArr.length) { that.tableTwoArr.push({ "行政县": item.YjList.county, "风景区": 1, "一级预警": 0, "二级预警": 0, "三级预警": 0 }); } } else { that.tableTwoArr.push({ "行政县": item.YjList.county, "风景区": 1, "一级预警": 0, "二级预警": 0, "三级预警": 0 }); } // 表格数据填充 that.tableTwoArr.forEach(function (it, index) { if (it.行政县 == item.YjList.county) { if (item.YjList.YJ == '一级预警') { it.一级预警 += 1; } else if (item.YjList.YJ == '二级预警') { it.二级预警 += 1; } else if (item.YjList.YJ == '三级预警') { it.三级预警 += 1; } } }); color = that.getColors(item.YjList.YJ); that.createTwinkleEntitys('风景区雨量', that.addTwoEntitys, item.YjList, item.YjList.dj, item.YjList.bw, color.twinkleColor); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '风景区雨量', item.YjList, item.YjList.dj, item.YjList.bw, color.outlineColors, that.entityTwoName, item.YjList.spotname, that.addTwoNameEntitys) } }); var textContentOne = ''; var textContentTwo = ''; var textContentThree = ''; for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableTwoArr.length; j++) { a += that.tableTwoArr[j].风景区; b += that.tableTwoArr[j].一级预警; c += that.tableTwoArr[j].二级预警; d += that.tableTwoArr[j].三级预警; if (that.tableTwoArr[j].一级预警 > 0) { textContentOne += '
' + that.tableTwoArr[j].行政县 + '\uFF1A ' + that.tableTwoArr[j].一级预警 + ' \u4E2A\uFF1B
'; } if (that.tableTwoArr[j].二级预警 > 0) { textContentTwo += '
' + that.tableTwoArr[j].行政县 + '\uFF1A ' + that.tableTwoArr[j].二级预警 + ' \u4E2A\uFF1B
'; } if (that.tableTwoArr[j].三级预警 > 0) { textContentThree += '
' + that.tableTwoArr[j].行政县 + '\uFF1A ' + that.tableTwoArr[j].三级预警 + ' \u4E2A\uFF1B
'; } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .two').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u5173\u8054\u96E8\u91CF\u7AD9\u7684\u98CE\u666F\u533A\uFF0C \u6709' + b + '\u4E2A\u8FBE\u5230\u4E00\u7EA7\u9884\u8B66' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + '\uFF0C\u6709' + c + '\u4E2A\u8FBE\u5230\u4E8C\u7EA7\u9884\u8B66' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\uFF0C \u6709' + d + '\u4E2A\u8FBE\u5230\u4E09\u7EA7\u9884\u8B66' + (textContentThree.length > 0 ? '(' + textContentThree + ')' : '') + '\u3002'); that.tableTwoArr.unshift({"行政县": "赣州市", '风景区': a, "一级预警": b, "二级预警": c, "三级预警": d}); // 生成表格头部 var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u98CE\u666F\u533A \u4E00\u7EA7\u9884\u8B66 \u4E8C\u7EA7\u9884\u8B66 \u4E09\u7EA7\u9884\u8B66 \u77ED\u4FE1 ')); // 生成表格体(内容) var shortMessagebcgrd = null; that.tableTwoArr.forEach(function (item, index) { if (item.一级预警 == 0 && item.二级预警 == 0 && item.三级预警 == 0) { shortMessagebcgrd = '#ccc'; } else { shortMessagebcgrd = 'rgb(37, 129, 235)'; } tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.风景区 + ' ' + item.一级预警 + ' ' + item.二级预警 + ' ' + item.三级预警 + ' \n\t\t\t\t\t\t\t ')); }); // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .two').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
"); that.showLibraryOrDate(); that.completeProgram('completetwo', 'flagtwo', 'completetwo', 'flagone', 'completeone'); }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 雨量站预测事件函数 forecastRainfallStation: function (time) { var that = this that.hideLibraryOrDate('雨量站') that.completeone = false var url = null if (that.futureOfRealTime == 0) { url = "http://192.168.0.207:82/blade-ycreal/pptnr/pptnYc?time=" + time } else { url = "http://192.168.0.207:82/blade-ycreal/pptnr/pptndYc?time=" + time } $.ajax({ url: url, type: 'get', dataType: 'JSON', success: function success(data) { var color = null that.clearOneAll() data.data.forEach(function (item, index) { if (item.YjList.ADDVCD5 && item.YjList.STNM && item.YjList.STLC && item.YjList.LGTD && item.YjList.LTTD) { if (that.tableOneArr.length > 0) { var a = 0 that.tableOneArr.forEach(function (it, index) { if (item.YjList.ADDVCD5 != it.行政县) { a += 1 } else { it.雨量站 += 1 } }) if (a == that.tableOneArr.length) { that.tableOneArr.push({ "行政县": item.YjList.ADDVCD5, "雨量站": 1, "一级预警": 0, "二级预警": 0 }) } } else { that.tableOneArr.push({ "行政县": item.YjList.ADDVCD5, "雨量站": 1, "一级预警": 0, "二级预警": 0 }) } // 表格数据填充 that.tableOneArr.forEach(function (it, index) { if (it.行政县 == item.YjList.ADDVCD5) { if (item.YjList.YJ == '一级预警') { it.一级预警 += 1 } else if (item.YjList.YJ == '二级预警') { it.二级预警 += 1 } } }) color = that.getColors(item.YjList.YJ) if (item.YjList.identification == undefined) { that.createEntitys(that.addOneEntitys, that.entityOneContent, '雨量站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors, that.entityOneName, item.YjList.STNM, that.addOneNameEntitys) that.createTwinkleEntitys('雨量站', that.addOneEntitys, item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.twinkleColor) } else { color.outlineColors = 'grey' color.twinkleColor = 'grey-transparent' that.createEntitys(that.addOneEntitys, that.entityOneContent, '雨量站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors, that.entityOneName, item.YjList.STNM, that.addOneNameEntitys) } } }) var textContentOne = '' var textContentTwo = '' var textContentThree = '' for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].雨量站 b += that.tableOneArr[j].一级预警 c += that.tableOneArr[j].二级预警 if (that.tableOneArr[j].一级预警 > 0) { textContentOne += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].一级预警 + ' \u4E2A\uFF1B
' } if (that.tableOneArr[j].二级预警 > 0) { textContentTwo += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].二级预警 + ' \u4E2A\uFF1B
' } } // 生成文字预警信息 $('#text_content_box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u96E8\u91CF\u7AD9\uFF0C \u6709' + b + '\u4E2A\u8FBE\u5230\u4E00\u7EA7\u9884\u8B66' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + '\uFF0C\u6709' + c + '\u4E2A\u8FBE\u5230\u4E8C\u7EA7\u9884\u8B66' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\u3002') that.tableOneArr.unshift({ "行政县": "赣州市", '雨量站': a, "一级预警": b, "二级预警": c }) var theadDiv = $("
").html($('
')) var tbodyDiv = $("
").html($('
')) theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u96E8\u91CF\u7AD9 \u4E00\u7EA7\u9884\u8B66 \u4E8C\u7EA7\u9884\u8B66 \u77ED\u4FE1 ')) // 生成表格体(内容) var shortMessagebcgrd = null that.tableOneArr.forEach(function (item, index) { if (item.一级预警 == 0 && item.二级预警 == 0) { shortMessagebcgrd = '#ccc' } else { shortMessagebcgrd = 'rgb(37, 129, 235)' } tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.雨量站 + ' ' + item.一级预警 + ' ' + item.二级预警 + ' \n\t\t\t\t\t\t\t ')) }) // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
") that.completeProgram('completeone', 'flagtwo', 'completetwo', 'flagthree', 'completethree') }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }) }, // 雨量站事件函数 rainfallStation: function (time) { var that = this; that.completeone = false; that.showLibraryOrDate(); var url = null; var times = that.getOneThreeSixTime(time); if (that.libraryNoOneEight == 13) { url = 'http://127.0.0.1:82/blade-ycreal/pptnr/pptnYj?type=0&k=13&timez=' + time + '&dateBegins1=' + times[0] + '&dateBegins3=' + times[1] + '&dateBegins6=' + times[2] + '&timet=' + times[5] } else { url = 'http://127.0.0.1:82/blade-ycreal/pptnr/pptnYj?type=1&timez=' + time + '&dateBegins1=' + times[0] + '&dateBegins3=' + times[1] + '&dateBegins6=' + times[2] + '&timet=' + times[5] + '&k=18' } $.ajax({ url: url, type: 'get', dataType: 'JSON', success: function success(data) { var color = null; that.clearOneAll(); data.data.forEach(function (item, index) { if (item.YjList.ADDVCD5 && item.YjList.STNM && item.YjList.STLC && item.YjList.LGTD && item.YjList.LTTD) { if (that.tableOneArr.length > 0) { var a = 0; that.tableOneArr.forEach(function (it, index) { if (item.YjList.ADDVCD5 != it.行政县) { a += 1; } else { it.雨量站 += 1; } }); if (a == that.tableOneArr.length) { that.tableOneArr.push({ "行政县": item.YjList.ADDVCD5, "雨量站": 1, "一级预警": 0, "二级预警": 0, "三级预警": 0 }); } } else { that.tableOneArr.push({ "行政县": item.YjList.ADDVCD5, "雨量站": 1, "一级预警": 0, "二级预警": 0, "三级预警": 0 }); } // 表格数据填充 that.tableOneArr.forEach(function (it, index) { if (it.行政县 == item.YjList.ADDVCD5) { if (item.YjList.YJ == '一级预警') { it.一级预警 += 1; } else if (item.YjList.YJ == '二级预警') { it.二级预警 += 1; } else if (item.YjList.YJ == '三级预警') { it.三级预警 += 1; } } }); color = that.getColors(item.YjList.YJ); that.createTwinkleEntitys('雨量站', that.addOneEntitys, item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.twinkleColor); that.createEntitys(that.addOneEntitys, that.entityOneContent, '雨量站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors, that.entityOneName, item.YjList.STNM, that.addOneNameEntitys) } }); var textContentOne = ''; var textContentTwo = ''; var textContentThree = ''; for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < that.tableOneArr.length; j++) { a += that.tableOneArr[j].雨量站; b += that.tableOneArr[j].一级预警; c += that.tableOneArr[j].二级预警; d += that.tableOneArr[j].三级预警; if (that.tableOneArr[j].一级预警 > 0) { textContentOne += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].一级预警 + ' \u4E2A\uFF1B
'; } if (that.tableOneArr[j].二级预警 > 0) { textContentTwo += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].二级预警 + ' \u4E2A\uFF1B
'; } if (that.tableOneArr[j].三级预警 > 0) { textContentThree += '
' + that.tableOneArr[j].行政县 + '\uFF1A ' + that.tableOneArr[j].三级预警 + ' \u4E2A\uFF1B
'; } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A\u96E8\u91CF\u7AD9\uFF0C \u6709' + b + '\u4E2A\u8FBE\u5230\u4E00\u7EA7\u9884\u8B66' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + '\uFF0C\u6709' + c + '\u4E2A\u8FBE\u5230\u4E8C\u7EA7\u9884\u8B66' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\uFF0C \u6709' + d + '\u4E2A\u8FBE\u5230\u4E09\u7EA7\u9884\u8B66' + (textContentThree.length > 0 ? '(' + textContentThree + ')' : '') + '\u3002'); that.tableOneArr.unshift({"行政县": "赣州市", '雨量站': a, "一级预警": b, "二级预警": c, "三级预警": d}); var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF \u96E8\u91CF\u7AD9 \u4E00\u7EA7\u9884\u8B66 \u4E8C\u7EA7\u9884\u8B66 \u4E09\u7EA7\u9884\u8B66 \u77ED\u4FE1 ')); // 生成表格体(内容) var shortMessagebcgrd = null; that.tableOneArr.forEach(function (item, index) { if (item.一级预警 == 0 && item.二级预警 == 0 && item.三级预警 == 0) { shortMessagebcgrd = '#ccc'; } else { shortMessagebcgrd = 'rgb(37, 129, 235)'; } tbodyDiv.find('tbody').append($(' ' + item.行政县 + ' ' + item.雨量站 + ' ' + item.一级预警 + ' ' + item.二级预警 + ' ' + item.三级预警 + ' \n\t\t\t\t\t\t\t ')); }); // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
"); that.completeProgram('completeone', 'flagtwo', 'completetwo', 'flagthree', 'completethree'); }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 水库站实时事件函数 reservoirStation: function (mou, datetime) { var that = this; that.completetwo = false; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/rsvrr/selectyjck', type: 'post', dataType: 'JSON', data: { mou: mou, times: datetime, k: that.libraryNoOneEight }, success: function success(data) { that.clearTwoAll(); var color = null; data.data.forEach(function (item, index) { if (item.YjList.ADDVCD5 && item.YjList.LGTD && item.YjList.LTTD) { that.addToTableArr(that.tableTwoArr, item.YjList.ADDVCD5, item.YjList.yj, "水库站"); color = that.getColors(item.YjList.yj); that.createTwinkleEntitys('水库站', that.addTwoEntitys, item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.twinkleColor); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '水库站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors); } }); that.createTable(that.tableTwoArr, '.two', 'skz-skz', checkOrNot, '水库站', '水库站', 'skz', '其中'); function checkOrNot() { that.showLibraryOrDate(); that.completeProgram('completetwo', 'flagone', 'completeone', 'flagthree', 'completethree'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 水库站预测事件函数 forecastReservoirStation: function (time) { var that = this; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/rsvrr/selectycck', type: 'post', dataType: 'JSON', data: { begintime: time.tomorrow, endtime: time.current, mou: time.month }, success: function success(data) { var color = null; var outlineColors = null; that.clearTwoAll(); data.data.forEach(function (item, index) { if (item.ADDVCD5 && item.LGTD && item.LTTD && (item.yj || item.yuc)) { that.addToTableArr(that.tableTwoArr, item.ADDVCD5, item.yj, "水库站"); if (item.yj) { color = that.getColors(item.yj); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '水库站', item, item.LGTD, item.LTTD, color.outlineColors, that.entityTwoName, item.STNM, that.addTwoNameEntitys) // that.createTwinkleEntitys('水库站', that.addTwoEntitys, item.LGTD, item.LTTD, color.twinkleColor); } if (item.yuc && item.yuc == '暂无预测') { outlineColors = that.getColors(item.yuc); that.createEntitys(that.addTwoEntitys, that.entityTwoContent, '水库站', item, item.LGTD, item.LTTD, outlineColors.outlineColors, that.entityTwoName, item.STNM, that.addTwoNameEntitys) } } }); that.createTable(that.tableTwoArr, '.two', 'skz-skz', checkOrNot, '水库站', '水库站', 'skz', '预计将有'); function checkOrNot() { that.hideLibraryOrDate('水库站') that.completeProgram('completetwo', 'flagone', 'completeone', 'flagthree', 'completethree') layer.close(that.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(0)').stop().show().siblings().stop().hide(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 河道站事件函数 riverStation: function (mou, datetime) { var that = this; that.completethree = false; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/riverr/selectyj?mou=0', type: 'post', dataType: 'JSON', data: { mou: mou, times: datetime, k: that.libraryNoOneEight }, success: function success(data) { var color = null; that.clearThreeAll(); data.data.forEach(function (item, index) { if (item.YjList.ADDVCD5 && item.YjList.STNM && item.YjList.RVNM && item.YjList.LGTD && item.YjList.LTTD) { that.addToTableArr(that.tableThreeArr, item.YjList.ADDVCD5, item.YjList.yuc, "水位站"); color = that.getColors(item.YjList.yuc); that.createEntitys(that.addThreeEntitys, that.entityThreeContent, '河道站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors); // that.createTwinkleEntitys('河道站', that.addThreeEntitys, item.YjList.LGTD, item.YjList.LTTD, color.twinkleColor); } }); that.createTable(that.tableThreeArr, '.three', 'hdz-swz', checkOrNot, '河道站', '水位站', 'hdz', '其中'); function checkOrNot() { that.showLibraryOrDate(); that.completeProgram('completethree', 'flagone', 'completeone', 'flagtwo', 'completetwo'); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 河道站预测事件函数 forecastRiverStation: function (time) { var that = this; $.ajax({ url: 'http://127.0.0.1:82/blade-ycreal/riverr/selectyc', type: 'post', dataType: 'JSON', data: { begintime: time.tomorrow, endtime: time.current }, success: function success(data) { var color = null; that.clearThreeAll(); var outlineColors = null; data.data.forEach(function (item, index) { if (item.YjList.ADDVCD5 && item.YjList.STNM && item.YjList.RVNM && item.YjList.LGTD && item.YjList.LTTD) { that.addToTableArr(that.tableThreeArr, item.YjList.ADDVCD5, item.YjList.yuc, "水位站"); if (item.YjList.yuc && item.YjList.yuc == '暂无预测') { outlineColors = that.getColors(item.YjList.yuc); that.createEntitys(that.addThreeEntitys, that.entityThreeContent, '河道站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, outlineColors.outlineColors, that.entityThreeName, item.YjList.STNM, that.addThreeNameEntitys) } else { color = that.getColors(item.YjList.yuc); that.createEntitys(that.addThreeEntitys, that.entityThreeContent, '河道站', item.YjList, item.YjList.LGTD, item.YjList.LTTD, color.outlineColors, that.entityThreeName, item.YjList.STNM, that.addThreeNameEntitys) // that.createTwinkleEntitys('河道站', that.addThreeEntitys, item.YjList.LGTD, item.YjList.LTTD, color.twinkleColor); } } }); that.createTable(that.tableThreeArr, '.three', 'hdz-swz', checkOrNot, '水位站', '水位站', 'hdz', '预计将有'); function checkOrNot() { that.hideLibraryOrDate('河道站') that.completeProgram('completethree', 'flagone', 'completeone', 'flagtwo', 'completetwo') layer.close(that.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(0)').stop().show().siblings().stop().hide(); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { layer.close(that.msgLoading); } }); }, // 获取鼠标事件 movehandLer: function movehandLer() { // 取消默认双击事件 this.map.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK); // 获取鼠标事件 this.mountainHandler = new Cesium.ScreenSpaceEventHandler(this.map.scene.canvas); // 给鼠标左键添加事件函数 this.mountainHandler.setInputAction(lang.hitch(this, this.mouseMove), Cesium.ScreenSpaceEventType.MOUSE_MOVE); this.mountainHandler.setInputAction(lang.hitch(this, this.clickHand), Cesium.ScreenSpaceEventType.LEFT_CLICK); }, // 注册鼠标左键单击事件 clickHand: function clickHand(click) { var pickedObjects = this.map.scene.drillPick(click.position); if (Cesium.defined(pickedObjects)) { for (var i = 0; i < pickedObjects.length; ++i) { var obj = pickedObjects[i].id; var result = obj.entityData; var liText = obj.name; if (result) { if (liText == '雨量站') { this.rainOpenWindow(result); } else if (liText == '水库站') { this.reservoirOpenWindow(result); } else if (liText == '河道站') { this.riverCourseOpenWindow(result); } else if (liText == '风景区雨量') { this.rainOpenWindow(result); } else if (liText == '风景区河道水位') { this.riverCourseOpenWindow({ STNM: result.swname, id: result.swcode }); } else if (liText == '风景区水库水位') { this.reservoirOpenWindow({ STNM: result.swname, stcd: result.swcode }); } break; } } } }, mouseMove: function mouseMove(movement) { var winHeight = $(window).height(); var self = this; var pickedObjects = this.map.scene.drillPick(movement.endPosition); if (pickedObjects.length > 0) { if (Cesium.defined(pickedObjects)) { for (var i = 0; i < pickedObjects.length; ++i) { var obj = pickedObjects[i].id; var result = obj.entityData; var liText = obj.name; if (result && result != undefined && result != null) { if (liText == '水库站') { if (self.btnInd == 1) { self.detailsOfRiskPointsOfReservoirStation(result, movement, winHeight, '实时'); } else if (self.btnInd == 2) { self.detailsOfRiskPointsOfReservoirStation(result, movement, winHeight, '预测'); } } else if (liText == '河道站') { if (self.btnInd == 1) { self.detailsOfRiskPointsOfRiverStation(result, movement, winHeight, '实时'); } else if (self.btnInd == 2) { self.detailsOfRiskPointsOfRiverStation(result, movement, winHeight, '预测'); } } else if (liText == '中小河流' || liText == '主要河流') { self.detailsOfMajorRiverRiskPoints(result, movement, winHeight); } else if (liText == '雨量站') { // 风险点详情添加内容 var firstIndex = null; var secondIndex = null; var thirdIndex = null; var dayIndex = null; if (result.YJ == '一级预警') { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } else if (result.YJ == '二级预警') { firstIndex = 50; secondIndex = 80; thirdIndex = 100; dayIndex = 100; } else if (result.YJ == '三级预警') { firstIndex = 80; secondIndex = 100; thirdIndex = 120; dayIndex = 120; } else { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t'); var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 160 ? winHeight - 160 : top, 'left': left }); } else if (liText == '山洪灾害') { // 风险点详情添加内容 var type = null; var oneHourIndicator = null; var twoHourIndicator = null; var threeHourIndicator = null; if (result.Max == 0) { type = '暂无转移'; oneHourIndicator = result.List.gohour; twoHourIndicator = result.List.gthour; threeHourIndicator = result.List.gshour; } else if (result.Max == 1) { type = '准备转移'; oneHourIndicator = result.List.gohour; twoHourIndicator = result.List.gthour; threeHourIndicator = result.List.gshour; } else if (result.Max == 2) { type = '立即转移'; oneHourIndicator = result.List.imohour; twoHourIndicator = result.List.imthour; threeHourIndicator = result.List.imshour; } $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t'); var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 200 ? winHeight - 200 : top, 'left': left }); } else if (liText == '风景区水库水位' || liText == '风景区河道水位') { var text = null; var labelText = null; if (self.btnInd == 1) { labelText = '实时水位:'; } else if (self.btnInd == 2) { labelText = '预测水位:'; } if (result.yj && result.yuc == undefined) { text = '关联水库站'; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t'); } else if (result.yj == undefined && result.yuc) { text = '关联河道站'; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t'); } var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 160 ? winHeight - 160 : top, 'left': left }); } else if (liText == '风景区雨量') { // 风险点详情添加内容 var firstIndex = null; var secondIndex = null; var thirdIndex = null; var dayIndex = null; if (result.YJ == '一级预警') { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } else if (result.YJ == '二级预警') { firstIndex = 50; secondIndex = 80; thirdIndex = 100; dayIndex = 100; } else if (result.YJ == '三级预警') { firstIndex = 80; secondIndex = 100; thirdIndex = 120; dayIndex = 120; } else { firstIndex = 30; secondIndex = 50; thirdIndex = 80; dayIndex = 80; } $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'); var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 160 ? winHeight - 160 : top, 'left': left }); } } } } } else { $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().hide(); } }, /** * 河道站弹框 * @param {*} item 保存有弹框的名字和站点编码 */ rainOpenWindow: function (item) { var url = './corelib/common/popup/rain.html'; var top = ($(window).height() - 526) / 2; var left = ($(window).width() - 802 - 340) / 2 + 340; layer.open({ title: item.STNM, type: 2, maxmin: true, //开启最大化最小化按钮 area: ['802px', '526px'], skin: 'fxyjylz', offset: [top, left], content: url + "?id=" + item.STCD + "&dqtime=" + this.riskEarlyWarningDate, id: "fxyjylzLayer", closeBtn: 1 }); }, /** * 河道站弹框 * @param {*} item 保存有弹框的名字和站点编码 */ reservoirOpenWindow: function (item) { var url = './corelib/common/popup/weather.html'; var top = ($(window).height() - 526) / 2; var left = ($(window).width() - 802 - 340) / 2 + 340; layer.open({ title: item.STNM, type: 2, maxmin: true, //开启最大化最小化按钮 area: ['802px', '526px'], skin: 'fxyjskz', offset: [top, left], content: url + "?id=" + item.stcd + "&dqtime=" + this.riskEarlyWarningDate, id: "fxyjskzLayer", closeBtn: 1 }); }, /** * 河道站弹框 * @param {*} item 保存有弹框的名字和站点编码 */ riverCourseOpenWindow: function (item) { var url = './corelib/common/popup/river.html'; var top = ($(window).height() - 526) / 2; var left = ($(window).width() - 802 - 340) / 2 + 340; layer.open({ title: item.STNM, type: 2, maxmin: true, //开启最大化最小化按钮 area: ['802px', '526px'], skin: 'fxyjhdz', offset: [top, left], content: url + "?id=" + item.id + "&dqtime=" + this.riskEarlyWarningDate, id: "fxyjhdzLayer", closeBtn: 1 }); }, /** * 主要河流风险点详情 * @param {*} item 存储风险点详情的对象 * @param {*} movement 保存鼠标坐标的对象 * @param {*} winHeight 当前浏览器文档区域高度 */ detailsOfMajorRiverRiskPoints: function (item, movement, winHeight) { // 风险点详情添加内容 var text = this.changeShowText(item) $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html('\n\t\t\t\t \n\t\t\t\t') var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 160 ? winHeight - 160 : top, 'left': left }); }, changeShowText (text) { // if (text == '蓝色预警') { // return '-0.5-0m' // } else if (text == '黄色预警') { // return '0-1m' // } else if (text == '橙色预警') { // return '1-3m' // } else if (text == '红色预警') { // return '>3m' // } //计算淹没深度 if (text.yj == "暂无预测") { return "暂无" } var z = (Number(text.List.Z) - Number(text.List.cz)).toFixed(2); return z }, /** * 水库站风险点详情 * @param {*} obj 存有具体内容的对象 * @param {*} movement 鼠标坐标 * @param {*} winHeight 浏览器可视窗口高度 * @param {*} siteType 预测 or 实时 */ detailsOfRiskPointsOfReservoirStation: function (obj, movement, winHeight, siteType) { // 风险点详情添加内容 $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html(' \n\t\t\t\t\t\t\t\t'); var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 160 ? winHeight - 160 : top, 'left': left }); }, /** * 河道站风险点详情 * @param {*} obj 存有具体内容的对象 * @param {*} movement 鼠标坐标 * @param {*} winHeight 浏览器可视窗口高度 * @param {*} siteType 预测 or 实时 */ detailsOfRiskPointsOfRiverStation: function (obj, movement, winHeight, siteType) { // 风险点详情添加内容 $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').html(' \n\t\t\t\t\t\t\t\t'); var top = movement.endPosition.y + 10; var left = movement.endPosition.x + 10; $('.jimu-widget-RiskEarlyWarning .details-of-risk-points').stop().show().css({ 'top': winHeight - top < 120 ? winHeight - 120 : top, 'left': left }); }, onClose: function () { var that = this; layer.close(that.msgLoading); that.flagone = false; that.flagtwo = false; that.flagthree = false; that.mountainHandler.destroy(); if (that.tableOneArr.length > 0) { that.tableOneArr = []; that.entityOneContent = []; that.addOneEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').empty(); } if (that.tableTwoArr.length > 0) { that.tableTwoArr = []; that.entityTwoContent = []; that.addTwoEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .two').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .two').empty(); } if (that.tableThreeArr.length > 0) { that.tableThreeArr = []; that.entityThreeContent = []; that.addThreeEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .three').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .three').empty(); } }, /** * 获取颜色的公共方法 * @param {*} item 预警类型 */ getColors: function (item) { var outlineColors = null; var twinkleColor = null; if (item == '暂无预测') { outlineColors = 'grey' twinkleColor = null } else if (item == '无预警') { outlineColors = 'green' twinkleColor = null } else if (item == '红色预警' || item == '一级预警') { outlineColors = 'red' twinkleColor = 'red-transparent' } else if (item == '黄色预警' || item == '二级预警') { outlineColors = 'yellow' twinkleColor = 'yellow-transparent' } else if (item == '蓝色预警') { outlineColors = 'blue' twinkleColor = 'blue-transparent' } else if (item == '橙色预警') { outlineColors = 'orange' twinkleColor = 'orange-transparent' } return {outlineColors: outlineColors, twinkleColor: twinkleColor}; }, /** * 添加实体的公共方法 * @param {*} entitys 实体类 * @param {Array} entityContent 存放每个点详细数据的数组 * @param {string} name 实体的名字 * @param {*} item 实体数据 * @param {*} lgtd 经度 * @param {*} lttd 纬度 * @param {*} outlineColors 颜色 */ createEntitys: function (entitys, entityContent, name, item, lgtd, lttd, outlineColors) { if (name == '河道站' || name == '风景区水库水位' || name == '风景区河道水位') { var image = './images/River-Station-' + outlineColors + '-triangle.png' var width = 14 var height = 14 } else if (name == '中小河流') { var image = './images/River-Station-' + outlineColors + '-triangle.png' var width = 12 var height = 12 } else if (name == '主要河流') { var image = './images/River-Station-' + outlineColors + '-triangle.png' var width = 16 var height = 16 } else if (name == '水库站') { var image = './images/Reservoir-Station-' + outlineColors + '.png' var width = 14 var height = 14 } else { var image = './images/mountain-on-' + outlineColors + '.png' var width = 8 var height = 8 } entitys.add({ name: name, position: Cesium.Cartesian3.fromDegrees(Number(lgtd), Number(lttd), 0.1), billboard: { image: image, // img 与实体相关的图片 show: true, width: width, height: height, // color: outlineColors, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY }, entityData: item }); entityContent.push(item); }, /** * 具有蓝色预警,黄色预警,橙色预警,红色预警公共生成表格 * @param {*} tableArr 表格数据存储数组 * @param {string} element 生成内容添加到的元素的类名 * @param {string} className 表格第二列的类名 * @param {function} checkOrNot 控制是否显示函数 * @param {string} describe 文字预警中的文字 * @param {string} siteName 表格第二列的key * @param {string} publicClass 公共类名头 * @param {string} type 文字预警中预警前的文字(其中 or 预计将有) */ createTable: function (tableArr, element, className, checkOrNot, describe, siteName, publicClass, type) { var _tableArr$unshift; var textContentOne = ''; var textContentTwo = ''; var textContentThree = ''; var textContentFour = ''; for (var j = 0, a = 0, b = 0, c = 0, d = 0, e = 0; j < tableArr.length; j++) { a += tableArr[j]['' + siteName]; b += tableArr[j].蓝色预警; c += tableArr[j].黄色预警; d += tableArr[j].橙色预警; e += tableArr[j].红色预警; if (tableArr[j].蓝色预警 > 0) { textContentOne += '
' + tableArr[j].行政县 + '\uFF1A ' + tableArr[j].蓝色预警 + ' \u4E2A\uFF1B
'; } if (tableArr[j].黄色预警 > 0) { textContentTwo += '
' + tableArr[j].行政县 + '\uFF1A ' + tableArr[j].黄色预警 + ' \u4E2A\uFF1B
'; } if (tableArr[j].橙色预警 > 0) { textContentThree += '
' + tableArr[j].行政县 + '\uFF1A ' + tableArr[j].橙色预警 + ' \u4E2A\uFF1B
'; } if (tableArr[j].红色预警 > 0) { textContentFour += '
' + tableArr[j].行政县 + '\uFF1A ' + tableArr[j].红色预警 + ' \u4E2A\uFF1B
'; } } // 生成文字预警信息 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) ' + element).html('\u8D63\u5DDE\u5E02\u5171\u6709 ' + a + ' \u4E2A' + describe + '\uFF0C' + type + '\u7EA2\u8272\u9884\u8B66 ' + e + ' \u4E2A' + (textContentFour.length > 0 ? '(' + textContentFour + ')' : '') + '\uFF0C\u6A59\u8272\u9884\u8B66 ' + d + ' \u4E2A' + (textContentThree.length > 0 ? '(' + textContentThree + ')' : '') + '\uFF0C\u9EC4\u8272\u9884\u8B66 ' + c + ' \u4E2A' + (textContentTwo.length > 0 ? '(' + textContentTwo + ')' : '') + '\u3001\u84DD\u8272\u9884\u8B66 ' + b + ' \u4E2A' + (textContentOne.length > 0 ? '(' + textContentOne + ')' : '') + '\u3002'); tableArr.unshift((_tableArr$unshift = {"行政县": "赣州市"}, _defineProperty(_tableArr$unshift, siteName, a), _defineProperty(_tableArr$unshift, "蓝色预警", b), _defineProperty(_tableArr$unshift, "黄色预警", c), _defineProperty(_tableArr$unshift, "橙色预警", d), _defineProperty(_tableArr$unshift, "红色预警", e), _tableArr$unshift)); var theadDiv = $("
").html($('
')); var tbodyDiv = $("
").html($('
')); theadDiv.find('thead').append($(' \u884C\u653F\u53BF ' + siteName + ' \u84DD\u8272 \u9EC4\u8272 \u6A59\u8272 \u7EA2\u8272 \u77ED\u4FE1 ')); // 生成表格体(内容) var shortMessagebcgrd = null; tableArr.forEach(function (item, index) { if (item.蓝色预警 == 0 && item.黄色预警 == 0 && item.橙色预警 == 0 && item.红色预警 == 0) { shortMessagebcgrd = '#ccc'; } else { shortMessagebcgrd = 'rgb(37, 129, 235)'; } tbodyDiv.find('tbody').append($(' \n\t\t\t\t\t ' + item.行政县 + ' \n\t\t\t\t\t ' + item[siteName] + ' \n\t\t\t\t\t ' + item.蓝色预警 + '\n\t\t\t\t\t ' + item.黄色预警 + '\n\t\t\t\t\t ' + item.橙色预警 + '\n\t\t\t\t\t ' + item.红色预警 + '\n\t\t\t\t\t \n\t\t\t\t ')); }); // 生成表格头部 $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) ' + element).html("
" + theadDiv.html() + "
" + tbodyDiv.html() + "
"); checkOrNot(); }, /** * 添加闪烁实体的公共方法 * @param {*} entitys 实体类 * @param {*} lgtd 经度 * @param {*} lttd 纬度 * @param {*} color 颜色 */ createTwinkleEntitys: function (name, entitys, item, lgtd, lttd, color) { if (color == null) return; if (name == '水库站') { var max = 20; var image = './images/Reservoir-Station-' + color + '.png' } else { var max = 14; var image = './images/mountain-on-' + color + '.png' } var r1 = 0; var min = 0; var deviationR = 0.08; function changeR1() { //这是callback,参数不能内传 r1 = r1 + deviationR; if (r1 >= max) { r1 = min; } return r1; } entitys.add({ position: Cesium.Cartesian3.fromDegrees(Number(lgtd), Number(lttd), 0.11), billboard: { image: image, // img 与实体相关的图片 show: true, width: new Cesium.CallbackProperty(changeR1, false), height: new Cesium.CallbackProperty(changeR1, false), // color: color, heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY } }); }, createLayerShortMessageContent: function createLayerShortMessageContent(entityContent, county, siteName, year, month, day, hour, yj, stnm) { var that = this; var a = 0, b = 0, c = 0, d = 0, e = '', f = '', g = '', h = '', j = 0; if (county == '赣州市') { for (var i = 0; i < entityContent.length; i++) { if (entityContent[i][yj] == '蓝色预警') { e += entityContent[i][stnm] + '、'; a += 1; } else if (entityContent[i][yj] == '黄色预警') { f += entityContent[i][stnm] + '、'; b += 1; } else if (entityContent[i][yj] == '橙色预警') { g += entityContent[i][stnm] + '、'; c += 1; } else if (entityContent[i][yj] == '红色预警') { h += entityContent[i][stnm] + '、'; d += 1; } j += 1; } } else { for (var i = 0; i < entityContent.length; i++) { if (entityContent[i].ADDVCD5 == county) { if (entityContent[i][yj] == '蓝色预警') { e += entityContent[i][stnm] + '、'; a += 1; } else if (entityContent[i][yj] == '黄色预警') { f += entityContent[i][stnm] + '、'; b += 1; } else if (entityContent[i][yj] == '橙色预警') { g += entityContent[i][stnm] + '、'; c += 1; } else if (entityContent[i][yj] == '红色预警') { h += entityContent[i][stnm] + '、'; d += 1; } j += 1; } } } if (a != 0 || b != 0 || c != 0 || d != 0) { layer.open({ type: 0, title: county, area: ['40%', '36%'], skin: 'fxyj-layui-layer', content: '

' + year + '\u5E74' + month + '\u6708' + day + '\u65E5' + hour + '\u65F6\uFF0C' + county + j + '\u4E2A' + siteName + '\u4E2D' + (a > 0 ? ',有' + a + '个站(' + e.substr(0, e.length - 1) + ')达到蓝色预警' : '') + (b > 0 ? ',有' + b + '个站(' + f.substr(0, f.length - 1) + ')达到黄色预警' : '') + (c > 0 ? ',有' + c + '个站(' + g.substr(0, g.length - 1) + ')达到橙色预警' : '') + (d > 0 ? ',有' + d + '个站(' + h.substr(0, h.length - 1) + ')达到红色预警。' : '。') + '

\n\t\t\t\t\t\t ', yes: function yes(index, layero) { //按钮【按钮一】的回调 $('.hidea').val($(".layui-layer-content p").text()).select(); document.execCommand("Copy"); layer.close(index); } }); } }, clearTimes: function () { if (this.timesArray.length > 0) { for (let i = 0; i < this.timesArray.length; i++) { clearInterval(this.timesArray[i]); } this.timesArray = []; } else { return; } }, // 获取时间 getTime: function () { var timestamp = Date.parse(new Date()); // 当前时间 var currentTime = new Date(timestamp); // 年 var currentY = currentTime.getFullYear(); // 月 var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1; // 日 var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate(); // 时 var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours(); // 分 var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes(); // 明天 var tomorrowTime = new Date(timestamp - 60 * 60 * 24 * 1000); // 年 var tomorrowY = tomorrowTime.getFullYear(); // 月 var tomorrowM = tomorrowTime.getMonth() + 1 < 10 ? '0' + (tomorrowTime.getMonth() + 1) : tomorrowTime.getMonth() + 1; // 日 var tomorrowD = tomorrowTime.getDate() < 10 ? '0' + tomorrowTime.getDate() : tomorrowTime.getDate(); // 时 var tomorrowH = tomorrowTime.getHours() < 10 ? '0' + tomorrowTime.getHours() : tomorrowTime.getHours(); // 分 var tomorrowDd = tomorrowTime.getMinutes() < 10 ? '0' + tomorrowTime.getMinutes() : tomorrowTime.getMinutes(); return { current: currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd + ':00', tomorrow: tomorrowY + '-' + tomorrowM + '-' + tomorrowD + ' ' + tomorrowH + ':' + tomorrowDd + ':00', month: currentM + currentD }; }, /** * 时间获取,1小时,3小时,6小时,24小时 * @param {*} time 当前时间 */ getOneThreeSixTime: function getOneThreeSixTime(time) { var nowTime = time; var thisTime = nowTime; thisTime = thisTime.replace(/-/g, '/'); var current = new Date(new Date(thisTime).getTime()); var oneHoursAgo = new Date(new Date(thisTime).getTime() - 1 * 60 * 60 * 1000); var threeHoursAgo = new Date(new Date(thisTime).getTime() - 3 * 60 * 60 * 1000); var sixHoursAgo = new Date(new Date(thisTime).getTime() - 6 * 60 * 60 * 1000); var yesterday = new Date(new Date(thisTime).getTime() - 24 * 60 * 60 * 1000); var currentY = current.getFullYear(); var oneHoursAgoY = oneHoursAgo.getFullYear(); var threeHoursAgoY = threeHoursAgo.getFullYear(); var sixHoursAgoY = sixHoursAgo.getFullYear(); var yesterdayY = yesterday.getFullYear(); var currentM = current.getMonth() + 1 < 10 ? '0' + (current.getMonth() + 1) : current.getMonth() + 1; var oneHoursAgoM = oneHoursAgo.getMonth() + 1 < 10 ? '0' + (oneHoursAgo.getMonth() + 1) : oneHoursAgo.getMonth() + 1; var threeHoursAgoM = threeHoursAgo.getMonth() + 1 < 10 ? '0' + (threeHoursAgo.getMonth() + 1) : threeHoursAgo.getMonth() + 1; var sixHoursAgoM = sixHoursAgo.getMonth() + 1 < 10 ? '0' + (sixHoursAgo.getMonth() + 1) : sixHoursAgo.getMonth() + 1; var yesterdayM = yesterday.getMonth() + 1 < 10 ? '0' + (yesterday.getMonth() + 1) : yesterday.getMonth() + 1; var currentD = current.getDate() < 10 ? '0' + current.getDate() : current.getDate(); var oneHoursAgoD = oneHoursAgo.getDate() < 10 ? '0' + oneHoursAgo.getDate() : oneHoursAgo.getDate(); var threeHoursAgoD = threeHoursAgo.getDate() < 10 ? '0' + threeHoursAgo.getDate() : threeHoursAgo.getDate(); var sixHoursAgoD = sixHoursAgo.getDate() < 10 ? '0' + sixHoursAgo.getDate() : sixHoursAgo.getDate(); var yesterdayD = yesterday.getDate() < 10 ? '0' + yesterday.getDate() : yesterday.getDate(); var oneHoursAgoH = oneHoursAgo.getHours() < 10 ? '0' + oneHoursAgo.getHours() : oneHoursAgo.getHours(); var threeHoursAgoH = threeHoursAgo.getHours() < 10 ? '0' + threeHoursAgo.getHours() : threeHoursAgo.getHours(); var sixHoursAgoH = sixHoursAgo.getHours() < 10 ? '0' + sixHoursAgo.getHours() : sixHoursAgo.getHours(); var yesterdayH = yesterday.getHours() < 10 ? '0' + yesterday.getHours() : yesterday.getHours(); var time1 = oneHoursAgoY + '-' + oneHoursAgoM + '-' + oneHoursAgoD + ' ' + oneHoursAgoH + ':00:00'; var time2 = threeHoursAgoY + '-' + threeHoursAgoM + '-' + threeHoursAgoD + ' ' + threeHoursAgoH + ':00:00'; var time3 = sixHoursAgoY + '-' + sixHoursAgoM + '-' + sixHoursAgoD + ' ' + sixHoursAgoH + ':00:00'; var time4 = currentY + '-' + currentM + '-' + currentD + ' ' + '08:00:00'; var time5 = yesterdayY + '-' + yesterdayM + '-' + yesterdayD + ' ' + '08:00:00'; var time24 = yesterdayY + '-' + yesterdayM + '-' + yesterdayD + ' ' + yesterdayH + ':00:00'; /** * @return 返回1小时,2小时,3小时,4小时,24小时 */ return [time1, time2, time3, time4, time24, time5]; }, /** * 时间获取,加载中间部分,雨情,水情,水库水情描述 * @param {*} dateBegin 开始时间 * @param {*} dateEnd 结束时间 */ getPointRain: function (dateBegin, dateEnd) { $.ajax({ url: 'http://127.0.0.1:82/gzsq/gz/rthy/monitor/rainDesc?addvcd=360700&plevel=50&dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'get', success: function success(data) { var _data = data.data; _data = _data.split("点")[0]; $.ajax({ url: 'http://127.0.0.1:82/gzsq/rest/rthyinfo/core/rain/station/accpAll?Addvcd=360700&dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'GET', success: function success(result) { var res = result.data; var djy = res[0].cnnm + res[0].stlc + "" + res[0].name + "" + "站,(" + res[0].accp + "毫米)," + res[1].cnnm + res[1].stlc + "" + res[1].name + "" + "站,(" + res[1].accp + "毫米)," + res[2].cnnm + res[2].stlc + "" + res[2].name + "" + "站,(" + res[2].accp + "毫米)。"; var pContent = $('

').html('雨情:' + _data + "点降雨前三位是:" + djy); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .rain-content').html(pContent); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content div:eq(0)').stop().show(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .loading').stop().hide(); } }); } }); var time = dateEnd.split(' ')[0]; var _html = time.split('-')[1] + "月" + time.split('-')[2] + "日"; $.ajax({ url: 'http://127.0.0.1:82/gzsq/rest/rthyinfo/core/river/overList?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd + '&orderMode=cmpwrzdesc', dataType: 'JSON', type: 'GET', success: function success(data) { if (data.data.length > 0) { _html += "超汛限站数" + data.data.length + "个数,分别为:"; for (var i = 0; i < data.data.length; i++) { _html += data.data[i].cnnm + "" + data.data[i].name + ""; _html += "(超警戒" + data.data[i].cmpwrz + "米)"; } _html += "
"; } else { _html += "暂无河道超警信息。"; } $.ajax({ url: 'http://127.0.0.1:82/gzsq/rest/rthyinfo/core/river/riseMax?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'GET', success: function success(data) { var a = data.data; _html += "涨幅最大的是:" + a[0].cnnm + "" + a[0].name + "站,(涨" + a[0].zcv + "米)。
跌幅最大的是:"; $.ajax({ url: 'http://127.0.0.1:82/gzsq/rest/rthyinfo/core/river/fallMax?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'GET', success: function success(data) { var b = data.data; _html += b[0].cnnm + "" + b[0].name + "站,(跌" + Math.abs(b[0].zcv) + "米)。"; $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .water-regime-content').html($('

').html('水情:' + _html)); } }); } }); } }); var times = dateEnd.split(' ')[0]; var _htmls = times.split('-')[1] + "月" + times.split('-')[2] + "日"; $.ajax({ url: 'http://127.0.0.1:82/gzsq/data/rthyinfo/rsvr/last/overList?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd + '&orderMode=cmpfsltdzdesc', dataType: 'JSON', type: 'GET', success: function success(data) { var cxx = data.data; if (cxx.length > 0) { _htmls += "超汛限站数" + cxx.length + "个,分别为:"; for (var i = 0; i < cxx.length; i++) { _htmls += cxx[i].cnnm + "" + cxx[i].name + "" + "站"; _htmls += "(超汛限" + cxx[i].cmpfsltdz + "米)"; } _htmls += "
"; } else { _htmls += "暂无水库超警信息。"; } $.ajax({ url: 'http://127.0.0.1:82/gzsq/data/rthyinfo/rsvr/last/riseMax?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'GET', success: function success(data) { var a = data.data; if (a.length > 0) { _htmls += "涨幅最大的是:" + a[0].cnnm + "" + a[0].name + "站,(涨" + a[0].rzcv + "米)。
跌幅最大的是:"; } $.ajax({ url: 'http://127.0.0.1:82/gzsq/data/rthyinfo/rsvr/last/fallMax?dateBegin=' + dateBegin + '&dateEnd=' + dateEnd, dataType: 'JSON', type: 'GET', success: function success(data) { var b = data.data; if (b.lelngth > 0) { _htmls += b[0].cnnm + "" + b[0].name + "站,(跌" + Math.abs(b[0].rzcv) + "米)。"; } $('.jimu-widget-RiskEarlyWarning .risk-early-warning-center .text-content .reservoir-water-regime-content').html($('

').html('水库水情:' + _htmls)); } }); } }); } }); }, // 获取当前完整时间时间 getCurrentTime: function () { var timestamp = Date.parse(new Date()); // 当前时间 var currentTime = new Date(timestamp); // 年 var currentY = currentTime.getFullYear(); // 月 var currentM = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1; // 日 var currentD = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate(); // 时 var currentH = currentTime.getHours() < 10 ? '0' + currentTime.getHours() : currentTime.getHours(); var currentDd = currentTime.getMinutes() < 10 ? '0' + currentTime.getMinutes() : currentTime.getMinutes(); var currentMm = currentTime.getSeconds() < 10 ? '0' + currentTime.getSeconds() : currentTime.getSeconds(); /** * @return 返回完整的时间 */ return currentY + '-' + currentM + '-' + currentD + ' ' + currentH + ':' + currentDd + ':' + currentMm; }, /** * 将数据添加到存放表格数据的数组中的公共方法 * @param {*} tableArr 数组名 * @param {*} county 存储行政县名称 * @param {*} earlyCarning 预警类型 * @param {*} siteName 危险区 or 风景区 之类 */ addToTableArr: function (tableArr, county, earlyCarning, siteName) { var that = this; if (tableArr.length > 0) { var a = 0; tableArr.forEach(function (it, index) { if (county != it.行政县) { a += 1; } else { it[siteName] += 1; } }); if (a == tableArr.length) { var _tableArr$push; tableArr.push((_tableArr$push = {"行政县": county}, _defineProperty(_tableArr$push, siteName, 1), _defineProperty(_tableArr$push, "蓝色预警", 0), _defineProperty(_tableArr$push, "黄色预警", 0), _defineProperty(_tableArr$push, "橙色预警", 0), _defineProperty(_tableArr$push, "红色预警", 0), _tableArr$push)); } } else { var _tableArr$push2; tableArr.push((_tableArr$push2 = {"行政县": county}, _defineProperty(_tableArr$push2, siteName, 1), _defineProperty(_tableArr$push2, "蓝色预警", 0), _defineProperty(_tableArr$push2, "黄色预警", 0), _defineProperty(_tableArr$push2, "橙色预警", 0), _defineProperty(_tableArr$push2, "红色预警", 0), _tableArr$push2)); } // 表格数据填充 tableArr.forEach(function (it, index) { if (earlyCarning) { if (it.行政县 == county) { if (earlyCarning == '红色预警') { it.红色预警 += 1; } else if (earlyCarning == '黄色预警') { it.黄色预警 += 1; } else if (earlyCarning == '蓝色预警') { it.蓝色预警 += 1; } else if (earlyCarning == '橙色预警') { it.橙色预警 += 1; } } } }); }, // 获取已有的时间,做为下次的使用时间 getTimeAvailable: function () { var changeTime = $('#riskEarlyWarningDateChoice').val(); var years = changeTime.substr(0, 14); var branch = changeTime.substr(14, 2); var dateTime = years + branch + ':00'; var month = dateTime.substr(5, 2) + dateTime.substr(8, 2); return { // 年月日时分秒 changeTime: changeTime, // 月日 month: month, // 年月日时分,秒默认00 dateTime: dateTime } }, // 关闭loading加载层 loadClose: function () { layer.close(this.msgLoading); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box > div:eq(0)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0)').stop().show().siblings().stop().hide(); }, // 确定哪个执行完毕,什么时候关闭loading加载层的函数 completeProgram: function (a, b, d, u, n) { var that = this; that[a] = true; if (that[b] == true && that[u] == true) { if (that[d] == true && that[n] == true) { that.loadClose(); } } else { if (that[b] == true && that[u] == false) { if (that[d] == true) { that.loadClose(); } } else if (that[b] == false && that[u] == true) { if (that[n] == true) { that.loadClose(); } } else if (that[b] == false && that[u] == false) { that.loadClose(); } } }, childrenShowOne: function () { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').stop().show().siblings().stop().hide(); }, childrenShowTwo: function () { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .two').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .two').stop().show().siblings().stop().hide(); }, childrenShowThree: function () { $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .three').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .three').stop().show().siblings().stop().hide(); }, // 时间查询事件执行函数 getTimeQuery: function () { var that = this; that.clearOneAll(); that.clearTwoAll(); that.clearThreeAll(); var liText = that.excelFileName.substr(0, that.excelFileName.length - 5); if (liText == '未选中') return; that.layerLoad(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(1)').stop().show().siblings().stop().hide(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box>div:eq(1)').stop().show().siblings().stop().hide(); if (that.riskEarlyWarningDate == null) { var changeTime = $('#riskEarlyWarningDateChoice').val(); } else { var changeTime = that.riskEarlyWarningDate; } var years = changeTime.substr(0, 14); var branch = changeTime.substr(14, 2); var dateTime = years + branch + ':00'; var month = dateTime.substr(5, 2) + dateTime.substr(8, 2); if (that.btnClickInd == 0) { if (that.flagone == true) { that.mountainFloodDisaster(changeTime, month); } if (that.flag == false) { if (that.flagtwo == true) { that.mediumAndSmallRivers(month, dateTime); } if (that.flagthree == true) { that.bigRiver(month, dateTime); } } if (liText == '山洪灾害') { that.childrenShowOne(); } else if (liText == '中小河流') { that.childrenShowTwo(); } else if (liText == '主要河流') { that.childrenShowThree(); } } else if (that.btnClickInd == 1) { if (that.flagone == true) { that.scenicSpot(month, dateTime); } if (that.flagtwo == true) { that.rainfallInScenicSpots(changeTime); } if (liText == '风景区水位') { that.childrenShowOne(); } else if (liText == '风景区雨量') { that.childrenShowTwo(); } } else if (that.btnClickInd == 2) { if (that.flagone == true) { that.rainfallStation(changeTime); } if (that.flag == false) { if (that.flagtwo == true) { that.reservoirStation(month, dateTime); } if (that.flagthree == true) { that.riverStation(month, dateTime); } } if (liText == '雨量站') { that.childrenShowOne(); } else if (liText == '水库站') { that.childrenShowTwo(); } else if (liText == '河道站') { that.childrenShowThree(); } } }, getRealTimeQuery: function () { var that = this that.clearOneAll() that.clearTwoAll() that.clearThreeAll() var liText = that.excelFileName.substr(0, that.excelFileName.length - 5) if (liText == '未选中') return that.layerLoad() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(1)').stop().show().siblings().stop().hide() $('#text_content_box>div:eq(1)').stop().show().siblings().stop().hide() if (that.realTimeWarningY == null) { var changeTime = $('#real_time_warning').val() } else { var changeTime = that.realTimeWarningY } if (that.btnClickInd == 0) { if (liText == '山洪灾害') { that.forecastMountainFloodDisaster(changeTime) that.childrenShowOne() } } else if (that.btnClickInd == 1) { if (liText == '风景区雨量') { that.forecastRainfallInScenicSpots(changeTime) that.childrenShowTwo() } } else if (that.btnClickInd == 2) { if (liText == '雨量站') { that.forecastRainfallStation(changeTime) that.childrenShowOne() } } }, // 显示时间选择,与历史库 showLibraryOrDate: function () { $('.jimu-widget-RiskEarlyWarning .text-title-box .library-changes').stop().show() $('.jimu-widget-RiskEarlyWarning .text-title-box .dataSelect').stop().show() $('#real_time_y').stop().hide() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .early-warning-date').stop().show() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .real-time-warning').stop().hide() }, // 隐藏时间选择,与历史库 hideLibraryOrDate: function (name) { if (name == '山洪灾害' || name == '雨量站' || name == '风景区雨量') { $('.jimu-widget-RiskEarlyWarning .text-title-box .library-changes').stop().show() $('.jimu-widget-RiskEarlyWarning .text-title-box .dataSelect').stop().hide() $('#real_time_y').stop().show() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .real-time-warning').stop().show() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .early-warning-date').stop().hide() } else { $('.jimu-widget-RiskEarlyWarning .text-title-box .dataSelect').stop().hide() $('.jimu-widget-RiskEarlyWarning .text-title-box .library-changes').stop().hide() $('#real_time_y').stop().hide() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .real-time-warning').stop().hide() $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .early-warning-date').stop().hide() } }, // 清除所有与 .one 相关得 clearOneAll: function () { this.tableOneArr = [] this.entityOneContent = [] this.entityOneName = [] this.clearTimes(); this.addOneEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .one').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .one').empty(); }, // 清除所有与 .two 相关得 clearTwoAll: function () { this.tableTwoArr = []; this.entityTwoContent = []; this.clearTimes(); this.addTwoEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .two').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .two').empty(); }, // 清除所有与 .three 相关得 clearThreeAll: function () { this.tableThreeArr = []; this.entityThreeContent = []; this.clearTimes(); this.addThreeEntitys.removeAll(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-bottom .table-box>div:eq(0) .three').empty(); $('.jimu-widget-RiskEarlyWarning .risk-early-warning-top .text-content-box > div:eq(0) .three').empty(); }, layerLoad: function () { this.msgLoading = layer.msg('加载中', { icon: 16, shade: 0.3, time: false }); }, openRiskEarlyWarning: function openRiskEarlyWarning(item) { var self = this; if (item == this.name) { self.openOrClose = true; self.onOpen(); } }, closeRiskEarlyWarning: function closeRiskEarlyWarning(item) { var self = this; if (item == this.name) { self.onClose(); self.openOrClose = false; $('.jimu-widget-RiskEarlyWarning').stop().hide(); } } }); });