Commit 160bf1ad by 前端

Merge branch 'sass-5.8.2-ccw' into 'SAAS+V5.8.2'

Sass 5.8.2 ccw

See merge request !703
2 parents d27db8d2 1da2cb6c
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
<el-form-item label="项目组名称" <el-form-item label="项目组名称"
prop="name"> prop="name">
<el-input v-model.trim="form.name" <el-input v-model.trim="form.name"
style="width: 530px"
maxlength="10" maxlength="10"
placeholder="请输入项目组名称" placeholder="请输入项目组名称"
style="width: 530px"
show-word-limit /> show-word-limit />
</el-form-item> </el-form-item>
<!-- <el-form-item label="备注" <!-- <el-form-item label="备注"
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
<span class="range-sep">≤</span> <span class="range-sep">&lt;</span>
<span class="range-mid">选中的指标值</span> <span class="range-mid">选中的指标值</span>
<span class="range-sep">&lt;</span> <span class="range-sep">&lt;</span>
<el-form-item class="condition-row__item condition-row__item--range-end" <el-form-item class="condition-row__item condition-row__item--range-end"
...@@ -878,8 +878,8 @@ export default { ...@@ -878,8 +878,8 @@ export default {
}, },
getRangePlaceholder(group, cond) { getRangePlaceholder(group, cond) {
return this.isRatioMetricKind(this.getMetricKindForCond(group, cond)) return this.isRatioMetricKind(this.getMetricKindForCond(group, cond))
? "0-100,最多两位小数" ? "0-100%"
: "0-99999999,最多两位小数"; : "0-99999999";
}, },
validateThresholdValue(group, cond, value) { validateThresholdValue(group, cond, value) {
const kind = this.getMetricKindForCond(group, cond); const kind = this.getMetricKindForCond(group, cond);
...@@ -963,11 +963,11 @@ export default { ...@@ -963,11 +963,11 @@ export default {
if (count <= 1) if (count <= 1)
return; return;
this.$message.info("预警类型与应用业务组合不能重复"); this.$message.info("预警类型与应用业务组合不能重复");
if (changedField === "warningType") if (changedField === "warningType") {
group.warningType = ""; group.warningType = "";
else if (changedField === "bizType") } else if (changedField === "bizType") {
group.bizType = ""; group.bizType = "";
else { } else {
group.warningType = ""; group.warningType = "";
group.bizType = ""; group.bizType = "";
} }
...@@ -1203,12 +1203,28 @@ export default { ...@@ -1203,12 +1203,28 @@ export default {
this.validateConditionRangeFields(groupIndex, condIndex); this.validateConditionRangeFields(groupIndex, condIndex);
}); });
}, },
async handleSubmit() { handleSubmit() {
this.$refs.formRef.validate(async (valid) => { if (this.submitLoading)
return;
this.$refs.formRef.validate((valid) => {
if (!valid) if (!valid)
return; return;
this.submitForm();
});
},
async submitForm() {
if (this.submitLoading)
return;
if (!this.form.ruleGroups.length) { if (!this.form.ruleGroups.length) {
this.$message.info("请至少添加1个预警类型"); this.submitLoading = true;
try {
const params = this.buildSaveParams();
await saveProjectGroup(params);
this.$message.success(this.isEdit ? "保存成功" : "新增成功");
this.$router.back();
} finally {
this.submitLoading = false;
}
return; return;
} }
if (this.form.ruleGroups.length > this.maxRuleGroups) { if (this.form.ruleGroups.length > this.maxRuleGroups) {
...@@ -1266,8 +1282,6 @@ export default { ...@@ -1266,8 +1282,6 @@ export default {
this.$refs.formRef.validateField(invalidRangeFields); this.$refs.formRef.validateField(invalidRangeFields);
return; return;
} }
if (this.submitLoading)
return;
this.submitLoading = true; this.submitLoading = true;
try { try {
const params = this.buildSaveParams(); const params = this.buildSaveParams();
...@@ -1284,7 +1298,6 @@ export default { ...@@ -1284,7 +1298,6 @@ export default {
} finally { } finally {
this.submitLoading = false; this.submitLoading = false;
} }
});
}, },
handleCancel() { handleCancel() {
this.$router.back(); this.$router.back();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!