feat:设备的监测点实时数据展示

This commit is contained in:
shijing 2025-04-07 15:51:15 +08:00
parent d769ae239b
commit c9497ba140
2 changed files with 145 additions and 7 deletions

View File

@ -121,15 +121,14 @@
width="150" width="150"
> >
<template #default="scope"> <template #default="scope">
<!-- <el-button <el-button
link link
size="small" size="small"
v-auth="'mlog.update'" type="success"
v-if="scope.row.submit_time == null" v-if="route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'"
type="primary" @click.stop="table_monitor(scope.row)"
@click.stop="table_edit(scope.row)" >监测</el-button
>编辑</el-button >
> -->
<el-button <el-button
link link
size="small" size="small"
@ -180,11 +179,19 @@
@closed="detailClose" @closed="detailClose"
> >
</detail-drawer> </detail-drawer>
<monitor-drawer
v-if="dialog.monitor"
ref="monitorDialog"
:endTime="endTime"
:startTime="startTime"
:equipmentId="equipmentId"
></monitor-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from "./mlog_form.vue"; import saveDialog from "./mlog_form.vue";
import detailDrawer from "./mlog_detail.vue"; import detailDrawer from "./mlog_detail.vue";
import monitorDrawer from "./monitor_detail.vue";
export default { export default {
props: { props: {
@ -201,6 +208,7 @@ export default {
components: { components: {
saveDialog, saveDialog,
detailDrawer, detailDrawer,
monitorDrawer
}, },
data() { data() {
return { return {
@ -210,6 +218,7 @@ export default {
dialog: { dialog: {
save: false, save: false,
detail: false, detail: false,
monitor:false,
}, },
tableData: [], tableData: [],
selection: [], selection: [],
@ -217,6 +226,8 @@ export default {
mlogId: "", mlogId: "",
deptId: null, deptId: null,
processId: "", processId: "",
route_code: "",
equipmentId: "",
processCate: "", processCate: "",
mgroupMtype: "", mgroupMtype: "",
showHidden:false, showHidden:false,
@ -234,6 +245,7 @@ export default {
}, },
mounted() { mounted() {
let that = this; let that = this;
that.route_code = this.$route.path.split("/")[2];
that.params.mgroup =that.mgroupId; that.params.mgroup =that.mgroupId;
that.apiObj = that.$API.wpm.mlog.list; that.apiObj = that.$API.wpm.mlog.list;
this.getMgroupInfo(); this.getMgroupInfo();
@ -277,6 +289,20 @@ export default {
this.dialog.detail = false; this.dialog.detail = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
table_monitor(row){
let that= this;
if(row.equipment!==null){
that.equipmentId = row.equipment;
that.endTime = row.work_end_time;
that.startTime = row.work_start_time;
that.dialog.monitor = true;
this.$nextTick(() => {
this.$refs.monitorDialog.open("add");
});
}else{
that.$message.error("该日志未关联设备,请选择设备后重新查看");
}
},
// //
table_add() { table_add() {
this.dialog.save = true; this.dialog.save = true;

View File

@ -0,0 +1,112 @@
<!-- 日志详情 mlog信息以及mlogb -->
<template>
<el-drawer
title="监测数据"
v-model="visible"
:size="'65%'"
destroy-on-close
@closed="$emit('closed')"
>
<div id="tableWap" style="height: 100%;">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in mpointList" :label="item.name" :name="item.name" :key="item.id" lazy>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:height="tableHeight"
:params="{'mpoint':item.id, 'timex_gte':startTime, 'timex_lte':endTime}"
hideDo
>
<el-table-column label="时间" prop="timex">
</el-table-column>
<el-table-column label="数值" prop="val_float">
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</div>
</el-drawer>
</template>
<script>
export default {
props: {
equipmentId: {
type: String,
default: "",
},
endTime: {
type: String,
default: "",
},
startTime: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
apiObj:null,
loading: false,
isSaveing: false,
visible: false,
params:{},
query:{},
mpointList:[],
activeName: "",
tableHeight:300,
};
},
mounted() {
let that = this;
that.params.timex_gte = that.startTime;
that.params.timex_lte = that.endTime;
that.$API.enm.mpoint.list.req({ep_belong:that.equipmentId,page:0}).then((res) => {
if(res.length>0){
that.mpointList = res;
that.activeName = res[0].name;
that.params.mpoint = res[0].id;
that.apiObj = that.$API.enm.mplogx;
}else{
that.$message.error("该设备没有监测点");
}
})
},
methods: {
open() {
let that = this;
this.visible = true;
that.$nextTick(() => {
let height = document.getElementById("tableWap").clientHeight;
console.log('height',height)
that.tableHeight = height - 45;
})
},
handleClick(val){
console.log('val',val)
console.log('this.activeName',this.activeName)
let that = this;
that.mpointList.forEach(item=>{
if(item.name == that.activeName){
that.query.mpoint = item.id;
that.query.page = 1;
// that.$refs.table.queryData(that.query);
}
})
},
},
};
</script>
<style scoped>
.file_show{
position: absolute;
width: 100%;
height: 100%;
top: 0;
background: rgb(255,255,255);
z-index: 999;
}
</style>