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){
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>
</div>
<div style="padding-top: 10px">
<el-checkbox v-model="runConfig.runWithinResourcePool" style="padding-right: 10px;">
{{ $t('run_mode.run_with_resource_pool') }}
</el-checkbox>
<span style="padding-right: 10px;">{{ $t('run_mode.run_with_resource_pool') }}</span>
<el-select :disabled="!runConfig.runWithinResourcePool" v-model="runConfig.resourcePoolId" size="mini">
<el-option
v-for="item in resourcePools"
@ -84,9 +82,10 @@ import EnvPopover from "@/business/module/environment/EnvPopover";
import {strMapToObj} from "metersphere-frontend/src/utils";
import {ENV_TYPE} from "metersphere-frontend/src/utils/constants";
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 {getEnvironmentByProjectId} from "metersphere-frontend/src/api/environment";
import { getCurrentProjectID } from 'metersphere-frontend/src/utils/token';
export default {
name: "MsApiCaseRunModeWithEnv",
@ -100,7 +99,7 @@ export default {
mode: "serial",
reportType: "iddReport",
onSampleError: false,
runWithinResourcePool: false,
runWithinResourcePool: true,
resourcePoolId: null,
envMap: new Map(),
environmentGroupId: "",
@ -117,11 +116,20 @@ export default {
this.runModeVisible = true;
this.getResourcePools();
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() {
this.runConfig.onSampleError = false;
this.runConfig.runWithinResourcePool = false;
this.runConfig.resourcePoolId = null;
this.runConfig.runWithinResourcePool = true;
// this.runConfig.resourcePoolId = null;
this.runConfig.reportName = "";
},
close() {
@ -130,7 +138,7 @@ export default {
reportType: "iddReport",
onSampleError: false,
reportName: "",
runWithinResourcePool: false,
runWithinResourcePool: true,
resourcePoolId: null,
envMap: new Map(),
environmentGroupId: "",