[update 移动端-天然气数据远传中端] 实时运行参数对接接口

This commit is contained in:
danshihao
2024-06-03 11:19:04 +08:00
parent 9b1676119a
commit acf2a7f5ed
4 changed files with 63 additions and 42 deletions
+4
View File
@@ -26,6 +26,9 @@ const saveSysSetting = (params) => postAction('/systemSetting/save', params)
// 油井实时数据:(油井实时参数、实时示功图、载荷分布图) // 油井实时数据:(油井实时参数、实时示功图、载荷分布图)
const getOilWellRealTimeData = (params) => getAction('/khOilRealtimeData/realtimeDataResults', params) const getOilWellRealTimeData = (params) => getAction('/khOilRealtimeData/realtimeDataResults', params)
// 天然气数据远传终端-实时运行参数(移动端)
const getRealTimeRunningParams = (params) => getAction('/khNgRealtimeData/realtimeDataResults', params)
// 用户信息分页列表 // 用户信息分页列表
const getUserPage = (params) => getAction('/sys/user/page', params) const getUserPage = (params) => getAction('/sys/user/page', params)
// 添加用户 // 添加用户
@@ -46,6 +49,7 @@ export {
getSysSetting, getSysSetting,
saveSysSetting, saveSysSetting,
getOilWellRealTimeData, getOilWellRealTimeData,
getRealTimeRunningParams,
getUserPage, getUserPage,
addUserInfo, addUserInfo,
delUserInfo, delUserInfo,
+1 -1
View File
@@ -499,7 +499,7 @@ button.ant-btn {
line-height: 16px; line-height: 16px;
} }
.info-row .info-label::after { .info-row .info-label::after {
content: '' content: ':'
} }
.info-row .info-value { .info-row .info-value {
text-align: right; text-align: right;
+10
View File
@@ -45,3 +45,13 @@ export const deviceType = {
export const wellheadArea = { export const wellheadArea = {
tree101: { label: '树101井', value: '1' } tree101: { label: '树101井', value: '1' }
} }
// 门站数据字典
export const stationGateStationEnum = {
baimamenStation: { label: '白马门站', value: '1' }
}
// 门站数据字典
export const dataAcquisitionEquipmentEnum = {
mediumPressureOutputFlowMeter: { label: '中压输出流量计', value: '1' }
}
+48 -41
View File
@@ -82,13 +82,13 @@
<!-- 实时运行参数 --> <!-- 实时运行参数 -->
<div class="mb-12"> <div class="mb-12">
<common-card title="实时运行参数"> <common-card title="实时运行参数">
<template v-for="(item, index) in allData.realTimeRunningParamsList"> <template v-for="(item, index) in realTimeRunningParamsList">
<common-card-info :data="item" <common-card-info :data="item"
:key="(item.id || item.channelNo) + 'info'" :key="(item.id || item.channelNo) + 'info'"
:left-list="labelData.realTimeRunningParamsLeft || []" :left-list="labelData.realTimeRunningParamsLeft || []"
:right-list="labelData.realTimeRunningParamsRight || []"/> :right-list="labelData.realTimeRunningParamsRight || []"/>
<div class="divider-horizontal" <div class="divider-horizontal"
v-if="index !== allData.realTimeRunningParamsList.length - 1" v-if="index !== realTimeRunningParamsList.length - 1"
:key="(item.id || item.channelNo) + 'horizontal-line'"></div> :key="(item.id || item.channelNo) + 'horizontal-line'"></div>
</template> </template>
</common-card> </common-card>
@@ -147,16 +147,14 @@
<span slot="label" class="vertical-label">场站<br/>门站</span> <span slot="label" class="vertical-label">场站<br/>门站</span>
<dict-picker :triggerChange="true" <dict-picker :triggerChange="true"
class="search-input mb-8" class="search-input mb-8"
dictCode="wellhead_area" dictCode="gate_station"
@change="changeStationGateStation"
v-model="queryParam.stationGateStation" v-model="queryParam.stationGateStation"
placeholder="请选择场站门站"/> placeholder="请选择场站门站"/>
<select-picker class="search-input" <dict-picker :triggerChange="true"
v-model="queryParam.dataAcquisitionEquipment" class="search-input"
placeholder="请选择数采设备" dictCode="data_acquisition_equipment"
label-key="wellheadName" v-model="queryParam.dataAcquisitionEquipment"
:list="singleWellList" placeholder="请选择数采设备"/>
allowClear/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col flex="0.8rem"> <a-col flex="0.8rem">
@@ -186,9 +184,15 @@ import CommonCard from '@comp/CommonCard'
import CommonCardInfo from '@comp/CommonCardInfo' import CommonCardInfo from '@comp/CommonCardInfo'
import ResponsiveChart from '@comp/ResponsiveChart' import ResponsiveChart from '@comp/ResponsiveChart'
import CommonEmpty from '@comp/CommonEmpty' import CommonEmpty from '@comp/CommonEmpty'
import { getOilWellRealTimeData, getWellheadList } from '@api/systemOverview' import { getOilWellRealTimeData, getWellheadList, getRealTimeRunningParams } from '@api/systemOverview'
import { generateBaseOption } from '@/utils/charts' import { generateBaseOption } from '@/utils/charts'
import { deviceType, wellheadArea, wellheadType } from '@/enums/commonEnums' import {
dataAcquisitionEquipmentEnum,
deviceType,
stationGateStationEnum,
wellheadArea,
wellheadType
} from '@/enums/commonEnums'
import DictPicker from '@comp/vant/DictPicker' import DictPicker from '@comp/vant/DictPicker'
import SelectPicker from '@comp/vant/SelectPicker' import SelectPicker from '@comp/vant/SelectPicker'
@@ -218,25 +222,12 @@ const staticData = {
comment: '当前工作状态良好,请按时检查', comment: '当前工作状态良好,请按时检查',
pumpType: '常规泵', pumpType: '常规泵',
// 门站信息 // 门站信息
stationName: '济源1#2号站', stationName: '白马门站',
region: '济宁区域', region: '济宁区域',
terminalType: '电池供电设备', terminalType: '电池供电设备',
flowmetersNumber: '30', flowmetersNumber: '30',
dataAcquisitionTerminals: '5', dataAcquisitionTerminals: '5',
equipmentInstallationTime: '2024-12-25', equipmentInstallationTime: '2024-05-30'
// 实时运行参数
realTimeRunningParamsList: [
...new Array(2).fill(0).map((_, i) => {
return {
channelNo: '济源1#通道' + i,
cumulativeFlow: '1232222',
instantaneousStandardCondition: '236.33',
realTimeTemperature: '35',
realTimePressure: '1.23',
instantaneousWorkingConditions: '256.33'
}
})
]
} }
export default { export default {
@@ -253,6 +244,8 @@ export default {
hasData: false, // 有没有请求到数据 hasData: false, // 有没有请求到数据
// 油井实时数据 // 油井实时数据
oilWellRealTimeData: {}, oilWellRealTimeData: {},
// 实时运行参数
realTimeRunningParamsList: [],
// 所有面板展示的数据 // 所有面板展示的数据
allData: {}, allData: {},
// 定时器,用于10秒请求一次 // 定时器,用于10秒请求一次
@@ -305,13 +298,13 @@ export default {
// 实时运行参数 // 实时运行参数
realTimeRunningParamsLeft: [ realTimeRunningParamsLeft: [
{ label: '通道编号', valueField: 'channelNo', unit: '' }, { label: '通道编号', valueField: 'channelNo', unit: '' },
{ label: '累计流量', valueField: 'cumulativeFlow', unit: '' }, { label: '累计流量', valueField: 'cumulativeFlow', unit: '' },
{ label: '标况瞬时', valueField: 'instantaneousStandardCondition', unit: 'm³/d' } { label: '标况瞬时', valueField: 'stdInstant', unit: '' }
], ],
realTimeRunningParamsRight: [ realTimeRunningParamsRight: [
{ label: '实时温度', valueField: 'realTimeTemperature', unit: '' }, { label: '实时温度', valueField: 'realTimeTemp', unit: '' },
{ label: '实时压力', valueField: 'realTimePressure', unit: 'Mpa' }, { label: '实时压力', valueField: 'realTimePressure', unit: '' },
{ label: '工况瞬时', valueField: 'instantaneousWorkingConditions', unit: 'm³/d' } { label: '工况瞬时', valueField: 'operationalInstant', unit: '' }
] ]
}, },
// 油井下拉 // 油井下拉
@@ -336,15 +329,11 @@ export default {
switch (params.deviceType + '') { switch (params.deviceType + '') {
// 天然气数据远传终端 // 天然气数据远传终端
case deviceType.transmissionTerminal.value: case deviceType.transmissionTerminal.value:
clearInterval(this.timer)
this.timer = null
// 默认回显井场和单井 // 默认回显井场和单井
this.$set(this.queryParam, 'stationGateStation', wellheadArea.tree101.value) this.$set(this.queryParam, 'stationGateStation', stationGateStationEnum.baimamenStation.value)
this.loadOilWellList(wellheadArea.tree101.value).then(() => { this.$set(this.queryParam, 'dataAcquisitionEquipment', dataAcquisitionEquipmentEnum.mediumPressureOutputFlowMeter.value)
this.$set(this.queryParam, 'dataAcquisitionEquipment', this.singleWellList[0].id) // 查询数据
// 查询数据 this.loadTransmissionTerminalData()
this.loadTransmissionTerminalData()
})
break break
// 井口设备 // 井口设备
case deviceType.wellheadEquipment.value: case deviceType.wellheadEquipment.value:
@@ -369,7 +358,12 @@ export default {
this.clearPageData() this.clearPageData()
return return
} }
this.loadOilWellRealTimeData() // 每10秒请求一次实时数据
this.loadRealTimeRunningParams()
clearInterval(this.timer)
this.timer = setInterval(() => {
this.loadRealTimeRunningParams()
}, 1000 * 10)
}, },
// 获取井口设备页面数据 // 获取井口设备页面数据
loadWellheadEquipment () { loadWellheadEquipment () {
@@ -408,6 +402,19 @@ export default {
}).finally(() => { }).finally(() => {
}) })
}, },
// 加载天然气数据远传终端实施参数
loadRealTimeRunningParams () {
getRealTimeRunningParams().then(res => {
if (res.success) {
const data = res.result || []
this.hasData = !!data.length
this.allData = Object.assign({}, staticData)
this.realTimeRunningParamsList = data
} else {
this.$message.warning(res.message)
}
})
},
// 初始化 实时示功图 // 初始化 实时示功图
initIndicatorDiagram (data) { initIndicatorDiagram (data) {
this.$nextTick(() => { this.$nextTick(() => {