@@ -14,10 +14,11 @@ import icon_redo_outlined from '@/assets/svg/icon_redo_outlined.svg'
1414import icon_arrow_left_outlined from ' @/assets/svg/icon_arrow-left_outlined.svg'
1515import { saveDashboardResource } from ' @/views/dashboard/utils/canvasUtils.ts'
1616import ChatChartSelection from ' @/views/dashboard/editor/ChatChartSelection.vue'
17-
17+ import icon_pc_outlined from ' @/assets/svg/icon_pc_outlined.svg'
18+ const fullScreeRef = ref (null )
1819const { t } = useI18n ()
1920const dashboardStore = dashboardStoreWithOut ()
20- const { dashboardInfo } = storeToRefs (dashboardStore )
21+ const { dashboardInfo, fullscreenFlag } = storeToRefs (dashboardStore )
2122
2223const snapshotStore = snapshotStoreWithOut ()
2324const { snapshotIndex } = storeToRefs (snapshotStore )
@@ -30,6 +31,7 @@ const openViewDialog = () => {
3031}
3132
3233import cloneDeep from ' lodash/cloneDeep'
34+ import SQFullscreen from ' @/views/dashboard/common/SQFullscreen.vue'
3335
3436let nameEdit = ref (false )
3537let inputName = ref (' ' )
@@ -136,10 +138,16 @@ const addChatChart = (views: any) => {
136138 emits (' addComponent' , ' SQView' , cloneDeep (view ))
137139 })
138140}
141+
142+ const previewInner = () => {
143+ if (fullScreeRef .value ) {
144+ fullScreeRef .value .toggleFullscreen ()
145+ }
146+ }
139147 </script >
140148
141149<template >
142- <div class =" toolbar-main" >
150+ <div class =" toolbar-main" :class = " { 'toolbar-main-hidden': fullscreenFlag } " >
143151 <el-icon class =" custom-el-icon back-icon" @click =" backToMain()" >
144152 <Icon name =" icon_left_outlined" >
145153 <icon _arrow_left_outlined class =" toolbar-hover-icon toolbar-icon" />
@@ -204,6 +212,14 @@ const addChatChart = (views: any) => {
204212 </component-button-label >
205213 </div >
206214 <div class =" right-toolbar" >
215+ <el-button secondary @click =" previewInner" >
216+ <template #icon >
217+ <icon name =" icon_pc_outlined" >
218+ <icon _pc_outlined class =" svg-icon" />
219+ </icon >
220+ </template >
221+ {{ t('dashboard.preview') }}
222+ </el-button >
207223 <el-button
208224 style =" float : right ; margin-right : 12px "
209225 type =" primary"
@@ -226,10 +242,14 @@ const addChatChart = (views: any) => {
226242 @add-chat-chart =" addChatChart"
227243 @finish =" chartSelectionFinish"
228244 ></ChatChartSelection >
245+ <SQFullscreen ref =" fullScreeRef" show-position =" edit" ></SQFullscreen >
229246 </div >
230247</template >
231248
232249<style scoped lang="less">
250+ .toolbar-main-hidden {
251+ display : none !important ;
252+ }
233253.toolbar-main {
234254 width : 100% ;
235255 height : 56px ;
0 commit comments