From 88feacb3a4313f1641505fa5b7ff649540cf53cf Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Tue, 14 Jul 2026 13:38:13 +0800
Subject: [PATCH] =?UTF-8?q?2026-07-14=20=E5=BC=82=E5=B8=B8=E8=A7=84?=
=?UTF-8?q?=E5=88=99=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/sys/sceneExceptionRuleConfig.vue | 51 +++++++++++++++----
1 file changed, 42 insertions(+), 9 deletions(-)
diff --git a/src/views/modules/sys/sceneExceptionRuleConfig.vue b/src/views/modules/sys/sceneExceptionRuleConfig.vue
index 51dfb92..4dad105 100644
--- a/src/views/modules/sys/sceneExceptionRuleConfig.vue
+++ b/src/views/modules/sys/sceneExceptionRuleConfig.vue
@@ -157,7 +157,11 @@
-
+
+
+ {{ scope.row.parentConditionNo ? scope.row.triggerEvent : '' }}
+
+
编辑
@@ -210,7 +214,7 @@
-
+
@@ -234,8 +238,8 @@
-
-
+
+
@@ -314,7 +318,7 @@ export default {
warningLevel: '一般',
animationEffect: '系统默认',
responsibilityDept: '',
- triggerEvent: '异常代码'
+ triggerEvent: ''
},
relationFieldOptions: ['排数', '分切卷数', '良品数', '面损', '性能不良', '不良数', '良率', '不良率', '总数'],
compareSymbolOptions: ['>', '=', '<', '>=', '<='],
@@ -329,6 +333,12 @@ export default {
computed: {
rootConditionList () {
return this.conditionList || []
+ },
+ isChildCondition () {
+ return !!this.conditionForm.parentConditionNo
+ },
+ isForceTypeLocked () {
+ return this.isChildCondition && this.conditionForm.triggerEvent === '异常代码'
}
},
created () {
@@ -546,12 +556,13 @@ export default {
relationField: '',
compareSymbol: '>',
conditionParam: null,
- forceType: '强制',
+ forceType: parentConditionNo ? '提示' : '强制',
warningLevel: '一般',
animationEffect: '系统默认',
responsibilityDept: '',
- triggerEvent: '异常代码'
+ triggerEvent: parentConditionNo ? '异常代码' : ''
}
+ this.applyConditionRule()
this.conditionEditVisible = true
},
onParentConditionChange (parentConditionNo) {
@@ -559,6 +570,22 @@ export default {
return
}
this.conditionForm.conditionNo = this.generateConditionNo(parentConditionNo || '')
+ this.applyConditionRule()
+ },
+ onTriggerEventChange () {
+ this.applyConditionRule()
+ },
+ applyConditionRule () {
+ if (!this.conditionForm.parentConditionNo) {
+ this.conditionForm.triggerEvent = ''
+ return
+ }
+ if (!this.conditionForm.triggerEvent) {
+ this.conditionForm.triggerEvent = '异常代码'
+ }
+ if (this.conditionForm.triggerEvent === '异常代码') {
+ this.conditionForm.forceType = '提示'
+ }
},
openConditionEdit (row) {
this.conditionEditTitle = '编辑触发条件'
@@ -576,8 +603,9 @@ export default {
warningLevel: row.warningLevel,
animationEffect: row.animationEffect,
responsibilityDept: row.responsibilityDept,
- triggerEvent: row.triggerEvent
+ triggerEvent: row.parentConditionNo ? row.triggerEvent : ''
}
+ this.applyConditionRule()
this.conditionEditVisible = true
},
saveCondition () {
@@ -605,10 +633,15 @@ export default {
this.$message.warning('请选择是否强制')
return
}
- if (!this.conditionForm.triggerEvent) {
+ if (this.isChildCondition && !this.conditionForm.triggerEvent) {
this.$message.warning('请选择触发异常事件')
return
}
+ if (!this.isChildCondition) {
+ this.conditionForm.triggerEvent = ''
+ } else if (this.conditionForm.triggerEvent === '异常代码') {
+ this.conditionForm.forceType = '提示'
+ }
if (this.conditionForm.mode === 'add') {
saveSceneExceptionRuleCondition(this.conditionForm).then(({ data }) => {
if (data && data.code === 0) {