{"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\\hdWaterHistory.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\sqMonitor\\hdWaterHistory.vue","mtime":1684458239402},{"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//\nimport hdWaterHistory from '@/api/monitor/resMonitor/hdWaterHistory.js';\nimport dictUtils from '@/components/dict/DictSelectUtils.js';\nimport { TableMixin } from '@/mixins/tableMixin';\nimport * as echarts from 'echarts';\nimport req from '@/request.js';\nexport default {\n name: 'hdWaterHistory',\n components: {},\n mixins: [TableMixin],\n data: function data() {\n return {\n title: '',\n scopeTime: '',\n setKesLabels: {\n value: 'code',\n label: 'name',\n children: 'children'\n },\n loading: false,\n wptns: [],\n //水势\n statuss: [{\n name: '在线',\n value: '1'\n }, {\n name: '不在线',\n value: '0'\n }],\n multipleSelection: [],\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 stcd: null,\n wptn: null,\n usfl: null,\n startTime: null,\n endTime: null\n }\n },\n tableData: [],\n stcds: [],\n //河道测站\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 },\n timeList: [],\n jzList: [],\n bzList: [],\n fhList: [],\n zgList: [],\n zzList: [],\n baseUrl: null,\n loadingChartData: false\n };\n },\n created: function created() {\n this.baseUrl = window.context.portal;\n this.czyyfl = dictUtils.getDictItemsFromCache('czyyfl');\n this.getCurrentMonthLast();\n this.getDateList();\n this.getSysDict();\n },\n methods: {\n openMore: function openMore() {\n this.showMore = !this.showMore;\n },\n //导出excl\n updateExcl: function updateExcl() {\n var _this = this;\n\n var loading = this.$loading({\n lock: true,\n text: '导出中...',\n spinner: 'el-icon-loading',\n background: 'rgba(0, 0, 0, 0.7)'\n });\n var param = {\n groupRelation: 'AND',\n groupTree: {},\n pageBean: {\n page: 1,\n pageSize: -1,\n showTotal: true\n },\n params: {\n startTime: this.queryParam.params.startTime,\n endTime: this.queryParam.params.endTime,\n stnm: this.queryParam.params.stnm,\n stcd: this.queryParam.params.stcd,\n usfl: this.queryParam.params.usfl,\n appType: this.queryParam.params.appType,\n wptn: this.queryParam.params.wptn\n },\n querys: [{\n group: 'main',\n operation: 'EQUAL',\n parentGroup: '',\n property: '',\n relation: 'AND',\n value: {}\n }],\n sorter: [{\n direction: 'ASC',\n property: ''\n }]\n };\n hdWaterHistory.riverHistoryExport(param, function (res) {\n loading.close();\n\n if (res.state == false) {\n _this.$message.error(res.message);\n } else {\n _this.$message.success('导出成功');\n }\n });\n },\n //默认时间\n getCurrentMonthLast: function getCurrentMonthLast() {\n var moment = require('moment'); //打开时默认时间为一天前至获取当前年月日时分秒\n\n\n var endTime = moment().format('YYYY-MM-DD'); //当前年月日\n\n var startTime = moment().subtract(1, 'days').format('YYYY-MM-DD');\n this.scopeTime = [startTime, endTime];\n var time = moment().format('LTS'); //当前时分秒\n\n this.queryParam.params.startTime = this.scopeTime[0] + ' ' + '00:00:00';\n this.queryParam.params.endTime = this.scopeTime[1] + ' ' + time;\n },\n openDate: function openDate(val) {\n var _this2 = 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 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 }\n };\n this.timeList = [];\n this.jzList = [];\n this.bzList = [];\n this.fhList = [];\n this.zgList = [];\n this.zzList = [];\n hdWaterHistory.getChartsList(data.query, function (res) {\n _this2.echartLiat = res.value;\n\n if (res.value.length) {\n _this2.echartLiat.forEach(function (e) {\n _this2.timeList.push(e.tm);\n\n _this2.jzList.push(e.jz);\n\n _this2.bzList.push(e.bz);\n\n _this2.fhList.push(e.fh);\n\n _this2.zgList.push(e.zg);\n\n _this2.zzList.push(e.zz);\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 _this2.getCharts();\n });\n } else {\n _this2.timeList = [];\n _this2.jzList = [];\n _this2.bzList = [];\n _this2.fhList = [];\n _this2.zgList = [];\n _this2.zzList = [];\n\n _this2.$nextTick(function () {\n _this2.getCharts();\n });\n }\n\n _this2.loadingChartData = false;\n });\n },\n changeChart: function changeChart(val) {\n var _this3 = 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.jzList = [];\n this.bzList = [];\n this.fhList = [];\n this.zgList = [];\n this.zzList = [];\n hdWaterHistory.getChartsList(this.query, function (res) {\n if (res.value.length) {\n _this3.echartLiat = res.value;\n\n _this3.echartLiat.forEach(function (e) {\n _this3.timeList.push(e.tm);\n\n _this3.jzList.push(e.jz);\n\n _this3.bzList.push(e.bz);\n\n _this3.fhList.push(e.fh);\n\n _this3.zgList.push(e.zg);\n\n _this3.zzList.push(e.zz);\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 _this3.$nextTick(function () {\n console.log(_this3.dangerzs, 666);\n\n _this3.getCharts();\n });\n\n _this3.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.jzList = [];\n this.bzList = [];\n this.fhList = [];\n this.zgList = [];\n this.zzList = [];\n this.$nextTick(function () {\n _this3.getCharts();\n });\n this.loadingChartData = false;\n return;\n hdWaterHistory.getChartsList(this.query, function (res) {\n if (res.value.length) {\n _this3.echartLiat = res.value;\n\n _this3.echartLiat.forEach(function (e) {\n _this3.timeList.push(e.tm);\n\n _this3.jzList.push(e.jz);\n\n _this3.bzList.push(e.bz);\n\n _this3.fhList.push(e.fh);\n\n _this3.zgList.push(e.zg);\n\n _this3.zzList.push(e.zz);\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 _this3.$nextTick(function () {\n console.log(_this3.dangerzs, 777);\n\n _this3.getCharts();\n });\n }\n });\n }\n },\n changeDate: function changeDate(val) {\n if (val) {\n var moment = require('moment'); //打开时默认时间为一天前至获取当前年月日时分秒\n\n\n var time = moment().format('LTS'); //当前时分秒\n\n this.queryParam.params.startTime = val[0] + ' ' + '00:00:00';\n this.queryParam.params.endTime = val[1] + ' ' + time;\n } else {\n this.queryParam.params.startTime = '';\n this.queryParam.params.endTime = '';\n }\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.bzList,\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.jzList,\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 _this4 = this;\n\n this.loading = true;\n this.tableData = [];\n hdWaterHistory.ListGet(this.queryParam, function (res) {\n _this4.total = res.value.total;\n _this4.tableData = JSON.parse(JSON.stringify(res.value.rows));\n\n _this4.tableData.forEach(function (e) {\n _this4.wptns.forEach(function (w) {\n if (e.wptn == w.value) {\n e.wptn = w.name;\n }\n });\n\n _this4.czyyfl.forEach(function (c) {\n if (e.appType == c.value) {\n e.appTypeName = c.name;\n }\n });\n\n e.thresholdData.forEach(function (t) {\n if (t.gradeName == '警戒') {\n e.alertValue = t.fsltdz;\n } else if (t.gradeName == '保证') {\n e.ensureValue = t.fsltdz;\n }\n });\n\n if (e.z > e.alertValue) {\n e.transfinite = _this4.floatSub(e.z, e.alertValue);\n } else {\n e.transfinite = '--';\n }\n });\n\n _this4.$set(_this4.tableData);\n\n _this4.loading = false;\n });\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 // // 点击查询\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.scopeTime = '';\n this.onClickSearch();\n },\n //获取字典数据\n getSysDict: function getSysDict() {\n var _this5 = 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 _this5.wptns = response.data.ss; //水电站类型\n // 行政区查询\n\n hdWaterHistory.getStcd({}, function (res) {\n _this5.stcds = res.value;\n });\n\n _this5.getDateList();\n }, function (error) {\n reject(error);\n });\n });\n }\n }\n};",null]}