File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -189,8 +189,9 @@ function showSql() {
189189}
190190
191191function addToDashboard() {
192+ const viewInfo = chartRef .value ?.getViewInfo ()
192193 // @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
193- addViewRef .value ?.optInit ()
194+ addViewRef .value ?.optInit (viewInfo )
194195}
195196
196197function copy() {
Original file line number Diff line number Diff line change @@ -54,9 +54,22 @@ function onTypeChange() {
5454 chartRef .value ?.renderChart ()
5555 })
5656}
57-
57+ function getViewInfo() {
58+ return {
59+ chart: {
60+ columns: chartObject .value ?.columns ,
61+ type: props .chartType ,
62+ xAxis: xAxis .value ,
63+ yAxis: yAxis .value ,
64+ series: series .value ,
65+ title: chartObject .value .title ,
66+ },
67+ data: { data: props .data },
68+ }
69+ }
5870defineExpose ({
5971 onTypeChange ,
72+ getViewInfo ,
6073})
6174 </script >
6275
Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ const saveResourcePrepare = () => {
8686 component [' id' ] = newComponentId
8787 component [' y' ] = bottomPosition + 1
8888 canvasDataResult .push (component )
89+ // @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
90+ state .viewInfo .chart [' id' ] = newComponentId
8991 canvasViewInfoPreview [newComponentId ] = state .viewInfo
9092 const commonParams = {
9193 componentData: canvasDataResult ,
You can’t perform that action at this time.
0 commit comments