{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\resMonitor\\ylStQuery.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\resMonitor\\ylStQuery.vue","mtime":1684458239402},{"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//\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//\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//\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//\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//\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\r\nimport ylStQuery from '@/api/monitor/resMonitor/ylStQuery.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport TimeSelection from './components/TimeSelection.vue'\r\nimport * as echarts from 'echarts'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport req from '@/request.js'\r\nexport default {\r\n name: 'displacement',\r\n components: {\r\n TimeSelection,\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n warnSds: [\r\n {\r\n value: 'pn10',\r\n warnSdMsg: '10分钟时段降水量',\r\n },\r\n {\r\n value: 'pn30',\r\n warnSdMsg: '30分钟时段降水量',\r\n },\r\n {\r\n value: 'p1',\r\n warnSdMsg: '1小时时段降水量',\r\n },\r\n {\r\n value: 'p3',\r\n warnSdMsg: '3小时时段降水量',\r\n },\r\n {\r\n value: 'p6',\r\n warnSdMsg: '6小时时段降水量',\r\n },\r\n {\r\n value: 'p12',\r\n warnSdMsg: '12小时时段降水量',\r\n },\r\n {\r\n value: 'pd',\r\n warnSdMsg: '24小时时段降水量',\r\n },\r\n ],\r\n total: 0,\r\n showFormDias: false,\r\n tableData: [],\r\n loading: false,\r\n basAdNames: [], //行政区\r\n yjdjs: [],\r\n title: '',\r\n statuss: [\r\n {\r\n name: '在线',\r\n value: '1',\r\n },\r\n {\r\n name: '不在线',\r\n value: '0',\r\n },\r\n ],\r\n czyyfl: [],\r\n times: [],\r\n timeValue: 'drp',\r\n multipleSelection: [], // 复选框\r\n stnms: [], //测站下拉\r\n setKesLabel: {\r\n value: 'code',\r\n label: 'name',\r\n children: 'children',\r\n },\r\n queryParam: {\r\n pageBean: {\r\n pageSize: 20,\r\n page: 1,\r\n },\r\n params: {\r\n appType: '',\r\n warnGrade: null,\r\n stcd: null,\r\n addvcd: null,\r\n usfl: null,\r\n timeFrame: 'yjz',\r\n },\r\n },\r\n query: {\r\n stcd: '60749857',\r\n stnm: null,\r\n startTime: null,\r\n endTime: null,\r\n },\r\n timeFrameList: [\r\n {\r\n name: '1小时',\r\n value: 'yjz',\r\n },\r\n {\r\n name: '3小时',\r\n value: 'shhjz',\r\n },\r\n {\r\n name: '6小时',\r\n value: 'lhjz',\r\n },\r\n {\r\n name: '12小时',\r\n value: 'sejz',\r\n },\r\n {\r\n name: '24小时',\r\n value: 'esjz',\r\n },\r\n ],\r\n options: [\r\n {\r\n label: 'drp',\r\n name: '默认',\r\n },\r\n {\r\n label: 'pn10',\r\n name: '10分',\r\n },\r\n {\r\n label: 'pn30',\r\n name: '30分',\r\n },\r\n {\r\n label: 'p1',\r\n name: '1小时',\r\n },\r\n {\r\n label: 'p3',\r\n name: '3小时',\r\n },\r\n {\r\n label: 'p6',\r\n name: '6小时',\r\n },\r\n {\r\n label: 'p12',\r\n name: '12小时',\r\n },\r\n {\r\n label: 'pd',\r\n name: '24小时',\r\n },\r\n {\r\n label: 'dyp',\r\n name: '日降雨量',\r\n },\r\n ],\r\n echartLiat: [],\r\n loadingChartData: false,\r\n StationId: '',\r\n refreshData: null,\r\n }\r\n },\r\n created() {\r\n this.StationId = window.sessionStorage.getItem('StationId')\r\n this.czyyfl = dictUtils.getDictItemsFromCache('czyyfl')\r\n this.getSysDict()\r\n if (\r\n this.StationId != '' &&\r\n this.StationId != null &&\r\n this.StationId != undefined\r\n ) {\r\n this.queryParam.params.stcd = this.StationId\r\n this.queryParam.pageBean.page = 1\r\n this.getDateList()\r\n window.sessionStorage.removeItem('StationId')\r\n }\r\n },\r\n mounted() {\r\n //自动刷新获取数据(1000*60*10=>毫秒*秒*分钟,此时表示为10分钟)\r\n this.refreshData = setInterval(() => {\r\n this.getSysDict()\r\n }, 1000 * 60 * 10)\r\n },\r\n //生命周期若已设置定时器,需清空定时器beforeDestroy()\r\n beforeDestroy() {\r\n this.refreshData = null\r\n },\r\n methods: {\r\n // 导出表格弹窗显示\r\n updateExcl() {\r\n this.$refs.Time.openShare()\r\n },\r\n openMore() {\r\n this.showMore = !this.showMore\r\n },\r\n onhouChange(val) {\r\n if (val) {\r\n this.queryParam.params.addvcd = val[val.length - 1]\r\n } else {\r\n this.queryParam.params.addvcd = null\r\n }\r\n },\r\n getDateList() {\r\n this.loading = true\r\n this.tableData = []\r\n ylStQuery.ListGet(this.queryParam, (res) => {\r\n this.total = res.value.total\r\n this.tableData = JSON.parse(JSON.stringify(res.value.rows))\r\n this.tableData.forEach((e) => {\r\n this.warnSds.forEach((w) => {\r\n if (e.warnSd == w.value) {\r\n e.warnSd = w.warnSdMsg\r\n }\r\n })\r\n this.yjdjs.forEach((c) => {\r\n if (e.warnGrade == c.value) {\r\n e.level = c.name\r\n }\r\n })\r\n this.czyyfl.forEach((c) => {\r\n if (e.appType == c.value) {\r\n e.appTypeName = c.name\r\n }\r\n })\r\n })\r\n this.$set(this.tableData)\r\n this.loading = false\r\n })\r\n },\r\n handleSizeChange(val) {\r\n this.queryParam.pageBean.pageSize = val\r\n this.getDateList()\r\n },\r\n\r\n rowStyle({row, rowIndex}) {\r\n if (row.warnGrade == '2') {\r\n return 'orange_class'\r\n } else if (row.warnGrade == '1') {\r\n return 'error_class'\r\n } else if (row.warnGrade == 3) {\r\n return 'success_class'\r\n }\r\n return ''\r\n },\r\n handleCurrentChange(val) {\r\n this.queryParam.pageBean.page = val\r\n this.getDateList()\r\n },\r\n handleSelectionChange(val) {\r\n this.multipleSelection = val.map((item) => {\r\n return item.id\r\n })\r\n },\r\n //获取字典数据\r\n getSysDict() {\r\n let portal = window.context.portal\r\n return new Promise((resolve, reject) => {\r\n req.post(\r\n portal + '/sys/sysDictionary/v1/queryAllDictItems'\r\n ).then(\r\n (response) => {\r\n resolve(response.data)\r\n this.yjdjs = response.data.yjdj\r\n ylStQuery.getbasAdName({}, (res) => {\r\n this.basAdNames = res.value\r\n })\r\n ylStQuery.getStnms({}, (res) => {\r\n this.stnms = res.value\r\n })\r\n this.getDateList()\r\n },\r\n (error) => {\r\n reject(error)\r\n }\r\n )\r\n })\r\n },\r\n // // 点击查询\r\n onClickSearch() {\r\n this.queryParam.pageBean.page = 1\r\n this.getDateList()\r\n },\r\n // 重置\r\n resetQuery() {\r\n this.queryParam.params = {}\r\n this.onClickSearch()\r\n },\r\n openDate(val) {\r\n this.echartLiat = []\r\n this.loadingChartData = true\r\n console.log(val)\r\n this.title = val.stnm\r\n this.timeValue = 'drp'\r\n this.query.startTime = null //每次打开弹窗时清空上次手动选择的时间\r\n this.query.endTime = null //每次打开弹窗时清空上次手动选择的时间\r\n this.times = [] //每次打开弹窗时清空上次手动选择的时间\r\n this.query.stcd = val.stcd //点击打开曲线图时赋值\r\n this.query.stnm = val.stnm //点击打开曲线图时赋值\r\n var moment = require('moment') //打开时默认时间为一天前至获取当前年月日时分秒\r\n var _today = moment()\r\n this.showFormDias = true\r\n let endTime = moment().format('L') //当前年月日\r\n let time = moment().format('LTS') //当前时分秒\r\n endTime = endTime.replace(/\\//g, '-')\r\n endTime = endTime + ' ' + time\r\n let startTime = _today\r\n .subtract(1, 'days')\r\n .format('YYYY-MM-DD') /*前一天的时间*/\r\n startTime = startTime + ' ' + time\r\n this.query.startTime = startTime\r\n this.query.endTime = endTime\r\n this.times = [startTime, endTime]\r\n let data = {\r\n query: {\r\n stnm: '',\r\n stcd: val.stcd,\r\n startTime: startTime,\r\n endTime: endTime,\r\n sttp: val.sttp,\r\n },\r\n // {\r\n // \tendTime: \"2022-05-20 15:17:33\",\r\n // \tstartTime: \"2022-05-19 15:00:33\",\r\n // \tstcd: \"60749857\",\r\n // }\r\n }\r\n ylStQuery.pptnList(data.query, (res) => {\r\n this.echartLiat = res.value\r\n if (res.value.length > 0) {\r\n this.dates = this.echartLiat.map((item) => {\r\n return item.tm\r\n })\r\n this.dangerzs = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'drp') {\r\n return item.drp\r\n }\r\n })\r\n this.dangerjz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.jj1\r\n } else if (this.timeValue == 'p3') {\r\n return item.jj3\r\n } else if (this.timeValue == 'p6') {\r\n return item.jj6\r\n } else if (this.timeValue == 'p12') {\r\n return item.jj12\r\n } else if (this.timeValue == 'pd') {\r\n return item.jj24\r\n }\r\n })\r\n this.dangerdz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.wx1\r\n } else if (this.timeValue == 'p3') {\r\n return item.wx3\r\n } else if (this.timeValue == 'p6') {\r\n return item.wx6\r\n } else if (this.timeValue == 'p12') {\r\n return item.wx12\r\n } else if (this.timeValue == 'pd') {\r\n return item.wx24\r\n }\r\n })\r\n this.$nextTick(() => {\r\n this.getCharts()\r\n })\r\n } else {\r\n this.dangerdz = []\r\n this.dates = []\r\n this.dangerjz = []\r\n this.dangerQ = []\r\n this.dangerzs = []\r\n this.$nextTick(() => {\r\n this.getCharts()\r\n })\r\n }\r\n this.loadingChartData = false\r\n })\r\n },\r\n handleClose() {\r\n this.echartLiat = []\r\n this.showFormDias = false\r\n },\r\n changeChart() {\r\n this.echartLiat = []\r\n this.loadingChartData = true\r\n if (this.times && this.times.length > 0) {\r\n this.query.startTime = this.times[0]\r\n this.query.endTime = this.times[1]\r\n this.dangerdz = []\r\n this.dates = []\r\n this.dangerjz = []\r\n this.dangerzs = []\r\n this.dangerQ = []\r\n ylStQuery.pptnList(this.query, (res) => {\r\n console.log(res.value.length)\r\n if (res.value.length > 0) {\r\n this.echartLiat = res.value\r\n this.dates = this.echartLiat.map((item) => {\r\n return item.tm\r\n })\r\n this.dangerzs = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'drp') {\r\n return item.drp\r\n } else if (this.timeValue == 'pn10') {\r\n return item.pn10\r\n } else if (this.timeValue == 'pn30') {\r\n return item.pn30\r\n } else if (this.timeValue == 'p1') {\r\n return item.p1\r\n } else if (this.timeValue == 'p3') {\r\n return item.p3\r\n } else if (this.timeValue == 'p6') {\r\n return item.p6\r\n } else if (this.timeValue == 'p12') {\r\n return item.p12\r\n } else if (this.timeValue == 'pd') {\r\n return item.pd\r\n } else if (this.timeValue == 'dyp') {\r\n return item.dyp\r\n }\r\n })\r\n this.dangerjz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.jj1\r\n } else if (this.timeValue == 'p3') {\r\n return item.jj3\r\n } else if (this.timeValue == 'p6') {\r\n return item.jj6\r\n } else if (this.timeValue == 'p12') {\r\n return item.jj12\r\n } else if (this.timeValue == 'pd') {\r\n return item.jj24\r\n }\r\n })\r\n this.dangerdz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.wx1\r\n } else if (this.timeValue == 'p3') {\r\n return item.wx3\r\n } else if (this.timeValue == 'p6') {\r\n return item.wx6\r\n } else if (this.timeValue == 'p12') {\r\n return item.wx12\r\n } else if (this.timeValue == 'pd') {\r\n return item.wx24\r\n }\r\n })\r\n console.log(this.dangerzs)\r\n this.$nextTick(() => {\r\n this.getCharts()\r\n })\r\n } else {\r\n this.dangerdz = []\r\n this.dates = []\r\n this.$nextTick(() => {\r\n this.getCharts()\r\n })\r\n }\r\n this.loadingChartData = false\r\n })\r\n } else {\r\n this.$message.warning('请选择查询时间范围!')\r\n this.loadingChartData = false\r\n this.query.startTime = ''\r\n this.query.endTime = ''\r\n this.times = []\r\n this.dangerdz = []\r\n this.dates = []\r\n this.dangerjz = []\r\n this.dangerzs = []\r\n this.dangerQ = []\r\n this.$nextTick(() => {\r\n console.log(this.dangerzs, 777)\r\n this.getCharts()\r\n })\r\n return\r\n ylStQuery.pptnList(this.query, (res) => {\r\n return\r\n if (res.value.length > 0) {\r\n this.echartLiat = res.value\r\n this.dates = this.echartLiat.map((item) => {\r\n return item.tm\r\n })\r\n this.dangerzs = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'drp') {\r\n return item.drp\r\n } else if (this.timeValue == 'pn10') {\r\n return item.pn10\r\n } else if (this.timeValue == 'pn30') {\r\n return item.pn30\r\n } else if (this.timeValue == 'p1') {\r\n return item.p1\r\n } else if (this.timeValue == 'p3') {\r\n return item.p3\r\n } else if (this.timeValue == 'p6') {\r\n return item.p6\r\n } else if (this.timeValue == 'p12') {\r\n return item.p12\r\n } else if (this.timeValue == 'pd') {\r\n return item.pd\r\n } else if (this.timeValue == 'dyp') {\r\n return item.dyp\r\n }\r\n })\r\n this.dangerjz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.jj1\r\n } else if (this.timeValue == 'p3') {\r\n return item.jj3\r\n } else if (this.timeValue == 'p6') {\r\n return item.jj6\r\n } else if (this.timeValue == 'p12') {\r\n return item.jj12\r\n } else if (this.timeValue == 'pd') {\r\n return item.jj24\r\n }\r\n })\r\n this.dangerdz = this.echartLiat.map((item) => {\r\n if (this.timeValue == 'p1') {\r\n return item.wx1\r\n } else if (this.timeValue == 'p3') {\r\n return item.wx3\r\n } else if (this.timeValue == 'p6') {\r\n return item.wx6\r\n } else if (this.timeValue == 'p12') {\r\n return item.wx12\r\n } else if (this.timeValue == 'pd') {\r\n return item.wx24\r\n }\r\n })\r\n this.$nextTick(() => {\r\n console.log(this.dangerzs, 777)\r\n this.getCharts()\r\n })\r\n }\r\n })\r\n }\r\n },\r\n getCharts() {\r\n let chartDom = document.getElementById('echartsBox')\r\n let myChart = echarts.init(chartDom)\r\n let option = {\r\n title: {\r\n text: '',\r\n },\r\n tooltip: {\r\n trigger: 'axis',\r\n },\r\n legend: {\r\n data: ['危险', '警戒', '降雨量(m)'],\r\n },\r\n grid: {\r\n left: '8%',\r\n right: '4%',\r\n bottom: '6%',\r\n containLabel: true,\r\n },\r\n // toolbox: {\r\n // feature: {\r\n // saveAsImage: {},\r\n // },\r\n // },\r\n xAxis: {\r\n type: 'category',\r\n boundaryGap: false,\r\n data: this.dates,\r\n },\r\n yAxis: {\r\n type: 'value',\r\n scale: true,\r\n },\r\n series: [\r\n {\r\n name: '危险',\r\n type: 'line',\r\n itemStyle: {\r\n normal: {\r\n color: 'red',\r\n lineStyle: {\r\n color: 'red',\r\n },\r\n },\r\n },\r\n data: this.dangerdz, // [120, 132, 101, 134, 90, 230, 210],\r\n },\r\n {\r\n name: '警戒',\r\n type: 'line',\r\n itemStyle: {\r\n normal: {\r\n color: '#FAC858',\r\n lineStyle: {\r\n color: '#FAC858',\r\n },\r\n },\r\n },\r\n data: this.dangerjz, //[220, 182, 191, 234, 290, 330, 310],\r\n },\r\n {\r\n name: '降雨量(m)',\r\n type: 'line',\r\n itemStyle: {\r\n normal: {\r\n color: '#5470C6',\r\n lineStyle: {\r\n color: '#5470C6',\r\n },\r\n },\r\n },\r\n data: this.dangerzs, // [150, 232, 201, 154, 190, 330, 410],\r\n },\r\n ],\r\n }\r\n option && myChart.setOption(option)\r\n },\r\n },\r\n}\r\n",null]}