{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\otherMonitor\\waterStatistical.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\otherMonitor\\waterStatistical.vue","mtime":1684458239356},{"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":["//\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\r\nimport req from '@/request.js'\r\nimport * as echarts from 'echarts'\r\nimport {\r\n\tTableMixin\r\n} from '@/mixins/tableMixin'\r\nimport waterStatistical from '@/api/monitor/otherMonitor/waterStatistical.js'\r\nimport YearWaterPoint from './components/YearWaterPoint.vue'\r\nimport MonthWaterPoint from './components/MonthWaterPoint.vue'\r\nimport DateWaterPoint from './components/DateWaterPoint.vue'\r\nexport default {\r\n\tname: 'waterStatistical',\r\n\tcomponents: {\r\n\t\tYearWaterPoint,\r\n\t\tMonthWaterPoint,\r\n\t\tDateWaterPoint\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tstartDatePicker: this.beginDate(),\r\n\t\t\tendDatePicker: this.processDate(),\r\n\t\t\tyeartsStart: '',\r\n\t\t\tyeartsEnd: '',\r\n\t\t\tmonthValue: '',\r\n\t\t\tdateValue: '',\r\n\t\t\tyearEchart: null,\r\n\t\t\tmonthEchart: null,\r\n\t\t\tdateEchart: null,\r\n\t\t\tparmas: {\r\n\t\t\t\ttimeLine: [],\r\n\t\t\t\ttype: '',\r\n\t\t\t},\r\n\t\t\tmonthList: [],\r\n\t\t\tyearList: [],\r\n\t\t\tdateList: []\r\n\t\t}\r\n\t},\r\n\tcreated() {\r\n\t\tthis.initialize()\r\n\t},\r\n\tmounted() {\r\n\t\tthis.yearEcharts()\r\n\t\tthis.monthEcharts()\r\n\t\tthis.dateEcharts()\r\n\t\tthis.$root.$on('resize', () => {\r\n\t\t\tthis.resize(500)\r\n\t\t})\r\n\t},\r\n\tmethods: {\r\n\t\tresize(delay) {\r\n\t\t\t// 动态计算表格的高度,自适应当前容器\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.yearEchart.resize()\r\n\t\t\t\tthis.monthEchart.resize()\r\n\t\t\t\tthis.dateEchart.resize()\r\n\t\t\t}, delay || 0)\r\n\t\t},\r\n\t\tinitialize() {\r\n\t\t\tvar moment = require('moment') //打开时默认时间为一天前至获取当前年月日时分秒\r\n\t\t\tlet endTime = moment().format('YYYY-MM-DD 23:59:59') //当前年月日\r\n\t\t\tlet January = moment(new Date().getFullYear() + \"-\" + \"01\").format('YYYY-MM-DD 00:00:00'); //当年一月\r\n\t\t\tlet monthOne = moment().startOf('month').format('YYYY-MM-DD 00:00:00'); //当月第一天\r\n\t\t\tlet oneYearTime = moment(new Date()).subtract(1, 'years').format('YYYY-MM-DD 00:00:00'); //前一月\r\n\t\t\tlet oneEonthTime = moment(new Date()).subtract(1, 'months').format('YYYY-MM-DD 00:00:00'); //前一月\r\n\t\t\tlet oneDayTime = moment(new Date()).subtract(1, 'day').format('YYYY-MM-DD 00:00:00'); //前一天\r\n\t\t\tthis.yeartsStart = oneYearTime\r\n\t\t\tthis.yeartsEnd = endTime\r\n\t\t\tthis.monthValue = [January, endTime]\r\n\t\t\tthis.dateValue = [monthOne, endTime]\r\n\t\t\tthis.yearChange()\r\n\t\t\tthis.monthChange()\r\n\t\t\tthis.dateChange()\r\n\t\t},\r\n\t\tyearChange(val) {\r\n\t\t\tlet times = []\r\n\t\t\tif (val) {\r\n\t\t\t\tif (this.yeartsStart.length == 4 && this.yeartsEnd.length == 19) {\r\n\t\t\t\t\ttimes = [this.yeartsStart + '-01-01 00:00:00', this.yeartsEnd]\r\n\t\t\t\t} else if (this.yeartsEnd.length == 4 && this.yeartsStart.length == 19) {\r\n\t\t\t\t\ttimes = [this.yeartsStart, this.yeartsEnd + '-12-31 23:59:59']\r\n\t\t\t\t} else if (this.yeartsEnd.length == 4 && this.yeartsStart.length == 4) {\r\n\t\t\t\t\ttimes = [this.yeartsStart + '-01-01 00:00:00', this.yeartsEnd + '-12-31 23:59:59']\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttimes = [this.yeartsStart, this.yeartsEnd]\r\n\t\t\t}\r\n\t\t\tlet parmas = {\r\n\t\t\t\ttimeLine: times,\r\n\t\t\t\ttype: 'yyyy'\r\n\t\t\t}\r\n\t\t\twaterStatistical.stationStatistics(parmas, res => {\r\n\t\t\t\tif (res.state) {\r\n\t\t\t\t\tthis.yearList = res.value\r\n\t\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\t\tthis.yearEcharts()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tmonthChange(val) {\r\n\t\t\tthis.monthValue[1] = this.createEndTime(this.monthValue[1])\r\n\t\t\tlet parmas = {\r\n\t\t\t\ttimeLine: this.monthValue,\r\n\t\t\t\ttype: 'yyyy-MM'\r\n\t\t\t}\r\n\t\t\twaterStatistical.stationStatistics(parmas, res => {\r\n\t\t\t\tif (res.state) {\r\n\t\t\t\t\tthis.monthList = res.value\r\n\t\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\t\tthis.monthEcharts()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tdateChange(val) {\r\n\t\t\tthis.dateValue[1] = this.dateValue[1].replace('00:00:00', '23:59:59')\r\n\t\t\tconsole.log(this.dateValue);\r\n\t\t\tlet parmas = {\r\n\t\t\t\ttimeLine: this.dateValue,\r\n\t\t\t\ttype: 'yyyy-MM-dd'\r\n\t\t\t}\r\n\t\t\twaterStatistical.stationStatistics(parmas, res => {\r\n\t\t\t\tif (res.state) {\r\n\t\t\t\t\tthis.dateList = res.value\r\n\t\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\t\tthis.dateEcharts()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tcreateEndTime(startTimeString) {\r\n\t\t\tvar moment = require('moment') //打开时默认时间为一天前至获取当前年月日时分秒\r\n\t\t\tlet currDate = moment(startTimeString)\r\n\t\t\tlet date = new Date(parseInt(currDate.endOf(\"month\").valueOf()))\r\n\t\t\tlet Y = date.getFullYear() + '-';\r\n\t\t\tlet M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) + '-' : date.getMonth() + 1 + '-';\r\n\t\t\tlet D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';\r\n\t\t\treturn Y + M + D + '23:59:59'\r\n\t\t},\r\n\t\tgetData() {\r\n\t\t\twaterStatistical.stationStatistics(this.parmas, res => {\r\n\t\t\t\tif (res.state) {\r\n\t\t\t\t\tif (this.parmas.type == 'yyyy') {\r\n\t\t\t\t\t\tthis.yearList = res.value\r\n\t\t\t\t\t} else if (this.parmas.type == 'yyyy-MM') {\r\n\t\t\t\t\t\tthis.monthList = res.value\r\n\t\t\t\t\t} else if (this.parmas.type == 'yyyy-MM-dd') {\r\n\t\t\t\t\t\tthis.dateList = res.value\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\t\tthis.yearEcharts()\r\n\t\t\t\t\t\tthis.monthEcharts()\r\n\t\t\t\t\t\tthis.dateEcharts()\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tbeginDate() {\r\n\t\t\tlet self = this\r\n\t\t\treturn {\r\n\t\t\t\tdisabledDate(time) {\r\n\t\t\t\t\tif (self.yeartsEnd !== '') {\r\n\t\t\t\t\t\tlet fixedTime = new Date(time)\r\n\t\t\t\t\t\treturn fixedTime.getFullYear() > self.yeartsEnd\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\t// 提出结束时间必须大于提出开始时间\r\n\t\tprocessDate() {\r\n\t\t\tlet self = this\r\n\t\t\treturn {\r\n\t\t\t\tdisabledDate(time) {\r\n\t\t\t\t\tlet fixedTime = new Date(time)\r\n\t\t\t\t\treturn fixedTime.getFullYear() < self.yeartsStart\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tstartTime(val) {\r\n\r\n\t\t},\r\n\t\tyearEcharts() {\r\n\t\t\tlet times = []\r\n\t\t\tlet yNum = []\r\n\t\t\tthis.yearList.forEach(e => {\r\n\t\t\t\ttimes.push(e.x)\r\n\t\t\t\tyNum.push(e.y)\r\n\t\t\t})\r\n\t\t\tlet chartDom = document.getElementById('yearEcharts')\r\n\t\t\tthis.yearEchart = echarts.init(chartDom)\r\n\t\t\tlet option = {\r\n\t\t\t\tgrid: {\r\n\t\t\t\t\ttop: 35,\r\n\t\t\t\t\tleft: 70,// 调整这个属性\r\n\t\t\t\t},\r\n\t\t\t\txAxis: {\r\n\t\t\t\t\ttype: 'category',\r\n\t\t\t\t\tdata: times\r\n\t\t\t\t},\r\n\t\t\t\tyAxis: {\r\n\t\t\t\t\tname: '万m³',\r\n\t\t\t\t\ttype: 'value'\r\n\t\t\t\t},\r\n\t\t\t\ttooltip: {\r\n\t\t\t\t\ttrigger: 'axis',\r\n\t\t\t\t\taxisPointer: {\r\n\t\t\t\t\t\ttype: 'shadow'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tseries: [{\r\n\t\t\t\t\tdata: yNum,\r\n\t\t\t\t\ttype: 'bar'\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t\toption && this.yearEchart.setOption(option)\r\n\t\t\t// 点击事件\r\n\t\t\tthis.yearEchart.on('click', parmas => {\r\n\t\t\t\tthis.$refs.YearStationSub.handleOpen(parmas.name)\r\n\t\t\t\tconsole.log(parmas.name);\r\n\t\t\t\t// console.log(parmas);\r\n\t\t\t})\r\n\t\t},\r\n\t\tmonthEcharts() {\r\n\t\t\tlet times = []\r\n\t\t\tlet yNum = []\r\n\t\t\tthis.monthList.forEach(e => {\r\n\t\t\t\ttimes.push(e.x)\r\n\t\t\t\tyNum.push(e.y)\r\n\t\t\t})\r\n\t\t\tlet chartDom = document.getElementById('monthEcharts')\r\n\t\t\tthis.monthEchart = echarts.init(chartDom)\r\n\t\t\tlet option = {\r\n\t\t\t\tgrid: {\r\n\t\t\t\t\ttop: 35,\r\n\t\t\t\t\tleft: 70,// 调整这个属性\r\n\t\t\t\t},\r\n\t\t\t\txAxis: {\r\n\t\t\t\t\ttype: 'category',\r\n\t\t\t\t\tdata: times\r\n\t\t\t\t},\r\n\t\t\t\tyAxis: {\r\n\t\t\t\t\tname: '万m³',\r\n\t\t\t\t\ttype: 'value'\r\n\t\t\t\t},\r\n\t\t\t\ttooltip: {\r\n\t\t\t\t\ttrigger: 'axis',\r\n\t\t\t\t\taxisPointer: {\r\n\t\t\t\t\t\ttype: 'shadow'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tseries: [{\r\n\t\t\t\t\tdata: yNum,\r\n\t\t\t\t\ttype: 'bar'\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t\toption && this.monthEchart.setOption(option)\r\n\t\t\t// 点击事件\r\n\t\t\tthis.monthEchart.on('click', parmas => {\r\n\t\t\t\tthis.$refs.MonthStationSub.handleOpen(parmas.name)\r\n\t\t\t\tconsole.log(parmas.name);\r\n\t\t\t\t// console.log(parmas);\r\n\t\t\t})\r\n\t\t},\r\n\t\tdateEcharts() {\r\n\t\t\tlet times = []\r\n\t\t\tlet yNum = []\r\n\t\t\tthis.dateList.forEach(e => {\r\n\t\t\t\ttimes.push(e.x)\r\n\t\t\t\tyNum.push(e.y)\r\n\t\t\t})\r\n\t\t\tlet chartDom = document.getElementById('dateEcharts')\r\n\t\t\tthis.dateEchart = echarts.init(chartDom)\r\n\t\t\tlet option = {\r\n\t\t\t\tgrid: {\r\n\t\t\t\t\ttop: 35,\r\n\t\t\t\t\tleft: 60,// 调整这个属性\r\n\t\t\t\t\tright: 60,\r\n\t\t\t\t},\r\n\t\t\t\txAxis: {\r\n\t\t\t\t\ttype: 'category',\r\n\t\t\t\t\tdata: times\r\n\t\t\t\t},\r\n\t\t\t\tyAxis: {\r\n\t\t\t\t\tname: '万m³',\r\n\t\t\t\t\ttype: 'value'\r\n\t\t\t\t},\r\n\t\t\t\ttooltip: {\r\n\t\t\t\t\ttrigger: 'axis',\r\n\t\t\t\t\taxisPointer: {\r\n\t\t\t\t\t\ttype: 'shadow'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tseries: [{\r\n\t\t\t\t\tdata: yNum,\r\n\t\t\t\t\ttype: 'bar'\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t\toption && this.dateEchart.setOption(option)\r\n\t\t\t// 点击事件\r\n\t\t\tthis.dateEchart.on('click', parmas => {\r\n\t\t\t\tthis.$refs.DateStationSub.handleOpen(parmas.name)\r\n\t\t\t\tconsole.log(parmas.name);\r\n\t\t\t})\r\n\t\t}\r\n\t}\r\n}\r\n",null]}