Commit 0c28ffa8e6a93e8923b7d3a32292db8ae786242c
1 parent
bcab4b77
fix: fix fullscreen bg color not work (#75)
Showing
8 changed files
with
44 additions
and
68 deletions
src/design/color.less
... | ... | @@ -10,34 +10,33 @@ |
10 | 10 | @iconify-bg-color: #5551; |
11 | 11 | |
12 | 12 | // ================================= |
13 | -// ==============边框颜色============ | |
13 | +// ==============border-color============ | |
14 | 14 | // ================================= |
15 | 15 | |
16 | -// 暗色-深 | |
16 | +// Dark-dark | |
17 | 17 | @border-color-dark: #b6b7b9; |
18 | 18 | |
19 | -// 暗色-浅 | |
19 | +// Dark-light | |
20 | 20 | @border-color-shallow-dark: #cececd; |
21 | 21 | |
22 | -// 亮色-深 | |
22 | +// Light-dark | |
23 | 23 | @border-color-light: #ebeef5; |
24 | 24 | |
25 | -// 亮色-浅 | |
25 | +// Light-light | |
26 | 26 | @border-color-shallow-light: #f2f6fc; |
27 | 27 | |
28 | 28 | // ================================= |
29 | 29 | // ==============message============== |
30 | 30 | // ================================= |
31 | -// 成功背景颜色 | |
31 | + | |
32 | +// success-bg-color | |
32 | 33 | @success-background-color: #f1f9ec; |
33 | -// 一般背景颜色 | |
34 | +// info-bg-color | |
34 | 35 | @info-background-color: #e8eff8; |
35 | -// 警告背景颜色 | |
36 | +// warn-bg-color | |
36 | 37 | @warning-background-color: #fdf6ed; |
37 | -// 危险背景颜色 | |
38 | +// danger-bg-color | |
38 | 39 | @danger-background-color: #fef0f0; |
39 | -// tag标签:失效 | |
40 | -@invalid-color: #909399; | |
41 | 40 | |
42 | 41 | // ================================= |
43 | 42 | // ==============bg color============ |
... | ... | @@ -59,6 +58,7 @@ |
59 | 58 | @header-light-bg-hover-color: #f6f6f6; |
60 | 59 | @header-light-desc-color: #7c8087; |
61 | 60 | @header-light-bottom-border-color: #eee; |
61 | + | |
62 | 62 | // ================================= |
63 | 63 | // ==============Menu============ |
64 | 64 | // ================================= |
... | ... | @@ -66,9 +66,9 @@ |
66 | 66 | // let -menu |
67 | 67 | @first-menu-item-dark-bg-color: #273352; |
68 | 68 | |
69 | -// 2级菜单黑暗背景色 | |
69 | +// Level 2 menu dark background color | |
70 | 70 | @sub-menu-item-dark-bg-color: #314268; |
71 | -// 3级菜单黑暗背景色 | |
71 | +// Level 3 menu dark background color | |
72 | 72 | @children-menu-item-dark-bg-color: #4f6088; |
73 | 73 | |
74 | 74 | // top-menu |
... | ... | @@ -87,6 +87,7 @@ |
87 | 87 | @tree-hover-background-color: #f5f7fa; |
88 | 88 | // tree item hover font color |
89 | 89 | @tree-hover-font-color: #f5f7fa; |
90 | + | |
90 | 91 | // ================================= |
91 | 92 | // ==============link============ |
92 | 93 | // ================================= |
... | ... | @@ -94,18 +95,19 @@ |
94 | 95 | @link-active-color: darken(@primary-color, 10%); |
95 | 96 | |
96 | 97 | // ================================= |
97 | -// ==============文本色-============= | |
98 | +// ==============Text color-============= | |
98 | 99 | // ================================= |
99 | 100 | |
100 | -// 主文本色 | |
101 | +// Main text color | |
101 | 102 | @text-color-base: #2c3a61; |
102 | -// 标注色 | |
103 | + | |
104 | +// Label color | |
103 | 105 | @text-color-call-out: #606266; |
104 | 106 | |
105 | -// 辅助说明信息色-深色 | |
107 | +// Auxiliary information color-dark | |
106 | 108 | @text-color-help-dark: #909399; |
107 | 109 | |
108 | -// 辅助说明信息色-浅色 | |
110 | +// Auxiliary information color-light color | |
109 | 111 | @text-color-help-light: #c0c4cc; |
110 | 112 | |
111 | 113 | // ================================= |
... | ... | @@ -135,7 +137,8 @@ |
135 | 137 | @button-cancel-color: @text-color-call-out; |
136 | 138 | @button-cancel-bg-color: @white; |
137 | 139 | @button-cancel-border-color: @border-color-shallow-dark; |
138 | -// 鼠标悬停 | |
140 | + | |
141 | +// Mouse over | |
139 | 142 | @button-cancel-hover-color: @primary-color; |
140 | 143 | @button-cancel-hover-bg-color: @white; |
141 | 144 | @button-cancel-hover-border-color: @primary-color; | ... | ... |
src/design/index.less
... | ... | @@ -13,6 +13,16 @@ |
13 | 13 | box-sizing: border-box; |
14 | 14 | } |
15 | 15 | |
16 | +// Background color setting in full screen state in each browser | |
17 | +::backdrop, | |
18 | +html, | |
19 | +*:fullscreen, | |
20 | +*:-webkit-full-screen, | |
21 | +*:-moz-full-screen { | |
22 | + z-index: 1; | |
23 | + background-color: #fff !important; | |
24 | +} | |
25 | + | |
16 | 26 | html, |
17 | 27 | body { |
18 | 28 | width: 100%; | ... | ... |
src/design/public.less
1 | -/* 滚动槽 */ | |
2 | 1 | ::-webkit-scrollbar { |
3 | 2 | width: 6px; |
4 | 3 | height: 6px; |
5 | 4 | } |
6 | 5 | |
7 | -// TODO 滚动条样式-待修改 | |
8 | 6 | ::-webkit-scrollbar-track { |
9 | 7 | background: rgba(0, 0, 0, 0.05); |
10 | 8 | } |
11 | 9 | |
12 | -/* 滚动条滑块 */ | |
13 | 10 | ::-webkit-scrollbar-thumb { |
14 | 11 | background: rgba(0, 0, 0, 0.2); |
15 | 12 | border-radius: 4px; | ... | ... |
src/design/reset.less
... | ... | @@ -6,7 +6,6 @@ |
6 | 6 | body { |
7 | 7 | width: 100%; |
8 | 8 | height: 100%; |
9 | - // overflow: hidden; | |
10 | 9 | |
11 | 10 | &.color-weak { |
12 | 11 | filter: invert(80%); |
... | ... | @@ -18,19 +17,13 @@ |
18 | 17 | } |
19 | 18 | } |
20 | 19 | |
21 | - // remove the clear button of a text input control in IE10+ | |
22 | 20 | input::-ms-clear, |
23 | 21 | input::-ms-reveal { |
24 | 22 | display: none; |
25 | 23 | } |
26 | 24 | |
27 | 25 | body { |
28 | - // 重置文本样式 | |
29 | 26 | .reset-text(); |
30 | - | |
31 | - // font-size: @--base-font-size; | |
32 | - // color: @--norm-text-color; | |
33 | - // background-color: @--norm-background-dark-color !important; | |
34 | 27 | } |
35 | 28 | |
36 | 29 | h1, | ... | ... |
src/hooks/event/useBreakpoint.ts
src/hooks/web/useApexCharts.ts
... | ... | @@ -25,12 +25,14 @@ export function useApexCharts(elRef: Ref<HTMLDivElement>) { |
25 | 25 | } |
26 | 26 | |
27 | 27 | tryOnUnmounted(() => { |
28 | - const chartInstance = unref(chartInstanceRef); | |
28 | + let chartInstance = unref(chartInstanceRef); | |
29 | 29 | if (!chartInstance) { |
30 | 30 | return; |
31 | 31 | } |
32 | - chartInstanceRef.value = null; | |
32 | + | |
33 | 33 | chartInstance.destroy(); |
34 | + chartInstanceRef.value = null; | |
35 | + chartInstance = null; | |
34 | 36 | }); |
35 | 37 | return { |
36 | 38 | setOptions, | ... | ... |
src/hooks/web/useFullScreen.ts
... | ... | @@ -15,35 +15,30 @@ type FSEPropName = |
15 | 15 | | 'msFullscreenElement' |
16 | 16 | | 'mozFullScreenElement' |
17 | 17 | | 'fullscreenElement'; |
18 | -type ONFSCPropName = 'onfullscreenchange' | 'onwebkitfullscreenchange' | 'MSFullscreenChange'; | |
19 | 18 | |
20 | 19 | export function useFullscreen( |
21 | 20 | target: Ref<Nullable<HTMLElement>> = ref(document.documentElement), |
22 | 21 | options?: FullscreenOptions |
23 | 22 | ) { |
24 | 23 | const isFullscreenRef = ref(false); |
25 | - const DOC_EL = document.documentElement; | |
24 | + const el = document.documentElement; | |
26 | 25 | let RFC_METHOD_NAME: RFSMethodName = 'requestFullscreen'; |
27 | 26 | let EFS_METHOD_NAME: EFSMethodName = 'exitFullscreen'; |
28 | 27 | let FSE_PROP_NAME: FSEPropName = 'fullscreenElement'; |
29 | - let ON_FSC_PROP_NAME: ONFSCPropName = 'onfullscreenchange'; | |
30 | 28 | |
31 | - if ('webkitRequestFullScreen' in DOC_EL) { | |
29 | + if ('webkitRequestFullScreen' in el) { | |
32 | 30 | RFC_METHOD_NAME = 'webkitRequestFullScreen'; |
33 | 31 | EFS_METHOD_NAME = 'webkitExitFullscreen'; |
34 | 32 | FSE_PROP_NAME = 'webkitFullscreenElement'; |
35 | - ON_FSC_PROP_NAME = 'onwebkitfullscreenchange'; | |
36 | - } else if ('msRequestFullscreen' in DOC_EL) { | |
33 | + } else if ('msRequestFullscreen' in el) { | |
37 | 34 | RFC_METHOD_NAME = 'msRequestFullscreen'; |
38 | 35 | EFS_METHOD_NAME = 'msExitFullscreen'; |
39 | 36 | FSE_PROP_NAME = 'msFullscreenElement'; |
40 | - ON_FSC_PROP_NAME = 'MSFullscreenChange'; | |
41 | - } else if ('mozRequestFullScreen' in DOC_EL) { | |
37 | + } else if ('mozRequestFullScreen' in el) { | |
42 | 38 | RFC_METHOD_NAME = 'mozRequestFullScreen'; |
43 | 39 | EFS_METHOD_NAME = 'mozCancelFullScreen'; |
44 | 40 | FSE_PROP_NAME = 'mozFullScreenElement'; |
45 | - // ON_FSC_PROP_NAME = 'onmozfullscreenchange'; | |
46 | - } else if (!('requestFullscreen' in DOC_EL)) { | |
41 | + } else if (!('requestFullscreen' in el)) { | |
47 | 42 | throw new Error('当前浏览器不支持Fullscreen API !'); |
48 | 43 | } |
49 | 44 | function enterFullscreen(): Promise<void> { |
... | ... | @@ -68,32 +63,8 @@ export function useFullscreen( |
68 | 63 | } |
69 | 64 | } |
70 | 65 | |
71 | - /** | |
72 | - * 当全屏/退出时触发 | |
73 | - */ | |
74 | - function watchFullscreen(callback: (isFull: boolean) => void) { | |
75 | - const cancel = () => { | |
76 | - const t = unref(target); | |
77 | - t && (t.onfullscreenchange = null); | |
78 | - }; | |
79 | - | |
80 | - const handler = () => { | |
81 | - callback(isFullscreen()); | |
82 | - }; | |
83 | - if (target.value) { | |
84 | - (target.value as any)[ON_FSC_PROP_NAME] = handler; | |
85 | - } | |
86 | - | |
87 | - return { | |
88 | - cancel, | |
89 | - }; | |
90 | - } | |
91 | - watchFullscreen((isFull: boolean) => { | |
92 | - isFullscreenRef.value = isFull; | |
93 | - }); | |
94 | - | |
95 | 66 | return { |
96 | - watchFullscreen, | |
67 | + // watchFullscreen, | |
97 | 68 | toggleFullscreen, |
98 | 69 | exitFullscreen, |
99 | 70 | isFullscreen, | ... | ... |
src/utils/helper/persistent.ts
... | ... | @@ -58,7 +58,7 @@ export function setSession(key: string, value: any, immediate = false) { |
58 | 58 | cacheStore.session[BASE_SESSION_CACHE_KEY][key] = value; |
59 | 59 | if (immediate) { |
60 | 60 | const cache = cacheStore.session; |
61 | - ls.set(BASE_SESSION_CACHE_KEY, cache); | |
61 | + ss.set(BASE_SESSION_CACHE_KEY, cache); | |
62 | 62 | } |
63 | 63 | } |
64 | 64 | ... | ... |