From 0dcd63003d5e740af0af37df13be13de00775d02 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Wed, 4 Oct 2023 17:41:16 +0000 Subject: [PATCH] feat: copy expanded record url --- .../smartsheet/expanded-form/index.vue | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index 7f064d110c..6c1413e0bc 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -51,6 +51,10 @@ const key = ref(0) const wrapper = ref() +const { dashboardUrl } = useDashboard() + +const { copy } = useClipboard() + const { isMobileMode } = useGlobal() const { t } = useI18n() @@ -63,6 +67,8 @@ const state = toRef(props, 'state') const meta = toRef(props, 'meta') +const route = useRoute() + const router = useRouter() const isPublic = inject(IsPublicInj, ref(false)) @@ -188,6 +194,17 @@ const onNext = async () => { } } +const copyRecordUrl = () => { + copy( + encodeURI( + `${dashboardUrl?.value}#/${route.params.typeOrId}/${route.params.baseId}/${meta.value?.id}${ + props.view ? `/${props.view.title}` : '' + }?rowId=${primaryKey.value}`, + ), + ) + message.success('Copied to clipboard') +} + const saveChanges = async () => { isUnsavedFormExist.value = false await save() @@ -418,6 +435,12 @@ export default { {{ $t('general.reload') }} + +
+ + Copy record URL +
+