fix(接口定义、接口自动化): 修复接口定义、接口自动化导出文件中项目名为null的问题
修复接口定义、接口自动化导出文件中项目名为null的问题
This commit is contained in:
parent
c7cb74be3a
commit
d81cb28bfb
|
@ -286,6 +286,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
projectName:"",
|
||||||
result: {},
|
result: {},
|
||||||
tableHeaderKey:"API_SCENARIO",
|
tableHeaderKey:"API_SCENARIO",
|
||||||
type: API_SCENARIO_LIST,
|
type: API_SCENARIO_LIST,
|
||||||
|
@ -436,6 +437,9 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if(!this.projectName || this.projectName === ""){
|
||||||
|
this.getProjectName();
|
||||||
|
}
|
||||||
this.operators = this.unTrashOperators;
|
this.operators = this.unTrashOperators;
|
||||||
this.buttons = this.unTrashButtons;
|
this.buttons = this.unTrashButtons;
|
||||||
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
|
this.condition.filters = {status: ["Prepare", "Underway", "Completed"]};
|
||||||
|
@ -481,6 +485,14 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getProjectName (){
|
||||||
|
this.$get('project/get/' + this.projectId, response => {
|
||||||
|
let project = response.data;
|
||||||
|
if(project){
|
||||||
|
this.projectName = project.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
selectByParam() {
|
selectByParam() {
|
||||||
this.changeSelectDataRangeAll();
|
this.changeSelectDataRangeAll();
|
||||||
this.search();
|
this.search();
|
||||||
|
@ -811,7 +823,7 @@ export default {
|
||||||
this.result.loading = false;
|
this.result.loading = false;
|
||||||
let obj = response.data;
|
let obj = response.data;
|
||||||
this.buildApiPath(obj.data);
|
this.buildApiPath(obj.data);
|
||||||
downloadFile("Metersphere_Scenario_" + localStorage.getItem(PROJECT_NAME) + ".json", JSON.stringify(obj));
|
downloadFile("Metersphere_Scenario_" + this.projectName + ".json", JSON.stringify(obj));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
exportJmx() {
|
exportJmx() {
|
||||||
|
|
|
@ -361,6 +361,7 @@ export default {
|
||||||
screenHeight: 'calc(100vh - 250px)',//屏幕高度,
|
screenHeight: 'calc(100vh - 250px)',//屏幕高度,
|
||||||
environmentId: undefined,
|
environmentId: undefined,
|
||||||
selectDataCounts: 0,
|
selectDataCounts: 0,
|
||||||
|
projectName:"",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -411,6 +412,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
|
if(!this.projectName || this.projectName === ""){
|
||||||
|
this.getProjectName();
|
||||||
|
}
|
||||||
if (this.trashEnable) {
|
if (this.trashEnable) {
|
||||||
this.tableOperatorButtons = this.tableTrashOperatorButtons;
|
this.tableOperatorButtons = this.tableTrashOperatorButtons;
|
||||||
this.condition.filters = {status: ["Trash"]};
|
this.condition.filters = {status: ["Trash"]};
|
||||||
|
@ -455,6 +459,14 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getProjectName (){
|
||||||
|
this.$get('project/get/' + this.projectId, response => {
|
||||||
|
let project = response.data;
|
||||||
|
if(project){
|
||||||
|
this.projectName = project.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
handleBatchMove() {
|
handleBatchMove() {
|
||||||
this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptions);
|
this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptions);
|
||||||
},
|
},
|
||||||
|
@ -773,9 +785,9 @@ export default {
|
||||||
if (type == 'MS') {
|
if (type == 'MS') {
|
||||||
obj.protocol = this.currentProtocol;
|
obj.protocol = this.currentProtocol;
|
||||||
this.buildApiPath(obj.data);
|
this.buildApiPath(obj.data);
|
||||||
downloadFile("Metersphere_Api_" + localStorage.getItem(PROJECT_NAME) + ".json", JSON.stringify(obj));
|
downloadFile("Metersphere_Api_" + this.projectName + ".json", JSON.stringify(obj));
|
||||||
} else {
|
} else {
|
||||||
downloadFile("Swagger_Api_" + localStorage.getItem(PROJECT_NAME) + ".json", JSON.stringify(obj));
|
downloadFile("Swagger_Api_" + this.projectName+ ".json", JSON.stringify(obj));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue