| | |
| | | //… |
| | | }); |
| | | }, |
| | | setdefaultTime: function () { |
| | | //获取当前时间7天前 |
| | | var date = new Date(); |
| | | var date1 = new Date(+new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
| | | var myDate = date.setDate(date.getDate() - 7); |
| | | var date2 = new Date(+new Date(myDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
| | | console.log([date1, date2], 123456789); |
| | | //设置value |
| | | $('#test-startDate-1').val(date1); |
| | | $('#test-endDate-1').val(date2); |
| | | that.times = [date1, date2]; |
| | | var stcd = $('.jimu-widget-searchTabaPopup').find('#userMyStcd').val(); |
| | | // that.getOurData(that.times, stcd);//默认7天时间完成 |
| | | }, |
| | | setXiangqing(obj) { |
| | | var str = ''; |
| | | var XQDom = $('.jimu-widget-searchTabaPopup').find('.xiangqing'); |
| | |
| | | }) |
| | | }, |
| | | setshishidata: function (data, stcd, id = '#shuiwenshishi') { |
| | | //给默认时间 |
| | | var date = new Date(); |
| | | var date1 = new Date(+new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
| | | var myDate = date.setDate(date.getDate() - 7); |
| | | var date2 = new Date(+new Date(myDate) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
| | | // console.log([date1, date2], 123456789); |
| | | //设置value |
| | | $('#test-startDate-1').val(date2); |
| | | $('#test-endDate-1').val(date1); |
| | | window.defultEchartsTimes = [date2, date1]; |
| | | // var time = setTimeout(() => { |
| | | $('.jimu-widget-searchTabaPopup').find('#query').click(); |
| | | // clearTimeout(time); |
| | | // time = null; |
| | | // }, 500); |
| | | |
| | | var str = '', |
| | | shuiwenDom = $('.jimu-widget-searchTabaPopup').find(id) |
| | | shuiwenDom.empty(); |
| | |
| | | }) |
| | | |
| | | $('.jimu-widget-searchTabaPopup').find('#query').click(() => { |
| | | if (that.times[0] != 1) { |
| | | var stcd = $('.jimu-widget-searchTabaPopup').find('#userMyStcd').val() |
| | | if (that.times[0] != 1 || window.defultEchartsTimes[0] != 1) { |
| | | that.times = window.defultEchartsTimes; |
| | | var stcd = $('.jimu-widget-searchTabaPopup').find('#userMyStcd').val(); |
| | | that.getOurData(that.times, stcd); |
| | | } else { |
| | | layui.use(function () { //亦可加载特定模块:layui.use(['layer', 'laydate', function(){ |
| | |
| | | $('.jimu-widget-searchTabaPopup').find('#empty').click(() => { |
| | | $('.myCHosetimeinput').val(""); |
| | | that.times = [1]; |
| | | window.defultEchartsTimes = [1]; |
| | | }) |
| | | |
| | | }, |
| | |
| | | |
| | | onOpen: function () { |
| | | var that = this; |
| | | |
| | | |
| | | // $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' }); |
| | | // $('.jimu-widget-searchTabaPopup').find('.p-main').eq(1).css({ 'display': 'block' }).siblings().css({ 'display': 'none' }); |
| | | this.creMyEcharts(); |
| | |
| | | this.myChart2 = echarts.init(dom); |
| | | }, |
| | | getOurData: function (time, stcd) { |
| | | // console.log(time,stcd,55555555555555) |
| | | var that = this |
| | | , url = `http://171.34.76.171:8880/pyh-station/monitorData/queryStationHistoryMonitorData?stcd=${stcd}&startTime=${time[0]}&endTime=${time[1]}`, |
| | | token = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJlY2hpc2FuIiwic3ViIjoiYWRtaW4iLCJpYXQiOjE2MjMyNDQxNDQsImV4cCI6MTYyNTgzNjE0NH0.wjtMw7hv8IYGxFKI9b1vo2ozMXD1pE0-02HinfPl-r8l0TYVg1YvMBxW_VzzFKoY1jeC6XByQQT-aC_mAvBnWA'; |