From e665c2013afb16fb58610800e78ca811a5d38902 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 10 Dec 2024 10:35:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20copilot=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B5=8C=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/pages/panel/App.vue | 5 +- .../src/views/chart/ChartView.vue | 4 +- .../core-frontend/src/views/copilot/index.vue | 184 ++++++++++-------- 3 files changed, 105 insertions(+), 88 deletions(-) diff --git a/core/core-frontend/src/pages/panel/App.vue b/core/core-frontend/src/pages/panel/App.vue index 6dc9124cbd..8055e8bd47 100644 --- a/core/core-frontend/src/pages/panel/App.vue +++ b/core/core-frontend/src/pages/panel/App.vue @@ -23,6 +23,8 @@ const DashboardPanel = defineAsyncComponent( () => import('@/views/dashboard/DashboardPreviewShow.vue') ) +const Copilot = defineAsyncComponent(() => import('@/views/copilot/index.vue')) + const Preview = defineAsyncComponent(() => import('@/views/data-visualization/PreviewCanvas.vue')) const DashboardEmpty = defineAsyncComponent(() => import('@/views/mobile/panel/DashboardEmpty.vue')) @@ -45,7 +47,8 @@ const componentMap = { ScreenPanel, DashboardPanel, DatasetEditor, - DashboardEmpty + DashboardEmpty, + Copilot } const isDataFilling = ref(false) diff --git a/core/core-frontend/src/views/chart/ChartView.vue b/core/core-frontend/src/views/chart/ChartView.vue index 1be09da827..f1000c9fae 100644 --- a/core/core-frontend/src/views/chart/ChartView.vue +++ b/core/core-frontend/src/views/chart/ChartView.vue @@ -28,6 +28,7 @@ const ScreenPanel = defineAsyncComponent(() => import('@/views/data-visualizatio const DashboardPanel = defineAsyncComponent( () => import('@/views/dashboard/DashboardPreviewShow.vue') ) +const Copilot = defineAsyncComponent(() => import('@/views/copilot/index.vue')) const AsyncXpackComponent = defineAsyncComponent(() => import('@/components/plugin/src/index.vue')) @@ -39,7 +40,8 @@ const componentMap = { Dataset, Datasource, ScreenPanel, - DashboardPanel + DashboardPanel, + Copilot } const iframeStyle = ref(null) const setStyle = debounce(() => { diff --git a/core/core-frontend/src/views/copilot/index.vue b/core/core-frontend/src/views/copilot/index.vue index b2fa6e46f2..a494425982 100644 --- a/core/core-frontend/src/views/copilot/index.vue +++ b/core/core-frontend/src/views/copilot/index.vue @@ -5,6 +5,7 @@ import copilot from '@/assets/svg/copilot.svg' import icon_loading_outlined from '@/assets/svg/icon_loading_outlined.svg' import icon_right_outlined from '@/assets/svg/icon_right_outlined.svg' import icon_left_outlined from '@/assets/svg/icon_left_outlined.svg' +import { useEmbedded } from '@/store/modules/embedded' import dvFolder from '@/assets/svg/dv-folder.svg' import icon_dataset from '@/assets/svg/icon_dataset.svg' import icon_expandRight_filled from '@/assets/svg/icon_expand-right_filled.svg' @@ -24,6 +25,8 @@ import { type Tree } from '@/views/visualized/data/dataset/form/CreatDsGroup.vue import { cloneDeep } from 'lodash-es' import { iconFieldMap } from '@/components/icon-group/field-list' import { useI18n } from '@/hooks/web/useI18n' + +const embeddedStore = useEmbedded() const { t } = useI18n() const quota = shallowRef([]) const dimensions = shallowRef([]) @@ -91,6 +94,12 @@ let oldId = '' let currentId = '' let oldName = '' +const copilotDialogueComputed = computed(() => { + if (embeddedStore.baseUrl) { + return { height: `100%` } + } + return { height: `calc(100vh - ${height + 152}px)` } +}) const dfsName = arr => { return arr.filter(ele => { if (ele.id === oldId) { @@ -215,7 +224,7 @@ const queryAnswer = (event?: KeyboardEvent) => {
-
+
@@ -252,7 +261,6 @@ const queryAnswer = (event?: KeyboardEvent) => {

-

@@ -260,92 +268,95 @@ const queryAnswer = (event?: KeyboardEvent) => {

-
{{ t('copilot.choose_dataset') }}
-
- - - -
-
-
-
- - - -  {{ $t('chart.dimension') }} -
- -