From 32817390c20e4e69a34f164c12ae4e2d3832e741 Mon Sep 17 00:00:00 2001 From: Bai Date: Wed, 18 Aug 2021 19:31:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=9B=E5=BB=BA=E6=97=B6=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SyncInstanceTaskCreateUpdate.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue index 9c707d2ae..1f88e80a0 100644 --- a/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue +++ b/src/views/xpack/Cloud/SyncInstanceTask/SyncInstanceTaskCreateUpdate.vue @@ -134,6 +134,23 @@ export default { value.ip_network_segment_group = value.ip_network_segment_group ? value.ip_network_segment_group.split(',') : [] } return value + }, + onPerformError(error, method, vm) { + this.$emit('submitError', error) + const response = error.response + const data = response.data + if (response.status === 400) { + for (const key of Object.keys(data)) { + let value = data[key] + if (key === 'protocols') { + value = Object.values(data[key]) + } + if (value instanceof Array) { + value = value.join(';') + } + this.$refs.form.setFieldError(key, value) + } + } } } },