diff --git a/ruoyi-ui/src/components/DeviceSelect/index.vue b/ruoyi-ui/src/components/DeviceSelect/index.vue index 2f2695b..c124fdb 100644 --- a/ruoyi-ui/src/components/DeviceSelect/index.vue +++ b/ruoyi-ui/src/components/DeviceSelect/index.vue @@ -8,13 +8,20 @@ :filterable="filterable" :multiple="multiple" @change="handleChange" + :filter-method="dataFilter" > + > + + {{ item.name }} + ({{ item.sn }}) + + + @@ -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); diff --git a/ruoyi-ui/src/views/history/bound/index.vue b/ruoyi-ui/src/views/history/bound/index.vue index fd7845f..2d9bc8d 100644 --- a/ruoyi-ui/src/views/history/bound/index.vue +++ b/ruoyi-ui/src/views/history/bound/index.vue @@ -1,12 +1,12 @@ - + - + @@ -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 { } }; - \ No newline at end of file +