|
|
|
@ -142,14 +142,14 @@
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<!-- <el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-plus"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleAdd"
|
|
|
|
@click="handleAdd"
|
|
|
|
v-hasPermi="['ems/record:recordIotenvInstant:add']"
|
|
|
|
v-hasPermi="['ems/record:recordIOTInstant:add']"
|
|
|
|
>新增</el-button>
|
|
|
|
>新增</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
@ -160,7 +160,7 @@
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="single"
|
|
|
|
:disabled="single"
|
|
|
|
@click="handleUpdate"
|
|
|
|
@click="handleUpdate"
|
|
|
|
v-hasPermi="['ems/record:recordIotenvInstant:edit']"
|
|
|
|
v-hasPermi="['ems/record:recordIOTInstant:edit']"
|
|
|
|
>修改</el-button>
|
|
|
|
>修改</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
@ -171,9 +171,9 @@
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="multiple"
|
|
|
|
:disabled="multiple"
|
|
|
|
@click="handleDelete"
|
|
|
|
@click="handleDelete"
|
|
|
|
v-hasPermi="['ems/record:recordIotenvInstant:remove']"
|
|
|
|
v-hasPermi="['ems/record:recordIOTInstant:remove']"
|
|
|
|
>删除</el-button>
|
|
|
|
>删除</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>-->
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="warning"
|
|
|
|
type="warning"
|
|
|
|
@ -181,7 +181,7 @@
|
|
|
|
icon="el-icon-download"
|
|
|
|
icon="el-icon-download"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="openExportDialog"
|
|
|
|
@click="openExportDialog"
|
|
|
|
v-hasPermi="['ems/record:recordIotenvInstant:export']"
|
|
|
|
v-hasPermi="['ems/record:recordIOTInstant:export']"
|
|
|
|
>导出</el-button>
|
|
|
|
>导出</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
@ -192,25 +192,25 @@
|
|
|
|
<el-table-column label="序号" type="index" width="55" align="center" />
|
|
|
|
<el-table-column label="序号" type="index" width="55" align="center" />
|
|
|
|
<el-table-column label="计量设备" align="center" prop="monitorName" min-width="150">
|
|
|
|
<el-table-column label="计量设备" align="center" prop="monitorName" min-width="150">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 根据设备类型显示对应的传感器数据列 -->
|
|
|
|
<!-- 根据设备类型显示对应的传感器数据列 -->
|
|
|
|
<!-- type=5: 只显示温度 -->
|
|
|
|
<!-- type=5: 只显示温度 -->
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 5 || selectedNodeType === 6"
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 5 || selectedNodeType === 6"
|
|
|
|
label="温度(℃)" align="center" prop="temperature" width="100">
|
|
|
|
label="温度(℃)" align="center" prop="temperature" width="100">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- type=6: 显示温度和湿度 -->
|
|
|
|
<!-- type=6: 显示温度和湿度 -->
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 6"
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 6"
|
|
|
|
label="湿度(%)" align="center" prop="humidity" width="100">
|
|
|
|
label="湿度(%)" align="center" prop="humidity" width="100">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 照度列(暂时隐藏,如需要可根据type显示) -->
|
|
|
|
<!-- 照度列(暂时隐藏,如需要可根据type显示) -->
|
|
|
|
<!-- <el-table-column v-if="!selectedNodeType"
|
|
|
|
<!-- <el-table-column v-if="!selectedNodeType"
|
|
|
|
label="照度(lx)" align="center" prop="illuminance" width="100">
|
|
|
|
label="照度(lx)" align="center" prop="illuminance" width="100">
|
|
|
|
</el-table-column> -->
|
|
|
|
</el-table-column> -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- type=7: 显示噪声 -->
|
|
|
|
<!-- type=7: 显示噪声 -->
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 7"
|
|
|
|
<el-table-column v-if="!selectedNodeType || selectedNodeType === 7"
|
|
|
|
label="噪声(dB)" align="center" prop="noise" width="100">
|
|
|
|
label="噪声(dB)" align="center" prop="noise" width="100">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
@ -439,7 +439,7 @@ export default {
|
|
|
|
children: 'children',
|
|
|
|
children: 'children',
|
|
|
|
label: 'label'
|
|
|
|
label: 'label'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 选中节点的类型,用于控制显示字段
|
|
|
|
// 选中节点的类型,用于控制显示字段
|
|
|
|
selectedNodeType: null,
|
|
|
|
selectedNodeType: null,
|
|
|
|
|
|
|
|
|
|
|
|
@ -592,18 +592,18 @@ export default {
|
|
|
|
// 清空之前的查询条件
|
|
|
|
// 清空之前的查询条件
|
|
|
|
this.queryParams.monitorIds = [];
|
|
|
|
this.queryParams.monitorIds = [];
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
|
|
|
|
|
|
|
|
// 判断是否为父节点(有children属性)
|
|
|
|
// 判断是否为父节点(有children属性)
|
|
|
|
if (data.children && data.children.length > 0) {
|
|
|
|
if (data.children && data.children.length > 0) {
|
|
|
|
// 父节点:收集所有子节点的code,过滤掉空值
|
|
|
|
// 父节点:收集所有子节点的code,过滤掉空值
|
|
|
|
this.queryParams.monitorIds = data.children
|
|
|
|
this.queryParams.monitorIds = data.children
|
|
|
|
.filter(child => child.code)
|
|
|
|
.filter(child => child.code)
|
|
|
|
.map(child => child.code);
|
|
|
|
.map(child => child.code);
|
|
|
|
|
|
|
|
|
|
|
|
// 父节点的type应该与子节点一致,取第一个有效子节点的type
|
|
|
|
// 父节点的type应该与子节点一致,取第一个有效子节点的type
|
|
|
|
const firstValidChild = data.children.find(child => child.type);
|
|
|
|
const firstValidChild = data.children.find(child => child.type);
|
|
|
|
this.selectedNodeType = firstValidChild ? firstValidChild.type : data.type;
|
|
|
|
this.selectedNodeType = firstValidChild ? firstValidChild.type : data.type;
|
|
|
|
|
|
|
|
|
|
|
|
console.log('点击父节点:', data.label, '节点type:', data.type, '子节点codes:', this.queryParams.monitorIds, '使用type:', this.selectedNodeType);
|
|
|
|
console.log('点击父节点:', data.label, '节点type:', data.type, '子节点codes:', this.queryParams.monitorIds, '使用type:', this.selectedNodeType);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 子节点:使用单个设备code
|
|
|
|
// 子节点:使用单个设备code
|
|
|
|
@ -611,7 +611,7 @@ export default {
|
|
|
|
this.selectedNodeType = data.type;
|
|
|
|
this.selectedNodeType = data.type;
|
|
|
|
console.log('点击子节点:', data.label, 'code:', data.code, 'type:', this.selectedNodeType);
|
|
|
|
console.log('点击子节点:', data.label, 'code:', data.code, 'type:', this.selectedNodeType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
this.handleQuery();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
@ -681,7 +681,7 @@ export default {
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
resetQuery() {
|
|
|
|
resetQuery() {
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
|
|
|
|
|
|
|
// 重置时间范围为默认值(昨天8:00:00到今天8:00:00)
|
|
|
|
// 重置时间范围为默认值(昨天8:00:00到今天8:00:00)
|
|
|
|
const nowDate = new Date();
|
|
|
|
const nowDate = new Date();
|
|
|
|
const today = parseTime(new Date(), '{y}-{m}-{d}')
|
|
|
|
const today = parseTime(new Date(), '{y}-{m}-{d}')
|
|
|
|
@ -689,12 +689,12 @@ export default {
|
|
|
|
lastDate.setDate(nowDate.getDate() - 1)
|
|
|
|
lastDate.setDate(nowDate.getDate() - 1)
|
|
|
|
const yesterday = parseTime(lastDate, '{y}-{m}-{d}')
|
|
|
|
const yesterday = parseTime(lastDate, '{y}-{m}-{d}')
|
|
|
|
this.daterangeRecordTime = [yesterday + ' 08:00:00', today + ' 08:00:00'];
|
|
|
|
this.daterangeRecordTime = [yesterday + ' 08:00:00', today + ' 08:00:00'];
|
|
|
|
|
|
|
|
|
|
|
|
// 重置选中节点类型和查询条件
|
|
|
|
// 重置选中节点类型和查询条件
|
|
|
|
this.selectedNodeType = null;
|
|
|
|
this.selectedNodeType = null;
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
this.queryParams.monitorId = null;
|
|
|
|
this.queryParams.monitorIds = [];
|
|
|
|
this.queryParams.monitorIds = [];
|
|
|
|
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
this.handleQuery();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 多选框选中数据
|
|
|
|
// 多选框选中数据
|
|
|
|
|