From c5e7e477be4c8fd623e2beba89071391322f27cb Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 10 Oct 2024 17:21:14 +0700 Subject: [PATCH] refactor: add DialogDuplicateDate --- src/components/DialogDuplicateData.vue | 136 +++++++++++++++++++++++++ src/stores/utils/index.ts | 15 +++ 2 files changed, 151 insertions(+) create mode 100644 src/components/DialogDuplicateData.vue diff --git a/src/components/DialogDuplicateData.vue b/src/components/DialogDuplicateData.vue new file mode 100644 index 00000000..58931e12 --- /dev/null +++ b/src/components/DialogDuplicateData.vue @@ -0,0 +1,136 @@ + + + + diff --git a/src/stores/utils/index.ts b/src/stores/utils/index.ts index 9a448e6c..1ef871b4 100644 --- a/src/stores/utils/index.ts +++ b/src/stores/utils/index.ts @@ -1,5 +1,6 @@ import { Dialog, QSelect, Notify, QNotifyCreateOptions } from 'quasar'; import GlobalDialog from 'components/GlobalDialog.vue'; +import DialogDuplicateData from 'components/DialogDuplicateData.vue'; import { ComposerTranslation, useI18n } from 'vue-i18n'; import { defineStore } from 'pinia'; import { Ref, ref } from 'vue'; @@ -26,6 +27,20 @@ export function dialog(opts: { }); } +export function dialogCheckData(opts: { + checkData: (...args: unknown[]) => { + oldData: { filName: string; value: string }[]; + newData: { filName: string; value: string }[]; + }; + action?: (...args: unknown[]) => unknown; + cancel?: (...args: unknown[]) => unknown; +}) { + Dialog.create({ + component: DialogDuplicateData, + componentProps: opts, + }); +} + export function dialogWarningClose( t: ComposerTranslation, opts: {