feat: 历史数据-厂界在线 功能1;修改设备选择组件功能

This commit is contained in:
LokerL 2024-12-15 18:37:52 +08:00
parent 4c1b0a6d29
commit 3fc5bcdefd
2 changed files with 21 additions and 12 deletions

View File

@ -8,13 +8,20 @@
:filterable="filterable"
:multiple="multiple"
@change="handleChange"
:filter-method="dataFilter"
>
<el-option
v-for="item in deviceList"
:key="item.sn"
:label="item.name"
:value="item.sn"
></el-option>
>
<span>
{{ item.name }}
(<span style="color: #8492a6; font-size: 13px">{{ item.sn }}</span>)
</span>
</el-option>
</el-select>
</div>
</template>
@ -69,6 +76,10 @@
}
},
methods: {
dataFilter(query) {
if (!query) return this.deviceList = this.deviceListCopy;
this.deviceList = this.deviceListCopy.filter(item => item.name.includes(query) || item.sn.includes(query));
},
handleChange(val) {
this.$emit("input", val);
this.$emit("change", val);

View File

@ -1,12 +1,12 @@
<template>
<div class="app-container">
<el-form :inline="true" :model="queryParams" ref="form">
<el-form-item label="选择部门" prop="factoryId">
<el-form-item label="选择部门1" prop="factoryId">
<dept-tree @deptChange="handleDeptChange" style="width: 150px;" />
</el-form-item>
<el-form-item label="设备编号">
<el-input v-model="queryParams.sn"></el-input>
<el-form-item label="选择设备">
<device-select v-model="queryParams.sn" :deptId="queryParams.deptId || ''" />
</el-form-item>
<el-form-item label="日期" prop="equipmentName">
<el-date-picker v-model="dateList" type="daterange" range-separator="" start-placeholder="开始日期"
@ -25,7 +25,7 @@
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<!-- <el-table-column prop="zl" label="传感器类型" header-align="center" align="center" /> -->
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
@ -38,7 +38,7 @@
</span>
</template>
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
@ -52,7 +52,7 @@
</span>
</template>
</el-table-column>
</el-table>
@ -66,9 +66,10 @@
import store from "@/store";
import DeptTree from "@/components/DeptTree/index.vue";
import { listAlarmHistory } from "@/api/demostrate/monitor";
import DeviceSelect from '@/components/DeviceSelect/index.vue';
export default {
name: "alarm",
components: { DeptTree },
components: { DeptTree, DeviceSelect },
dicts: [],
data() {
return {
@ -153,9 +154,6 @@ export default {
this.total = response.total;
this.loading = false;
});
},
handleQuery() {
this.queryParams.pageNum = 1
@ -165,4 +163,4 @@ export default {
}
};
</script>
</script>