11<script setup lang="ts">
22import ChartComponent from ' @/views/chat/component/ChartComponent.vue'
3+ import icon_window_mini_outlined from ' @/assets/svg/icon_window-mini_outlined.svg'
4+ import SqViewDisplay from ' @/views/dashboard/components/sq-view/index.vue'
35defineProps ({
46 viewInfo: {
57 type: Object ,
68 required: true ,
79 },
10+ outerId: {
11+ type: String ,
12+ required: false ,
13+ default: null ,
14+ },
815})
916
1017import { ref } from ' vue'
18+ import { useI18n } from ' vue-i18n'
19+ const { t } = useI18n ()
1120const chartRef = ref (null )
1221const renderChart = () => {
1322 // @ts-expect-error eslint-disable-next-line @typescript-eslint/no-unused-expressions
1423 // eslint-disable-next-line @typescript-eslint/no-unused-expressions
1524 chartRef .value ?.renderChart
1625}
26+ const enlargeDialogVisible = ref (false )
1727
28+ const enlargeView = () => {
29+ enlargeDialogVisible .value = true
30+ }
1831defineExpose ({
1932 renderChart ,
33+ enlargeView ,
2034})
2135 </script >
2236
@@ -30,7 +44,7 @@ defineExpose({
3044 <div class =" chart-show-area" >
3145 <ChartComponent
3246 v-if =" viewInfo.id"
33- :id =" viewInfo.id"
47+ :id =" outerId || viewInfo.id"
3448 ref =" chartRef"
3549 :type =" viewInfo.chart.type"
3650 :columns =" viewInfo.chart.columns"
@@ -40,15 +54,54 @@ defineExpose({
4054 :data =" viewInfo.data?.data"
4155 />
4256 </div >
57+ <el-dialog
58+ v-if =" enlargeDialogVisible"
59+ v-model =" enlargeDialogVisible"
60+ fullscreen
61+ :show-close =" false"
62+ class =" chart-fullscreen-dialog-view"
63+ header-class =" chart-fullscreen-dialog-header-view"
64+ body-class =" chart-fullscreen-dialog-body-view"
65+ >
66+ <div style =" position : absolute ; right : 15px ; top : 15px ; cursor : pointer " >
67+ <el-tooltip effect =" dark" :content =" t('dashboard.exit_preview')" placement =" top" >
68+ <el-button
69+ class =" tool-btn"
70+ style =" width : 26px "
71+ text
72+ @click =" () => (enlargeDialogVisible = false)"
73+ >
74+ <el-icon size =" 16" >
75+ <icon _window_mini_outlined />
76+ </el-icon >
77+ </el-button >
78+ </el-tooltip >
79+ </div >
80+ <SqViewDisplay :view-info =" viewInfo" :outer-id =" 'enlarge-' + viewInfo.id" />
81+ </el-dialog >
4382 </div >
4483</template >
4584
85+ <style lang="less">
86+ .chart-fullscreen-dialog-view {
87+ padding : 0 ;
88+ }
89+ .chart-fullscreen-dialog-header-view {
90+ display : none ;
91+ }
92+ .chart-fullscreen-dialog-body-view {
93+ padding : 0 ;
94+ height : 100% ;
95+ }
96+ </style >
97+
4698<style scoped lang="less">
4799.chart-base-container {
48100 width : 100% ;
49101 height : 100% ;
50102 background : #fff ;
51103 padding : 12px !important ;
104+ border-radius : 12px ;
52105 .header-bar {
53106 height : 32px ;
54107 display : flex ;
0 commit comments