diff --git a/src/assets/css/components/views/detections/detection-create/detection-form-setting.scss b/src/assets/css/components/views/detections/detection-create/detection-form-setting.scss index a637e976..7b9ceef3 100644 --- a/src/assets/css/components/views/detections/detection-create/detection-form-setting.scss +++ b/src/assets/css/components/views/detections/detection-create/detection-form-setting.scss @@ -194,12 +194,13 @@ } } -.form-setting__btn, .form-setting__btn1 { +.form-setting__btn, .form-setting__btn1, .policy-form__footer__btn { width: 100%; display: flex; justify-content: flex-end; .el-button { + width: 80px !important; height: 30px !important; min-height: 30px !important; line-height: 30px !important; @@ -222,8 +223,15 @@ } } } +.policy-form__footer__btn { + justify-content: center; + margin-top: 8px; -.form-setting__btn1 { + .btn1 { + margin-right: 16px; + } +} +.form-setting__btn1, .policy-form__footer__btn { .el-button { padding: 0 11px !important; } diff --git a/src/assets/css/components/views/detections/detection-create/detection-form.scss b/src/assets/css/components/views/detections/detection-create/detection-form.scss index ebef8d00..f82c0da9 100644 --- a/src/assets/css/components/views/detections/detection-create/detection-form.scss +++ b/src/assets/css/components/views/detections/detection-create/detection-form.scss @@ -10,9 +10,9 @@ } .detection-form-content { - height: 100%; + height: calc(100% - 92px); overflow: scroll; - padding-bottom: 40px; + padding-bottom: 20px; .detection-form-collapse { margin-top: 20px; @@ -130,6 +130,12 @@ } } } + + .policy-form-trigger { + .el-collapse-item__content { + padding-bottom: 0 !important; + } + } } .el-input--mini, .el-input--mini .el-input__inner { @@ -143,4 +149,13 @@ padding-bottom: 20px; } + .policy-form__footer { + width: calc(100% + 40px); + height: 60px; + margin-left: -20px; + box-shadow: 0 -1px 4px 0 rgba(0,0,0,0.10); + display: flex; + align-items: center; + justify-content: center; + } } diff --git a/src/views/detections/detectionPolicies/PolicyForm.vue b/src/views/detections/detectionPolicies/PolicyForm.vue index d23212cd..d41c9007 100644 --- a/src/views/detections/detectionPolicies/PolicyForm.vue +++ b/src/views/detections/detectionPolicies/PolicyForm.vue @@ -6,8 +6,8 @@ {{ ruleId ? $t('detection.editEventPolicies') : $t('detection.createEventPolicies') }} -
+
@@ -43,7 +43,7 @@
- + @@ -369,7 +371,7 @@ export default { } }, /** 创建policy */ - createPolicy (flag) { + createPolicy () { const settingLen = Object.keys(this.settingObj).length const ruleLen = Object.keys(this.ruleObj).length @@ -378,9 +380,6 @@ export default { if (valid) { // 最终提交form const formObj = this.$_.cloneDeep({ ...this.settingObj, ruleConfig: JSON.stringify(this.ruleObj), ruleTrigger: this.triggerObj }) - if (flag) { - formObj.status = 1 - } // 将时间转为参数所需,如5分钟转为PT5M formObj.ruleTrigger.resetInterval = getDurationsTimeByType(formObj.ruleTrigger.resetInterval, formObj.ruleTrigger.resetIntervalVal) formObj.ruleTrigger.interval = getDurationsTimeByType(formObj.ruleTrigger.interval, formObj.ruleTrigger.intervalVal) @@ -429,12 +428,18 @@ export default { message: this.$t('tip.saveSuccess') }) + const { query } = this.$route + const queryInfo = { + pageNo: self.pageNoForTable ? Number(self.pageNoForTable) : 1, + t: +new Date() + } + if (query.name && query.id) { + queryInfo.ruleId = query.id + queryInfo.name = this.settingObj.name + } this.$router.push({ path: '/detection/policy', - query: { - pageNo: self.pageNoForTable ? Number(self.pageNoForTable) : 1, - t: +new Date() - } + query: queryInfo }) } else { console.error(response.data.message) @@ -492,7 +497,134 @@ export default { return { flag: false, msg: this.$t('policy.dateTimeRangeSeconds') } } } + }, + cancel () { + const { query } = this.$route + const queryInfo = { + pageNo: this.pageNoForTable ? Number(this.pageNoForTable) : 1, + t: +new Date() + } + if (query.name && query.id) { + queryInfo.ruleId = query.id + queryInfo.name = this.settingObj.name + } + this.$refs.form3.validate(valid => { + if (this.settingObj.settingNoContinue || this.ruleObj.settingNoContinue || !valid) { + this.$confirm(this.$t('tip.leavePage'), { + confirmButtonText: this.$t('tip.confirm'), + cancelButtonText: this.$t('overall.cancel'), + message: this.$t('tip.leavePageTips'), + title: this.$t('tip.leavePage'), + type: 'warning', + iconClass: 'width:0px;height:0px;', + customClass: 'del-model' + }).then(() => { + this.$router.push({ + path: '/detection/policy', + query: queryInfo + }) + }).catch(() => {}) + } else { + this.$router.push({ + path: '/detection/policy', + query: queryInfo + }) + } + }) } } } + +