{"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\\sqMonitor\\resWaterLatest.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\sqMonitor\\resWaterLatest.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/es6.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\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 resWaterLatest from '@/api/monitor/resMonitor/resWaterLatest.js';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport { TableMixin } from '@/mixins/tableMixin';\nimport req from '@/request.js';\nimport * as echarts from 'echarts';\nexport default {\n name: 'resWaterLatest',\n components: {// FormDialog,\n },\n mixins: [TableMixin],\n data: function data() {\n return {\n title: '',\n yjdjs: [],\n loading: false,\n basAdNames: [],\n //行政区\n statuss: [{\n name: '在线',\n value: '1'\n }, {\n name: '不在线',\n value: '0'\n }],\n multipleSelection: [],\n // 复选框\n rsnms: [],\n //水库下拉,\n stnms: [],\n //测站下拉\n setKesLabel: {\n value: 'code',\n label: 'name',\n children: 'children'\n },\n queryParam: {\n pageBean: {\n pageSize: 20,\n page: 1\n },\n params: {\n rscd: null,\n stcd: null,\n addvcd: null,\n usfl: null,\n rwptn: null\n }\n },\n rwptns: [],\n //水势\n tableData: [],\n pId: '',\n total: 0,\n showFormDias: false,\n dates: [],\n dangerdz: [],\n dangerjz: [],\n dangerzs: [],\n //水位\n dangerQ: [],\n //流量\n echartLiat: [],\n times: [],\n //选择时间\n czyyfl: [],\n query: {\n stcd: null,\n stnm: null,\n startTime: null,\n endTime: null,\n rscd: null\n },\n timeList: [],\n zzList: [],\n nrstlvList: [],\n dsfllvList: [],\n rstpcList: [],\n chfllvList: [],\n StationId: '',\n loadingChartData: false\n };\n },\n created: function created() {\n this.czyyfl = dictUtils.getDictItemsFromCache('czyyfl');\n this.StationId = window.sessionStorage.getItem('StationId');\n\n if (this.StationId != '' && this.StationId != null && this.StationId != undefined) {\n this.queryParam.params.rscd = this.StationId;\n this.queryParam.pageBean.page = 1;\n this.getDateList();\n this.getSysDict();\n window.sessionStorage.removeItem('StationId');\n } else {\n this.getSysDict();\n }\n },\n methods: {\n openMore: function openMore() {\n this.showMore = !this.showMore;\n },\n onhouChange: function onhouChange(val) {\n if (val) {\n this.queryParam.params.addvcd = val[val.length - 1];\n } else {\n this.queryParam.params.addvcd = null;\n }\n },\n openDate: function openDate(val) {\n var _this = this;\n\n this.echartLiat = [];\n this.loadingChartData = true;\n this.title = val.stnm;\n this.query.startTime = null; //每次打开弹窗时清空上次手动选择的时间\n\n this.query.endTime = null; //每次打开弹窗时清空上次手动选择的时间\n\n this.times = []; //每次打开弹窗时清空上次手动选择的时间\n\n this.query.stcd = val.stcd; //点击打开曲线图时赋值\n\n this.query.stnm = val.stnm; //点击打开曲线图时赋值\n\n this.query.rscd = val.rscd; //点击打开曲线图时赋值\n\n var moment = require('moment'); //打开时默认时间为一天前至获取当前年月日时分秒\n\n\n var _today = moment();\n\n this.showFormDias = true;\n var endTime = moment().format('L'); //当前年月日\n\n var time = moment().format('LTS'); //当前时分秒\n\n endTime = endTime.replace(/\\//g, '-');\n endTime = endTime + ' ' + time;\n\n var startTime = _today.subtract(1, 'days').format('YYYY-MM-DD');\n /*前一天的时间*/\n\n\n startTime = startTime + ' ' + time;\n this.query.startTime = startTime;\n this.query.endTime = endTime;\n this.times = [startTime, endTime];\n var data = {\n query: {\n stnm: val.stnm,\n stcd: val.stcd,\n startTime: startTime,\n endTime: endTime,\n sttp: val.sttp,\n rscd: val.rscd\n }\n };\n this.timeList = [];\n this.zzList = [];\n this.nrstlvList = [];\n this.dsfllvList = [];\n this.chfllvList = [];\n this.rstpcList = [];\n resWaterLatest.getRESChartsList(data.query, function (res) {\n _this.echartLiat = res.value;\n\n if (res.value.length) {\n _this.echartLiat.forEach(function (e) {\n _this.timeList.push(e.tm);\n\n _this.zzList.push(e.zz);\n\n _this.nrstlvList.push(e.nrstlv);\n\n _this.dsfllvList.push(e.dsfllv);\n\n _this.chfllvList.push(e.chfllv);\n\n _this.rstpcList.push(e.rstpc);\n }); // this.dates = this.echartLiat.map((item) => {\n // return item.tm\n // })\n // this.dangerdz = this.echartLiat.map((item) => {\n // return item.dz\n // })\n // this.dangerjz = this.echartLiat.map((item) => {\n // return item.jz\n // })\n // this.dangerzs = this.echartLiat.map((item) => {\n // return item.zz\n // })\n // this.dangerQ = this.echartLiat.map((item) => {\n // return item.q\n // })\n\n\n _this.$nextTick(function () {\n _this.getCharts();\n\n _this.getCharts1();\n });\n } else {\n _this.timeList = [];\n _this.zzList = [];\n _this.nrstlvList = [];\n _this.dsfllvList = [];\n _this.rstpcList = [];\n _this.chfllvList = [];\n\n _this.$nextTick(function () {\n _this.getCharts();\n\n _this.getCharts1();\n });\n }\n\n _this.loadingChartData = false;\n });\n },\n changeChart: function changeChart(val) {\n var _this2 = this;\n\n this.echartLiat = [];\n this.loadingChartData = true;\n\n if (val) {\n this.query.startTime = val[0];\n this.query.endTime = val[1];\n this.timeList = [];\n this.zzList = [];\n this.nrstlvList = [];\n this.dsfllvList = [];\n this.chfllvList = [];\n this.rstpcList = [];\n resWaterLatest.getRESChartsList(this.query, function (res) {\n if (res.value.length) {\n _this2.echartLiat = res.value;\n\n _this2.echartLiat.forEach(function (e) {\n _this2.timeList.push(e.tm);\n\n _this2.zzList.push(e.zz);\n\n _this2.nrstlvList.push(e.nrstlv);\n\n _this2.dsfllvList.push(e.dsfllv);\n\n _this2.chfllvList.push(e.chfllv);\n\n _this2.rstpcList.push(e.rstpc);\n }); // this.dates = this.echartLiat.map((item) => {\n // return item.tm\n // })\n // this.dangerdz = this.echartLiat.map((item) => {\n // return item.dz\n // })\n // this.dangerjz = this.echartLiat.map((item) => {\n // return item.jz;\n // })\n // this.dangerzs = this.echartLiat.map((item) => {\n // return item.zz;\n // })\n // this.dangerQ = this.echartLiat.map((item) => {\n // return item.q;\n // })\n\n }\n\n _this2.$nextTick(function () {\n console.log(_this2.dangerzs, 666);\n\n _this2.getCharts();\n\n _this2.getCharts1();\n });\n\n _this2.loadingChartData = false;\n });\n } else {\n this.$message.warning('请选择查询时间范围!');\n this.query.startTime = '';\n this.query.endTime = '';\n this.times = [];\n this.timeList = [];\n this.zzList = [];\n this.nrstlvList = [];\n this.dsfllvList = [];\n this.chfllvList = [];\n this.rstpcList = [];\n this.$nextTick(function () {\n _this2.getCharts();\n\n _this2.getCharts1();\n });\n this.loadingChartData = false;\n return;\n resWaterLatest.getRESChartsList(this.query, function (res) {\n if (res.value.length) {\n _this2.echartLiat = res.value;\n\n _this2.echartLiat.forEach(function (e) {\n _this2.timeList.push(e.tm);\n\n _this2.zzList.push(e.zz);\n\n _this2.nrstlvList.push(e.nrstlv);\n\n _this2.dsfllvList.push(e.dsfllv);\n\n _this2.chfllvList.push(e.chfllv);\n\n _this2.rstpcList.push(e.rstpc);\n }); // this.dates = this.echartLiat.map((item) => {\n // return item.tm;\n // })\n // this.dangerdz = this.echartLiat.map((item) => {\n // return item.dz;\n // })\n // this.dangerjz = this.echartLiat.map((item) => {\n // return item.jz;\n // })\n // this.dangerzs = this.echartLiat.map((item) => {\n // return item.zz;\n // })\n // this.dangerQ = this.echartLiat.map((item) => {\n // return item.q;\n // })\n\n\n _this2.$nextTick(function () {\n console.log(_this2.dangerzs, 777);\n\n _this2.getCharts();\n\n _this2.getCharts1();\n });\n }\n });\n }\n },\n getCharts1: function getCharts1() {\n var echartList = this.echartLiat;\n var chartDom = document.getElementById('echartsBox1');\n var myChart = echarts.init(chartDom);\n var option = {\n title: {\n text: ''\n },\n tooltip: {\n trigger: 'axis',\n formatter: function formatter(params) {\n // params 是一个包含详细信息的对象\n // 可以根据 params 中的数据自定义 tooltip 的展示\n var html = '';\n\n for (var i = 0; i < params.length; i++) {\n var color = params[i].color;\n var name = params[i].seriesName;\n var value = params[i].data ? params[i].data : '-';\n var dataIndex = params[i].dataIndex;\n var marker = '';\n var label = '' + name + '';\n var valueLabel = '';\n var yue = name == '库容' ? '约' : '';\n\n if (echartList[dataIndex].isMatched == 'f') {\n valueLabel = '' + yue + value + '';\n } else {\n valueLabel = '' + value + '';\n }\n\n html += marker + label + valueLabel + '
';\n }\n\n return html;\n }\n },\n legend: {\n // data: ['当前水位', '库容'],\n data: ['库容']\n },\n grid: {\n left: '8%',\n right: '4%',\n bottom: '6%',\n containLabel: true\n },\n // toolbox: {\n // feature: {\n // saveAsImage: {},\n // },\n // },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n data: this.timeList\n },\n yAxis: {\n type: 'value',\n scale: true\n },\n series: [// {\n // name: '当前水位',\n // type: 'line',\n // emphasis: {\n // focus: 'series',\n // },\n // data: this.zzList,\n // itemStyle: {\n // color: '#0091ff',\n // },\n // },\n {\n name: '库容',\n type: 'line',\n emphasis: {\n focus: 'series'\n },\n data: this.rstpcList,\n itemStyle: {\n normal: {\n color: 'green',\n lineStyle: {\n color: 'green'\n }\n }\n }\n }]\n };\n option && myChart.setOption(option);\n },\n getCharts: function getCharts() {\n var chartDom = document.getElementById('echartsBox');\n var myChart = echarts.init(chartDom);\n var option = {\n title: {\n text: ''\n },\n tooltip: {\n trigger: 'axis'\n },\n legend: {\n data: ['警戒水位', '设计洪水位', '校核洪水位', '当前水位']\n },\n grid: {\n left: '8%',\n right: '4%',\n bottom: '6%',\n containLabel: true\n },\n // toolbox: {\n // feature: {\n // saveAsImage: {},\n // },\n // },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n data: this.timeList\n },\n yAxis: {\n type: 'value',\n scale: true\n },\n series: [{\n name: '警戒水位',\n type: 'line',\n emphasis: {\n focus: 'series'\n },\n data: this.nrstlvList,\n itemStyle: {\n normal: {\n color: 'yellow',\n lineStyle: {\n color: 'yellow'\n }\n }\n }\n }, {\n name: '设计洪水位',\n type: 'line',\n emphasis: {\n focus: 'series'\n },\n data: this.dsfllvList,\n itemStyle: {\n normal: {\n color: '#ff6347',\n lineStyle: {\n color: '#ff6347'\n }\n }\n }\n }, {\n name: '校核洪水位',\n type: 'line',\n emphasis: {\n focus: 'series'\n },\n data: this.chfllvList,\n itemStyle: {\n normal: {\n color: '#b22222',\n lineStyle: {\n color: '#b22222'\n }\n }\n }\n }, {\n name: '当前水位',\n type: 'line',\n emphasis: {\n focus: 'series'\n },\n data: this.zzList,\n itemStyle: {\n color: '#0091ff'\n }\n }]\n };\n option && myChart.setOption(option);\n },\n handleClose: function handleClose() {\n this.echartLiat = [];\n this.showFormDias = false;\n },\n floatSub: function floatSub(arg1, arg2) {\n var r1, r2, m, n;\n\n try {\n r1 = arg1.toString().split('.')[1].length;\n } catch (e) {\n r1 = 0;\n }\n\n try {\n r2 = arg2.toString().split('.')[1].length;\n } catch (e) {\n r2 = 0;\n }\n\n m = Math.pow(10, Math.max(r1, r2));\n console.log(m); //动态控制精度长度\n\n n = r1 >= r2 ? r1 : r2;\n return ((arg1 * m - arg2 * m) / m).toFixed(n);\n },\n getDateList: function getDateList() {\n var _this3 = this;\n\n this.loading = true;\n this.tableData = [];\n resWaterLatest.ListGet(this.queryParam, function (res) {\n _this3.total = res.value.total;\n _this3.tableData = JSON.parse(JSON.stringify(res.value.rows));\n\n _this3.tableData.forEach(function (e) {\n if (e.rz > e.nrstlv) {\n e.transfinite = _this3.floatSub(e.rz, e.nrstlv);\n } else {\n e.transfinite = '--';\n }\n\n _this3.rwptns.forEach(function (w) {\n if (e.rwptn == w.value) {\n e.rwptn = w.name;\n }\n });\n\n _this3.czyyfl.forEach(function (c) {\n if (e.appType == c.value) {\n e.appTypeName = c.name;\n }\n });\n });\n\n _this3.$set(_this3.tableData);\n\n _this3.loading = false;\n });\n },\n rowStyle: function rowStyle(_ref) {\n var row = _ref.row,\n rowIndex = _ref.rowIndex;\n\n if (row.warnGrade == '2') {\n return 'orange_class';\n } else if (row.warnGrade == '1') {\n return 'error_class';\n } else if (row.warnGrade == 3) {\n return 'success_class';\n }\n\n return '';\n },\n handleSizeChange: function handleSizeChange(val) {\n this.queryParam.pageBean.pageSize = val;\n this.getDateList();\n },\n handleCurrentChange: function handleCurrentChange(val) {\n this.queryParam.pageBean.page = val;\n this.getDateList();\n },\n handleSelectionChange: function handleSelectionChange(val) {\n this.multipleSelection = val.map(function (item) {\n return item.id;\n });\n },\n //获取字典数据\n getSysDict: function getSysDict() {\n var _this4 = this;\n\n var portal = window.context.portal;\n return new Promise(function (resolve, reject) {\n req.post(portal + '/sys/sysDictionary/v1/queryAllDictItems').then(function (response) {\n resolve(response.data);\n _this4.rwptns = response.data.ss; //水势\n\n _this4.yjdjs = response.data.yjdj;\n resWaterLatest.getbasAdName({}, function (res) {\n _this4.basAdNames = res.value;\n });\n resWaterLatest.getRsnm({}, function (res) {\n _this4.rsnms = res.value;\n });\n resWaterLatest.getStnms({}, function (res) {\n _this4.stnms = res.value;\n });\n\n _this4.getDateList();\n }, function (error) {\n reject(error);\n });\n });\n },\n // // 点击查询\n onClickSearch: function onClickSearch() {\n this.queryParam.pageBean.page = 1;\n this.getDateList();\n },\n // 重置\n resetQuery: function resetQuery() {\n this.queryParam.params = {};\n this.onClickSearch();\n }\n }\n};",null]}