diff --git a/frontend/src/views/system/resourcePool/components/jobTemplateDrawer.vue b/frontend/src/views/system/resourcePool/components/jobTemplateDrawer.vue index e61d2615a3..398ce4612d 100644 --- a/frontend/src/views/system/resourcePool/components/jobTemplateDrawer.vue +++ b/frontend/src/views/system/resourcePool/components/jobTemplateDrawer.vue @@ -18,14 +18,14 @@ const props = defineProps<{ visible: boolean; - value: string; + value: string | null; }>(); const emit = defineEmits(['update:value', 'update:visible']); const { t } = useI18n(); const showJobDrawer = ref(props.visible); - const jobDefinition = ref(props.value); + const jobDefinition = ref(props.value || ''); watch( () => props.visible, diff --git a/frontend/src/views/system/resourcePool/detail.vue b/frontend/src/views/system/resourcePool/detail.vue index 8a70053200..449a111649 100644 --- a/frontend/src/views/system/resourcePool/detail.vue +++ b/frontend/src/views/system/resourcePool/detail.vue @@ -173,7 +173,7 @@ v-show="form.addType === 'single'" ref="batchFormRef" :models="batchFormModels" - :form-mode="isEdit ? 'edit' : 'create'" + form-mode="create" add-text="system.resourcePool.addResource" :default-vals="defaultVals" max-height="250px" @@ -402,11 +402,19 @@ try { loading.value = true; const res = await getPoolInfo(route.query.id); + const { testResourceDTO } = res; + const { girdConcurrentNumber, podThreads, concurrentNumber } = testResourceDTO; form.value = { ...res, addType: 'single', orgType: res.allOrg ? 'allOrg' : 'set', use: [res.loadTest ? 'performance' : '', res.apiTest ? 'API' : '', res.uiTest ? 'UI' : ''].filter((e) => e), + testResourceDTO: { + ...testResourceDTO, + girdConcurrentNumber: girdConcurrentNumber || 1, + podThreads: podThreads || 1, + concurrentNumber: concurrentNumber || 1, + }, }; } catch (error) { console.log(error); @@ -464,10 +472,10 @@ // 是否显示K8S资源配置信息 const isShowK8SResources = computed(() => form.value.type === 'Kubernetes' && isShowTypeItem.value); // 是否填写了命名空间 - const isFillNameSpaces = computed(() => form.value.testResourceDTO.nameSpaces.trim() !== ''); + const isFillNameSpaces = computed(() => form.value.testResourceDTO.nameSpaces?.trim() !== ''); // 是否填写了命名空间及Deploy Name const isFillNameSpacesAndDeployName = computed( - () => isFillNameSpaces.value && form.value.testResourceDTO.deployName.trim() !== '' + () => isFillNameSpaces.value && form.value.testResourceDTO.deployName?.trim() !== '' ); const batchFormRef = ref(null); @@ -564,11 +572,11 @@ monitor: line[2], concurrentNumber: Number(line[3]), }; - if (form.value.testResourceDTO.nodesList.length === 0) { + if (i === 0) { // 第四个是concurrentNumber,需要是数字 - form.value.testResourceDTO.nodesList.push(item); - } else { form.value.testResourceDTO.nodesList = [item]; + } else { + form.value.testResourceDTO.nodesList.push(item); } } }