diff --git a/src/views/traceManage/pcap/index.vue b/src/views/traceManage/pcap/index.vue index 5bf5dc2c..4c0c1395 100644 --- a/src/views/traceManage/pcap/index.vue +++ b/src/views/traceManage/pcap/index.vue @@ -62,8 +62,12 @@ function fnNeChange(_: any, item: any) { const modalStateFrom = Form.useForm( modalState.from, reactive({ - cmd: [{ required: true, message: t('views.traceManage.pcap.capArgPlease') }], - timeout: [{ required: true, message: t('views.traceManage.pcap.capTimePlease') }], + cmd: [ + { required: true, message: t('views.traceManage.pcap.capArgPlease') }, + ], + timeout: [ + { required: true, message: t('views.traceManage.pcap.capTimePlease') }, + ], upfStart: [ { required: true, message: t('views.traceManage.pcap.capArgUPFPlease') }, ], @@ -188,12 +192,8 @@ function fnDownPCAP() { /**UPF抓包执行 */ function fnUPF(runType: 'start' | 'stop') { - let validateArr = ['upfStop']; - if (runType === 'start') { - validateArr = ['upfStart']; - } modalStateFrom - .validate(validateArr) + .validate([runType === 'start' ? 'upfStart' : 'upfStop']) .then(() => { modalState.confirmLoading = true; const from = toRaw(modalState.from); @@ -201,8 +201,8 @@ function fnUPF(runType: 'start' | 'stop') { tcpdumpNeUPFTask({ neType: modalState.neType[0], neId: modalState.neType[1], - runType: runType, - cmd: from.upfStart, + runType: runType === 'start' ? 'start_str' : 'stop_str', + cmd: runType === 'start' ? from.upfStart : from.upfStop, }) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { @@ -288,7 +288,10 @@ onMounted(() => { :label-col="{ span: 5 }" labelWrap > - + { {{ runTime != 0 - ? t('views.traceManage.pcap.runTimeText', { s: runTime }) + ? t('views.traceManage.pcap.runTimeText', { + s: runTime, + }) : t('views.traceManage.pcap.runText') }}