From 33f5fce87de5e0bede703e1723f5c80cc21917d6 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 1 Aug 2022 12:01:49 +0800 Subject: [PATCH] feat(gui-v2): Formula Cell --- .../components/virtual-cell/Formula.vue | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/packages/nc-gui-v2/components/virtual-cell/Formula.vue b/packages/nc-gui-v2/components/virtual-cell/Formula.vue index a32011b359..1e93f6ba00 100644 --- a/packages/nc-gui-v2/components/virtual-cell/Formula.vue +++ b/packages/nc-gui-v2/components/virtual-cell/Formula.vue @@ -5,6 +5,7 @@ import { handleTZ } from '~/utils/dateTimeUtils' import { replaceUrlsWithLink } from '~/utils/urlUtils' const column = inject(ColumnInj) + const value = inject('value') const { isPg } = useProject() @@ -18,32 +19,23 @@ const showEditFormulaWarningMessage = () => { }, 3000) } -const result = computed(() => { - if (isPg) { - return handleTZ(value) - } - return value -}) +const result = computed(() => (isPg ? handleTZ(value) : value)) -const urls = computed(() => { - return replaceUrlsWithLink(result.value) -}) +const urls = computed(() => replaceUrlsWithLink(result.value))