{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\resMonitor\\rainfallStatistics.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\resMonitor\\rainfallStatistics.vue","mtime":1688458391974},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.regexp.replace\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport req from '@/request.js';\nimport * as echarts from 'echarts';\nimport rainfallStatistics from '@/api/monitor/resMonitor/rainfallStatistics.js';\nimport moment from 'moment';\nexport default {\n data: function data() {\n return {\n dateValue: '',\n dateList: [],\n trendList: [],\n parmas: {\n time: moment().format('YYYY'),\n type: 'YYYY'\n },\n options: [{\n value: 'YYYY',\n label: '年趋势'\n }, {\n value: 'YYYY-MM',\n label: '月趋势'\n }, {\n value: 'YYYY-MM-DD',\n label: '日趋势'\n }],\n optionRain: null\n };\n },\n created: function created() {\n this.initialize();\n },\n mounted: function mounted() {\n var _this = this;\n\n this.dateEcharts();\n this.trendEcharts();\n this.$root.$on('resize', function () {\n _this.resize(500);\n });\n },\n methods: {\n initialize: function initialize() {\n var moment = require('moment'); //打开时默认时间为一天前至获取当前年月日时分秒\n\n\n var endTime = moment().format('YYYY-MM-DD 23:59:59'); //当前年月日\n\n var January = moment(new Date().getFullYear() + '-' + '01').format('YYYY-MM-DD 00:00:00'); //当年一月\n\n var monthOne = moment().startOf('month').format('YYYY-MM-DD 00:00:00'); //当月第一天\n\n var oneYearTime = moment(new Date()).subtract(1, 'years').format('YYYY-MM-DD 00:00:00'); //前一月\n\n var oneEonthTime = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD 00:00:00'); //前一月\n\n var oneDayTime = moment(new Date()).subtract(1, 'day').format('YYYY-MM-DD 00:00:00'); //前一天\n\n this.dateValue = [monthOne, endTime];\n this.dateChange();\n this.trendChange();\n },\n handlClick: function handlClick() {\n if (this.parmas.type == 'YYYY') {\n this.parmas.time = moment().format('YYYY');\n } else if (this.parmas.type == 'YYYY-MM') {\n this.parmas.time = moment().format('YYYY-MM');\n } else if (this.parmas.type == 'YYYY-MM-DD') {\n this.parmas.time = moment().format('YYYY-MM-DD');\n }\n\n this.trendList = [];\n this.trendChange();\n },\n dateChange: function dateChange(val) {\n var _this2 = this;\n\n this.dateValue[1] = this.dateValue[1].replace('00:00:00', '23:59:59');\n var parmas = {\n timeLine: this.dateValue,\n type: 'yyyy-MM-dd'\n };\n rainfallStatistics.chain(parmas, function (res) {\n if (res.state) {\n _this2.dateList = res.value;\n\n _this2.$nextTick(function () {\n _this2.dateEcharts();\n });\n }\n });\n },\n trendChange: function trendChange() {\n var _this3 = this;\n\n rainfallStatistics.tendency(this.parmas, function (res) {\n if (res.state) {\n _this3.trendList = res.value;\n\n _this3.$nextTick(function () {\n _this3.trendEcharts();\n });\n }\n });\n },\n trendEcharts: function trendEcharts() {\n var times = [];\n var BNum = [];\n this.trendList.forEach(function (e) {\n times.push(e.x);\n BNum.push(e.y);\n });\n var chartDom = document.getElementById('trendEcharts');\n var trendEcharts = echarts.init(chartDom);\n var option = {\n grid: {\n top: 35,\n left: 60,\n // 调整这个属性\n right: 60\n },\n legend: {\n show: true\n },\n xAxis: {\n type: 'category',\n data: times\n },\n yAxis: {\n name: 'mm',\n type: 'value'\n },\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'shadow'\n }\n },\n series: [{\n data: BNum,\n type: 'line',\n smooth: true,\n color: '#91CC75'\n }]\n };\n option && trendEcharts.setOption(option);\n },\n dateEcharts: function dateEcharts() {\n var _this4 = this;\n\n var times = []; // let ANum = []\n\n var BNum = [];\n this.dateList.forEach(function (e) {\n times.push(e.x);\n var data = [e.x, e.y.current, e.appType];\n BNum.push(data);\n });\n var chartDom = document.getElementById('dateEcharts');\n this.dateEchart = echarts.init(chartDom);\n this.optionRain = {\n grid: {\n top: 35,\n left: 60,\n // 调整这个属性\n right: 60,\n bottom: 100\n },\n xAxis: {\n type: 'category',\n data: times\n },\n yAxis: {\n name: 'mm',\n type: 'value'\n },\n dataZoom: [{\n type: 'inside'\n }],\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n type: 'none'\n }\n },\n series: [{\n name: '雨量',\n barMaxWidth: 40,\n data: BNum,\n type: 'bar',\n showBackground: true,\n itemStyle: {\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n offset: 0,\n color: '#abed8d'\n }, {\n offset: 1,\n color: '#91CC75'\n }])\n },\n emphasis: {\n itemStyle: {\n color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{\n offset: 0,\n color: '#91CC75'\n }, {\n offset: 1,\n color: '#abed8d'\n }])\n }\n }\n }]\n };\n this.dateEchart.on('click', function (params) {\n if (params.data.length && params.data[2]) {\n _this4.barNext(params.data[2]);\n } else {\n _this4.barNext();\n }\n });\n this.optionRain && this.dateEchart.setOption(this.optionRain);\n },\n barNext: function barNext(appType) {\n var _this5 = this;\n\n this.dateValue[1] = this.dateValue[1].replace('00:00:00', '23:59:59');\n var parmas = {\n timeLine: this.dateValue,\n type: 'yyyy-MM-dd',\n appType: appType\n };\n rainfallStatistics.chain(parmas, function (res) {\n if (res.state) {\n console.log(res.value);\n _this5.dateList = res.value;\n var xAxis = [];\n var yAxis = [];\n\n _this5.dateList.forEach(function (e) {\n xAxis.push(e.x);\n var data;\n\n if (appType) {\n data = [e.x, e.y.current];\n _this5.optionRain.xAxis.axisLabel = {\n interval: 0,\n rotate: 30\n };\n } else {\n _this5.optionRain.xAxis.axisLabel = {\n interval: 0,\n rotate: 0\n };\n data = [e.x, e.y.current, e.appType];\n }\n\n yAxis.push(data);\n });\n\n _this5.optionRain.xAxis.data = xAxis;\n _this5.optionRain.series[0].data = yAxis;\n\n _this5.dateEchart.setOption(_this5.optionRain);\n }\n });\n }\n }\n};",null]}