提交 bade858c 编写于 作者: C Captain.B

loading

上级 51fa6ed5
...@@ -244,7 +244,6 @@ ...@@ -244,7 +244,6 @@
data() { data() {
return { return {
result: {}, result: {},
testLoading: false,
createVisible: false, createVisible: false,
infoList: [], infoList: [],
updateVisible: false, updateVisible: false,
...@@ -386,11 +385,13 @@ ...@@ -386,11 +385,13 @@
}); });
}, },
createTestResourcePool(createTestResourcePoolForm) { createTestResourcePool(createTestResourcePoolForm) {
if (this.result.loading) {
return;
}
this.$refs[createTestResourcePoolForm].validate(valide => { this.$refs[createTestResourcePoolForm].validate(valide => {
if (valide) { if (valide) {
let vri = this.validateResourceInfo(); let vri = this.validateResourceInfo();
if (vri.validate) { if (vri.validate) {
this.testLoading = true;
this.convertSubmitResources(); this.convertSubmitResources();
this.result = this.$post("/testresourcepool/add", this.form, () => { this.result = this.$post("/testresourcepool/add", this.form, () => {
this.$message({ this.$message({
...@@ -399,14 +400,12 @@ ...@@ -399,14 +400,12 @@
}, },
this.createVisible = false, this.createVisible = false,
this.initTableData()); this.initTableData());
this.testLoading = false;
}); });
} else { } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: vri.msg message: vri.msg
}); });
this.testLoading = false;
return false; return false;
} }
...@@ -428,9 +427,11 @@ ...@@ -428,9 +427,11 @@
this.form.resources = resources; this.form.resources = resources;
}, },
updateTestResourcePool(updateTestResourcePoolForm) { updateTestResourcePool(updateTestResourcePoolForm) {
if (this.result.loading) {
return;
}
this.$refs[updateTestResourcePoolForm].validate(valide => { this.$refs[updateTestResourcePoolForm].validate(valide => {
if (valide) { if (valide) {
this.testLoading = true;
let vri = this.validateResourceInfo(); let vri = this.validateResourceInfo();
if (vri.validate) { if (vri.validate) {
this.convertSubmitResources(); this.convertSubmitResources();
...@@ -442,20 +443,18 @@ ...@@ -442,20 +443,18 @@
this.updateVisible = false, this.updateVisible = false,
this.initTableData(), this.initTableData(),
self.loading = false); self.loading = false);
this.testLoading = false;
}); });
} else { } else {
this.$message({ this.$message({
type: 'warning', type: 'warning',
message: vri.msg message: vri.msg
}); });
this.testLoading = false;
return false; return false;
} }
} else { } else {
return false; return false;
} }
}) });
}, },
closeFunc() { closeFunc() {
this.form = {}; this.form = {};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册