修改ajax回调的使用方式
This commit is contained in:
parent
19478566a1
commit
1bd6b77182
|
@ -101,14 +101,10 @@
|
|||
name: this.condition
|
||||
};
|
||||
|
||||
this.$post(this.buildPagePath(this.queryPath), param).then(response => {
|
||||
if (response.data.success) {
|
||||
let data = response.data.data;
|
||||
this.$post(this.buildPagePath(this.queryPath), param, response => {
|
||||
let data = response.data;
|
||||
this.total = data.itemCount;
|
||||
this.tableData = data.listObject;
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
search() {
|
||||
|
@ -151,16 +147,12 @@
|
|||
id: testPlan.id
|
||||
};
|
||||
|
||||
this.$post(this.deletePath, data).then(response => {
|
||||
if (response.data.success) {
|
||||
this.$post(this.deletePath, data, () => {
|
||||
this.$message({
|
||||
message: '删除成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.initTableData();
|
||||
} else {
|
||||
this.$message.error(response.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
},
|
||||
methods: {
|
||||
listProjects() {
|
||||
this.$get(this.listProjectPath).then(response => {
|
||||
this.projects = response.data.data;
|
||||
this.$get(this.listProjectPath, response => {
|
||||
this.projects = response.data;
|
||||
})
|
||||
},
|
||||
save() {
|
||||
|
@ -88,13 +88,11 @@
|
|||
|
||||
let options = this.getSaveOption();
|
||||
|
||||
this.$request(options).then(response => {
|
||||
if (response) {
|
||||
this.$request(options, () => {
|
||||
this.$message({
|
||||
message: '保存成功!',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
saveAndRun() {
|
||||
|
@ -104,8 +102,7 @@
|
|||
|
||||
let options = this.getSaveOption();
|
||||
|
||||
this.$request(options).then(response => {
|
||||
if (response) {
|
||||
this.$request(options, () => {
|
||||
this.$message({
|
||||
message: '保存成功!',
|
||||
type: 'success'
|
||||
|
@ -117,7 +114,6 @@
|
|||
type: 'success'
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
getSaveOption() {
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
},
|
||||
methods: {
|
||||
getFileMetadata(testPlan) {
|
||||
this.$get(this.getFileMetadataPath + "/" + testPlan.id).then(response => {
|
||||
let file = response.data.data;
|
||||
this.$get(this.getFileMetadataPath + "/" + testPlan.id, response => {
|
||||
let file = response.data;
|
||||
|
||||
this.testPlan.file = file;
|
||||
|
||||
|
@ -115,8 +115,7 @@
|
|||
name: file.name
|
||||
};
|
||||
|
||||
this.$post(this.jmxDownloadPath, data).then(response => {
|
||||
if (response) {
|
||||
this.$post(this.jmxDownloadPath, data, response => {
|
||||
const content = response.data;
|
||||
const blob = new Blob([content]);
|
||||
if ("download" in document.createElement("a")) {
|
||||
|
@ -131,9 +130,6 @@
|
|||
// IE10+下载
|
||||
navigator.msSaveBlob(blob, this.filename)
|
||||
}
|
||||
}
|
||||
}).catch((response) => {
|
||||
this.$message.error(response.message);
|
||||
});
|
||||
},
|
||||
handleDelete(file, index) {
|
||||
|
|
Loading…
Reference in New Issue