add(ems): 添加瞬时流量总和显示

- 在表格下方添加瞬时流量总和的显示
- 在 data 中添加 totalFluxFlow 属性用于存储瞬时流量总和
- 在请求数据后计算瞬时流量总和并赋值给 totalFluxFlow
- 在重置表单时添加 totalFluxFlow 的重置操作
master
zch 1 year ago
parent 15bbafd7dd
commit b6503508db

@ -162,6 +162,9 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
</el-table> </el-table>
<span v-if="totalFluxFlow!==null">{{totalFluxFlow}} t/h</span>
</el-col> </el-col>
</el-row> </el-row>
@ -252,6 +255,9 @@ export default {
}, },
data() { data() {
return { return {
totalFluxFlow: null, //
//List //List
baseMonitorInfoOptions: [], baseMonitorInfoOptions: [],
//List //List
@ -375,7 +381,9 @@ export default {
this.queryParams.params['sensorId'] = this.queryParams.sensorId; this.queryParams.params['sensorId'] = this.queryParams.sensorId;
} }
latestSteamInstantList(this.queryParams).then(response => { latestSteamInstantList(this.queryParams).then(response => {
this.recordSteamInstantList = response.data this.recordSteamInstantList = response.data
this.totalFluxFlow = this.recordSteamInstantList.reduce((sum, item) => sum + (parseFloat(item.fluxFlow) || 0), 0);
this.loading = false this.loading = false
}) })
}, },
@ -398,7 +406,8 @@ export default {
press: null, press: null,
density: null, density: null,
differencePress: null, differencePress: null,
recordTime: null recordTime: null,
totalFluxFlow: null
} }
this.resetForm('form') this.resetForm('form')
}, },

Loading…
Cancel
Save