{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\module\\RealTimeRainModel.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\gisTabComponents\\module\\RealTimeRainModel.vue","mtime":1684458238637},{"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\r\nimport * as echarts from 'echarts'\r\nimport gisMap from '@/api/frontScreen/gisMap.js'\r\nexport default {\r\n name: 'RealTimeRainModel',\r\n props: {\r\n currentPoint: {\r\n type: Object,\r\n default: () => {\r\n return {}\r\n },\r\n },\r\n\t\ttimes: {\r\n\t\t type: Array,\r\n\t\t default: () => {\r\n\t\t return {}\r\n\t\t },\r\n\t\t},\r\n\t\tframeTime: {\r\n\t\t type: String,\r\n\t\t default: () => {\r\n\t\t return {}\r\n\t\t },\r\n\t\t},\r\n },\r\n data() {\r\n return {\r\n params:{\r\n stcd:null,\r\n\t\t\t\ttmOrderAsc:true\r\n },\r\n timeList:[],\r\n rainChart: null, //雨情\r\n rainList:[],\r\n\t\t\twaterHistoryLists:[]\r\n }\r\n },\r\n inject: ['mapData'],\r\n created() {\r\n let mapData = this.mapData()\r\n this.districtData = this.originData\r\n this.T = mapData.T\r\n this.map = mapData.map\r\n },\r\n watch: {\r\n\t currentPoint: {\r\n\t handler(newVal) {\r\n\t\t\t\tthis.getFindResList()\r\n\t },\r\n\t }\r\n\t},\r\n mounted() {\r\n this.$nextTick(() => {\r\n // this.initCharts()\r\n \r\n })\r\n },\r\n updated() {\r\n // this.rainChart.resize()\r\n },\r\n beforeDestroy() {},\r\n methods: {\r\n getFindResList(){\r\n\t\t\tif(this.times.length>0){\r\n\t\t\t\tthis.params.startTime=this.times[0]\r\n\t\t\t\tthis.params.endTime=this.times[1]\r\n\t\t\t}else{\r\n\t\t\t\tthis.params.startTime=\"\"\r\n\t\t\t\tthis.params.endTime=\"\"\r\n\t\t\t}\r\n\t\t\tthis.params.stcd=this.currentPoint.stcd\r\n\t\t\tthis.params.tm=this.currentPoint.tm\r\n\t\t\tgisMap.pptnLatestList(this.params,res=>{\r\n\t\t\t\tif(res.state){\r\n\t\t\t\t\tthis.waterHistoryLists=res.value\r\n this.$nextTick(()=>{\r\n\t\t\t\t\t this.initRainChart()\r\n\t\t\t\t })\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n initCharts() {\r\n this.initRainChart()\r\n },\r\n initRainChart() {\r\n\t\t\tlet rainList = []\r\n\t\t\tlet timeList = []\r\n\t\t\tlet alertList=[]//警戒\r\n\t\t\tlet dangerList=[]//危险\r\n\t\t\t this.waterHistoryLists.forEach(e=>{\r\n let alter = {}, danger={}\r\n e.thresholdData.forEach(item=>{\r\n if(item.gradeCode == 1){ //警戒\r\n alter = item\r\n }else if(item.gradeCode == 2){ //危险\r\n danger = item\r\n }\r\n })\r\n\t\t\t timeList.push(e.tm)\r\n\t\t\t\tswitch (this.frameTime){\r\n\t\t\t\t\tcase 'drp':\r\n\t\t\t\t\trainList.push(e.drp)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'pn10':\r\n\t\t\t\t\trainList.push(e.pn10)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'pn30':\r\n\t\t\t\t\trainList.push(e.pn30)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'p1':\r\n\t\t\t\t\trainList.push(e.p1)\r\n\t\t\t\t\tdangerList.push(danger.yjz)\r\n alertList.push(alter.yjz)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'p3':\r\n\t\t\t\t\trainList.push(e.p3)\r\n\t\t\t\t\tdangerList.push(danger.shhjz)\r\n alertList.push(alter.shhjz)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'p6':\r\n\t\t\t\t\trainList.push(e.p6)\r\n\t\t\t\t\tdangerList.push(danger.lhjz)\r\n alertList.push(alter.lhjz)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'p12':\r\n\t\t\t\t\trainList.push(e.p12)\r\n\t\t\t\t\tdangerList.push(danger.sejz)\r\n alertList.push(alter.sejz)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'p24':\r\n\t\t\t\t\trainList.push(e.p24)\r\n dangerList.push(danger.esjz)\r\n\t\t\t\t\talertList.push(alter.esjz)\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'dyp':\r\n\t\t\t\t\trainList.push(e.dyp)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t})\r\n\t\t\tconsole.log(alertList);\r\n\t\t\tconsole.log(dangerList);\r\n const rainChartDom = document.getElementById('rainChart')\r\n this.rainChart = echarts.init(rainChartDom)\r\n let option = {\r\n tooltip: {\r\n appendToBody: true,\r\n trigger: 'axis',\r\n backgroundColor: 'rgba(0,0,0,0.7)',\r\n textStyle: {\r\n color: '#dddee0',\r\n },\r\n axisPointer: {\r\n type: 'cross',\r\n label: {\r\n backgroundColor: '#6a7985',\r\n },\r\n },\r\n },\r\n legend: {\r\n bottom: 0,\r\n right: 0,\r\n data: ['雨量(mm)','危险阈值','警戒阈值'],\r\n textStyle: {\r\n color: '#adb9ba',\r\n fontSize: 10,\r\n },\r\n },\r\n grid: {\r\n top: '4%',\r\n left: '4%',\r\n right: '4%',\r\n bottom: '16%',\r\n containLabel: true,\r\n },\r\n xAxis: [\r\n {\r\n type: 'category',\r\n boundaryGap: false,\r\n data: timeList,\r\n },\r\n ],\r\n yAxis: [\r\n {\r\n type: 'value',\r\n\t\t\t\t\t\t scale:true\r\n },\r\n ],\r\n series: [\r\n {\r\n name: '雨量(mm)',\r\n type: 'line',\r\n // smooth: true,\r\n // areaStyle: {},\r\n // emphasis: {\r\n // focus: 'series',\r\n // },\r\n data:rainList,\r\n itemStyle: {\r\n color: '#6767ff',\r\n },\r\n },\r\n\t\t\t\t\t{\r\n\t\t\t\t\t name: '危险阈值',\r\n\t\t\t\t\t type: 'line',\r\n\t\t\t\t\t data: dangerList,\r\n\t\t\t\t\t itemStyle: {\r\n\t\t\t\t\t color: 'red',\r\n\t\t\t\t\t },\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t name: '警戒阈值',\r\n\t\t\t\t\t type: 'line',\r\n\t\t\t\t\t data: alertList,\r\n\t\t\t\t\t itemStyle: {\r\n\t\t\t\t\t color: 'yellow',\r\n\t\t\t\t\t },\r\n\t\t\t\t\t},\r\n ],\r\n }\r\n option && this.rainChart.setOption(option)\r\n },\r\n },\r\n}\r\n",null]}