From 6dea1ee8909d5eaa88785b972a9587c4355773c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Wed, 25 Oct 2023 15:13:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201=E3=80=81=E4=BF=AE=E5=A4=8Ddetection?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=9D=A2=E6=9D=BF=E7=82=B9=E5=87=BB=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E5=A4=84=EF=BC=8C=E5=9C=B0=E5=9D=80=E6=A0=8F=E7=9A=84?= =?UTF-8?q?eventId=E6=9C=AA=E8=A2=AB=E6=B8=85=E9=99=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B2=E3=80=81=E5=AE=8C=E5=96=84policy=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/detection/GeneralSettings.vue | 14 ++++++++- .../table/detection/RuleDefinition.vue | 14 ++++++++- src/views/detections/DetectionRow.vue | 9 ++++++ src/views/detectionsNew/DetectionForm.vue | 31 ++++++++++++++----- 4 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/components/table/detection/GeneralSettings.vue b/src/components/table/detection/GeneralSettings.vue index 29f8260a..e7b8f354 100644 --- a/src/components/table/detection/GeneralSettings.vue +++ b/src/components/table/detection/GeneralSettings.vue @@ -118,6 +118,9 @@ export default { props: { editObj: { type: Object + }, + isComplete: { + type: Boolean } }, data () { @@ -167,6 +170,12 @@ export default { this.settingObj.editFlag = false this.settingObj.saveFlag = true } + }, + isComplete (newVal) { + if (!newVal) { + console.log('让我瞅瞅咋回事') + this.onContinue() + } } }, mounted () { @@ -190,7 +199,10 @@ export default { } }, /** 点击继续,进行第二步 */ - onContinue () { + onContinue (e) { + if (e) { + delete this.settingObj.settingNoContinue + } this.$refs.form.validate(valid => { if (valid) { this.settingObj.editFlag = false diff --git a/src/components/table/detection/RuleDefinition.vue b/src/components/table/detection/RuleDefinition.vue index 44d3bd3e..dd045d8c 100644 --- a/src/components/table/detection/RuleDefinition.vue +++ b/src/components/table/detection/RuleDefinition.vue @@ -229,6 +229,9 @@ export default { }, editObj: { type: Object + }, + isComplete: { + type: Boolean } }, components: { @@ -258,6 +261,11 @@ export default { } } } + }, + isComplete (newVal) { + if (!newVal) { + this.onContinue() + } } }, data () { @@ -374,6 +382,7 @@ export default { if (response.status === 200) { this.libraryList = _.get(response, 'data.data.list', []).filter(l => l.isBuiltIn === 0) } else { + console.error(response.data.message) this.libraryList = [] if (response.data.message) { this.$message.error(response.data.message) @@ -485,7 +494,10 @@ export default { this.thresholdRuleObj.filterList.splice(i, 1) }, /** 点击继续,展开第三步 */ - onContinue () { + onContinue (e) { + if (e) { + delete this.indicatorRuleObj.ruleNoContinue + } this.$refs.form.validate(valid => { if (valid) { if (this.mySettingObj.ruleType === detectionRuleType.indicator) { diff --git a/src/views/detections/DetectionRow.vue b/src/views/detections/DetectionRow.vue index a33ae3b2..d7181a2b 100644 --- a/src/views/detections/DetectionRow.vue +++ b/src/views/detections/DetectionRow.vue @@ -176,6 +176,15 @@ export default { } } }, + watch: { + isCollapse (newVal) { + const newQuery = this.$route.query + if (newVal && newQuery.eventId) { + delete newQuery.eventId + this.reloadUrl(newQuery, 'cleanOldParams') + } + } + }, methods: { unitConvert, getMillisecond, diff --git a/src/views/detectionsNew/DetectionForm.vue b/src/views/detectionsNew/DetectionForm.vue index 57e36bd4..a60f1ff3 100644 --- a/src/views/detectionsNew/DetectionForm.vue +++ b/src/views/detectionsNew/DetectionForm.vue @@ -18,7 +18,7 @@
- +
@@ -35,7 +35,7 @@
- +
@@ -147,7 +147,8 @@ export default { ] }, intervalList: detectionUnitList.intervalList || [], - editObj: {} + editObj: {}, + isComplete: true // 参数完整标识,默认完整(照顾编辑模式),false即不完整 } }, components: { @@ -236,6 +237,12 @@ export default { if (!flag) { const list = arr list.splice(list.indexOf(name), 1) + if (name === '1' && list.indexOf('2') < 0) { + list.push('2') + } + if (name === '2' && list.indexOf('3') < 0) { + list.push('3') + } this.activeNames = [] list.forEach(t => { this.activeNames.push(t) @@ -284,6 +291,7 @@ export default { } }) } else { + console.error(response.data.message) this.$message.error(this.errorMsgHandler(response)) } }).catch(e => { @@ -310,6 +318,7 @@ export default { } }) } else { + console.error(response.data.message) this.$message.error(this.errorMsgHandler(response)) } }).catch(e => { @@ -319,21 +328,27 @@ export default { this.myLoading = false }) } + } else { + this.isComplete = false } }) } else if (settingLen === 0) { + this.isComplete = false this.handleFormError('1') } else if (ruleLen === 0) { + this.isComplete = false this.handleFormError('2') } }, handleFormError (name) { const list = this.activeNames - list.push(name) - this.activeNames = [] - list.forEach(t => { - this.activeNames.push(t) - }) + if (list.indexOf(name) < 0) { + list.push(name) + this.activeNames = [] + list.forEach(t => { + this.activeNames.push(t) + }) + } this.$message.error(this.$t('detection.create.informationFilled')) } }