Showing
4 changed files
with
13 additions
and
16 deletions
... | ... | @@ -31,7 +31,7 @@ import { isPreview } from '@/utils' |
31 | 31 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' |
32 | 32 | import isObject from 'lodash/isObject' |
33 | 33 | import dataJson from './data.json' |
34 | -import { isFullScreen } from '../../utls/isFullScreen' | |
34 | +import { useFullScreen } from '../../utls/fullScreen' | |
35 | 35 | |
36 | 36 | const props = defineProps({ |
37 | 37 | themeSetting: { |
... | ... | @@ -68,9 +68,9 @@ const toolBoxOption = { |
68 | 68 | icon: 'path://M733.549304 0l116.434359 116.23452-226.402521 226.40252 57.053835 57.068109 226.459617-226.445342 120.616689 120.41685V0H733.549304zM689.513507 619.855586l-57.068108 57.068109 224.232847 224.232847-122.64362 122.843458h293.676657V729.838022l-114.007751 114.207588-224.190025-224.190024zM338.197775 404.144414l57.068109-57.068109L171.033037 122.843458 293.676657 0H0v294.161978l114.022025-114.207588 224.17575 224.190024zM347.076305 624.294851L120.616689 850.754468 0 730.323343v293.676657h294.161978l-116.420084-116.23452 226.40252-226.40252-57.068109-57.068109z', |
69 | 69 | onclick: () => { |
70 | 70 | const getEchartDom = vChartRef.value?.getDom() |
71 | - const domName = document.getElementById(getEchartDom.id) as any | |
72 | - const htmlName = document.querySelector('html') as any | |
73 | - isFullScreen(domName, htmlName) | |
71 | + const domName = document.getElementById(getEchartDom.id) as HTMLElement | |
72 | + const htmlName = document.querySelector('html') as HTMLHtmlElement | |
73 | + useFullScreen(domName, htmlName) | |
74 | 74 | } |
75 | 75 | } |
76 | 76 | } | ... | ... |
... | ... | @@ -30,7 +30,7 @@ import { isPreview } from '@/utils' |
30 | 30 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' |
31 | 31 | import isObject from 'lodash/isObject' |
32 | 32 | import dataJson from './data.json' |
33 | -import { isFullScreen } from '../../utls/isFullScreen' | |
33 | +import { useFullScreen } from '../../utls/fullScreen' | |
34 | 34 | |
35 | 35 | const props = defineProps({ |
36 | 36 | themeSetting: { |
... | ... | @@ -67,9 +67,9 @@ const toolBoxOption = { |
67 | 67 | icon: 'path://M733.549304 0l116.434359 116.23452-226.402521 226.40252 57.053835 57.068109 226.459617-226.445342 120.616689 120.41685V0H733.549304zM689.513507 619.855586l-57.068108 57.068109 224.232847 224.232847-122.64362 122.843458h293.676657V729.838022l-114.007751 114.207588-224.190025-224.190024zM338.197775 404.144414l57.068109-57.068109L171.033037 122.843458 293.676657 0H0v294.161978l114.022025-114.207588 224.17575 224.190024zM347.076305 624.294851L120.616689 850.754468 0 730.323343v293.676657h294.161978l-116.420084-116.23452 226.40252-226.40252-57.068109-57.068109z', |
68 | 68 | onclick: () => { |
69 | 69 | const getEchartDom = vChartRef.value?.getDom() |
70 | - const domName = document.getElementById(getEchartDom.id) as any | |
71 | - const htmlName = document.querySelector('html') as any | |
72 | - isFullScreen(domName, htmlName) | |
70 | + const domName = document.getElementById(getEchartDom.id) as HTMLElement | |
71 | + const htmlName = document.querySelector('html') as HTMLHtmlElement | |
72 | + useFullScreen(domName, htmlName) | |
73 | 73 | } |
74 | 74 | } |
75 | 75 | } | ... | ... |
... | ... | @@ -26,7 +26,7 @@ import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } fr |
26 | 26 | import { useChartDataFetch } from '@/hooks' |
27 | 27 | import { isPreview, colorGradientCustomMerge } from '@/utils' |
28 | 28 | import dataJson from './data.json' |
29 | -import { isFullScreen } from '../../utls/isFullScreen' | |
29 | +import { useFullScreen } from '../../utls/fullScreen' | |
30 | 30 | |
31 | 31 | const props = defineProps({ |
32 | 32 | themeSetting: { |
... | ... | @@ -61,9 +61,9 @@ const toolBoxOption = { |
61 | 61 | icon: 'path://M733.549304 0l116.434359 116.23452-226.402521 226.40252 57.053835 57.068109 226.459617-226.445342 120.616689 120.41685V0H733.549304zM689.513507 619.855586l-57.068108 57.068109 224.232847 224.232847-122.64362 122.843458h293.676657V729.838022l-114.007751 114.207588-224.190025-224.190024zM338.197775 404.144414l57.068109-57.068109L171.033037 122.843458 293.676657 0H0v294.161978l114.022025-114.207588 224.17575 224.190024zM347.076305 624.294851L120.616689 850.754468 0 730.323343v293.676657h294.161978l-116.420084-116.23452 226.40252-226.40252-57.068109-57.068109z', |
62 | 62 | onclick: () => { |
63 | 63 | const getEchartDom = vChartRef.value?.getDom() |
64 | - const domName = document.getElementById(getEchartDom.id) as any | |
65 | - const htmlName = document.querySelector('html') as any | |
66 | - isFullScreen(domName, htmlName) | |
64 | + const domName = document.getElementById(getEchartDom.id) as HTMLElement | |
65 | + const htmlName = document.querySelector('html') as HTMLHtmlElement | |
66 | + useFullScreen(domName, htmlName) | |
67 | 67 | } |
68 | 68 | } |
69 | 69 | } | ... | ... |
src/packages/components/external/Charts/utls/fullScreen.ts
renamed from
src/packages/components/external/Charts/utls/isFullScreen.ts
1 | -export const isFullScreen = (domName: any, htmlName: any) => { | |
1 | +export const useFullScreen = (domName: any, htmlName: HTMLHtmlElement) => { | |
2 | 2 | const isFullScreen = document.fullscreenElement |
3 | 3 | const currentDatkTheme = htmlName.getAttribute('data-theme') |
4 | 4 | |
5 | 5 | if (isFullScreen) { |
6 | - console.log('退出全屏') | |
7 | 6 | if (document.exitFullscreen) { |
8 | 7 | document.exitFullscreen() |
9 | - domName.style.background = '' | |
10 | 8 | } |
11 | 9 | } else { |
12 | - console.log('进入全屏') | |
13 | 10 | if (domName.requestFullscreen) { |
14 | 11 | domName.requestFullscreen() |
15 | 12 | domName.style.background = currentDatkTheme === 'light' ? 'white' : '#18181c' | ... | ... |