From 9ca9049c9663666752de9bf95335045a3eed0f0c Mon Sep 17 00:00:00 2001 From: xusd Date: Fri, 13 Sep 2024 17:41:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E7=AE=A1=E7=90=86-=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AE=BE=E5=A4=87=E4=B8=8B=E6=8B=89=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/system/alarm/alarmrules/index.vue | 68 +++++++++---------- .../system/alarm/equipalarmdata/index.vue | 47 +++++++------ .../system/alarm/equiptrendalarm/index.vue | 47 +++++++------ 3 files changed, 87 insertions(+), 75 deletions(-) diff --git a/imt-ui/src/views/system/alarm/alarmrules/index.vue b/imt-ui/src/views/system/alarm/alarmrules/index.vue index 7801263..fd7aca7 100644 --- a/imt-ui/src/views/system/alarm/alarmrules/index.vue +++ b/imt-ui/src/views/system/alarm/alarmrules/index.vue @@ -42,23 +42,13 @@ @keyup.enter.native="handleQuery" /> - - + - - + @change="cascaderChange"> - - + - - + @change="cascaderChange"> import * as AlarmRulesApi from "@/api/system/alarm/alarmrules"; import AlarmRulesForm from "./AlarmRulesForm.vue"; -import { getEquipSelection } from "@/api/system/equip/equipInfo"; +import {getEquipCascader, getEquipSelection} from "@/api/system/equip/equipInfo"; export default { name: "AlarmRules", components: { @@ -613,6 +593,8 @@ export default { }, data() { return { + cascaderValue:[], + equipCascader: [], // 遮罩层 loading: true, // 导出遮罩层 @@ -710,13 +692,27 @@ export default { this.loading = true; this.queryParams.type = this.activeName === "threshold" ? 0 : 1; const res = await AlarmRulesApi.getAlarmRulesPage(this.queryParams); - this.equipSelection = await getEquipSelection(); + await getEquipCascader().then(res=>{ + res.forEach(item=>{ + if (item.children == null){ + item.disabled = true; + } + }) + this.equipCascader = res; + }) this.list = res.data.list; this.total = res.data.total; } finally { this.loading = false; } }, + cascaderChange(value){ + if (value.length > 0){ + this.queryParams.equipId = value[1]; + }else { + this.queryParams.equipId = null; + } + }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNo = 1; @@ -724,7 +720,9 @@ export default { }, /** 重置按钮操作 */ resetQuery() { + this.cascaderValue = []; this.resetForm("queryForm"); + this.queryParams.equipId = null; this.handleQuery(); }, /** 添加/修改操作 */ @@ -759,4 +757,4 @@ export default { }, }, }; - \ No newline at end of file + diff --git a/imt-ui/src/views/system/alarm/equipalarmdata/index.vue b/imt-ui/src/views/system/alarm/equipalarmdata/index.vue index 9408575..9074831 100644 --- a/imt-ui/src/views/system/alarm/equipalarmdata/index.vue +++ b/imt-ui/src/views/system/alarm/equipalarmdata/index.vue @@ -10,23 +10,13 @@ label-width="68px" style="text-align:right" > - - + - - + @change="cascaderChange">