feat: 资源池-编辑
This commit is contained in:
parent
aaf949113e
commit
08edab0974
|
@ -18,14 +18,14 @@
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
value: string;
|
value: string | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits(['update:value', 'update:visible']);
|
const emit = defineEmits(['update:value', 'update:visible']);
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const showJobDrawer = ref(props.visible);
|
const showJobDrawer = ref(props.visible);
|
||||||
const jobDefinition = ref(props.value);
|
const jobDefinition = ref(props.value || '');
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.visible,
|
() => props.visible,
|
||||||
|
|
|
@ -173,7 +173,7 @@
|
||||||
v-show="form.addType === 'single'"
|
v-show="form.addType === 'single'"
|
||||||
ref="batchFormRef"
|
ref="batchFormRef"
|
||||||
:models="batchFormModels"
|
:models="batchFormModels"
|
||||||
:form-mode="isEdit ? 'edit' : 'create'"
|
form-mode="create"
|
||||||
add-text="system.resourcePool.addResource"
|
add-text="system.resourcePool.addResource"
|
||||||
:default-vals="defaultVals"
|
:default-vals="defaultVals"
|
||||||
max-height="250px"
|
max-height="250px"
|
||||||
|
@ -402,11 +402,19 @@
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await getPoolInfo(route.query.id);
|
const res = await getPoolInfo(route.query.id);
|
||||||
|
const { testResourceDTO } = res;
|
||||||
|
const { girdConcurrentNumber, podThreads, concurrentNumber } = testResourceDTO;
|
||||||
form.value = {
|
form.value = {
|
||||||
...res,
|
...res,
|
||||||
addType: 'single',
|
addType: 'single',
|
||||||
orgType: res.allOrg ? 'allOrg' : 'set',
|
orgType: res.allOrg ? 'allOrg' : 'set',
|
||||||
use: [res.loadTest ? 'performance' : '', res.apiTest ? 'API' : '', res.uiTest ? 'UI' : ''].filter((e) => e),
|
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) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -464,10 +472,10 @@
|
||||||
// 是否显示K8S资源配置信息
|
// 是否显示K8S资源配置信息
|
||||||
const isShowK8SResources = computed(() => form.value.type === 'Kubernetes' && isShowTypeItem.value);
|
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
|
// 是否填写了命名空间及Deploy Name
|
||||||
const isFillNameSpacesAndDeployName = computed(
|
const isFillNameSpacesAndDeployName = computed(
|
||||||
() => isFillNameSpaces.value && form.value.testResourceDTO.deployName.trim() !== ''
|
() => isFillNameSpaces.value && form.value.testResourceDTO.deployName?.trim() !== ''
|
||||||
);
|
);
|
||||||
|
|
||||||
const batchFormRef = ref<MsBatchFormInstance | null>(null);
|
const batchFormRef = ref<MsBatchFormInstance | null>(null);
|
||||||
|
@ -564,11 +572,11 @@
|
||||||
monitor: line[2],
|
monitor: line[2],
|
||||||
concurrentNumber: Number(line[3]),
|
concurrentNumber: Number(line[3]),
|
||||||
};
|
};
|
||||||
if (form.value.testResourceDTO.nodesList.length === 0) {
|
if (i === 0) {
|
||||||
// 第四个是concurrentNumber,需要是数字
|
// 第四个是concurrentNumber,需要是数字
|
||||||
form.value.testResourceDTO.nodesList.push(item);
|
|
||||||
} else {
|
|
||||||
form.value.testResourceDTO.nodesList = [item];
|
form.value.testResourceDTO.nodesList = [item];
|
||||||
|
} else {
|
||||||
|
form.value.testResourceDTO.nodesList.push(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue