refactor(接口测试): 完善接口测试首页的跳转
--story=1007743 --user=宋天阳 接口测试首页数据统计优化 https://www.tapd.cn/55049933/s/1194610
This commit is contained in:
parent
d6587265cf
commit
fefd3017a3
|
@ -3,45 +3,45 @@
|
|||
<ms-container v-if="renderComponent">
|
||||
<ms-aside-container>
|
||||
<ms-api-module
|
||||
:show-operator="true"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@protocolChange="handleProtocolChange"
|
||||
@refreshTable="refresh"
|
||||
@exportAPI="exportAPI"
|
||||
@debug="debug"
|
||||
@saveAsEdit="editApi"
|
||||
@setModuleOptions="setModuleOptions"
|
||||
@setNodeTree="setNodeTree"
|
||||
@enableTrash="enableTrash"
|
||||
@schedule="handleTabsEdit($t('api_test.api_import.timing_synchronization'), 'SCHEDULE')"
|
||||
:type="'edit'"
|
||||
page-source="definition"
|
||||
:total='total'
|
||||
:current-version="currentVersion"
|
||||
ref="nodeTree"/>
|
||||
:show-operator="true"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@protocolChange="handleProtocolChange"
|
||||
@refreshTable="refresh"
|
||||
@exportAPI="exportAPI"
|
||||
@debug="debug"
|
||||
@saveAsEdit="editApi"
|
||||
@setModuleOptions="setModuleOptions"
|
||||
@setNodeTree="setNodeTree"
|
||||
@enableTrash="enableTrash"
|
||||
@schedule="handleTabsEdit($t('api_test.api_import.timing_synchronization'), 'SCHEDULE')"
|
||||
:type="'edit'"
|
||||
page-source="definition"
|
||||
:total='total'
|
||||
:current-version="currentVersion"
|
||||
ref="nodeTree"/>
|
||||
</ms-aside-container>
|
||||
|
||||
<ms-main-container>
|
||||
<ms-environment-select
|
||||
:project-id="projectId"
|
||||
:is-read-only="false"
|
||||
:useEnvironment='useEnvironment'
|
||||
@setEnvironment="setEnvironment"
|
||||
class="ms-api-button"
|
||||
ref="environmentSelect"/>
|
||||
:project-id="projectId"
|
||||
:is-read-only="false"
|
||||
:useEnvironment='useEnvironment'
|
||||
@setEnvironment="setEnvironment"
|
||||
class="ms-api-button"
|
||||
ref="environmentSelect"/>
|
||||
<!-- 主框架列表 -->
|
||||
<el-tabs v-model="apiDefaultTab" @edit="closeConfirm" @tab-click="addTab">
|
||||
<el-tab-pane
|
||||
name="trash"
|
||||
:label="$t('commons.trash')" v-if="trashEnable">
|
||||
name="trash"
|
||||
:label="$t('commons.trash')" v-if="trashEnable">
|
||||
<ms-tab-button
|
||||
v-if="this.trashTabInfo.type === 'list'"
|
||||
:active-dom.sync="trashActiveDom"
|
||||
:left-tip="$t('api_test.definition.api_title')"
|
||||
:right-tip="$t('api_test.definition.case_title')"
|
||||
:middle-button-enable="false"
|
||||
left-content="API"
|
||||
right-content="CASE"
|
||||
v-if="this.trashTabInfo.type === 'list'"
|
||||
:active-dom.sync="trashActiveDom"
|
||||
:left-tip="$t('api_test.definition.api_title')"
|
||||
:right-tip="$t('api_test.definition.case_title')"
|
||||
:middle-button-enable="false"
|
||||
left-content="API"
|
||||
right-content="CASE"
|
||||
>
|
||||
<template v-slot:version>
|
||||
<version-select v-xpack :project-id="projectId" :version-id="trashVersion"
|
||||
|
@ -49,43 +49,43 @@
|
|||
</template>
|
||||
<!-- 列表集合 -->
|
||||
<ms-api-list
|
||||
v-if="trashActiveDom==='left'"
|
||||
@runTest="runTest"
|
||||
@refreshTree="refreshTree"
|
||||
@getTrashApi="getTrashApi"
|
||||
:module-tree="nodeTree"
|
||||
:module-options="moduleOptions"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="true"
|
||||
:selectDataRange="selectDataRange"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@editApi="editApi"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
@refreshTable="refresh"
|
||||
:init-api-table-opretion="initApiTableOpretion"
|
||||
@updateInitApiTableOpretion="updateInitApiTableOpretion"
|
||||
ref="trashApiList"/>
|
||||
v-if="trashActiveDom==='left'"
|
||||
@runTest="runTest"
|
||||
@refreshTree="refreshTree"
|
||||
@getTrashApi="getTrashApi"
|
||||
:module-tree="nodeTree"
|
||||
:module-options="moduleOptions"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="true"
|
||||
:selectDataRange="selectDataRange"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@editApi="editApi"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
@refreshTable="refresh"
|
||||
:init-api-table-opretion="initApiTableOpretion"
|
||||
@updateInitApiTableOpretion="updateInitApiTableOpretion"
|
||||
ref="trashApiList"/>
|
||||
<!--测试用例列表-->
|
||||
<api-case-simple-list
|
||||
v-if="trashActiveDom==='right'"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="true"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@refreshTable="refresh"
|
||||
@showExecResult="showExecResult"
|
||||
ref="trashCaseList"/>
|
||||
v-if="trashActiveDom==='right'"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="true"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@refreshTable="refresh"
|
||||
@showExecResult="showExecResult"
|
||||
ref="trashCaseList"/>
|
||||
</ms-tab-button>
|
||||
</el-tab-pane>
|
||||
|
||||
|
@ -95,117 +95,117 @@
|
|||
:closable="item.closable"
|
||||
:name="item.name">
|
||||
<ms-tab-button
|
||||
v-if="item.type === 'list'"
|
||||
:active-dom.sync="activeDom"
|
||||
:left-tip="$t('api_test.definition.api_title')"
|
||||
:right-tip="$t('api_test.definition.doc_title')"
|
||||
:middle-tip="$t('api_test.definition.case_title')"
|
||||
left-content="API"
|
||||
middle-content="CASE"
|
||||
:right-content="$t('api_test.definition.doc_title')"
|
||||
:right-button-enable="currentProtocol === 'HTTP' "
|
||||
v-if="item.type === 'list'"
|
||||
:active-dom.sync="activeDom"
|
||||
:left-tip="$t('api_test.definition.api_title')"
|
||||
:right-tip="$t('api_test.definition.doc_title')"
|
||||
:middle-tip="$t('api_test.definition.case_title')"
|
||||
left-content="API"
|
||||
middle-content="CASE"
|
||||
:right-content="$t('api_test.definition.doc_title')"
|
||||
:right-button-enable="currentProtocol === 'HTTP' "
|
||||
>
|
||||
<template v-slot:version>
|
||||
<version-select v-xpack :project-id="projectId" @changeVersion="changeVersion"/>
|
||||
</template>
|
||||
<!-- 列表集合 -->
|
||||
<ms-api-list
|
||||
v-if="activeDom==='left'"
|
||||
@getTrashApi="getTrashApi"
|
||||
:module-tree="nodeTree"
|
||||
:module-options="moduleOptions"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="false"
|
||||
:selectDataRange="selectDataRange"
|
||||
:is-read-only="isReadOnly"
|
||||
@runTest="runTest"
|
||||
@handleTestCase="handleTestCase"
|
||||
@refreshTree="refreshTree"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@editApi="editApi"
|
||||
@copyApi="copyApi"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
@refreshTable="refresh"
|
||||
:init-api-table-opretion="initApiTableOpretion"
|
||||
@updateInitApiTableOpretion="updateInitApiTableOpretion"
|
||||
ref="apiDefList"/>
|
||||
v-if="activeDom==='left'"
|
||||
@getTrashApi="getTrashApi"
|
||||
:module-tree="nodeTree"
|
||||
:module-options="moduleOptions"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="false"
|
||||
:selectDataRange="selectDataRange"
|
||||
:is-read-only="isReadOnly"
|
||||
@runTest="runTest"
|
||||
@handleTestCase="handleTestCase"
|
||||
@refreshTree="refreshTree"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@editApi="editApi"
|
||||
@copyApi="copyApi"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
@refreshTable="refresh"
|
||||
:init-api-table-opretion="initApiTableOpretion"
|
||||
@updateInitApiTableOpretion="updateInitApiTableOpretion"
|
||||
ref="apiDefList"/>
|
||||
<!--测试用例列表-->
|
||||
<api-case-simple-list
|
||||
v-if="activeDom==='middle'"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="false"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@refreshTable="refresh"
|
||||
@showExecResult="showExecResult"
|
||||
ref="caseList"/>
|
||||
v-if="activeDom==='middle'"
|
||||
:current-protocol="currentProtocol"
|
||||
:current-version="currentVersion"
|
||||
:visible="visible"
|
||||
:currentRow="currentRow"
|
||||
:select-node-ids="selectNodeIds"
|
||||
:trash-enable="false"
|
||||
:is-read-only="isReadOnly"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@refreshTable="refresh"
|
||||
@showExecResult="showExecResult"
|
||||
ref="caseList"/>
|
||||
<api-documents-page
|
||||
class="api-doc-page"
|
||||
v-if="activeDom==='right' && currentProtocol==='HTTP'"
|
||||
:project-id="projectId"
|
||||
:trash-enable="trashEnable"
|
||||
:version-id="currentVersion"
|
||||
:module-ids="selectNodeIds"
|
||||
ref="documentsPage"/>
|
||||
class="api-doc-page"
|
||||
v-if="activeDom==='right' && currentProtocol==='HTTP'"
|
||||
:project-id="projectId"
|
||||
:trash-enable="trashEnable"
|
||||
:version-id="currentVersion"
|
||||
:module-ids="selectNodeIds"
|
||||
ref="documentsPage"/>
|
||||
</ms-tab-button>
|
||||
<!-- 添加/编辑测试窗口-->
|
||||
<div v-if="item.type=== 'ADD' ||item.type === 'TEST'" class="ms-api-div">
|
||||
<ms-edit-complete-container
|
||||
:syncTabs="syncTabs"
|
||||
@runTest="runTest"
|
||||
@saveApi="saveApi"
|
||||
@createRootModel="createRootModel"
|
||||
@editApi="editApi"
|
||||
@refresh="refresh"
|
||||
:current-api="item.api"
|
||||
:project-id="projectId"
|
||||
:currentProtocol="currentProtocol"
|
||||
:moduleOptions="moduleOptions"
|
||||
:activeDom="activeTab"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
:syncTabs="syncTabs"
|
||||
@runTest="runTest"
|
||||
@saveApi="saveApi"
|
||||
@createRootModel="createRootModel"
|
||||
@editApi="editApi"
|
||||
@refresh="refresh"
|
||||
:current-api="item.api"
|
||||
:project-id="projectId"
|
||||
:currentProtocol="currentProtocol"
|
||||
:moduleOptions="moduleOptions"
|
||||
:activeDom="activeTab"
|
||||
@changeSelectDataRangeAll="changeSelectDataRangeAll"
|
||||
@handleCase="handleCase"
|
||||
@showExecResult="showExecResult"
|
||||
|
||||
ref="apiConfig"
|
||||
ref="apiConfig"
|
||||
/>
|
||||
</div>
|
||||
<!-- 快捷调试 -->
|
||||
<div v-else-if="item.type=== 'debug'" class="ms-api-div">
|
||||
<ms-debug-http-page
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='HTTP'"/>
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='HTTP'"/>
|
||||
<ms-debug-jdbc-page
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='SQL'"/>
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='SQL'"/>
|
||||
<ms-debug-tcp-page
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
:scenario="false"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='TCP'"/>
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
:scenario="false"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='TCP'"/>
|
||||
<ms-debug-dubbo-page
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='DUBBO'"/>
|
||||
:currentProtocol="currentProtocol"
|
||||
:testCase="item.api"
|
||||
@saveAs="editApi"
|
||||
@refreshModule="refreshModule"
|
||||
v-if="currentProtocol==='DUBBO'"/>
|
||||
</div>
|
||||
|
||||
<!-- 定时任务 -->
|
||||
|
@ -378,7 +378,25 @@ export default {
|
|||
this.param = item;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
let dataType = this.$route.params.dataType;
|
||||
if (dataType) {
|
||||
if (dataType === "api") {
|
||||
this.activeDom = 'left';
|
||||
} else {
|
||||
this.activeDom = 'middle';
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -577,7 +595,7 @@ export default {
|
|||
let tab = this.apiTabs;
|
||||
tab.forEach(t => {
|
||||
if (t.type === 'ADD' && t.api && this.$store.state.apiMap.has(t.api.id) && (this.$store.state.apiMap.get(t.api.id).get("responseChange") === true || this.$store.state.apiMap.get(t.api.id).get("requestChange") === true ||
|
||||
this.$store.state.apiMap.get(t.api.id).get("fromChange") === true)) {
|
||||
this.$store.state.apiMap.get(t.api.id).get("fromChange") === true)) {
|
||||
message += t.api.name + ",";
|
||||
} else if (t.type === 'ADD' && t.title === this.$t('api_test.definition.request.title')) {
|
||||
message += this.$t('api_test.definition.request.title') + ",";
|
||||
|
@ -614,7 +632,7 @@ export default {
|
|||
if (t.api && this.$store.state.apiMap.size > 0 && this.$store.state.apiMap.has(t.api.id)) {
|
||||
id = t.api.id;
|
||||
if (this.$store.state.apiMap.get(t.api.id).get("responseChange") === true || this.$store.state.apiMap.get(t.api.id).get("requestChange") === true ||
|
||||
this.$store.state.apiMap.get(t.api.id).get("fromChange") === true) {
|
||||
this.$store.state.apiMap.get(t.api.id).get("fromChange") === true) {
|
||||
message += t.api.name + ",";
|
||||
id = t.api.id;
|
||||
}
|
||||
|
@ -726,6 +744,20 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let dataRange = this.$route.params.dataSelectRange;
|
||||
let dataType = this.$route.params.dataType;
|
||||
if (dataRange) {
|
||||
let selectParamArr = dataRange.split("edit:");
|
||||
if (selectParamArr.length === 2) {
|
||||
let scenarioId = selectParamArr[1];
|
||||
if (dataType === 'api') {
|
||||
this.$get('/api/definition/get/' + scenarioId, (response) => {
|
||||
this.editApi(response.data);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
editApi(row) {
|
||||
|
@ -745,7 +777,7 @@ export default {
|
|||
this.activeTab = "api";
|
||||
if (row != null && row.tags != 'null' && row.tags != '' && row.tags != undefined) {
|
||||
if (Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object'
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
row.tags = JSON.parse(row.tags);
|
||||
}
|
||||
}
|
||||
|
@ -763,7 +795,7 @@ export default {
|
|||
this.activeTab = "api";
|
||||
if (row != null && row.tags != 'null' && row.tags != '' && row.tags != undefined) {
|
||||
if (Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object'
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
row.tags = JSON.parse(row.tags);
|
||||
}
|
||||
}
|
||||
|
@ -834,7 +866,7 @@ export default {
|
|||
}
|
||||
if (row != null && row.tags != 'null' && row.tags != '' && row.tags != undefined) {
|
||||
if (Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object'
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
&& Object.prototype.toString.call(row.tags).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'array') {
|
||||
row.tags = JSON.parse(row.tags);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -513,7 +513,7 @@ export default {
|
|||
// 通知过来的数据跳转到编辑
|
||||
if (this.$route.query.caseId) {
|
||||
this.$get('/api/testcase/findById/' + this.$route.query.caseId, (response) => {
|
||||
if(!response.data){
|
||||
if (!response.data) {
|
||||
this.$error(this.$t('api_test.case_jump_message'));
|
||||
return;
|
||||
}
|
||||
|
@ -1136,6 +1136,12 @@ export default {
|
|||
if (dataType === 'apiTestCase') {
|
||||
this.selectDataRange = routeParam;
|
||||
}
|
||||
} else {
|
||||
let routeParam = this.$route.params.dataSelectRange;
|
||||
let dataType = this.$route.params.dataType;
|
||||
if (dataType === 'apiTestCase') {
|
||||
this.selectDataRange = routeParam;
|
||||
}
|
||||
}
|
||||
},
|
||||
changeSelectDataRangeAll() {
|
||||
|
|
|
@ -914,6 +914,20 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let dataRange = this.$route.params.dataSelectRange;
|
||||
let dataType = this.$route.params.dataType;
|
||||
this.selectDataRange = dataType === 'api' ? dataRange : "all";
|
||||
if (this.selectDataRange &&
|
||||
Object.prototype.toString.call(this.selectDataRange).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object'
|
||||
&& this.selectDataRange.indexOf(":") !== -1) {
|
||||
let selectParamArr = this.selectDataRange.split(":");
|
||||
if (selectParamArr.length === 2) {
|
||||
if (selectParamArr[0] === "apiList") {
|
||||
this.condition.name = selectParamArr[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeSelectDataRangeAll() {
|
||||
|
|
|
@ -283,7 +283,6 @@ export default {
|
|||
});
|
||||
},
|
||||
redirectPage(page, dataType, selectType, title) {
|
||||
//api页面跳转
|
||||
//传入UUID是为了进行页面重新加载判断
|
||||
let uuid = getUUID();
|
||||
let redirectObj = {
|
||||
|
@ -296,12 +295,24 @@ export default {
|
|||
params: {paramObj: redirectObj}
|
||||
});
|
||||
break;
|
||||
case "apiWithQuery":
|
||||
this.$router.push({
|
||||
name: 'ApiDefinitionWithQuery',
|
||||
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType}
|
||||
});
|
||||
break;
|
||||
case "scenario":
|
||||
this.$router.push({
|
||||
name: 'ApiAutomation',
|
||||
params: {paramObj: redirectObj}
|
||||
});
|
||||
break;
|
||||
case "scenarioWithQuery":
|
||||
this.$router.push({
|
||||
name: 'ApiAutomationWithQuery',
|
||||
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType}
|
||||
});
|
||||
break;
|
||||
case "testPlanEdit":
|
||||
this.$router.push('/track/plan/view/' + selectType)
|
||||
break;
|
||||
|
|
|
@ -94,8 +94,16 @@ export default {
|
|||
if (param.protocol === 'dubbo://') {
|
||||
param.protocol = 'DUBBO'
|
||||
}
|
||||
let paramObj = {
|
||||
redirectID: getUUID(),
|
||||
dataType: "apiTestCase",
|
||||
dataSelectRange: 'single:' + param.id,
|
||||
projectId: getCurrentProjectID(),
|
||||
type: api.protocol,
|
||||
workspaceId: getCurrentWorkspaceId(),
|
||||
};
|
||||
definitionData = this.$router.resolve({
|
||||
name: 'ApiDefinition',
|
||||
name: 'ApiDefinitionWithQuery',
|
||||
params: {
|
||||
redirectID: getUUID(),
|
||||
dataType: "apiTestCase",
|
||||
|
@ -112,7 +120,7 @@ export default {
|
|||
});
|
||||
break;
|
||||
case "scenario":
|
||||
this.$emit('redirectPage', 'scenario', 'scenario', 'edit:' + param.id);
|
||||
this.$emit('redirectPage', 'scenarioWithQuery', 'scenario', 'edit:' + param.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ export default {
|
|||
switch (pageType) {
|
||||
case "api":
|
||||
resolve = this.$router.resolve({
|
||||
name: 'ApiDefinition',
|
||||
name: 'ApiDefinitionWithQuery',
|
||||
params: {
|
||||
redirectID: getUUID(),
|
||||
dataType: "api",
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
:data="tableData"
|
||||
@refresh="search"
|
||||
screen-height="300px">
|
||||
<el-table-column prop="index" :label="$t('api_test.home_page.running_task_list.table_coloum.index')" width="80" show-overflow-tooltip/>
|
||||
<el-table-column prop="name" :label="$t('commons.name')" width="200" >
|
||||
<el-table-column prop="index" :label="$t('api_test.home_page.running_task_list.table_coloum.index')" width="80"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="name" :label="$t('commons.name')" width="200">
|
||||
<template v-slot:default="{row}">
|
||||
<!-- 若为只读用户不可点击之后跳转-->
|
||||
<span v-if="isReadOnly">
|
||||
|
@ -24,12 +25,16 @@
|
|||
:filters="typeFilters"
|
||||
:label="$t('api_test.home_page.running_task_list.table_coloum.task_type')" width="120">
|
||||
<template v-slot:default="scope">
|
||||
<ms-tag v-if="scope.row.taskGroup == 'API_SCENARIO_TEST'" type="success" effect="plain" :content="$t('api_test.home_page.running_task_list.scenario_schedule')"/>
|
||||
<ms-tag v-if="scope.row.taskGroup == 'TEST_PLAN_TEST'" type="warning" effect="plain" :content="$t('api_test.home_page.running_task_list.test_plan_schedule')"/>
|
||||
<ms-tag v-if="scope.row.taskGroup == 'SWAGGER_IMPORT'" type="danger" effect="plain" :content="$t('api_test.home_page.running_task_list.swagger_schedule')"/>
|
||||
<ms-tag v-if="scope.row.taskGroup == 'API_SCENARIO_TEST'" type="success" effect="plain"
|
||||
:content="$t('api_test.home_page.running_task_list.scenario_schedule')"/>
|
||||
<ms-tag v-if="scope.row.taskGroup == 'TEST_PLAN_TEST'" type="warning" effect="plain"
|
||||
:content="$t('api_test.home_page.running_task_list.test_plan_schedule')"/>
|
||||
<ms-tag v-if="scope.row.taskGroup == 'SWAGGER_IMPORT'" type="danger" effect="plain"
|
||||
:content="$t('api_test.home_page.running_task_list.swagger_schedule')"/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
<el-table-column prop="rule" :label="$t('api_test.home_page.running_task_list.table_coloum.run_rule')" width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="rule" :label="$t('api_test.home_page.running_task_list.table_coloum.run_rule')" width="120"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column width="100" :label="$t('api_test.home_page.running_task_list.table_coloum.task_status')">
|
||||
<template v-slot:default="scope">
|
||||
<div>
|
||||
|
@ -49,7 +54,8 @@
|
|||
<span>{{ scope.row.nextExecutionTime | timestampFormatDate }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creator" :label="$t('api_test.home_page.running_task_list.table_coloum.create_user')" width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="creator" :label="$t('api_test.home_page.running_task_list.table_coloum.create_user')"
|
||||
width="100" show-overflow-tooltip/>
|
||||
<el-table-column width="170" :label="$t('api_test.home_page.running_task_list.table_coloum.update_time')">
|
||||
<template v-slot:default="scope">
|
||||
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
|
||||
|
@ -65,6 +71,7 @@ import MsTag from "@/business/components/common/components/MsTag";
|
|||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
import MsTable from "@/business/components/common/components/table/MsTable";
|
||||
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
|
||||
|
||||
export default {
|
||||
name: "MsApiRunningTaskList",
|
||||
components: {
|
||||
|
@ -84,15 +91,13 @@ export default {
|
|||
loading: false,
|
||||
typeFilters: [],
|
||||
condition: {
|
||||
filters: {
|
||||
|
||||
}
|
||||
filters: {}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed:{
|
||||
isReadOnly(){
|
||||
computed: {
|
||||
isReadOnly() {
|
||||
return false;
|
||||
},
|
||||
projectId() {
|
||||
|
@ -127,7 +132,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
closeTaskConfirm(row){
|
||||
closeTaskConfirm(row) {
|
||||
let flag = row.taskStatus;
|
||||
row.taskStatus = !flag; //保持switch点击前的状态
|
||||
this.$confirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), this.$t('commons.prompt'), {
|
||||
|
@ -140,19 +145,19 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
updateTask(taskRow){
|
||||
updateTask(taskRow) {
|
||||
|
||||
this.result = this.$post('/api/schedule/updateEnableByPrimyKey/disable', taskRow, response => {
|
||||
this.search();
|
||||
});
|
||||
},
|
||||
redirect(param){
|
||||
if(param.taskGroup === 'TEST_PLAN_TEST'){
|
||||
this.$emit('redirectPage','testPlanEdit','', param.scenarioId);
|
||||
}else if (param.taskGroup === 'API_SCENARIO_TEST') {
|
||||
this.$emit('redirectPage', 'scenario', 'scenario', 'edit:' + param.scenarioId);
|
||||
redirect(param) {
|
||||
if (param.taskGroup === 'TEST_PLAN_TEST') {
|
||||
this.$emit('redirectPage', 'testPlanEdit', '', param.scenarioId);
|
||||
} else if (param.taskGroup === 'API_SCENARIO_TEST') {
|
||||
this.$emit('redirectPage', 'scenarioWithQuery', 'scenario', 'edit:' + param.scenarioId);
|
||||
} else if (param.taskGroup === 'SWAGGER_IMPORT') {
|
||||
this.$emit('redirectPage', 'api', 'api', {param});
|
||||
this.$emit('redirectPage', 'apiWithQuery', 'api', {param});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -163,14 +168,15 @@ export default {
|
|||
activated() {
|
||||
this.search();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.el-table {
|
||||
cursor:pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-card /deep/ .el-card__header {
|
||||
border-bottom: 0px solid #EBEEF5;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ export default {
|
|||
this.$emit('redirectPage', 'api', 'apiTestCase', 'single:' + param);
|
||||
break;
|
||||
case "scenario":
|
||||
this.$emit('redirectPage', 'scenario', 'scenario', 'edit:' + param);
|
||||
this.$emit('redirectPage', 'scenarioWithQuery', 'scenario', 'edit:' + param);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,16 @@ export default {
|
|||
name: "ApiDefinition",
|
||||
component: () => import('@/business/components/api/definition/ApiDefinition'),
|
||||
},
|
||||
{
|
||||
path: "definition/:redirectID?/:dataType?/:dataSelectRange?/:projectId?/:type?/:workspaceId?",
|
||||
name: "ApiDefinitionWithQuery",
|
||||
component: () => import('@/business/components/api/definition/ApiDefinition'),
|
||||
},
|
||||
{
|
||||
path: "automation/:redirectID?/:dataType?/:dataSelectRange?/:projectId?/:workspaceId?",
|
||||
name: "ApiAutomationWithQuery",
|
||||
component: () => import('@/business/components/api/automation/ApiAutomation'),
|
||||
},
|
||||
{
|
||||
path: "automation",
|
||||
name: "ApiAutomation",
|
||||
|
|
|
@ -178,6 +178,18 @@ export default {
|
|||
case "testPlanEdit":
|
||||
this.$router.push('/track/plan/view/' + selectType)
|
||||
break;
|
||||
case "scenarioWithQuery":
|
||||
this.$router.push({
|
||||
name: 'ApiAutomationWithQuery',
|
||||
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType}
|
||||
});
|
||||
break;
|
||||
case "api":
|
||||
this.$router.push({
|
||||
name: 'ApiDefinition',
|
||||
params: {paramObj: redirectObj}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue