feat:设备的监测点实时数据展示
This commit is contained in:
parent
d769ae239b
commit
c9497ba140
|
@ -121,15 +121,14 @@
|
|||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
v-auth="'mlog.update'"
|
||||
v-if="scope.row.submit_time == null"
|
||||
type="primary"
|
||||
@click.stop="table_edit(scope.row)"
|
||||
>编辑</el-button
|
||||
> -->
|
||||
type="success"
|
||||
v-if="route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'"
|
||||
@click.stop="table_monitor(scope.row)"
|
||||
>监测</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
|
@ -180,11 +179,19 @@
|
|||
@closed="detailClose"
|
||||
>
|
||||
</detail-drawer>
|
||||
<monitor-drawer
|
||||
v-if="dialog.monitor"
|
||||
ref="monitorDialog"
|
||||
:endTime="endTime"
|
||||
:startTime="startTime"
|
||||
:equipmentId="equipmentId"
|
||||
></monitor-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
import saveDialog from "./mlog_form.vue";
|
||||
import detailDrawer from "./mlog_detail.vue";
|
||||
import monitorDrawer from "./monitor_detail.vue";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
|
@ -201,6 +208,7 @@ export default {
|
|||
components: {
|
||||
saveDialog,
|
||||
detailDrawer,
|
||||
monitorDrawer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -210,6 +218,7 @@ export default {
|
|||
dialog: {
|
||||
save: false,
|
||||
detail: false,
|
||||
monitor:false,
|
||||
},
|
||||
tableData: [],
|
||||
selection: [],
|
||||
|
@ -217,6 +226,8 @@ export default {
|
|||
mlogId: "",
|
||||
deptId: null,
|
||||
processId: "",
|
||||
route_code: "",
|
||||
equipmentId: "",
|
||||
processCate: "",
|
||||
mgroupMtype: "",
|
||||
showHidden:false,
|
||||
|
@ -234,6 +245,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
that.route_code = this.$route.path.split("/")[2];
|
||||
that.params.mgroup =that.mgroupId;
|
||||
that.apiObj = that.$API.wpm.mlog.list;
|
||||
this.getMgroupInfo();
|
||||
|
@ -277,6 +289,20 @@ export default {
|
|||
this.dialog.detail = false;
|
||||
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() {
|
||||
this.dialog.save = true;
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue