fix: 1、修复detection下拉面板点击空白处,地址栏的eventId未被清除的问题;2、完善policy交互流程
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="form-collapse-content">
|
||||
<general-settings ref="form" :editObj="editObj" @setSettingForm="getFormSetting" />
|
||||
<general-settings ref="form" :editObj="editObj" :isComplete="isComplete" @setSettingForm="getFormSetting" />
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="form-collapse-content">
|
||||
<rule-definition :settingObj="settingObj" :editObj="editObj" @setRuleObj="getRuleObj" />
|
||||
<rule-definition :settingObj="settingObj" :editObj="editObj" :isComplete="isComplete" @setRuleObj="getRuleObj" />
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
@@ -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
|
||||
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'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user