From bc8dee2c604a4264da8f9bfcad4fc46e20913f44 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 19 May 2022 13:21:50 +0800 Subject: [PATCH] feat: add information message when editing formula cell --- .../components/virtualCell/FormulaCell.vue | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/FormulaCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/FormulaCell.vue index 25f9db470d..4a217ffd4d 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/FormulaCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/FormulaCell.vue @@ -1,17 +1,29 @@ @@ -21,6 +33,9 @@ import dayjs from 'dayjs' export default { name: 'FormulaCell', props: { column: Object, row: Object, client: String }, + data: () => ({ + showEditFormulaWarning: false + }), computed: { result() { if (this.client === 'pg') { @@ -53,11 +68,25 @@ export default { return val.replace(/((?:-?(?:[1-9][0-9]*)?[0-9]{4})-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T(?:2[0-3]|[01][0-9]):(?:[0-5][0-9]):(?:[0-5][0-9])(?:\.[0-9]+)?(?:Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9]))/g, (i, v) => { return dayjs(v).format('YYYY-MM-DD HH:mm') }) + }, + showEditFormulaWarningMessage() { + this.showEditFormulaWarning = true + setTimeout(() => { + this.showEditFormulaWarning = false + }, 3000) } } } -