fix(工作台): 我的待办接口Case批量执行资源池显示问题

--bug=1026966 --user=宋昌昌 【工作台】我的待办-接口用例-待完成/待更新-批量执行-资源池显示问题 https://www.tapd.cn/55049933/s/1384058
This commit is contained in:
song-cc-rock 2023-06-20 16:52:31 +08:00 committed by f2c-ci-robot[bot]
parent 8ff6084a0a
commit 59532eba97
2 changed files with 21 additions and 8 deletions

View File

@ -33,3 +33,8 @@ export function getCurrentProject(callback) {
export function getProjectApplication(projectId){ export function getProjectApplication(projectId){
return get('/project_application/get/config/' + projectId + '/OPEN_UPDATE_RULE') return get('/project_application/get/config/' + projectId + '/OPEN_UPDATE_RULE')
} }
export function getProjectConfig(projectId) {
let url = '/project_application/get/config/' + projectId;
return get(url);
}

View File

@ -41,9 +41,7 @@
</el-radio-group> </el-radio-group>
</div> </div>
<div style="padding-top: 10px"> <div style="padding-top: 10px">
<el-checkbox v-model="runConfig.runWithinResourcePool" style="padding-right: 10px;"> <span style="padding-right: 10px;">{{ $t('run_mode.run_with_resource_pool') }}</span>
{{ $t('run_mode.run_with_resource_pool') }}
</el-checkbox>
<el-select :disabled="!runConfig.runWithinResourcePool" v-model="runConfig.resourcePoolId" size="mini"> <el-select :disabled="!runConfig.runWithinResourcePool" v-model="runConfig.resourcePoolId" size="mini">
<el-option <el-option
v-for="item in resourcePools" v-for="item in resourcePools"
@ -84,9 +82,10 @@ import EnvPopover from "@/business/module/environment/EnvPopover";
import {strMapToObj} from "metersphere-frontend/src/utils"; import {strMapToObj} from "metersphere-frontend/src/utils";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants"; import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
import {parseEnvironment} from "metersphere-frontend/src/model/EnvironmentModel"; import {parseEnvironment} from "metersphere-frontend/src/model/EnvironmentModel";
import {getOwnerProjects} from "@/api/project"; import { getOwnerProjects, getProjectConfig} from "@/api/project";
import {getTestResourcePools} from "@/api/test-resource-pool"; import {getTestResourcePools} from "@/api/test-resource-pool";
import {getEnvironmentByProjectId} from "metersphere-frontend/src/api/environment"; import {getEnvironmentByProjectId} from "metersphere-frontend/src/api/environment";
import { getCurrentProjectID } from 'metersphere-frontend/src/utils/token';
export default { export default {
name: "MsApiCaseRunModeWithEnv", name: "MsApiCaseRunModeWithEnv",
@ -100,7 +99,7 @@ export default {
mode: "serial", mode: "serial",
reportType: "iddReport", reportType: "iddReport",
onSampleError: false, onSampleError: false,
runWithinResourcePool: false, runWithinResourcePool: true,
resourcePoolId: null, resourcePoolId: null,
envMap: new Map(), envMap: new Map(),
environmentGroupId: "", environmentGroupId: "",
@ -117,11 +116,20 @@ export default {
this.runModeVisible = true; this.runModeVisible = true;
this.getResourcePools(); this.getResourcePools();
this.getWsProjects(); this.getWsProjects();
this.getDefaultResourcePool();
},
getDefaultResourcePool() {
getProjectConfig(getCurrentProjectID())
.then((res) => {
if (res.data && res.data.poolEnable && res.data.resourcePoolId) {
this.runConfig.resourcePoolId = res.data.resourcePoolId;
}
});
}, },
changeMode() { changeMode() {
this.runConfig.onSampleError = false; this.runConfig.onSampleError = false;
this.runConfig.runWithinResourcePool = false; this.runConfig.runWithinResourcePool = true;
this.runConfig.resourcePoolId = null; // this.runConfig.resourcePoolId = null;
this.runConfig.reportName = ""; this.runConfig.reportName = "";
}, },
close() { close() {
@ -130,7 +138,7 @@ export default {
reportType: "iddReport", reportType: "iddReport",
onSampleError: false, onSampleError: false,
reportName: "", reportName: "",
runWithinResourcePool: false, runWithinResourcePool: true,
resourcePoolId: null, resourcePoolId: null,
envMap: new Map(), envMap: new Map(),
environmentGroupId: "", environmentGroupId: "",