|
|
@ -1,5 +1,7 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import HTTPSnippet from 'httpsnippet' |
|
|
|
import HTTPSnippet from 'httpsnippet' |
|
|
|
|
|
|
|
import { LoadingOutlined } from '@ant-design/icons-vue' |
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveViewInj, |
|
|
|
ActiveViewInj, |
|
|
|
MetaInj, |
|
|
|
MetaInj, |
|
|
@ -31,6 +33,13 @@ const { xWhere } = useSmartsheetStoreOrThrow() |
|
|
|
|
|
|
|
|
|
|
|
const { queryParams } = useViewData(meta, view, xWhere) |
|
|
|
const { queryParams } = useViewData(meta, view, xWhere) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indicator = h(LoadingOutlined, { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
fontSize: '2rem', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
spin: true, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const { copy } = useCopy() |
|
|
|
const { copy } = useCopy() |
|
|
|
|
|
|
|
|
|
|
|
const langs = [ |
|
|
|
const langs = [ |
|
|
@ -75,7 +84,7 @@ const selectedLangName = ref(langs[0].name) |
|
|
|
const apiUrl = computed( |
|
|
|
const apiUrl = computed( |
|
|
|
() => |
|
|
|
() => |
|
|
|
new URL( |
|
|
|
new URL( |
|
|
|
`/api/v1/data/noco/${base.value.id}/${meta.value?.title}/views/${view.value?.title}`, |
|
|
|
`/api/v1/data/noco/${base.value?.id}/${meta.value?.title}/views/${view.value?.title}`, |
|
|
|
(appInfo.value && appInfo.value.ncSiteUrl) || '/', |
|
|
|
(appInfo.value && appInfo.value.ncSiteUrl) || '/', |
|
|
|
).href, |
|
|
|
).href, |
|
|
|
) |
|
|
|
) |
|
|
@ -109,7 +118,7 @@ const api = new Api({ |
|
|
|
|
|
|
|
|
|
|
|
api.dbViewRow.list( |
|
|
|
api.dbViewRow.list( |
|
|
|
"noco", |
|
|
|
"noco", |
|
|
|
${JSON.stringify(base.value.title)}, |
|
|
|
${JSON.stringify(base.value?.title)}, |
|
|
|
${JSON.stringify(meta.value?.title)}, |
|
|
|
${JSON.stringify(meta.value?.title)}, |
|
|
|
${JSON.stringify(view.value?.title)}, ${JSON.stringify(queryParams.value, null, 4)}).then(function (data) { |
|
|
|
${JSON.stringify(view.value?.title)}, ${JSON.stringify(queryParams.value, null, 4)}).then(function (data) { |
|
|
|
console.log(data); |
|
|
|
console.log(data); |
|
|
@ -180,7 +189,8 @@ watch(activeLang, (newLang) => { |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<LazyMonacoEditor |
|
|
|
<Suspense> |
|
|
|
|
|
|
|
<MonacoEditor |
|
|
|
class="border-1 border-gray-200 py-4 rounded-lg" |
|
|
|
class="border-1 border-gray-200 py-4 rounded-lg" |
|
|
|
style="height: calc(100vh - (var(--topbar-height) * 2) - 8rem)" |
|
|
|
style="height: calc(100vh - (var(--topbar-height) * 2) - 8rem)" |
|
|
|
:model-value="code" |
|
|
|
:model-value="code" |
|
|
@ -190,6 +200,12 @@ watch(activeLang, (newLang) => { |
|
|
|
:disable-deep-compare="true" |
|
|
|
:disable-deep-compare="true" |
|
|
|
hide-minimap |
|
|
|
hide-minimap |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
<template #fallback> |
|
|
|
|
|
|
|
<div class="h-full w-full flex flex-col justify-center items-center mt-28"> |
|
|
|
|
|
|
|
<a-spin size="large" :indicator="indicator" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</Suspense> |
|
|
|
</a-tab-pane> |
|
|
|
</a-tab-pane> |
|
|
|
</NcTabs> |
|
|
|
</NcTabs> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|