Commit 0c28ffa8e6a93e8923b7d3a32292db8ae786242c

Authored by vben
1 parent bcab4b77

fix: fix fullscreen bg color not work (#75)

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