|
|
@ -111,8 +111,8 @@ const sortByColumn = async (direction: 'asc' | 'desc') => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const isDuplicateDlgOpen = ref(false) |
|
|
|
const selectedColumnToDuplicate = ref<ColumnType>() |
|
|
|
|
|
|
|
const selectedColumnExtra = ref<any>() |
|
|
|
const selectedColumnExtra = ref<any>() |
|
|
|
|
|
|
|
const duplicateDialogRef = ref<any>() |
|
|
|
|
|
|
|
|
|
|
|
const duplicateVirtualColumn = async () => { |
|
|
|
const duplicateVirtualColumn = async () => { |
|
|
|
let columnCreatePayload = {} |
|
|
|
let columnCreatePayload = {} |
|
|
@ -165,7 +165,7 @@ const duplicateVirtualColumn = async () => { |
|
|
|
|
|
|
|
|
|
|
|
const openDuplicateDlg = async () => { |
|
|
|
const openDuplicateDlg = async () => { |
|
|
|
if (!column?.value) return |
|
|
|
if (!column?.value) return |
|
|
|
if (column.value.uidt && [UITypes.Formula, UITypes.Lookup, UITypes.Rollup].includes(column.value.uidt as UITypes)) { |
|
|
|
if (column.value.uidt && [UITypes.Lookup, UITypes.Rollup].includes(column.value.uidt as UITypes)) { |
|
|
|
duplicateVirtualColumn() |
|
|
|
duplicateVirtualColumn() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const gridViewColumnList = (await $api.dbViewColumn.list(view.value?.id as string)).list |
|
|
|
const gridViewColumnList = (await $api.dbViewColumn.list(view.value?.id as string)).list |
|
|
@ -186,8 +186,15 @@ const openDuplicateDlg = async () => { |
|
|
|
view_id: view.value!.id as string, |
|
|
|
view_id: view.value!.id as string, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
selectedColumnToDuplicate.value = column.value |
|
|
|
|
|
|
|
|
|
|
|
if (column.value.uidt === UITypes.Formula) { |
|
|
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
|
|
duplicateDialogRef?.value?.duplicate() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
|
isDuplicateDlgOpen.value = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isOpen.value = false |
|
|
|
isOpen.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -373,9 +380,10 @@ const onInsertAfter = () => { |
|
|
|
</a-dropdown> |
|
|
|
</a-dropdown> |
|
|
|
<SmartsheetHeaderDeleteColumnModal v-model:visible="showDeleteColumnModal" /> |
|
|
|
<SmartsheetHeaderDeleteColumnModal v-model:visible="showDeleteColumnModal" /> |
|
|
|
<DlgColumnDuplicate |
|
|
|
<DlgColumnDuplicate |
|
|
|
v-if="selectedColumnToDuplicate" |
|
|
|
v-if="column" |
|
|
|
|
|
|
|
ref="duplicateDialogRef" |
|
|
|
v-model="isDuplicateDlgOpen" |
|
|
|
v-model="isDuplicateDlgOpen" |
|
|
|
:column="selectedColumnToDuplicate" |
|
|
|
:column="column" |
|
|
|
:extra="selectedColumnExtra" |
|
|
|
:extra="selectedColumnExtra" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|