From f68b88c6f42a41a67d4f6620a930f060c0459053 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 12 Jul 2024 11:51:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20Co?= =?UTF-8?q?pilot=E6=BB=9A=E5=8A=A8=E5=8C=BA=E5=9F=9F=E4=B8=8D=E5=90=88?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/pages/panel/App.vue | 2 +- .../src/views/copilot/DialogueChart.vue | 42 +++++++++---------- .../core-frontend/src/views/copilot/index.vue | 23 ++++++++-- .../src/views/share/share/ShareTicket.vue | 2 +- 4 files changed, 42 insertions(+), 27 deletions(-) diff --git a/core/core-frontend/src/pages/panel/App.vue b/core/core-frontend/src/pages/panel/App.vue index d2a994ba9c..cd69b6d81b 100644 --- a/core/core-frontend/src/pages/panel/App.vue +++ b/core/core-frontend/src/pages/panel/App.vue @@ -26,7 +26,7 @@ const DashboardPanel = defineAsyncComponent( const Preview = defineAsyncComponent(() => import('@/views/data-visualization/PreviewCanvas.vue')) const props = defineProps({ - componentName: propTypes.string.def('DashboardEditor') + componentName: propTypes.string.def('Iframe') }) const currentComponent = shallowRef() diff --git a/core/core-frontend/src/views/copilot/DialogueChart.vue b/core/core-frontend/src/views/copilot/DialogueChart.vue index 2e66d453a5..7a29598d30 100644 --- a/core/core-frontend/src/views/copilot/DialogueChart.vue +++ b/core/core-frontend/src/views/copilot/DialogueChart.vue @@ -48,8 +48,8 @@ onMounted(() => { const chartType = chart.type === 'bar' ? Column : Line columnPlot = new chartType(`de-${id}-ed`, { data: chartData.data.data, - xField: chart.axis?.x, - yField: chart.axis?.y, + xField: chart.axis?.x?.value, + yField: chart.axis?.y?.value, legend: { layout: 'horizontal', position: 'left' @@ -61,17 +61,17 @@ onMounted(() => { columnPlot = new Pie(`de-${id}-ed`, { appendPadding: 10, data: chartData.data.data, - angleField: chart.axis?.y, - colorField: chart.axis?.x, + angleField: chart.axis?.y?.value, + colorField: chart.axis?.x?.value, radius: 0.9, interactions: [{ type: 'element-active' }] }) columnPlot.render() } else { - columns.value = chartData.data.fields.map(_ => ({ - key: `${_.originName}`, - dataKey: `${_.originName}`, - title: `${_.originName}`, + columns.value = chart.columns.map(_ => ({ + key: `${_.value}`, + dataKey: `${_.value}`, + title: `${_.name}`, width: 150 })) @@ -97,10 +97,10 @@ const exportExcel = () => { const workbook = new ExcelJS.Workbook() const worksheet = workbook.addWorksheet('Sheet1') // 设置列标题 - worksheet.columns = chartData.data.fields.map(ele => { - return { header: ele.originName, key: ele.originName } + worksheet.columns = chart.columns.map(ele => { + return { header: ele.name, key: ele.value } }) - const arr = chartData.data.fields.map(ele => ele.originName) + const arr = chart.columns.map(ele => ele.value) chartData.data.data.forEach(item => { worksheet.addRow(arr.map(ele => item[ele])) }) @@ -142,8 +142,8 @@ const switchChartType = type => { const chartType = type === 'bar' ? Column : Line const columnPlot = new chartType(`de-${id}-ed`, { data: chartData.data.data, - xField: chart.axis?.x, - yField: chart.axis?.y, + xField: chart.axis?.x?.value, + yField: chart.axis?.y?.value, legend: { layout: 'horizontal', position: 'left' @@ -157,8 +157,8 @@ const switchChartType = type => { columnPlot = new Pie(`de-${id}-ed`, { appendPadding: 10, data: chartData.data.data, - angleField: chart.axis?.y, - colorField: chart.axis?.x, + angleField: chart.axis?.y?.value, + colorField: chart.axis?.x?.value, radius: 0.9, interactions: [{ type: 'element-active' }] }) @@ -166,10 +166,10 @@ const switchChartType = type => { return } - columns.value = chartData.data.fields.map(_ => ({ - key: `${_.originName}`, - dataKey: `${_.originName}`, - title: `${_.originName}`, + columns.value = chart.columns.map(_ => ({ + key: `${_.value}`, + dataKey: `${_.value}`, + title: `${_.name}`, width: 150 })) @@ -411,7 +411,7 @@ const tips = computed(() => { margin-left: 8px; border-radius: 8px; .question-or-title { - font-family: PingFang SC; + font-family: '阿里巴巴普惠体 3.0 55 Regular L3'; font-size: 14px; font-weight: 400; line-height: 22px; @@ -445,7 +445,7 @@ const tips = computed(() => { } .is-welcome { - font-family: PingFang SC; + font-family: '阿里巴巴普惠体 3.0 55 Regular L3'; font-size: 14px; font-weight: 400; line-height: 22px; diff --git a/core/core-frontend/src/views/copilot/index.vue b/core/core-frontend/src/views/copilot/index.vue index d2dde70bcc..9743a0019d 100644 --- a/core/core-frontend/src/views/copilot/index.vue +++ b/core/core-frontend/src/views/copilot/index.vue @@ -1,5 +1,5 @@