diff --git a/src/views/tool/iperf/index.vue b/src/views/tool/iperf/index.vue index 8a0d95a8..389a3975 100644 --- a/src/views/tool/iperf/index.vue +++ b/src/views/tool/iperf/index.vue @@ -63,7 +63,11 @@ async function fnIPerf3() { }); return; } - if (state.dataType === 'options' && state.data.host === '') { + if ( + state.dataType === 'options' && + state.data.client && + state.data.host === '' + ) { message.warning({ content: 'Please fill in the Host', duration: 2, @@ -77,9 +81,12 @@ async function fnIPerf3() { }); return; } - if (state.initialized) { - fnResend(); - return; + + // 网元切换时重置 + if (neType !== state.params.neType || neId !== state.params.neId) { + state.initialized = false; + state.params.neType = neType; + state.params.neId = neId; } state.params.neType = neType; @@ -95,6 +102,12 @@ async function fnIPerf3() { } else { state.versionInfo = resVersion.data; } + + // 初始化的直接重发 + if (state.initialized) { + fnResend(); + return; + } state.initialized = true; }