|
|
@ -60,6 +60,8 @@ const newFields = ref<TableExplorerColumn[]>([]) |
|
|
|
|
|
|
|
|
|
|
|
const isFieldIdCopied = ref(false) |
|
|
|
const isFieldIdCopied = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isColOptionDropdownOpen = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
const compareCols = (a?: TableExplorerColumn, b?: TableExplorerColumn) => { |
|
|
|
const compareCols = (a?: TableExplorerColumn, b?: TableExplorerColumn) => { |
|
|
|
if (a?.id && b?.id) { |
|
|
|
if (a?.id && b?.id) { |
|
|
|
return a.id === b.id |
|
|
|
return a.id === b.id |
|
|
@ -683,6 +685,14 @@ onMounted(async () => { |
|
|
|
columnsHash.value = (await $api.dbTableColumn.hash(meta.value.id)).hash |
|
|
|
columnsHash.value = (await $api.dbTableColumn.hash(meta.value.id)).hash |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch(isColOptionDropdownOpen, () => { |
|
|
|
|
|
|
|
if (isColOptionDropdownOpen.value === true) return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
isFieldIdCopied.value = false |
|
|
|
|
|
|
|
}, 200) |
|
|
|
|
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -828,7 +838,13 @@ onMounted(async () => { |
|
|
|
Restore |
|
|
|
Restore |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
<NcDropdown v-else :trigger="['click']" overlay-class-name="nc-dropdown-table-explorer" @click.stop> |
|
|
|
<NcDropdown |
|
|
|
|
|
|
|
v-else |
|
|
|
|
|
|
|
v-model:visible="isColOptionDropdownOpen" |
|
|
|
|
|
|
|
:trigger="['click']" |
|
|
|
|
|
|
|
overlay-class-name="nc-dropdown-table-explorer" |
|
|
|
|
|
|
|
@click.stop |
|
|
|
|
|
|
|
> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
size="xsmall" |
|
|
|
size="xsmall" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
@ -842,7 +858,8 @@ onMounted(async () => { |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
|
|
|
|
|
|
|
|
<template #overlay> |
|
|
|
<template #overlay> |
|
|
|
<NcMenu> |
|
|
|
<NcMenu style="padding-top: 0.45rem !important"> |
|
|
|
|
|
|
|
<template v-if="fieldStatus(field) !== 'add'"> |
|
|
|
<NcTooltip placement="top"> |
|
|
|
<NcTooltip placement="top"> |
|
|
|
<template #title>Click to copy Field Id</template> |
|
|
|
<template #title>Click to copy Field Id</template> |
|
|
|
|
|
|
|
|
|
|
@ -860,7 +877,8 @@ onMounted(async () => { |
|
|
|
<GeneralIcon v-else icon="copy" class="mt-0.75" /> |
|
|
|
<GeneralIcon v-else icon="copy" class="mt-0.75" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
<a-menu-divider class="mb-1" /> |
|
|
|
<a-menu-divider class="mb-1.5" /> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem key="table-explorer-duplicate" @click="duplicateField(field)"> |
|
|
|
<NcMenuItem key="table-explorer-duplicate" @click="duplicateField(field)"> |
|
|
|
<Icon class="iconify text-gray-800" icon="lucide:copy" /><span>Duplicate</span> |
|
|
|
<Icon class="iconify text-gray-800" icon="lucide:copy" /><span>Duplicate</span> |
|
|
@ -872,7 +890,7 @@ onMounted(async () => { |
|
|
|
<Icon class="iconify text-gray-800" icon="lucide:arrow-down" /><span>Insert below</span> |
|
|
|
<Icon class="iconify text-gray-800" icon="lucide:arrow-down" /><span>Insert below</span> |
|
|
|
</NcMenuItem> |
|
|
|
</NcMenuItem> |
|
|
|
|
|
|
|
|
|
|
|
<a-menu-divider class="my-1" /> |
|
|
|
<a-menu-divider class="my-1.5" /> |
|
|
|
|
|
|
|
|
|
|
|
<NcMenuItem key="table-explorer-delete" class="!hover:bg-red-50" @click="onFieldDelete(field)"> |
|
|
|
<NcMenuItem key="table-explorer-delete" class="!hover:bg-red-50" @click="onFieldDelete(field)"> |
|
|
|
<div class="text-red-500"> |
|
|
|
<div class="text-red-500"> |
|
|
|