|
|
@ -1,28 +1,31 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import type { GridType } from 'nocodb-sdk' |
|
|
|
import type { GridType } from 'nocodb-sdk' |
|
|
|
import { ActiveViewInj, IsLockedInj, ReloadViewDataHookInj, inject, ref, useMenuCloseOnEsc } from '#imports' |
|
|
|
import { ActiveViewInj, IsLockedInj, inject, ref, useMenuCloseOnEsc } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { isSharedBase } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
const isPublic = inject(IsPublicInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const reloadDataHook = inject(ReloadViewDataHookInj) |
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const { $api } = useNuxtApp() |
|
|
|
const { $api } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
const open = ref(false) |
|
|
|
const open = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const updateRowHeight = (rh: number) => { |
|
|
|
const updateRowHeight = async (rh: number) => { |
|
|
|
if (view.value?.id) { |
|
|
|
if (view.value?.id) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
$api.dbView.gridUpdate(view.value.id, { |
|
|
|
if (!isPublic.value && !isSharedBase.value) { |
|
|
|
row_height: rh, |
|
|
|
await $api.dbView.gridUpdate(view.value.id, { |
|
|
|
}) |
|
|
|
row_height: rh, |
|
|
|
;(view.value.view as GridType).row_height = rh |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
message.success('View updated successfully!') |
|
|
|
message.success('View updated successfully!') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
reloadDataHook?.trigger() |
|
|
|
;(view.value.view as GridType).row_height = rh |
|
|
|
|
|
|
|
|
|
|
|
open.value = false |
|
|
|
open.value = false |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|