From cdf91334a84a926ecca0e11e43b1e4e698c94b2a Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 2 Jul 2024 15:51:17 +0800 Subject: [PATCH] =?UTF-8?q?style(sj=5Fmap=5Freduce):=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E5=BC=80=E5=A7=8B=E8=8A=82=E7=82=B9=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/code-mirror.vue | 5 ++- src/components/common/dynamic-input.vue | 17 +++++++- src/components/common/log-drawer.vue | 20 ++------- .../workflow/modules/detail/start-detail.vue | 12 +----- .../workflow/modules/drawer/branch-drawer.vue | 24 +---------- .../workflow/modules/drawer/start-drawer.vue | 17 +++++--- src/typings/workflow.d.ts | 1 + src/utils/common.ts | 41 +++++++++++++++++++ 8 files changed, 80 insertions(+), 57 deletions(-) diff --git a/src/components/common/code-mirror.vue b/src/components/common/code-mirror.vue index a20946d..1aa6d9d 100644 --- a/src/components/common/code-mirror.vue +++ b/src/components/common/code-mirror.vue @@ -11,7 +11,7 @@ defineOptions({ }); interface Props { - modelValue: string; + modelValue?: string; lang?: NaiveUI.CodeMirrorLang; height?: string; fontSize?: string; @@ -25,7 +25,8 @@ const props = withDefaults(defineProps(), { readonly: false, disabled: false, height: 'auto', - fontSize: '13px' + fontSize: '13px', + modelValue: '' }); interface Emits { diff --git a/src/components/common/dynamic-input.vue b/src/components/common/dynamic-input.vue index 6ad3cde..06560ef 100644 --- a/src/components/common/dynamic-input.vue +++ b/src/components/common/dynamic-input.vue @@ -51,6 +51,20 @@ const boolenOptions = [ value: 1 } ]; + +const handleUpdateType = (index: number) => { + if (content.value[index].type === 'string') { + content.value[index].value = ''; + } + + if (content.value[index].type === 'boolean') { + content.value[index].value = 1; + } + + if (content.value[index].type === 'number') { + content.value[index].value = 0; + } +};