diff --git a/packages/nc-gui/components/ProjectTreeView.vue b/packages/nc-gui/components/ProjectTreeView.vue index 8c7a5acf76..6905481f0f 100644 --- a/packages/nc-gui/components/ProjectTreeView.vue +++ b/packages/nc-gui/components/ProjectTreeView.vue @@ -642,6 +642,13 @@ :heading="selectedNodeForDelete.heading" type="error" /> + @@ -661,11 +668,13 @@ import DlgTableCreate from '@/components/utils/dlgTableCreate'; import DlgViewCreate from '@/components/utils/dlgViewCreate'; import SponsorMini from '@/components/sponsorMini'; import {validateTableName} from "~/helpers"; +import ExcelImport from "~/components/import/excelImport"; // const {clipboard} = require('electron'); export default { components: { + ExcelImport, SponsorMini, DlgViewCreate, DlgTableCreate, @@ -704,6 +713,7 @@ export default { open: [], search: null, menuVisible: false, + excelImportDialog:false, x: 0, y: 0, menuItem: null, @@ -924,7 +934,12 @@ export default { this.miniExpanded = false; } }, - + onExcelImport(){ + if (!this.menuItem || this.menuItem.type !== 'tableDir') { + this.menuItem = this.listViewArr.find(n => n.type === 'tableDir'); + } + this.loadTables(this.menuItem) + }, ...mapMutations({ setProject: 'project/list', updateProject: 'project/update', @@ -1146,12 +1161,11 @@ export default { this.dialogGetFunctionName.dialogShow = true; } else if (action === 'ENV_DB_FUNCTIONS_CREATE') { this.dialogGetFunctionName.dialogShow = true; - } else if (action === 'ENV_DB_TABLES_REFRESH') { - await this.loadTables(this.menuItem); - this.$toast.success('Tables refreshed').goAway(1000); } else if (action === 'ENV_DB_VIEWS_REFRESH') { await this.loadViews(this.menuItem); this.$toast.success('Views refreshed').goAway(1000); + } else if (action === 'IMPORT_EXCEL') { + this.excelImportDialog=true } else if (action === 'ENV_DB_FUNCTIONS_REFRESH') { await this.loadFunctions(this.menuItem); this.$toast.success('Functions refreshed').goAway(1000); diff --git a/packages/nc-gui/components/import/excelImport.vue b/packages/nc-gui/components/import/excelImport.vue index 487cd73d7d..5f75d77cc5 100644 --- a/packages/nc-gui/components/import/excelImport.vue +++ b/packages/nc-gui/components/import/excelImport.vue @@ -1,5 +1,5 @@