From 2350fbebc75693a37c1e44d99873785854edbc29 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Mon, 4 Sep 2023 09:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=94=B9=E5=8A=A8=E5=90=8E?= =?UTF-8?q?=E6=B5=8B=E8=AF=951=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/self-defined.scss | 5 + src/views/model/alert/deviceparamalert.vue | 171 +++++++++++---------- 2 files changed, 96 insertions(+), 80 deletions(-) diff --git a/src/assets/styles/self-defined.scss b/src/assets/styles/self-defined.scss index 6680eb4..adc418f 100644 --- a/src/assets/styles/self-defined.scss +++ b/src/assets/styles/self-defined.scss @@ -180,3 +180,8 @@ display: block; } +.elFormItem { + div{ + margin-left: 0px !important; + } +} \ No newline at end of file diff --git a/src/views/model/alert/deviceparamalert.vue b/src/views/model/alert/deviceparamalert.vue index c5c369f..cb24477 100644 --- a/src/views/model/alert/deviceparamalert.vue +++ b/src/views/model/alert/deviceparamalert.vue @@ -223,66 +223,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +

告警逻辑:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -692,7 +702,7 @@ function getModelListSwitch(row){ if(response.data && response.data.length>0){ formPolicy.value.statusValue = response.data[0].statusValue; formPolicy.value.statusType = response.data[0].statusType; - formPolicy.value.methodIds = response.data[0].methodIds.split(',').map(Number); + formPolicy.value.methodIds = response.data[0].methodIds?.split(',').map(Number); formPolicy.value.boolValue = response.data[0].boolValue; formPolicy.value.alertId = row.id; formPolicy.value.deviceId = row.deviceUuid; @@ -716,16 +726,18 @@ function getModelList(row){ formPolicy.value.deviceId = row.deviceUuid; proxy.$refs.policyTable.clearSelection(); console.log(queryPolicy.value); - listPolicyInfo(queryPolicy.value).then(response=>{ + listPolicyInfo(queryPolicy.value).then(responsePolicy=>{ //修改界面初始化 - if(response.data && response.data.length>0){ - console.log(response.data); - oldPolicyRows.value = response.data; - formPolicy.value.alertId = response.data[0].alertId; - formPolicy.value.deviceId = response.data[0].deviceId; - formPolicy.value.id = response.data[0].id; + if(responsePolicy.data && responsePolicy.data.length>0){ + console.log(responsePolicy.data); + oldPolicyRows.value = responsePolicy.data; + formPolicy.value.alertId = responsePolicy.data[0].alertId; + formPolicy.value.deviceId = responsePolicy.data[0].deviceId; + formPolicy.value.id = responsePolicy.data[0].id; + console.log('modle'); modelList.value.map(element=>{ - response.data.forEach(item=>{ + console.log('response'); + responsePolicy.data.forEach(item=>{ if(item.alertModelId == element.id){ policyDeviceUuid.value = item.deviceId; policyAlertId.value = item.alertId; @@ -738,12 +750,15 @@ function getModelList(row){ } element.level = item.level; element.name = item.name; - element.id = item.id; + console.log('item.id'); + console.log(item.id); + element.policyId = item.id; element.statusValue = item.statusValue; element.statusType = item.statusType; - element.methodIds = item.methodIds.split(',').map(Number); + element.methodIds = item.methodIds?.split(',').map(Number); element.operator = item.operator; element.sort = item.sortId; + element.id = item.alertModelId; proxy.$refs.policyTable.toggleRowSelection(element,true); return element; } @@ -775,7 +790,7 @@ function mapFormTable(){ policyParam.name = item.name; policyParam.statusValue = item.statusValue; policyParam.statusType = item.statusType; - policyParam.methodIds = item.methodIds.join(','); + policyParam.methodIds = item.methodIds?.join(','); policyParam.operator = item.operator; policyParam.sortId = item.sort; policyParams.value.push(policyParam); @@ -788,7 +803,7 @@ function mapFormTableUpdate(){ policyParams.value=[]; policyTableRows.forEach(item=>{ let policyParam = {}; - policyParam.id = item.id; + policyParam.id = item.policyId; policyParam.deviceId = policyDeviceUuid.value; policyParam.alertId = item.alertId; if(paramTypeValue.value == '3'){ @@ -799,11 +814,11 @@ function mapFormTableUpdate(){ policyParam.intValue = item.value; } policyParam.level = item.level; - policyParam.alertModelId = item.alertModelId; + policyParam.alertModelId = item.id; policyParam.name = item.name; policyParam.statusValue = item.statusValue; policyParam.statusType = item.statusType; - policyParam.methodIds = item.methodIds.join(','); + policyParam.methodIds = item.methodIds?.join(','); policyParam.operator = item.operator; policyParam.sortId = item.sort; policyParams.value.push(policyParam); @@ -849,7 +864,6 @@ function computeAddPolicy() { return item.id !== element.id; }) //为了新增不能传id给后台 - delete item.id; let policyParam = {}; policyParam.deviceId = policyDeviceUuid.value; policyParam.alertId = policyAlertId.value; @@ -865,7 +879,7 @@ function computeAddPolicy() { policyParam.name = item.name; policyParam.statusValue = item.statusValue; policyParam.statusType = item.statusType; - policyParam.methodIds = item.methodIds.join(','); + policyParam.methodIds = item.methodIds?.join(','); policyParam.operator = item.operator; policyParam.sortId = item.sort; addPolicyRows.value.push(policyParam); @@ -940,9 +954,6 @@ function handleValueChangeSub(row){ return flag; } -function methodIdsChange(){ - proxy.$forceUpdate(); -} getList();