|
|
|
@ -184,48 +184,27 @@
|
|
|
|
|
v-hasPermi="['ems/record:recordIotenvInstant:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="recordIotenvInstantList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<!-- <el-table-column label="主键标识" align="center" prop="objid" v-if="columns[0].visible"/>-->
|
|
|
|
|
<el-table-column label="序号" type="index" width="55" align="center" v-if="columns[0].visible" />
|
|
|
|
|
<el-table-column label="计量设备" align="center" prop="monitorName" v-if="columns[1].visible">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="序号" type="index" width="55" align="center" />
|
|
|
|
|
<el-table-column label="计量设备" align="center" prop="monitorName" min-width="150">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="温度" align="center" prop="temperature" v-if="columns[2].visible">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 振动设备专用列 -->
|
|
|
|
|
<el-table-column label="振动速度(mm/s)" align="center" prop="vibrationSpeed" width="120">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="湿度" align="center" prop="humidity" v-if="columns[3].visible">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="振动位移(μm)" align="center" prop="vibrationDisplacement" width="120">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="照度" align="center" prop="illuminance" v-if="columns[4].visible">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="振动加速度(g)" align="center" prop="vibrationAcceleration" width="120">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="噪声" align="center" prop="noise" v-if="columns[5].visible">
|
|
|
|
|
|
|
|
|
|
<el-table-column label="振动温度(℃)" align="center" prop="vibrationTemp" width="120">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="硫化氢浓度" align="center" prop="concentration" v-if="columns[6].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="振动-速度(mm/s)" align="center" prop="vibrationSpeed" v-if="columns[7].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="振动-位移(um)" align="center" prop="vibrationDisplacement" v-if="columns[8].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="振动-加速度(g)" align="center" prop="vibrationAcceleration" v-if="columns[9].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="振动-温度(℃)" align="center" prop="vibrationTemp" v-if="columns[10].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="采集时间" align="center" prop="collectTime" width="180" v-if="columns[11].visible">
|
|
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="记录时间" align="center" prop="recodeTime" width="180" v-if="columns[12].visible">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 记录时间列,给足够的宽度 -->
|
|
|
|
|
<el-table-column label="记录时间" align="center" prop="recodeTime" width="200">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -264,7 +243,7 @@
|
|
|
|
|
<el-form-item label="计量设备编号" prop="monitorId">
|
|
|
|
|
<el-input v-model="form.monitorId" placeholder="请输入计量设备编号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="温度" prop="temperature">
|
|
|
|
|
<!-- <el-form-item label="温度" prop="temperature">
|
|
|
|
|
<el-input v-model="form.temperature" placeholder="请输入温度" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="湿度" prop="humidity">
|
|
|
|
@ -278,7 +257,7 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="硫化氢浓度" prop="concentration">
|
|
|
|
|
<el-input v-model="form.concentration" placeholder="请输入硫化氢浓度" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-form-item label="振动-速度(mm/s)" prop="vibrationSpeed">
|
|
|
|
|
<el-input v-model="form.vibrationSpeed" placeholder="请输入振动-速度(mm/s)" />
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -291,14 +270,14 @@
|
|
|
|
|
<el-form-item label="振动-温度(℃)" prop="vibrationTemp">
|
|
|
|
|
<el-input v-model="form.vibrationTemp" placeholder="请输入振动-温度(℃)" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="采集时间" prop="collectTime">
|
|
|
|
|
<!-- <el-form-item label="采集时间" prop="collectTime">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="form.collectTime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择采集时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-form-item label="记录时间" prop="recodeTime">
|
|
|
|
|
<el-date-picker clearable
|
|
|
|
|
v-model="form.recodeTime"
|
|
|
|
@ -377,31 +356,17 @@ export default {
|
|
|
|
|
collectTime: null,
|
|
|
|
|
recodeTime: null,
|
|
|
|
|
monitorIds: [],
|
|
|
|
|
monitorName: null,
|
|
|
|
|
monitorName: null
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
},
|
|
|
|
|
columns: [
|
|
|
|
|
{ key: 0, label: `标识`, visible: true },
|
|
|
|
|
{ key: 1, label: `计量设备`, visible: true },
|
|
|
|
|
{ key: 2, label: `温度`, visible: false },
|
|
|
|
|
{ key: 3, label: `湿度`, visible: false },
|
|
|
|
|
{ key: 4, label: `照度`, visible: false },
|
|
|
|
|
{ key: 5, label: `噪声`, visible: false },
|
|
|
|
|
{ key: 6, label: `硫化氢浓度`, visible: false },
|
|
|
|
|
{ key: 7, label: `振动-速度(mm/s)`, visible: true },
|
|
|
|
|
{ key: 8, label: `振动-位移(um)`, visible: true },
|
|
|
|
|
{ key: 9, label: `振动-加速度(g)`, visible: true },
|
|
|
|
|
{ key: 10, label: `振动-温度(℃)`, visible: true },
|
|
|
|
|
{ key: 11, label: `采集时间`, visible: false },
|
|
|
|
|
{ key: 12, label: `记录时间`, visible: true },
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
async created() {
|
|
|
|
|
// 设置时间范围
|
|
|
|
|
const nowDate = new Date();
|
|
|
|
|
const today = parseTime(new Date(), '{y}-{m}-{d}')
|
|
|
|
|
const lastDate = new Date();
|
|
|
|
@ -410,11 +375,11 @@ export default {
|
|
|
|
|
this.daterangeRecordTime[0] = yesterday+ ' 08:00:00'
|
|
|
|
|
this.daterangeRecordTime[1] = today + ' 08:00:00'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 先获取树结构数据(用于新增功能)
|
|
|
|
|
this.getTreeMonitorInfo()
|
|
|
|
|
this.getTreeselect()
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取振动设备树结构并初始化查询
|
|
|
|
|
await this.initVibrationDevices();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
@ -479,17 +444,28 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 节点单击事件
|
|
|
|
|
handleNodeClick(data) {
|
|
|
|
|
// 点击节点时清空monitorIds,只使用选中的monitorId
|
|
|
|
|
// 清空之前的查询条件
|
|
|
|
|
this.queryParams.monitorIds = [];
|
|
|
|
|
this.queryParams.monitorId = data.code
|
|
|
|
|
this.handleQuery()
|
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
|
|
|
|
|
|
// 判断是否为父节点(有children属性)
|
|
|
|
|
if (data.children && data.children.length > 0) {
|
|
|
|
|
// 父节点:收集所有子节点的code
|
|
|
|
|
this.queryParams.monitorIds = data.children.map(child => child.code);
|
|
|
|
|
console.log('点击振动设备父节点:', data.label, '子节点codes:', this.queryParams.monitorIds);
|
|
|
|
|
} else {
|
|
|
|
|
// 子节点:使用单个设备code
|
|
|
|
|
this.queryParams.monitorId = data.code;
|
|
|
|
|
console.log('点击振动设备子节点:', data.label, 'code:', data.code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询物联网数据列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (null != this.daterangeCollectTime && '' != this.daterangeCollectTime) {
|
|
|
|
|
this.queryParams.params['beginCollectTime'] = this.daterangeCollectTime[0]
|
|
|
|
|
this.queryParams.params['endCollectTime'] = this.daterangeCollectTime[1]
|
|
|
|
@ -499,10 +475,13 @@ export default {
|
|
|
|
|
this.queryParams.params['endRecordTime'] = this.daterangeRecordTime[1]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果没有选中节点,则获取所有设备ID
|
|
|
|
|
if (!this.queryParams.monitorId) {
|
|
|
|
|
this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions);
|
|
|
|
|
// 如果没有选中具体设备且没有设备ID列表,则不执行查询
|
|
|
|
|
if (!this.queryParams.monitorId && this.queryParams.monitorIds.length === 0) {
|
|
|
|
|
this.recordIotenvInstantList = [];
|
|
|
|
|
this.total = 0;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
console.log('没有振动设备数据可查询');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
listRecordIotenvInstant(this.queryParams).then(response => {
|
|
|
|
@ -543,9 +522,14 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.daterangeCollectTime = [];
|
|
|
|
|
|
|
|
|
|
// 重置查询条件,重新获取所有振动设备ID
|
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
|
this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions);
|
|
|
|
|
console.log('重置后振动设备IDs:', this.queryParams.monitorIds);
|
|
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
@ -613,6 +597,24 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 初始化振动设备数据
|
|
|
|
|
async initVibrationDevices() {
|
|
|
|
|
try {
|
|
|
|
|
const response = await getMonitorInfoTree({ monitorType: 10 });
|
|
|
|
|
this.monitorInfoOptions = response.data;
|
|
|
|
|
|
|
|
|
|
// 获取所有振动设备的ID用于初始查询
|
|
|
|
|
this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions);
|
|
|
|
|
console.log('初始化振动设备IDs:', this.queryParams.monitorIds);
|
|
|
|
|
|
|
|
|
|
// 设置完设备ID后再执行查询
|
|
|
|
|
this.getList();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('获取振动设备树结构失败:', error);
|
|
|
|
|
this.loading = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|