From bec3d9c7377ce963e994be44cb2c959a388ffcf8 Mon Sep 17 00:00:00 2001 From: lana-k Date: Wed, 25 Oct 2023 20:43:22 +0200 Subject: [PATCH] #115 add split in result set --- .../{RunResult.vue => RunResult/index.vue} | 122 +++++++++++++----- src/views/Main/Workspace/Tabs/Tab/index.vue | 1 + 2 files changed, 91 insertions(+), 32 deletions(-) rename src/views/Main/Workspace/Tabs/Tab/{RunResult.vue => RunResult/index.vue} (66%) diff --git a/src/views/Main/Workspace/Tabs/Tab/RunResult.vue b/src/views/Main/Workspace/Tabs/Tab/RunResult/index.vue similarity index 66% rename from src/views/Main/Workspace/Tabs/Tab/RunResult.vue rename to src/views/Main/Workspace/Tabs/Tab/RunResult/index.vue index 7e0ece8..57e1e0e 100644 --- a/src/views/Main/Workspace/Tabs/Tab/RunResult.vue +++ b/src/views/Main/Workspace/Tabs/Tab/RunResult/index.vue @@ -1,31 +1,21 @@ @@ -63,7 +91,8 @@ import Logs from '@/components/Logs' import SqlTable from '@/components/SqlTable' import LoadingIndicator from '@/components/LoadingIndicator' -import SideToolBar from './SideToolBar' +import SideToolBar from '../SideToolBar' +import Splitpanes from '@/components/Splitpanes' import ExportToCsvIcon from '@/components/svg/exportToCsv' import ClipboardIcon from '@/components/svg/clipboard' import IconButton from '@/components/IconButton' @@ -73,16 +102,24 @@ import cIo from '@/lib/utils/clipboardIo' import time from '@/lib/utils/time' import loadingDialog from '@/components/LoadingDialog' import events from '@/lib/utils/events' +import Teleport from 'vue2-teleport' export default { name: 'RunResult', - props: ['result', 'isGettingResults', 'error', 'time'], + props: { + tab: Object, + result: Object, + isGettingResults: Boolean, + error: Object, + time: [String, Number] + }, data () { return { resizeObserver: null, pageSize: 20, preparingCopy: false, - dataToCopy: null + dataToCopy: null, + viewValuePanelVisible: false } }, components: { @@ -93,7 +130,19 @@ export default { ExportToCsvIcon, IconButton, ClipboardIcon, - loadingDialog + loadingDialog, + Splitpanes, + Teleport + }, + computed: { + resultSetTeleportTarget () { + const base = `#${this.viewValuePanelVisible + ? 'run-result-left-pane' + : 'run-result-result-set' + }` + const tabIdPostfix = `-${this.tab.id}` + return base + tabIdPostfix + } }, mounted () { this.resizeObserver = new ResizeObserver(this.handleResize) @@ -167,6 +216,10 @@ export default { cancelCopy () { this.dataToCopy = null this.$modal.hide('prepareCSVCopy') + }, + + toggleViewValuePanel () { + this.viewValuePanelVisible = !this.viewValuePanelVisible } } } @@ -180,10 +233,15 @@ export default { } .run-result-panel-content { - position: relative; flex-grow: 1; height: 100%; width: 0; +} + +.result-set-container { + position: relative; + height: 100%; + width: 100%; box-sizing: border-box; } diff --git a/src/views/Main/Workspace/Tabs/Tab/index.vue b/src/views/Main/Workspace/Tabs/Tab/index.vue index 2a98dac..61011fe 100644 --- a/src/views/Main/Workspace/Tabs/Tab/index.vue +++ b/src/views/Main/Workspace/Tabs/Tab/index.vue @@ -29,6 +29,7 @@