fix(接口测试): 接口测试首页过去7天有更新的接口统计中进行用例跳转时自动切换到对应的请求

--bug=1031580 --user=宋天阳
【接口测试】首页-过去7天有更新的接口-sql接口-点击关联CASE-进入到http-case页面
https://www.tapd.cn/55049933/s/1426921
This commit is contained in:
song-tianyang 2023-10-17 11:30:26 +08:00 committed by 建国
parent ec9b01c773
commit f3d67b0a46
2 changed files with 18 additions and 13 deletions

View File

@ -34,7 +34,8 @@
</el-row>
<el-row style="margin-top: 16px">
<el-col style="background-color: #ffffff">
<updated-api-list @redirectPage="redirectPage" ref="updatedApiList" />
<updated-api-list ref="updatedApiList" @redirectPage="redirectPage"
@redirectPageWithDataType="redirectPageWithDataType"/>
</el-col>
</el-row>
<el-row style="margin-top: 16px">
@ -49,7 +50,7 @@
</template>
<script>
import { getUUID } from 'metersphere-frontend/src/utils';
import {getUUID} from 'metersphere-frontend/src/utils';
import MsContainer from 'metersphere-frontend/src/components/MsContainer';
import MsMainContainer from 'metersphere-frontend/src/components/MsMainContainer';
import ApiDashboard from '@/business/home/components/dashboard/ApiDashboard';
@ -58,9 +59,9 @@ import ScenarioDashboard from '@/business/home/components/dashboard/ScenarioDash
import ScenarioScheduleDashboard from '@/business/home/components/dashboard/ScenarioScheduleDashboard';
import UpdatedApiList from '@/business/home/components/table/UpdatedApiList';
import ScheduleTaskList from '@/business/home/components/table/ScheduleTaskList';
import { getProjectVersions } from '@/api/xpack';
import { getCurrentProjectID } from 'metersphere-frontend/src/utils/token';
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
import {getProjectVersions} from '@/api/xpack';
import {getCurrentProjectID} from 'metersphere-frontend/src/utils/token';
import {hasLicense} from 'metersphere-frontend/src/utils/permission';
export default {
name: 'ApiHome',

View File

@ -64,7 +64,7 @@
type="info"
:underline="false"
v-permission-disable="['PROJECT_API_DEFINITION:READ']"
@click="redirectPage('api', 'apiTestCase', 'singleList:' + row.id)">
@click="redirectPage('api', 'apiTestCase', 'singleList:' + row.id, row.protocol)">
<span style="float: right">
{{ row.caseTotal }}
</span>
@ -118,13 +118,13 @@
</template>
<script>
import { definitionWeekList } from '@/api/definition';
import { getCurrentProjectID } from 'metersphere-frontend/src/utils/token';
import { API_STATUS } from '@/business/definition/model/JsonData';
import {definitionWeekList} from '@/api/definition';
import {getCurrentProjectID} from 'metersphere-frontend/src/utils/token';
import {API_STATUS} from '@/business/definition/model/JsonData';
import ApiStatus from '@/business/definition/components/list/ApiStatus';
import HomeTablePagination from '@/business/home/components/table/HomeTablePagination';
import BasicStatusLabel from 'metersphere-frontend/src/components/BasicStatusLabel';
import { hasPermission } from 'metersphere-frontend/src/utils/permission';
import {hasPermission} from 'metersphere-frontend/src/utils/permission';
export default {
name: 'UpdatedApiList',
@ -152,7 +152,7 @@ export default {
if (!hasPermission('PROJECT_API_DEFINITION:READ')) {
return;
}
this.redirectPage('api', 'api', 'edit:' + row.id);
this.redirectPageWithDataType('api', 'api', 'edit:' + row.id);
}
},
search(versionId) {
@ -175,8 +175,12 @@ export default {
this.loadError = true;
});
},
redirectPage(redirectPage, dataType, selectRange) {
this.$emit('redirectPage', redirectPage, dataType, selectRange, null);
redirectPage(redirectPage, dataType, selectRange, type) {
if (!type || type === undefined) {
this.$emit('redirectPage', redirectPage, dataType, selectRange, null, type);
} else {
this.$emit('redirectPageWithDataType', redirectPage, dataType, selectRange, null, type);
}
},
},
};