From c1ddc0f8e0f08364ea9a28fa85d3c7dc61454251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E6=80=80=E7=A3=8A=E2=80=9D?= <2280131253@qq.com> Date: Wed, 19 Jan 2022 12:52:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=BA=94=E7=94=A8=E4=BF=9D=E5=AD=98=E6=97=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tickets/RequestApplicationPerm/CreateUpdate.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue index 231a39f41..bf67764a9 100644 --- a/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue +++ b/src/views/tickets/RequestApplicationPerm/CreateUpdate.vue @@ -232,10 +232,14 @@ export default { }, methods: { performSubmit(validValues) { - const applyCategoryType = validValues.meta.apply_category_type - validValues.meta.apply_category = applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[0] : '' - validValues.meta.apply_type = applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[1] : '' - delete validValues.meta['apply_category_type'] + const validMeta = validValues.meta + const applyCategoryType = validMeta.apply_category_type + const filter = (len, field) => { + return applyCategoryType && applyCategoryType.length > 0 ? applyCategoryType[len] : validMeta[field] + } + validMeta.apply_category = filter(0, 'apply_category') + validMeta.apply_type = filter(1, 'apply_type') + delete validMeta['apply_category_type'] return this.$axios['post'](`/api/v1/tickets/tickets/open/?type=apply_application`, validValues) } }