From 564b749869887df2fb35d768ff52fc200110861e Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 19 Jul 2022 18:51:55 +0800 Subject: [PATCH] feat(gui-v2): add setEditableTn & remove onUpdate functions --- .../nc-gui-v2/components/template/Editor.vue | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/packages/nc-gui-v2/components/template/Editor.vue b/packages/nc-gui-v2/components/template/Editor.vue index e8259a056a..ca350de851 100644 --- a/packages/nc-gui-v2/components/template/Editor.vue +++ b/packages/nc-gui-v2/components/template/Editor.vue @@ -20,7 +20,7 @@ const { quickImportType, projectTemplate } = defineProps() const valid = ref(false) const expansionPanel = ref([]) -const editableTn = ref({}) +const editableTn = ref({}) const inputRefs = ref([]) const LinkToAnotherRecord = 'LinkToAnotherRecord' const Lookup = 'Lookup' @@ -90,10 +90,6 @@ const parseTemplate = ({ tables = [], ...rest }: Record) => { project.value = parsedTemplate } -const onTableNameUpdate = (oldTable: string, newVal: string) => { - // TODO: -} - const deleteTable = (tableIdx: number) => { const deleteTable = project.value.tables[tableIdx] for (const table of project.value.tables) { @@ -109,10 +105,6 @@ const isSelect = (col: ColumnType) => { return col.uidt === 'MultiSelect' || col.uidt === 'SingleSelect' } -const onColumnNameUpdate = (oldCol: ColumnType, newVal: string, tn: string) => { - // TODO -} - const deleteTableColumn = (i: number, j: number, col: Record, table: Record) => { const deleteTable = project.value.tables[i] const deleteColumn = deleteTable.columns[j] @@ -139,6 +131,10 @@ const addNewColumnRow = (table: Record, uidt?: string) => { input.select() }) } + +const setEditableTn = (idx: number, val: boolean) => { + editableTn.value[idx] = val +}