From 09b645793464f657917743ec75fcd27cd948dc42 Mon Sep 17 00:00:00 2001 From: danshihao Date: Thu, 25 Apr 2024 17:42:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix=2084048]=20=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=BB=A5=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1=E4=B8=BA?= =?UTF-8?q?=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WellheadDataMonitoring.vue | 77 ++++++++++--------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/src/views/systemOverview/wellheadDataMonitoring/WellheadDataMonitoring.vue b/src/views/systemOverview/wellheadDataMonitoring/WellheadDataMonitoring.vue index d29cbd7..a97af45 100644 --- a/src/views/systemOverview/wellheadDataMonitoring/WellheadDataMonitoring.vue +++ b/src/views/systemOverview/wellheadDataMonitoring/WellheadDataMonitoring.vue @@ -26,7 +26,7 @@ - + 查询 @@ -433,31 +433,6 @@ export default { align: 'center', width: '10%' } - // { - // title: '批量操作', - // dataIndex: 'actionBatch', - // customRender: (value, row, index) => { - // console.log(value, row, index, 'aaaaaa') - // const obj = { - // children: ( - //
- // - //
- // ), - // attrs: {} - // } - // if (index === 0) { - // obj.attrs.rowSpan = this.dataSource.length - // } else { - // obj.attrs.rowSpan = 0 - // } - // return obj - // }, - // // scopedSlots: { customRender: 'actionBatch' }, - // align: 'center', - // fixed: 'right', - // width: 100 - // } ], // 右侧表格 rightColumn: [{ @@ -533,7 +508,8 @@ export default { { label: '泵径', unit: 'mm', valueField: 'pumpDiameter' }, { label: '泵效', unit: '%', valueField: 'pumpEfficiency' } ] - } + }, + allOilWellList: [] // 所有油井 } }, watch: { @@ -557,6 +533,14 @@ export default { this.$set(this.queryParam, 'singleWell', this.singleWellList[0].id) this.searchQuery() }) + // 获取所有油井下拉 + getWellheadList({ + wellheadType: wellheadType.oil.value + }).then(res => { + if (res.success) { + this.allOilWellList = res.result || [] + } + }) }, beforeDestroy () { // 离开页面前清除定时器 @@ -569,17 +553,38 @@ export default { searchQuery () { const params = Object.assign({}, this.queryParam) console.log(params) - // if (!params.singleWell && !params.wellheadName) { - // this.$message.warning('请选择油井或输入井口名称查询') - // return - // } - // 选择单井查询 + // 选择的油井 if (params.singleWell) { - const singleWell = this.singleWellList.find(item => item.id === params.singleWell) this.hasData = true - this.allData = Object.assign({}, staticData, { - wellName: singleWell.wellheadName - }) + this.allData = Object.assign({}, staticData) + this.dataSource = staticTableData + setTimeout(() => { + // 加载功图计产监控 + this.initProductionMonitoring(staticMonitoringChart) + }, 100) + // 每10秒请求一次实时数据 + this.loadOilWellRealTimeData() + clearInterval(this.timer) + this.timer = setInterval(() => { + this.loadOilWellRealTimeData() + }, 1000 * 10) + return + } + // 置空数据,不请求实时数据 + this.hasData = false + this.allData = {} + this.dataSource = [] + clearInterval(this.timer) + this.timer = null + }, + // 输入框的搜索 + searchQueryInput () { + const params = Object.assign({}, this.queryParam) + console.log(params) + // 如果有输入的井口,返回信息,否则置空 + if (params.wellheadName && this.allOilWellList.find(item => item.wellheadName === params.wellheadName)) { + this.hasData = true + this.allData = Object.assign({}, staticData) this.dataSource = staticTableData setTimeout(() => { // 加载功图计产监控