Merge remote-tracking branch 'origin/boardTest' into boardTest

boardTest
suixy 2 weeks ago
commit 7a6c9b3cd4

@ -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);
// typetype // typetype
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:008:00:00 // 8:00:008: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();
}, },
// //

@ -150,14 +150,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:recordVibrationInstant:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -168,7 +168,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ems/record:recordIotenvInstant:edit']" v-hasPermi="['ems/record:recordVibrationInstant:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -179,9 +179,9 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ems/record:recordIotenvInstant:remove']" v-hasPermi="['ems/record:recordVibrationInstant: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"
@ -189,7 +189,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['ems/record:recordIotenvInstant:export']" v-hasPermi="['ems/record:recordVibrationInstant: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>
@ -200,7 +200,7 @@
<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>
<!-- 振动设备专用列根据选中参数动态显示单列 --> <!-- 振动设备专用列根据选中参数动态显示单列 -->
<el-table-column v-if="selectedVibrationParam === 'vibrationSpeed'" label="振动速度(mm/s)" align="center" prop="vibrationSpeed" width="150"> <el-table-column v-if="selectedVibrationParam === 'vibrationSpeed'" label="振动速度(mm/s)" align="center" prop="vibrationSpeed" width="150">
</el-table-column> </el-table-column>
@ -210,7 +210,7 @@
</el-table-column> </el-table-column>
<el-table-column v-if="selectedVibrationParam === 'vibrationTemp'" label="振动温度(℃)" align="center" prop="vibrationTemp" width="150"> <el-table-column v-if="selectedVibrationParam === 'vibrationTemp'" label="振动温度(℃)" align="center" prop="vibrationTemp" width="150">
</el-table-column> </el-table-column>
<!-- 记录时间列给足够的宽度 --> <!-- 记录时间列给足够的宽度 -->
<el-table-column label="记录时间" align="center" prop="recodeTime" width="200"> <el-table-column label="记录时间" align="center" prop="recodeTime" width="200">
</el-table-column> </el-table-column>
@ -387,7 +387,7 @@ export default {
// //
this.getTreeMonitorInfo() this.getTreeMonitorInfo()
// //
await this.initVibrationDevices(); await this.initVibrationDevices();
}, },
@ -457,7 +457,7 @@ 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
@ -468,7 +468,7 @@ export default {
this.queryParams.monitorId = data.code; this.queryParams.monitorId = data.code;
console.log('点击振动设备子节点:', data.label, 'code:', data.code); console.log('点击振动设备子节点:', data.label, 'code:', data.code);
} }
this.handleQuery(); this.handleQuery();
}, },
@ -541,12 +541,12 @@ export default {
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.daterangeCollectTime = []; this.daterangeCollectTime = [];
// ID // ID
this.queryParams.monitorId = null; this.queryParams.monitorId = null;
this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions); this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions);
console.log('重置后振动设备IDs:', this.queryParams.monitorIds); console.log('重置后振动设备IDs:', this.queryParams.monitorIds);
this.handleQuery(); this.handleQuery();
}, },
// //
@ -620,7 +620,7 @@ export default {
this.queryParams.params['monitorTypes'] = '10'; this.queryParams.params['monitorTypes'] = '10';
// //
this.queryParams.params['vibrationParam'] = this.selectedVibrationParam; this.queryParams.params['vibrationParam'] = this.selectedVibrationParam;
// //
const paramNameMap = { const paramNameMap = {
vibrationSpeed: '振动速度', vibrationSpeed: '振动速度',
@ -629,7 +629,7 @@ export default {
vibrationTemp: '振动温度' vibrationTemp: '振动温度'
}; };
const paramName = paramNameMap[this.selectedVibrationParam] || '振动数据'; const paramName = paramNameMap[this.selectedVibrationParam] || '振动数据';
this.download('ems/record/recordIotenvInstant/export', { this.download('ems/record/recordIotenvInstant/export', {
...this.queryParams ...this.queryParams
}, `${paramName}_${this.daterangeRecordTime[0].substring(0,10)}_${this.daterangeRecordTime[1].substring(0,10)}.xlsx`) }, `${paramName}_${this.daterangeRecordTime[0].substring(0,10)}_${this.daterangeRecordTime[1].substring(0,10)}.xlsx`)
@ -646,11 +646,11 @@ export default {
try { try {
const response = await getMonitorInfoTree({ monitorType: 10 }); const response = await getMonitorInfoTree({ monitorType: 10 });
this.monitorInfoOptions = response.data; this.monitorInfoOptions = response.data;
// ID // ID
this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions); this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions);
console.log('初始化振动设备IDs:', this.queryParams.monitorIds); console.log('初始化振动设备IDs:', this.queryParams.monitorIds);
// ID // ID
this.getList(); this.getList();
} catch (error) { } catch (error) {

Loading…
Cancel
Save