style(接口测试): 修复接口测试首页swagger跳转的问题
--bug=1015399 --user=宋天阳 【接口测试】首页-运行中的定时任务,swagger定时任务跳转后没有显示定时任务tab https://www.tapd.cn/55049933/s/1215835
This commit is contained in:
parent
294dbdb82a
commit
134e781f7c
|
@ -220,6 +220,7 @@ export default {
|
|||
if (!params) {
|
||||
return;
|
||||
}
|
||||
if (params instanceof String) {
|
||||
let paramArr = params.split("edit:");
|
||||
if (paramArr.length !== 2) {
|
||||
return;
|
||||
|
@ -244,6 +245,7 @@ export default {
|
|||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
initModules(row, projectId) {
|
||||
this.$get("/api/automation/module/list/" + projectId, response => {
|
||||
|
|
|
@ -354,7 +354,7 @@ export default {
|
|||
};
|
||||
},
|
||||
activated() {
|
||||
this.selectNodeIds = [];
|
||||
this.$nextTick(() => {
|
||||
let routeParamObj = this.$route.params.paramObj;
|
||||
if (routeParamObj) {
|
||||
let dataRange = routeParamObj.dataSelectRange;
|
||||
|
@ -374,7 +374,7 @@ export default {
|
|||
if (item !== undefined) {
|
||||
let type = item.taskGroup.toString();
|
||||
if (type === "SWAGGER_IMPORT") {
|
||||
this.handleTabsEdit(this.$t('api_test.api_import.timing_synchronization'), 'SCHEDULE');
|
||||
this.openSwaggerScheduleTab();
|
||||
this.param = item;
|
||||
}
|
||||
}
|
||||
|
@ -393,12 +393,13 @@ export default {
|
|||
if (item !== undefined) {
|
||||
let type = item.taskGroup.toString();
|
||||
if (type === "SWAGGER_IMPORT") {
|
||||
this.handleTabsEdit(this.$t('api_test.api_import.timing_synchronization'), 'SCHEDULE');
|
||||
this.openSwaggerScheduleTab();
|
||||
this.param = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
currentProtocol() {
|
||||
|
@ -463,6 +464,22 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
openSwaggerScheduleTab() {
|
||||
//检查是否有开启的定时任务配置页,如果有的话直接跳转,不用再开启
|
||||
let scheduleTabName = "";
|
||||
if (this.apiTabs) {
|
||||
this.apiTabs.forEach(tab => {
|
||||
if (tab.type === 'SCHEDULE') {
|
||||
scheduleTabName = tab.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (scheduleTabName === "") {
|
||||
this.handleTabsEdit(this.$t('api_test.api_import.timing_synchronization'), 'SCHEDULE');
|
||||
} else {
|
||||
this.apiDefaultTab = scheduleTabName;
|
||||
}
|
||||
},
|
||||
setEnvironment(data) {
|
||||
if (data) {
|
||||
this.useEnvironment = data.id;
|
||||
|
@ -733,7 +750,7 @@ export default {
|
|||
if (routeParamObj) {
|
||||
let dataRange = routeParamObj.dataSelectRange;
|
||||
let dataType = routeParamObj.dataType;
|
||||
if (dataRange) {
|
||||
if (dataRange && dataRange instanceof String) {
|
||||
let selectParamArr = dataRange.split("edit:");
|
||||
if (selectParamArr.length === 2) {
|
||||
let scenarioId = selectParamArr[1];
|
||||
|
@ -747,7 +764,7 @@ export default {
|
|||
} else {
|
||||
let dataRange = this.$route.params.dataSelectRange;
|
||||
let dataType = this.$route.params.dataType;
|
||||
if (dataRange) {
|
||||
if (dataRange && dataRange instanceof String) {
|
||||
let selectParamArr = dataRange.split("edit:");
|
||||
if (selectParamArr.length === 2) {
|
||||
let scenarioId = selectParamArr[1];
|
||||
|
|
|
@ -146,11 +146,13 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
initProtocol() {
|
||||
if(this.$route.params.type){
|
||||
//不是跳转来的页面不查询上次请求类型
|
||||
let isRedirectPage = this.isRedirect();
|
||||
if (this.$route.params.type) {
|
||||
this.condition.protocol = this.$route.params.type;
|
||||
this.$emit('protocolChange', this.condition.protocol);
|
||||
this.list();
|
||||
}else if (!this.isRelevance) {
|
||||
} else if (!this.isRelevance && !isRedirectPage) {
|
||||
//展示页面是非引用页面才会查询上一次接口类型
|
||||
this.$get('/api/module/getUserDefaultApiType/', response => {
|
||||
this.condition.protocol = response.data;
|
||||
|
@ -162,6 +164,32 @@ export default {
|
|||
this.list();
|
||||
}
|
||||
},
|
||||
isRedirect() {
|
||||
let isRedirectPage = false;
|
||||
let routeParamObj = this.$route.params.paramObj;
|
||||
if (routeParamObj) {
|
||||
if (routeParamObj.dataSelectRange) {
|
||||
let item = JSON.parse(JSON.stringify(routeParamObj.dataSelectRange)).param;
|
||||
if (item !== undefined) {
|
||||
let type = item.taskGroup.toString();
|
||||
if (type === "SWAGGER_IMPORT") {
|
||||
isRedirectPage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.$route.params.dataSelectRange) {
|
||||
let item = JSON.parse(JSON.stringify(this.$route.params.dataSelectRange)).param;
|
||||
if (item !== undefined) {
|
||||
let type = item.taskGroup.toString();
|
||||
if (type === "SWAGGER_IMPORT") {
|
||||
isRedirectPage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return isRedirectPage;
|
||||
},
|
||||
filter() {
|
||||
this.$refs.nodeTree.filter(this.condition.filterText);
|
||||
},
|
||||
|
@ -268,7 +296,7 @@ export default {
|
|||
this.$emit('refreshTable');
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
Loading…
Reference in New Issue