fix(测试跟踪): 系统配置的默认资源池不可用时,执行测试计划弹窗中资源池的下拉框设置为空

--bug=1026439 --user=宋天阳 【测试跟踪】测试计划之前保存的资源池被禁用后会显示成ID
https://www.tapd.cn/55049933/s/1374332
This commit is contained in:
song-tianyang 2023-05-23 13:51:51 +08:00 committed by 建国
parent b9844c40c1
commit 037d23b8e9
1 changed files with 10 additions and 2 deletions

View File

@ -304,6 +304,7 @@ export default {
getProjectApplication() { getProjectApplication() {
getProjectConfig(getCurrentProjectID(), "").then((res) => { getProjectConfig(getCurrentProjectID(), "").then((res) => {
let hasPool = false; let hasPool = false;
//
this.resourcePools.forEach((item) => { this.resourcePools.forEach((item) => {
if (item.id === this.runConfig.resourcePoolId) { if (item.id === this.runConfig.resourcePoolId) {
hasPool = true; hasPool = true;
@ -311,9 +312,16 @@ export default {
}); });
if (!hasPool) { if (!hasPool) {
if (res.data && res.data.poolEnable && res.data.resourcePoolId) { if (res.data && res.data.poolEnable && res.data.resourcePoolId) {
this.runConfig.resourcePoolId = res.data.resourcePoolId; //
this.resourcePools.forEach((item) => {
if (item.id === res.data.resourcePoolId) {
hasPool = true; hasPool = true;
} }
});
if (hasPool) {
this.runConfig.resourcePoolId = res.data.resourcePoolId;
}
}
} }
if (!hasPool) { if (!hasPool) {
this.runConfig.resourcePoolId = null; this.runConfig.resourcePoolId = null;