fix:【接口定义】首页跳转swagger定时同步显示

This commit is contained in:
wenyann 2021-07-19 16:23:23 +08:00 committed by 刘瑞斌
parent d33f6eccea
commit d192bc29ed
4 changed files with 30 additions and 7 deletions

View File

@ -175,7 +175,7 @@
<!-- 定时任务 -->
<div v-if="item.type=== 'SCHEDULE'" class="ms-api-div">
<api-schedule :module-options="nodeTree"/>
<api-schedule :param="param" :module-options="nodeTree" ref="apiSchedules"/>
</div>
<div v-else-if="item.type=== 'MOCK'" class="ms-api-div">
@ -313,13 +313,24 @@ export default {
currentModulePath: "",
//API
initApiTableOpretion: 'init',
param: {},
};
},
created() {
activated() {
let dataRange = this.$route.params.dataSelectRange;
if (dataRange && dataRange.length > 0) {
this.activeDom = 'middle';
this.trashActiveDom = 'left';
}
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") {
this.handleTabsEdit(this.$t('api_test.api_import.timing_synchronization'), 'SCHEDULE');
this.param = item;
}
}
}
},
watch: {

View File

@ -54,6 +54,7 @@
<div class="task-list">
<swagger-task-list
@clear="clear"
:param="param"
@rowClick="handleRowClick"
ref="taskList"/>
</div>
@ -79,13 +80,16 @@ export default {
props: {
customValidate: {
type: Function,
default: () => {return {pass: true};}
default: () => {
return {pass: true};
}
},
isReadOnly: {
type: Boolean,
default: false
},
moduleOptions: Array,
param: Object,
},
watch: {

View File

@ -61,14 +61,22 @@ export default {
return {
tableData: [],
result: {}
}
};
},
props: {
param: Object
},
methods: {
search() {
let projectId = getCurrentProjectID();
this.result = this.$get("/api/definition/scheduleTask/" + projectId, response => {
this.tableData = response.data;
})
response.data.forEach(item => {
if (item.taskId === this.param.taskID) {
this.handleRowClick(item);
}
});
});
},
handleRowClick(row) {
this.$emit('rowClick', row);

View File

@ -155,7 +155,7 @@ export default {
}else if (param.taskGroup === 'API_SCENARIO_TEST') {
this.$emit('redirectPage', 'scenario', 'scenario', 'edit:' + param.scenarioId);
} else if (param.taskGroup === 'SWAGGER_IMPORT') {
this.$emit('redirectPage', 'api', 'api', 'edit:' + param.scenarioId);
this.$emit('redirectPage', 'api', 'api', {param});
}
}
},