Showing
4 changed files
with
13 additions
and
16 deletions
@@ -31,7 +31,7 @@ import { isPreview } from '@/utils' | @@ -31,7 +31,7 @@ import { isPreview } from '@/utils' | ||
31 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' | 31 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' |
32 | import isObject from 'lodash/isObject' | 32 | import isObject from 'lodash/isObject' |
33 | import dataJson from './data.json' | 33 | import dataJson from './data.json' |
34 | -import { isFullScreen } from '../../utls/isFullScreen' | 34 | +import { useFullScreen } from '../../utls/fullScreen' |
35 | 35 | ||
36 | const props = defineProps({ | 36 | const props = defineProps({ |
37 | themeSetting: { | 37 | themeSetting: { |
@@ -68,9 +68,9 @@ const toolBoxOption = { | @@ -68,9 +68,9 @@ const toolBoxOption = { | ||
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', | 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 | onclick: () => { | 69 | onclick: () => { |
70 | const getEchartDom = vChartRef.value?.getDom() | 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,7 +30,7 @@ import { isPreview } from '@/utils' | ||
30 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' | 30 | import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components' |
31 | import isObject from 'lodash/isObject' | 31 | import isObject from 'lodash/isObject' |
32 | import dataJson from './data.json' | 32 | import dataJson from './data.json' |
33 | -import { isFullScreen } from '../../utls/isFullScreen' | 33 | +import { useFullScreen } from '../../utls/fullScreen' |
34 | 34 | ||
35 | const props = defineProps({ | 35 | const props = defineProps({ |
36 | themeSetting: { | 36 | themeSetting: { |
@@ -67,9 +67,9 @@ const toolBoxOption = { | @@ -67,9 +67,9 @@ const toolBoxOption = { | ||
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', | 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 | onclick: () => { | 68 | onclick: () => { |
69 | const getEchartDom = vChartRef.value?.getDom() | 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,7 +26,7 @@ import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } fr | ||
26 | import { useChartDataFetch } from '@/hooks' | 26 | import { useChartDataFetch } from '@/hooks' |
27 | import { isPreview, colorGradientCustomMerge } from '@/utils' | 27 | import { isPreview, colorGradientCustomMerge } from '@/utils' |
28 | import dataJson from './data.json' | 28 | import dataJson from './data.json' |
29 | -import { isFullScreen } from '../../utls/isFullScreen' | 29 | +import { useFullScreen } from '../../utls/fullScreen' |
30 | 30 | ||
31 | const props = defineProps({ | 31 | const props = defineProps({ |
32 | themeSetting: { | 32 | themeSetting: { |
@@ -61,9 +61,9 @@ const toolBoxOption = { | @@ -61,9 +61,9 @@ const toolBoxOption = { | ||
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', | 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 | onclick: () => { | 62 | onclick: () => { |
63 | const getEchartDom = vChartRef.value?.getDom() | 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 | const isFullScreen = document.fullscreenElement | 2 | const isFullScreen = document.fullscreenElement |
3 | const currentDatkTheme = htmlName.getAttribute('data-theme') | 3 | const currentDatkTheme = htmlName.getAttribute('data-theme') |
4 | 4 | ||
5 | if (isFullScreen) { | 5 | if (isFullScreen) { |
6 | - console.log('退出全屏') | ||
7 | if (document.exitFullscreen) { | 6 | if (document.exitFullscreen) { |
8 | document.exitFullscreen() | 7 | document.exitFullscreen() |
9 | - domName.style.background = '' | ||
10 | } | 8 | } |
11 | } else { | 9 | } else { |
12 | - console.log('进入全屏') | ||
13 | if (domName.requestFullscreen) { | 10 | if (domName.requestFullscreen) { |
14 | domName.requestFullscreen() | 11 | domName.requestFullscreen() |
15 | domName.style.background = currentDatkTheme === 'light' ? 'white' : '#18181c' | 12 | domName.style.background = currentDatkTheme === 'light' ? 'white' : '#18181c' |