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')) } }