{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\sqMonitor\\reservoirCapacity.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\monitor\\sqMonitor\\reservoirCapacity.vue","mtime":1688458391974},{"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\r\nimport hdWaterLatest from '@/api/monitor/resMonitor/hdWaterLatest.js'\r\nimport reservoirCapacityDialog from './components/reservoirCapacityDialog.vue'\r\nimport reservoirCapacity from '@/api/monitor/resMonitor/reservoirCapacity.js'\r\nimport dictUtils from '@/components/dict/DictSelectUtils.js'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport moment from 'moment'\r\nimport req from '@/request.js'\r\nexport default {\r\n name: 'reservoirCapacity',\r\n components: {\r\n reservoirCapacityDialog,\r\n },\r\n mixins: [TableMixin],\r\n data() {\r\n return {\r\n timeValue: '',\r\n rscdValue: '',\r\n scopeTime: '',\r\n loading: false,\r\n basAdNames: [], //行政区\r\n setKesLabel: {\r\n value: 'code',\r\n label: 'name',\r\n children: 'children',\r\n },\r\n querys: [\r\n {\r\n group: 'main',\r\n operation: 'IN',\r\n parentGroup: '',\r\n property: 'bs.rscd',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'ri.tm',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n {\r\n group: 'main',\r\n operation: 'EQUAL',\r\n parentGroup: '',\r\n property: 'bs.addvcd',\r\n relation: 'AND',\r\n value: '',\r\n },\r\n ],\r\n queryParam: {\r\n pageBean: {\r\n pageSize: -1,\r\n page: 1,\r\n showTotal: true,\r\n },\r\n params: {\r\n tm: '',\r\n },\r\n sorter: [\r\n {\r\n direction: 'ASC',\r\n property: '',\r\n },\r\n ],\r\n },\r\n tableData: [],\r\n rsnms: [], //水库下拉,\r\n baseUrl: null,\r\n }\r\n },\r\n updated() {\r\n this.$nextTick(() => {\r\n if (this.$refs.table) {\r\n this.$refs.table.doLayout()\r\n }\r\n })\r\n },\r\n created() {\r\n this.queryParam.params.tm = moment().format('YYYY-MM-DD 8:00:00')\r\n this.timeValue = moment().format('YYYY-MM-DD 8:00:00')\r\n this.baseUrl = window.context.portal\r\n // this.getCurrentMonthLast()\r\n this.getSysDict()\r\n this.getDateList()\r\n },\r\n methods: {\r\n onhouChange(val) {\r\n if (val) {\r\n this.querys[2].value = val[val.length - 1]\r\n } else {\r\n this.querys[2].value = null\r\n }\r\n },\r\n //指定列求和\r\n getSummaries(param) {\r\n const {columns, data} = param\r\n const sums = []\r\n columns.forEach((column, index) => {\r\n if (index === 0) {\r\n sums[index] = '合计'\r\n return\r\n }\r\n const values = data.map((item) => Number(item[column.property]))\r\n if (\r\n column.property == 'hy' ||\r\n column.property == 'ddstcp' ||\r\n column.property == 'acstcp' ||\r\n column.property == 'ttstcp'\r\n ) {\r\n sums[index] = values.reduce((prev, curr) => {\r\n const value = Number(curr)\r\n if (!isNaN(value)) {\r\n return Math.round((prev + curr) * 1000) / 1000\r\n } else {\r\n return Math.round(prev * 1000) / 1000\r\n }\r\n }, 0)\r\n sums[index]\r\n }\r\n })\r\n return sums\r\n },\r\n openContrast() {\r\n this.$refs.reservoirCapacityDialog.openShare()\r\n },\r\n //获取字典数据\r\n getSysDict() {\r\n reservoirCapacity.getRsnm({}, (res) => {\r\n this.rsnms = res.value\r\n })\r\n // 行政区查询\r\n hdWaterLatest.getbasAdName({}, (res) => {\r\n this.basAdNames = res.value\r\n })\r\n },\r\n changeDate() {\r\n if (this.timeValue == null) {\r\n this.queryParam.params.tm = ''\r\n } else {\r\n let cstDate = new Date(this.timeValue)\r\n let year = cstDate.getFullYear()\r\n let month = (cstDate.getMonth() + 1).toString().padStart(2, '0')\r\n let day = cstDate.getDate().toString().padStart(2, '0')\r\n let hours = cstDate.getHours().toString().padStart(2, '0')\r\n let minutes = cstDate.getMinutes().toString().padStart(2, '0')\r\n let seconds = cstDate.getSeconds().toString().padStart(2, '0')\r\n this.queryParam.params.tm = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`\r\n }\r\n },\r\n\r\n getDateList() {\r\n // this.getCurrentMonthLast()\r\n this.loading = true\r\n this.tableData = []\r\n this.queryParam.querys = []\r\n if (this.querys[0].value.length > 0) {\r\n this.queryParam.querys.push(this.querys[0])\r\n }\r\n if (this.querys[2].value) {\r\n this.queryParam.querys.push(this.querys[2])\r\n }\r\n reservoirCapacity.resDailyData(this.queryParam, (res) => {\r\n if (res.state) {\r\n this.tableData = res.value.rows\r\n this.tableData.forEach((item) => {\r\n if (item.rz == undefined) {\r\n item['rz'] = 0\r\n }\r\n if (item.dyp == undefined) {\r\n item['dyp'] = 0\r\n }\r\n })\r\n this.loading = false\r\n } else {\r\n this.$message.error(res.message)\r\n }\r\n })\r\n },\r\n // // 点击查询\r\n onClickSearch() {\r\n if (\r\n this.querys[0].value.length > 0 ||\r\n this.queryParam.params.tm != ''\r\n ) {\r\n this.queryParam.pageBean.page = 1\r\n this.getDateList()\r\n } else {\r\n this.$message.warning('请选择查询条件')\r\n }\r\n },\r\n // 重置\r\n resetQuery() {\r\n this.queryParam.params = {\r\n tm: moment().format('YYYY-MM-DD 8:00:00'),\r\n }\r\n this.queryParam.querys = []\r\n this.querys.forEach((item) => {\r\n item.value = ''\r\n })\r\n this.scopeTime = ''\r\n this.onClickSearch()\r\n },\r\n },\r\n}\r\n",null]}