|
|
@ -1,24 +1,19 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import type { ColumnType, KanbanType } from 'nocodb-sdk' |
|
|
|
import { UITypes } from 'nocodb-sdk' |
|
|
|
import { UITypes, ViewTypes, isVirtualCol } from 'nocodb-sdk' |
|
|
|
import type { KanbanType } from 'nocodb-sdk' |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
import type { SelectProps } from 'ant-design-vue' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveViewInj, |
|
|
|
ActiveViewInj, |
|
|
|
FieldsInj, |
|
|
|
|
|
|
|
IsLockedInj, |
|
|
|
IsLockedInj, |
|
|
|
IsPublicInj, |
|
|
|
|
|
|
|
MetaInj, |
|
|
|
MetaInj, |
|
|
|
ReloadViewDataHookInj, |
|
|
|
ReloadViewDataHookInj, |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
inject, |
|
|
|
inject, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
useKanbanViewData, |
|
|
|
useKanbanViewData, |
|
|
|
useNuxtApp, |
|
|
|
|
|
|
|
useViewColumns, |
|
|
|
useViewColumns, |
|
|
|
watch, |
|
|
|
watch, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
import CellIcon from '~/components/smartsheet-header/CellIcon.vue' |
|
|
|
|
|
|
|
import VirtualCellIcon from '~/components/smartsheet-header/VirtualCellIcon.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const meta = inject(MetaInj)! |
|
|
|
const meta = inject(MetaInj)! |
|
|
|
|
|
|
|
|
|
|
@ -26,36 +21,16 @@ const activeView = inject(ActiveViewInj)! |
|
|
|
|
|
|
|
|
|
|
|
const reloadDataHook = inject(ReloadViewDataHookInj)! |
|
|
|
const reloadDataHook = inject(ReloadViewDataHookInj)! |
|
|
|
|
|
|
|
|
|
|
|
const rootFields = inject(FieldsInj) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
const isLocked = inject(IsLockedInj, ref(false)) |
|
|
|
|
|
|
|
|
|
|
|
const isPublic = inject(IsPublicInj, ref(false)) |
|
|
|
const { fields, loadViewColumns, metaColumnById } = useViewColumns(activeView, meta, () => reloadDataHook.trigger()) |
|
|
|
|
|
|
|
|
|
|
|
const { $api, $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { kanbanMetaData, loadKanbanMeta, loadKanbanData, updateKanbanMeta, groupingField } = useKanbanViewData(meta, activeView) |
|
|
|
showSystemFields, |
|
|
|
|
|
|
|
sortedAndFilteredFields, |
|
|
|
|
|
|
|
fields, |
|
|
|
|
|
|
|
loadViewColumns, |
|
|
|
|
|
|
|
filteredFieldList, |
|
|
|
|
|
|
|
filterQuery, |
|
|
|
|
|
|
|
showAll, |
|
|
|
|
|
|
|
hideAll, |
|
|
|
|
|
|
|
saveOrUpdate, |
|
|
|
|
|
|
|
metaColumnById, |
|
|
|
|
|
|
|
} = useViewColumns(activeView, meta, () => reloadDataHook.trigger()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { kanbanMetaData, loadKanbanMeta, loadKanbanData, updateKanbanMeta, groupingField } = useKanbanViewData( |
|
|
|
|
|
|
|
meta, |
|
|
|
|
|
|
|
activeView as any, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stackedByDropdown = ref(false) |
|
|
|
const stackedByDropdown = ref(false) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => (activeView.value as any)?.id, |
|
|
|
() => activeView.value?.id, |
|
|
|
async (newVal, oldVal) => { |
|
|
|
async (newVal, oldVal) => { |
|
|
|
if (newVal !== oldVal && meta.value) { |
|
|
|
if (newVal !== oldVal && meta.value) { |
|
|
|
await loadViewColumns() |
|
|
|
await loadViewColumns() |
|
|
@ -64,11 +39,6 @@ watch( |
|
|
|
{ immediate: true }, |
|
|
|
{ immediate: true }, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const getIcon = (c: ColumnType) => |
|
|
|
|
|
|
|
h(isVirtualCol(c) ? VirtualCellIcon : CellIcon, { |
|
|
|
|
|
|
|
columnMeta: c, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const groupingFieldColumnId = computed({ |
|
|
|
const groupingFieldColumnId = computed({ |
|
|
|
get: () => kanbanMetaData.value.grp_column_id, |
|
|
|
get: () => kanbanMetaData.value.grp_column_id, |
|
|
|
set: async (val) => { |
|
|
|
set: async (val) => { |
|
|
|