refactor(性能测试): 添加监控表单必填校验

This commit is contained in:
shiziyuan9527 2021-04-15 15:37:11 +08:00 committed by 刘瑞斌
parent bbf6281627
commit bc74933ffc
2 changed files with 21 additions and 8 deletions

View File

@ -20,7 +20,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="Port">
<el-form-item label="Port" prop="port">
<el-input-number v-model="form.port" :min="1" :max="65535"/>
</el-form-item>
</el-col>
@ -61,7 +61,11 @@ export default {
result: {},
form: {},
dialogVisible: false,
rule: {},
rule: {
name: {required: true, message: "名称必填", trigger: 'blur'},
ip: {required: true, message: "ip必填", trigger: 'blur'},
port: {required: true, message: "port必填", trigger: 'blur'},
},
index: '',
};
},
@ -86,23 +90,23 @@ export default {
if (valid) {
this.list.splice(this.index, 1, this.form);
this.$emit("update:list", this.list);
this.dialogVisible = false;
} else {
return false;
}
});
this.dialogVisible = false;
},
create() {
this.$refs.monitorForm.validate(valid => {
if (valid) {
this.form.monitorStatus = CONFIG_TYPE.NOT;
// this.form.monitorStatus = CONFIG_TYPE.NOT;
this.list.push(this.form);
this.$emit("update:list", this.list);
this.dialogVisible = false;
} else {
return false;
}
});
this.dialogVisible = false;
},
}
};

View File

@ -173,10 +173,19 @@
<!-- prop="authStatus"-->
<!-- label="认证状态">-->
<!-- </el-table-column>-->
<el-table-column
<!-- <el-table-column-->
<!-- align="center"-->
<!-- prop="monitorStatus"-->
<!-- label="监控状态">-->
<el-table-column
align="center"
prop="monitorStatus"
label="监控状态">
prop="ip"
label="IP">
</el-table-column>
<el-table-column
align="center"
prop="port"
label="Port">
</el-table-column>
<el-table-column
align="center"