@utogether/udp-core 2.0.0-beta.1 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/{403-CTJDBjz7.js → 403-CxOqlq0f.js} +3 -3
  2. package/dist/403-WCboRvzZ-ZAPgYStl.js +65 -0
  3. package/dist/404-2V0Qi-d7-DkNwQggp.js +65 -0
  4. package/dist/{404-BFYkWIkQ.js → 404-xdB6lFeQ.js} +1 -1
  5. package/dist/500-BYfzvixf-CGpEieyQ.js +67 -0
  6. package/dist/{500-DGG3qadg.js → 500-C94bRK2S.js} +2 -2
  7. package/dist/AuthorityInfo-DBovfUjB-DpQwT9Q5.js +4 -0
  8. package/dist/{AuthorityInfo-ozZIo1Te.js → AuthorityInfo-Dy3b_nFN.js} +1 -1
  9. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DujerENw.js → AuthorityInfo.vue_vue_type_style_index_0_lang-Bh7IbcdY.js} +2 -2
  10. package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-D-l_Az3s-Cw7WmFxz.js +100 -0
  11. package/dist/AuthorityPanel-CRlAwbaI-G7pZXKdE.js +4 -0
  12. package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-DxhZjp1S-CJvk3pW8.js +114 -0
  13. package/dist/Company-B4vsXy2I-CkNCOqjJ.js +25 -0
  14. package/dist/{Company-6VJtwh23.js → Company-gKkfnhLt.js} +3 -3
  15. package/dist/{CompanyPanel-B2P488mq.js → CompanyPanel-BF5Pc35s.js} +7 -7
  16. package/dist/CompanyPanel-Czcx8Gyw-CvndXwB_.js +206 -0
  17. package/dist/DataSet-DT-rGICv-DaUfgbxk.js +147 -0
  18. package/dist/{Department-BnwoLEOC.js → Department-D0I3QVZe.js} +3 -3
  19. package/dist/Department-D0dVUrGC-C6HJcYI1.js +25 -0
  20. package/dist/{DepartmentPanel-CRrrmxtv.js → DepartmentPanel-2LHODgc7.js} +22 -22
  21. package/dist/DepartmentPanel-e91Lxr1j-BS_A-ILd.js +254 -0
  22. package/dist/{DesignPanel-CvbccgX2.js → DesignPanel-CtF3cAAQ.js} +1 -1
  23. package/dist/DesignPanel-DdFl_ohi-uCwFxcl1.js +4 -0
  24. package/dist/DesignPanel.vue_vue_type_style_index_0_lang-BACPrfUI-cC7yL0uY.js +1013 -0
  25. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-Dz2tUszs.js → DesignPanel.vue_vue_type_style_index_0_lang-BCYgwoVt.js} +3 -3
  26. package/dist/DictView-BzQLOf_P-DDicwdmM.js +111 -0
  27. package/dist/{DictView-Ce1LoVHh.js → DictView-H3V5hxg3.js} +1 -1
  28. package/dist/{InvOrganization-BwCFZO1X.js → InvOrganization-BiGLnbqe.js} +2 -2
  29. package/dist/InvOrganization-atbhw0CI-BABbVt9V.js +74 -0
  30. package/dist/Org-BW1YHG-Q-Cow7JWlD.js +39 -0
  31. package/dist/{Org-0hzs6b0R.js → Org-DQTCQHNY.js} +2 -2
  32. package/dist/Preview-DJtVsoq1-CCGidQjJ.js +48 -0
  33. package/dist/{Preview--DnEAhwh.js → Preview-DXaiis29.js} +1 -1
  34. package/dist/{ReportDefine-Cu983bTN.js → ReportDefine-BLh4CiER.js} +1 -1
  35. package/dist/ReportDefine-CNx_ob99-6NQAHK-Q.js +10 -0
  36. package/dist/ReportDesign-FbQ6yTJS-C1pPAUSp.js +165 -0
  37. package/dist/{ReportDesign-QsWXXgvo.js → ReportDesign-Ni1YxrLC.js} +7 -7
  38. package/dist/ReportQuery-C5gz8Lgd-Eu2cQmda.js +75 -0
  39. package/dist/{ReportQuery-BjKIIhPu.js → ReportQuery-C8G88_qF.js} +1 -1
  40. package/dist/ReportQueryFrom-C7scua5v-uHXWq8Gy.js +4 -0
  41. package/dist/{ReportQueryFrom-DIjBO6Fx.js → ReportQueryFrom-CuZKPtB4.js} +1 -1
  42. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-0T62cUMK.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BAn_siFW.js} +7 -7
  43. package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-DCbz67Wa-vK6r2uCl.js +178 -0
  44. package/dist/ReportTemplate-BDANdIWv-D_IGjR1w.js +161 -0
  45. package/dist/{ReportTemplate-2uk9tJcy.js → ReportTemplate-DFnDXWmx.js} +8 -8
  46. package/dist/{Role-_QP8QEaI.js → Role-BQ7hsfPn.js} +3 -3
  47. package/dist/Role-ByB0WbxW-5E8Mb148.js +25 -0
  48. package/dist/RoleAssign-DW6iC_0v-Bis61auk.js +26 -0
  49. package/dist/{RoleAssign-C2gkcmEQ.js → RoleAssign-UPCg2d4G.js} +3 -3
  50. package/dist/RolePanel-BM2MaQPU-CgcsbfaX.js +4 -0
  51. package/dist/{RolePanel-vnl_lXNY.js → RolePanel-C-mQ5XRq.js} +1 -1
  52. package/dist/RolePanel-ClQy8DBL-DARL4O-o.js +4 -0
  53. package/dist/{RolePanel-B8FPNGaA.js → RolePanel-CoSXOCZN.js} +1 -1
  54. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-Bc_Ao_PU-DMmxr2iI.js +132 -0
  55. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-bxHXrBYl.js → RolePanel.vue_vue_type_script_setup_true_lang-Bg-t2UhF.js} +7 -7
  56. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-BuQbYEEI.js → RolePanel.vue_vue_type_script_setup_true_lang-D-o7HYZ8.js} +8 -8
  57. package/dist/RolePanel.vue_vue_type_script_setup_true_lang-fthF1zkp-JsbQJoDy.js +154 -0
  58. package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-ByWIwajm-BsBf2Vs3.js +100 -0
  59. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-C6yZXBqB.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCsoxDfk.js} +1 -1
  60. package/dist/Staff-CuxzvhD9-D0KTcyRh.js +25 -0
  61. package/dist/{Staff-CHWrMIEb.js → Staff-D-CmvG1R.js} +3 -3
  62. package/dist/StaffInfo-CY7gUICu-EZUhUwIp.js +4 -0
  63. package/dist/{StaffInfo-Cpq2eayz.js → StaffInfo-Idhvuc6e.js} +1 -1
  64. package/dist/StaffInfo.vue_vue_type_script_setup_true_lang-Dd8gtQz8-Dlkt-eCn.js +108 -0
  65. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-BVCjF2i1.js → StaffInfo.vue_vue_type_script_setup_true_lang-MUGKjnHU.js} +1 -1
  66. package/dist/{StaffPanel-D2BMXt5p.js → StaffPanel-CDDmAYE5.js} +1 -1
  67. package/dist/StaffPanel-CwqG0_xr-CrvzLJoc.js +4 -0
  68. package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-B6jAGo-g.js → StaffPanel.vue_vue_type_script_setup_true_lang-Bdilqbee.js} +42 -42
  69. package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-DCdBy8Hu-BXrueqi0.js +143 -0
  70. package/dist/SysUser-9Q2UJWhi-DprWXFlR.js +15 -0
  71. package/dist/{SysUser-om6H1BeC.js → SysUser-a-j5bppr.js} +2 -2
  72. package/dist/{SysUserPanel-CH0HPP7h.js → SysUserPanel-6V232wwB.js} +1 -1
  73. package/dist/SysUserPanel-bJy69O7x-BJtBgFEs.js +4 -0
  74. package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-Dpl13ee0.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BOtHuMVy.js} +2 -2
  75. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-DUPFqgz3-BSqRCMen.js +356 -0
  76. package/dist/{SystemMenu-BkG_DKxA.js → SystemMenu-BnVeOSOQ.js} +7 -7
  77. package/dist/SystemMenu-DGOAolc1-CJSLHP8i.js +156 -0
  78. package/dist/UserInfo-CKoOHkAM-DDWp0I_U.js +4 -0
  79. package/dist/{UserInfo-D9croxUe.js → UserInfo-Cax9b2nw.js} +1 -1
  80. package/dist/UserInfo.vue_vue_type_style_index_0_lang-BaT53SSu-DsNaAomO.js +160 -0
  81. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-DLIP8xpN.js → UserInfo.vue_vue_type_style_index_0_lang-D-cw11i9.js} +2 -2
  82. package/dist/await-to-js.es5-Bv3Eu4mi-UCggJjes.js +10 -0
  83. package/dist/await-to-js.es5-Bv3Eu4mi.js +10 -0
  84. package/dist/childView-0YZQ6GBn-CEqg7k5d.js +4 -0
  85. package/dist/{childView-BY_Ip-l1.js → childView-DKG3eZo8.js} +1 -1
  86. package/dist/childView-DKkgi3yo-D47ft-vi.js +4 -0
  87. package/dist/{childView-CHp_TueS.js → childView-siumuBz0.js} +1 -1
  88. package/dist/childView.vue_vue_type_style_index_0_lang-ABMrGInv-ClOdE_sa.js +143 -0
  89. package/dist/{childView.vue_vue_type_style_index_0_lang-BNHbDRjt.js → childView.vue_vue_type_style_index_0_lang-CUfXDS1q.js} +8 -8
  90. package/dist/{childView.vue_vue_type_style_index_0_lang-CbjGf7Z7.js → childView.vue_vue_type_style_index_0_lang-CW3EbAmW.js} +8 -8
  91. package/dist/childView.vue_vue_type_style_index_0_lang-CaW106ve-CClTM8PK.js +180 -0
  92. package/dist/{code-rule-Ce6yWqCq.js → code-rule-Dtoree6F.js} +2 -2
  93. package/dist/code-rule-wQyfgpNL-C4evD4Co.js +148 -0
  94. package/dist/core.es.js +10 -10
  95. package/dist/cron-task-C-kryDtd-C0NuGZCe.js +135 -0
  96. package/dist/{cron-task-DziaH0rI.js → cron-task-GSRgA7S5.js} +2 -2
  97. package/dist/flow-task-B07st2aD-CgQvagSQ.js +10 -0
  98. package/dist/frameView-BOGA3ezf-QoSxzmSQ.js +44 -0
  99. package/dist/{frameView-DNeCVQaY.js → frameView-Cy6wxW0K.js} +1 -1
  100. package/dist/{index-BabfUVv_.js → index-Dc7xWMiC.js} +1057 -1033
  101. package/dist/layout-home-3Dy4onl4.js +228 -0
  102. package/dist/layout-home-CYHksXN_-Basy-3IH.js +228 -0
  103. package/dist/layoutView-BaRvAbIa-xVgfqspc.js +3302 -0
  104. package/dist/{layoutView-12Mlp9A2.js → layoutView-DMjNscJ-.js} +8 -8
  105. package/dist/log-in-Cx1dGik8-BVeEHeZ8.js +117 -0
  106. package/dist/{log-in-1NGaA5OM.js → log-in-VAG6Cvcx.js} +8 -8
  107. package/dist/log-out-COYdxrNC-ftopGZdE.js +130 -0
  108. package/dist/{log-out-B8_atGcQ.js → log-out-DZGaMCjC.js} +4 -4
  109. package/dist/{login-5dydO6GR.js → login-CqVMdNHs.js} +16 -16
  110. package/dist/login-Dg9ofNS8-Bocp1XMA.js +241 -0
  111. package/dist/login-log-DJBGJVV0-AoOyj0jD.js +70 -0
  112. package/dist/lov-view-C0T5prk8-B2DBmn55.js +97 -0
  113. package/dist/{lov-view-DPvGUu3h.js → lov-view-Cc68_28B.js} +7 -7
  114. package/dist/{menuInfo-DVADYfEK.js → menuInfo-BIrIaJlH.js} +1 -1
  115. package/dist/menuInfo-BZJ_q7bz-Drho-_QC.js +4 -0
  116. package/dist/menuInfo.vue_vue_type_style_index_0_lang-BA8xjUo3-BCZ1wipf.js +363 -0
  117. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-DgsifDrm.js → menuInfo.vue_vue_type_style_index_0_lang-DlE4w35X.js} +2 -2
  118. package/dist/{pda-app-BZXs-2BQ.js → pda-app-DnjphrRS.js} +9 -9
  119. package/dist/pda-app-m9hsppHo-B4xyja1o.js +710 -0
  120. package/dist/redirect-BqegffKC-CBCIuqmz.js +15 -0
  121. package/dist/resource-C6KEIXu--B_ddyecm.js +97 -0
  122. package/dist/{resource-BZA9NFKc.js → resource-DISgPDM7.js} +4 -4
  123. package/dist/su-welcome-BjbuSrBZ.js +49424 -0
  124. package/dist/su-welcome-CYYy-dzr-D3RKPoB0.js +42089 -0
  125. package/dist/sys-config-DCjJGtht-DARDjlrt.js +370 -0
  126. package/dist/{sys-config-DQmNjWH4.js → sys-config-Yc9vh1t1.js} +13 -13
  127. package/dist/udp-core.css +1 -1
  128. package/dist/utogether-MlnyYtNS-CGgjFNPS.js +4 -0
  129. package/package.json +5 -2
  130. package/src/App.vue +71 -71
  131. package/src/components/udp/content/index.vue +88 -88
  132. package/src/components/udp/form-upload/form-upload.vue +492 -492
  133. package/src/components/udp/grid/index.vue +524 -524
  134. package/src/components/udp/index.ts +6 -6
  135. package/src/components/udp/ut-stamp-badge/index.vue +271 -271
  136. package/src/components/udp/utils.ts +408 -408
  137. package/src/layout/components/lay-content/index.vue +136 -136
  138. package/src/layout/components/lay-search/components/SearchModal.vue +181 -189
  139. package/src/layout/components/lay-setting/index.vue +503 -503
  140. package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -101
  141. package/src/layout/components/lay-tag/index.vue +598 -598
  142. package/src/layout/hooks/useNav.ts +176 -176
  143. package/src/layout/hooks/useTag.ts +227 -227
  144. package/src/layout/layoutView.vue +216 -216
  145. package/src/layout/types.ts +93 -93
  146. package/src/main.ts +111 -112
  147. package/src/plugins/i18n/zh.ts +1 -0
  148. package/src/plugins/vxe-table/index.ts +116 -116
  149. package/src/plugins/vxe-table/render.tsx +968 -968
  150. package/src/router/index.ts +187 -187
  151. package/src/router/modules/home.ts +32 -32
  152. package/src/router/utils.ts +420 -420
  153. package/src/store/modules/epTheme.ts +48 -48
  154. package/src/style/vxetable.scss +364 -356
  155. package/src/utils/dataFormat/index.ts +222 -222
  156. package/src/utils/lifecycle.ts +39 -39
  157. package/src/views/organization/department/DepartmentPanel.vue +303 -303
  158. package/src/views/organization/staff/StaffInfo.vue +127 -127
  159. package/src/views/organization/staff/StaffPanel.vue +3 -3
  160. package/src/views/system/layout/layout-home.vue +45 -7
  161. package/src/views/system/menu/AuthorityPanel.vue +141 -141
  162. package/src/views/system/menu/SystemMenu.vue +194 -194
  163. package/src/views/system/menu/menuInfo.vue +1 -1
  164. package/src/views/system/sysUser/SysUserPanel.vue +363 -363
  165. package/src/views/udev/coderule/code-rule.vue +132 -132
  166. package/src/views/udev/dict/DictView.vue +118 -118
  167. package/src/views/udev/dict/childView.vue +184 -184
  168. package/src/views/udev/lov/childView.vue +174 -174
  169. package/src/views/uhome/components/common-menu.vue +118 -0
  170. package/src/views/uhome/components/dynamic-component.vue +66 -0
  171. package/src/views/uhome/components/home-todo.vue +170 -0
  172. package/src/views/uhome/components/menu-favorite.vue +315 -315
  173. package/src/views/uhome/dynamic-card.vue +18 -19
  174. package/src/views/uhome/su-welcome.vue +46 -116
  175. package/src/views/ulogin/login.vue +336 -336
  176. package/src/views/upms/interface/log-in.vue +100 -100
  177. package/src/views/upms/interface/log-out.vue +104 -104
  178. package/src/views/upms/user/login-log.vue +54 -54
  179. package/types/global.d.ts +232 -232
  180. package/dist/await-to-js.es5-BtRbN2QH.js +0 -10
  181. package/dist/layout-home-Cis1KlEr.js +0 -195
  182. package/dist/su-welcome-BXe6Cdp3.js +0 -580
@@ -1,503 +1,503 @@
1
- <script setup lang="ts">
2
- import { reactive, ref, unref, watch, computed, nextTick, onUnmounted, onBeforeMount } from 'vue';
3
- import { templateRef } from '@vueuse/core';
4
- import { useI18n } from 'vue-i18n';
5
- import { useDark, useGlobal, useDebounce } from '@utogether/utils';
6
- import panel from '../lay-panel/index.vue';
7
- import { emitter } from '../../../utils/mitt';
8
- import { useAppStoreHook } from '../../../store/modules/app';
9
- import { useMultiTagsStoreHook } from '../../../store/modules/multiTags';
10
- import { useDataThemeChange } from '../../hooks/useDataThemeChange';
11
- import { useNav } from '../../hooks/useNav';
12
- import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
13
- import dayIcon from '../../../assets/svg/day.svg?component';
14
- import darkIcon from '../../../assets/svg/dark.svg?component';
15
- import systemIcon from '../../../assets/svg/system.svg?component';
16
-
17
- interface IThemeOption {
18
- label: string;
19
- icon: any;
20
- theme: string;
21
- value: number;
22
- iconAttrs: { fill: string };
23
- }
24
-
25
- const { device } = useNav();
26
- const { t } = useI18n();
27
- const { isDark } = useDark();
28
- const { $storage } = useGlobal();
29
-
30
- const mixRef = templateRef<HTMLElement | null>('mixRef', null);
31
- const verticalRef = templateRef<HTMLElement | null>('verticalRef', null);
32
- const horizontalRef = templateRef<HTMLElement | null>('horizontalRef', null);
33
-
34
- const { dataTheme, overallStyle, layoutTheme, themeColors, toggleClass, dataThemeChange, setLayoutThemeColor } =
35
- useDataThemeChange();
36
-
37
- /* body添加layout属性,作用于src/style/sidebar.scss */
38
- if (unref(layoutTheme)) {
39
- const layout = unref(layoutTheme).layout;
40
- const theme = unref(layoutTheme).theme;
41
- document.documentElement.setAttribute('data-theme', theme);
42
- setLayoutModel(layout);
43
- }
44
-
45
- /** 默认灵动模式 */
46
- const markValue = ref($storage.configure?.showModel ?? 'smart');
47
-
48
- const logoVal = ref($storage.configure?.showLogo ?? true);
49
-
50
- const settings = reactive({
51
- greyVal: $storage.configure.grey,
52
- weakVal: $storage.configure.weak,
53
- tabsVal: $storage.configure.hideTabs,
54
- showLogo: $storage.configure.showLogo,
55
- showModel: $storage.configure.showModel,
56
- multiTagsCache: $storage.configure.multiTagsCache
57
- });
58
-
59
- const getThemeColorStyle = computed(() => {
60
- return color => {
61
- return { background: color };
62
- };
63
- });
64
-
65
- /** 当网页整体为暗色风格时不显示亮白色主题配色切换选项 */
66
- const showThemeColors = computed(() => {
67
- return themeColor => {
68
- return themeColor === 'light' && isDark.value ? false : true;
69
- };
70
- });
71
-
72
- function storageConfigureChange<T>(key: string, val: T): void {
73
- const storageConfigure = $storage.configure;
74
- storageConfigure[key] = val;
75
- $storage.configure = storageConfigure;
76
- }
77
-
78
- /** 灰色模式设置 */
79
- const greyChange = (value): void => {
80
- const htmlEl = document.querySelector('html');
81
- toggleClass(settings.greyVal, 'html-grey', htmlEl);
82
- storageConfigureChange('grey', value);
83
- };
84
-
85
- /** 色弱模式设置 */
86
- const weekChange = (value): void => {
87
- const htmlEl = document.querySelector('html');
88
- toggleClass(settings.weakVal, 'html-weakness', htmlEl);
89
- storageConfigureChange('weak', value);
90
- };
91
-
92
- /** 隐藏标签页设置 */
93
- const tagsChange = () => {
94
- const showVal = settings.tabsVal;
95
- storageConfigureChange('hideTabs', showVal);
96
- emitter.emit('tagViewsChange', showVal as unknown as string);
97
- };
98
-
99
- /** 标签页持久化设置 */
100
- const multiTagsCacheChange = () => {
101
- const multiTagsCache = settings.multiTagsCache;
102
- storageConfigureChange('multiTagsCache', multiTagsCache);
103
- useMultiTagsStoreHook().multiTagsCacheChange(multiTagsCache);
104
- };
105
-
106
- function onChange(value) {
107
- markValue.value = value;
108
- storageConfigureChange('showModel', value);
109
- emitter.emit('tagViewsShowModel', value);
110
- }
111
- /** 主题切换 */
112
- function onThemeChange(theme) {
113
- // dataTheme.value = !dataTheme.value;
114
- // dataThemeChange();
115
- theme === 1 && theme !== 2 ? (dataTheme.value = true) : (dataTheme.value = false);
116
- overallStyle.value = themeOptions.value[theme].theme;
117
- dataThemeChange(overallStyle.value);
118
- theme === 2 && watchSystemThemeChange();
119
- }
120
- /** 侧边栏Logo */
121
- function logoChange() {
122
- unref(logoVal) ? storageConfigureChange('showLogo', true) : storageConfigureChange('showLogo', false);
123
- emitter.emit('logoChange', unref(logoVal));
124
- }
125
-
126
- function setFalse(Doms): any {
127
- Doms.forEach(v => {
128
- toggleClass(false, 'is-select', unref(v));
129
- });
130
- }
131
-
132
- /** 主题色 激活选择项 */
133
- const getThemeColor = computed(() => {
134
- return current => {
135
- if (current === layoutTheme.value.theme && layoutTheme.value.theme !== 'light') {
136
- return '#fff';
137
- } else if (current === layoutTheme.value.theme && layoutTheme.value.theme === 'light') {
138
- return '#1d2b45';
139
- } else {
140
- return 'transparent';
141
- }
142
- };
143
- });
144
-
145
- const themeOptions = computed<IThemeOption[]>(() => {
146
- return [
147
- {
148
- label: t('message.udp.light'),
149
- icon: dayIcon,
150
- theme: 'light',
151
- value: 0,
152
- iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
153
- },
154
- {
155
- label: t('message.udp.dark'),
156
- icon: darkIcon,
157
- theme: 'dark',
158
- value: 1,
159
- iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
160
- },
161
- {
162
- label: '自动',
163
- icon: systemIcon,
164
- theme: 'system',
165
- value: 2,
166
- iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
167
- }
168
- ];
169
- });
170
-
171
- const markOptions = [
172
- { label: t('message.udp.smart'), value: 'smart' },
173
- { label: t('message.udp.card'), value: 'card' },
174
- { label: '丝滑', value: 'chrome' }
175
- ];
176
-
177
- /** 设置菜单布局 */
178
- function setLayoutModel(layout: string) {
179
- layoutTheme.value.layout = layout;
180
- window.document.body.setAttribute('layout', layout);
181
- window.document.body.setAttribute('layoutType', window.top === window.self ? 'normal' : 'iframe');
182
- $storage.layout = {
183
- layout,
184
- theme: layoutTheme.value.theme,
185
- darkMode: $storage.layout?.darkMode,
186
- sidebarStatus: $storage.layout?.sidebarStatus,
187
- epThemeColor: $storage.layout?.epThemeColor,
188
- themeColor: layoutTheme.value.theme,
189
- overallStyle: $storage.layout?.overallStyle
190
- };
191
- useAppStoreHook().setLayout(layout);
192
- }
193
-
194
- watch($storage, ({ layout }) => {
195
- switch (layout['layout']) {
196
- case 'vertical':
197
- toggleClass(true, 'is-select', unref(verticalRef));
198
- useDebounce(setFalse([horizontalRef]), 50);
199
- useDebounce(setFalse([mixRef]), 50);
200
- break;
201
- case 'horizontal':
202
- toggleClass(true, 'is-select', unref(horizontalRef));
203
- useDebounce(setFalse([verticalRef]), 50);
204
- useDebounce(setFalse([mixRef]), 50);
205
- break;
206
- case 'mix':
207
- toggleClass(true, 'is-select', unref(mixRef));
208
- useDebounce(setFalse([verticalRef]), 50);
209
- useDebounce(setFalse([horizontalRef]), 50);
210
- break;
211
- }
212
- });
213
-
214
- const mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');
215
-
216
- /** 根据操作系统主题设置平台主题模式 */
217
- function updateTheme() {
218
- if (overallStyle.value !== 'system') return;
219
- if (mediaQueryList.matches) {
220
- dataTheme.value = true;
221
- } else {
222
- dataTheme.value = false;
223
- }
224
- dataThemeChange(overallStyle.value);
225
- }
226
-
227
- function removeMatchMedia() {
228
- mediaQueryList.removeEventListener('change', updateTheme);
229
- }
230
-
231
- /** 监听操作系统主题改变 */
232
- function watchSystemThemeChange() {
233
- updateTheme();
234
- removeMatchMedia();
235
- mediaQueryList.addEventListener('change', updateTheme);
236
- }
237
-
238
- onBeforeMount(() => {
239
- /* 初始化项目配置 */
240
- nextTick(() => {
241
- watchSystemThemeChange();
242
- settings.greyVal && document.querySelector('html')?.classList.add('html-grey');
243
- settings.weakVal && document.querySelector('html')?.classList.add('html-weakness');
244
- settings.tabsVal && tagsChange();
245
- });
246
- });
247
-
248
- onUnmounted(() => removeMatchMedia);
249
- </script>
250
- <script lang="ts">
251
- export default { name: 'SettingPanel' };
252
- </script>
253
- <template>
254
- <panel>
255
- <div class="p-6">
256
- <p class="mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.pageStyle') }}</p>
257
- <el-segmented
258
- :model-value="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
259
- :options="themeOptions"
260
- @change="onThemeChange"
261
- >
262
- <template #default="{ item }">
263
- <div class="flex items-center gap-2 p-2">
264
- <component :is="useRenderIcon(item.icon)" />
265
- <span class="pl-1">{{ item.label }}</span>
266
- </div>
267
- </template>
268
- </el-segmented>
269
-
270
- <p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.theme') }}</p>
271
- <ul class="theme-color">
272
- <li
273
- v-for="(item, index) in themeColors"
274
- v-show="showThemeColors(item.themeColor)"
275
- :key="index"
276
- :style="getThemeColorStyle(item.color)"
277
- @click="setLayoutThemeColor(item.themeColor)"
278
- >
279
- <el-icon style="margin: 0.1em 0.1em 0 0" :size="17" :color="getThemeColor(item.themeColor)">
280
- <IconifyIconOffline icon="ri:check-line" />
281
- </el-icon>
282
- </li>
283
- </ul>
284
-
285
- <p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.navigationMode') }}</p>
286
- <ul class="udp-theme">
287
- <li
288
- ref="verticalRef"
289
- v-tippy="{
290
- content: '左侧菜单',
291
- zIndex: 41000
292
- }"
293
- :class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
294
- @click="setLayoutModel('vertical')"
295
- >
296
- <div />
297
- <div />
298
- </li>
299
- <li
300
- v-if="device !== 'mobile'"
301
- ref="horizontalRef"
302
- v-tippy="{
303
- content: '顶部菜单',
304
- zIndex: 41000
305
- }"
306
- :class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
307
- @click="setLayoutModel('horizontal')"
308
- >
309
- <div />
310
- <div />
311
- </li>
312
- <li
313
- v-if="device !== 'mobile'"
314
- ref="mixRef"
315
- v-tippy="{
316
- content: '混合菜单',
317
- zIndex: 41000
318
- }"
319
- :class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
320
- @click="setLayoutModel('mix')"
321
- >
322
- <div />
323
- <div />
324
- </li>
325
- </ul>
326
-
327
- <p class="mt-5 mb-3 text-base font-medium dark:text-white">{{ $t('message.udp.tagStyle') }}</p>
328
- <el-segmented :model-value="markValue" :options="markOptions" @change="onChange" />
329
-
330
- <p class="mt-5 mb-1 text-base font-medium dark:text-white">界面显示</p>
331
- <ul class="setting">
332
- <li>
333
- <span class="dark:text-white">灰色模式</span>
334
- <el-switch
335
- v-model="settings.greyVal"
336
- inline-prompt
337
- active-text="开"
338
- inactive-text="关"
339
- @change="greyChange"
340
- />
341
- </li>
342
- <li>
343
- <span class="dark:text-white">色弱模式</span>
344
- <el-switch
345
- v-model="settings.weakVal"
346
- inline-prompt
347
- active-text="开"
348
- inactive-text="关"
349
- @change="weekChange"
350
- />
351
- </li>
352
- <li>
353
- <span class="dark:text-white">隐藏标签页</span>
354
- <el-switch
355
- v-model="settings.tabsVal"
356
- inline-prompt
357
- active-text="开"
358
- inactive-text="关"
359
- @change="tagsChange"
360
- />
361
- </li>
362
- <li>
363
- <span class="dark:text-white">Logo</span>
364
- <el-switch
365
- v-model="logoVal"
366
- inline-prompt
367
- :active-value="true"
368
- :inactive-value="false"
369
- active-text="开"
370
- inactive-text="关"
371
- @change="logoChange"
372
- />
373
- </li>
374
- <li>
375
- <span class="dark:text-white">页签持久化</span>
376
- <el-switch
377
- v-model="settings.multiTagsCache"
378
- inline-prompt
379
- active-text="开"
380
- inactive-text="关"
381
- @change="multiTagsCacheChange"
382
- />
383
- </li>
384
- </ul>
385
- </div>
386
- </panel>
387
- </template>
388
-
389
- <style lang="scss" scoped>
390
- ::v-deep(.el-divider__text) {
391
- font-size: 16px;
392
- font-weight: 700;
393
- }
394
-
395
- ::v-deep(.el-switch__core) {
396
- --el-switch-off-color: var(--udp-switch-off-color);
397
-
398
- min-width: 36px;
399
- height: 18px;
400
- }
401
-
402
- ::v-deep(.el-switch__core .el-switch__action) {
403
- height: 14px;
404
- }
405
-
406
- .theme-color {
407
- height: 20px;
408
-
409
- li {
410
- float: left;
411
- height: 20px;
412
- margin-right: 8px;
413
- cursor: pointer;
414
- border-radius: 4px;
415
-
416
- &:nth-child(2) {
417
- border: 1px solid #ddd;
418
- }
419
- }
420
- }
421
-
422
- .udp-theme {
423
- display: flex;
424
- gap: 12px;
425
-
426
- li {
427
- position: relative;
428
- width: 46px;
429
- height: 36px;
430
- overflow: hidden;
431
- cursor: pointer;
432
- background: #f0f2f5;
433
- border-radius: 4px;
434
- box-shadow: 0 1px 2.5px 0 rgb(0 0 0 / 18%);
435
-
436
- &:nth-child(1) {
437
- div {
438
- &:nth-child(1) {
439
- width: 30%;
440
- height: 100%;
441
- background: #1b2a47;
442
- }
443
-
444
- &:nth-child(2) {
445
- position: absolute;
446
- top: 0;
447
- right: 0;
448
- width: 70%;
449
- height: 30%;
450
- background: #fff;
451
- box-shadow: 0 0 1px #888;
452
- }
453
- }
454
- }
455
-
456
- &:nth-child(2) {
457
- div {
458
- &:nth-child(1) {
459
- width: 100%;
460
- height: 30%;
461
- background: #1b2a47;
462
- box-shadow: 0 0 1px #888;
463
- }
464
- }
465
- }
466
-
467
- &:nth-child(3) {
468
- div {
469
- &:nth-child(1) {
470
- width: 100%;
471
- height: 30%;
472
- background: #1b2a47;
473
- box-shadow: 0 0 1px #888;
474
- }
475
-
476
- &:nth-child(2) {
477
- position: absolute;
478
- bottom: 0;
479
- left: 0;
480
- width: 30%;
481
- height: 70%;
482
- background: #fff;
483
- box-shadow: 0 0 1px #888;
484
- }
485
- }
486
- }
487
- }
488
- }
489
-
490
- .is-select {
491
- border: 2px solid var(--el-color-primary);
492
- }
493
-
494
- .setting {
495
- li {
496
- display: flex;
497
- align-items: center;
498
- justify-content: space-between;
499
- padding: 4px 0;
500
- font-size: 14px;
501
- }
502
- }
503
- </style>
1
+ <script setup lang="ts">
2
+ import { reactive, ref, unref, watch, computed, nextTick, onUnmounted, onBeforeMount } from 'vue';
3
+ import { templateRef } from '@vueuse/core';
4
+ import { useI18n } from 'vue-i18n';
5
+ import { useDark, useGlobal, useDebounce } from '@utogether/utils';
6
+ import panel from '../lay-panel/index.vue';
7
+ import { emitter } from '../../../utils/mitt';
8
+ import { useAppStoreHook } from '../../../store/modules/app';
9
+ import { useMultiTagsStoreHook } from '../../../store/modules/multiTags';
10
+ import { useDataThemeChange } from '../../hooks/useDataThemeChange';
11
+ import { useNav } from '../../hooks/useNav';
12
+ import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
13
+ import dayIcon from '../../../assets/svg/day.svg?component';
14
+ import darkIcon from '../../../assets/svg/dark.svg?component';
15
+ import systemIcon from '../../../assets/svg/system.svg?component';
16
+
17
+ interface IThemeOption {
18
+ label: string;
19
+ icon: any;
20
+ theme: string;
21
+ value: number;
22
+ iconAttrs: { fill: string };
23
+ }
24
+
25
+ const { device } = useNav();
26
+ const { t } = useI18n();
27
+ const { isDark } = useDark();
28
+ const { $storage } = useGlobal();
29
+
30
+ const mixRef = templateRef<HTMLElement | null>('mixRef', null);
31
+ const verticalRef = templateRef<HTMLElement | null>('verticalRef', null);
32
+ const horizontalRef = templateRef<HTMLElement | null>('horizontalRef', null);
33
+
34
+ const { dataTheme, overallStyle, layoutTheme, themeColors, toggleClass, dataThemeChange, setLayoutThemeColor } =
35
+ useDataThemeChange();
36
+
37
+ /* body添加layout属性,作用于src/style/sidebar.scss */
38
+ if (unref(layoutTheme)) {
39
+ const layout = unref(layoutTheme).layout;
40
+ const theme = unref(layoutTheme).theme;
41
+ document.documentElement.setAttribute('data-theme', theme);
42
+ setLayoutModel(layout);
43
+ }
44
+
45
+ /** 默认灵动模式 */
46
+ const markValue = ref($storage.configure?.showModel ?? 'smart');
47
+
48
+ const logoVal = ref($storage.configure?.showLogo ?? true);
49
+
50
+ const settings = reactive({
51
+ greyVal: $storage.configure.grey,
52
+ weakVal: $storage.configure.weak,
53
+ tabsVal: $storage.configure.hideTabs,
54
+ showLogo: $storage.configure.showLogo,
55
+ showModel: $storage.configure.showModel,
56
+ multiTagsCache: $storage.configure.multiTagsCache
57
+ });
58
+
59
+ const getThemeColorStyle = computed(() => {
60
+ return color => {
61
+ return { background: color };
62
+ };
63
+ });
64
+
65
+ /** 当网页整体为暗色风格时不显示亮白色主题配色切换选项 */
66
+ const showThemeColors = computed(() => {
67
+ return themeColor => {
68
+ return themeColor === 'light' && isDark.value ? false : true;
69
+ };
70
+ });
71
+
72
+ function storageConfigureChange<T>(key: string, val: T): void {
73
+ const storageConfigure = $storage.configure;
74
+ storageConfigure[key] = val;
75
+ $storage.configure = storageConfigure;
76
+ }
77
+
78
+ /** 灰色模式设置 */
79
+ const greyChange = (value): void => {
80
+ const htmlEl = document.querySelector('html');
81
+ toggleClass(settings.greyVal, 'html-grey', htmlEl);
82
+ storageConfigureChange('grey', value);
83
+ };
84
+
85
+ /** 色弱模式设置 */
86
+ const weekChange = (value): void => {
87
+ const htmlEl = document.querySelector('html');
88
+ toggleClass(settings.weakVal, 'html-weakness', htmlEl);
89
+ storageConfigureChange('weak', value);
90
+ };
91
+
92
+ /** 隐藏标签页设置 */
93
+ const tagsChange = () => {
94
+ const showVal = settings.tabsVal;
95
+ storageConfigureChange('hideTabs', showVal);
96
+ emitter.emit('tagViewsChange', showVal as unknown as string);
97
+ };
98
+
99
+ /** 标签页持久化设置 */
100
+ const multiTagsCacheChange = () => {
101
+ const multiTagsCache = settings.multiTagsCache;
102
+ storageConfigureChange('multiTagsCache', multiTagsCache);
103
+ useMultiTagsStoreHook().multiTagsCacheChange(multiTagsCache);
104
+ };
105
+
106
+ function onChange(value) {
107
+ markValue.value = value;
108
+ storageConfigureChange('showModel', value);
109
+ emitter.emit('tagViewsShowModel', value);
110
+ }
111
+ /** 主题切换 */
112
+ function onThemeChange(theme) {
113
+ // dataTheme.value = !dataTheme.value;
114
+ // dataThemeChange();
115
+ theme === 1 && theme !== 2 ? (dataTheme.value = true) : (dataTheme.value = false);
116
+ overallStyle.value = themeOptions.value[theme].theme;
117
+ dataThemeChange(overallStyle.value);
118
+ theme === 2 && watchSystemThemeChange();
119
+ }
120
+ /** 侧边栏Logo */
121
+ function logoChange() {
122
+ unref(logoVal) ? storageConfigureChange('showLogo', true) : storageConfigureChange('showLogo', false);
123
+ emitter.emit('logoChange', unref(logoVal));
124
+ }
125
+
126
+ function setFalse(Doms): any {
127
+ Doms.forEach(v => {
128
+ toggleClass(false, 'is-select', unref(v));
129
+ });
130
+ }
131
+
132
+ /** 主题色 激活选择项 */
133
+ const getThemeColor = computed(() => {
134
+ return current => {
135
+ if (current === layoutTheme.value.theme && layoutTheme.value.theme !== 'light') {
136
+ return '#fff';
137
+ } else if (current === layoutTheme.value.theme && layoutTheme.value.theme === 'light') {
138
+ return '#1d2b45';
139
+ } else {
140
+ return 'transparent';
141
+ }
142
+ };
143
+ });
144
+
145
+ const themeOptions = computed<IThemeOption[]>(() => {
146
+ return [
147
+ {
148
+ label: t('message.udp.light'),
149
+ icon: dayIcon,
150
+ theme: 'light',
151
+ value: 0,
152
+ iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
153
+ },
154
+ {
155
+ label: t('message.udp.dark'),
156
+ icon: darkIcon,
157
+ theme: 'dark',
158
+ value: 1,
159
+ iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
160
+ },
161
+ {
162
+ label: '自动',
163
+ icon: systemIcon,
164
+ theme: 'system',
165
+ value: 2,
166
+ iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
167
+ }
168
+ ];
169
+ });
170
+
171
+ const markOptions = [
172
+ { label: t('message.udp.smart'), value: 'smart' },
173
+ { label: t('message.udp.card'), value: 'card' },
174
+ { label: '丝滑', value: 'chrome' }
175
+ ];
176
+
177
+ /** 设置菜单布局 */
178
+ function setLayoutModel(layout: string) {
179
+ layoutTheme.value.layout = layout;
180
+ window.document.body.setAttribute('layout', layout);
181
+ window.document.body.setAttribute('layoutType', window.top === window.self ? 'normal' : 'iframe');
182
+ $storage.layout = {
183
+ layout,
184
+ theme: layoutTheme.value.theme,
185
+ darkMode: $storage.layout?.darkMode,
186
+ sidebarStatus: $storage.layout?.sidebarStatus,
187
+ epThemeColor: $storage.layout?.epThemeColor,
188
+ themeColor: layoutTheme.value.theme,
189
+ overallStyle: $storage.layout?.overallStyle
190
+ };
191
+ useAppStoreHook().setLayout(layout);
192
+ }
193
+
194
+ watch($storage, ({ layout }) => {
195
+ switch (layout['layout']) {
196
+ case 'vertical':
197
+ toggleClass(true, 'is-select', unref(verticalRef));
198
+ useDebounce(setFalse([horizontalRef]), 50);
199
+ useDebounce(setFalse([mixRef]), 50);
200
+ break;
201
+ case 'horizontal':
202
+ toggleClass(true, 'is-select', unref(horizontalRef));
203
+ useDebounce(setFalse([verticalRef]), 50);
204
+ useDebounce(setFalse([mixRef]), 50);
205
+ break;
206
+ case 'mix':
207
+ toggleClass(true, 'is-select', unref(mixRef));
208
+ useDebounce(setFalse([verticalRef]), 50);
209
+ useDebounce(setFalse([horizontalRef]), 50);
210
+ break;
211
+ }
212
+ });
213
+
214
+ const mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');
215
+
216
+ /** 根据操作系统主题设置平台主题模式 */
217
+ function updateTheme() {
218
+ if (overallStyle.value !== 'system') return;
219
+ if (mediaQueryList.matches) {
220
+ dataTheme.value = true;
221
+ } else {
222
+ dataTheme.value = false;
223
+ }
224
+ dataThemeChange(overallStyle.value);
225
+ }
226
+
227
+ function removeMatchMedia() {
228
+ mediaQueryList.removeEventListener('change', updateTheme);
229
+ }
230
+
231
+ /** 监听操作系统主题改变 */
232
+ function watchSystemThemeChange() {
233
+ updateTheme();
234
+ removeMatchMedia();
235
+ mediaQueryList.addEventListener('change', updateTheme);
236
+ }
237
+
238
+ onBeforeMount(() => {
239
+ /* 初始化项目配置 */
240
+ nextTick(() => {
241
+ watchSystemThemeChange();
242
+ settings.greyVal && document.querySelector('html')?.classList.add('html-grey');
243
+ settings.weakVal && document.querySelector('html')?.classList.add('html-weakness');
244
+ settings.tabsVal && tagsChange();
245
+ });
246
+ });
247
+
248
+ onUnmounted(() => removeMatchMedia);
249
+ </script>
250
+ <script lang="ts">
251
+ export default { name: 'SettingPanel' };
252
+ </script>
253
+ <template>
254
+ <panel>
255
+ <div class="p-6">
256
+ <p class="mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.pageStyle') }}</p>
257
+ <el-segmented
258
+ :model-value="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
259
+ :options="themeOptions"
260
+ @change="onThemeChange"
261
+ >
262
+ <template #default="{ item }">
263
+ <div class="flex items-center gap-2 p-2">
264
+ <component :is="useRenderIcon(item.icon)" />
265
+ <span class="pl-1">{{ item.label }}</span>
266
+ </div>
267
+ </template>
268
+ </el-segmented>
269
+
270
+ <p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.theme') }}</p>
271
+ <ul class="theme-color">
272
+ <li
273
+ v-for="(item, index) in themeColors"
274
+ v-show="showThemeColors(item.themeColor)"
275
+ :key="index"
276
+ :style="getThemeColorStyle(item.color)"
277
+ @click="setLayoutThemeColor(item.themeColor)"
278
+ >
279
+ <el-icon style="margin: 0.1em 0.1em 0 0" :size="17" :color="getThemeColor(item.themeColor)">
280
+ <IconifyIconOffline icon="ri:check-line" />
281
+ </el-icon>
282
+ </li>
283
+ </ul>
284
+
285
+ <p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.navigationMode') }}</p>
286
+ <ul class="udp-theme">
287
+ <li
288
+ ref="verticalRef"
289
+ v-tippy="{
290
+ content: '左侧菜单',
291
+ zIndex: 41000
292
+ }"
293
+ :class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
294
+ @click="setLayoutModel('vertical')"
295
+ >
296
+ <div />
297
+ <div />
298
+ </li>
299
+ <li
300
+ v-if="device !== 'mobile'"
301
+ ref="horizontalRef"
302
+ v-tippy="{
303
+ content: '顶部菜单',
304
+ zIndex: 41000
305
+ }"
306
+ :class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
307
+ @click="setLayoutModel('horizontal')"
308
+ >
309
+ <div />
310
+ <div />
311
+ </li>
312
+ <li
313
+ v-if="device !== 'mobile'"
314
+ ref="mixRef"
315
+ v-tippy="{
316
+ content: '混合菜单',
317
+ zIndex: 41000
318
+ }"
319
+ :class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
320
+ @click="setLayoutModel('mix')"
321
+ >
322
+ <div />
323
+ <div />
324
+ </li>
325
+ </ul>
326
+
327
+ <p class="mt-5 mb-3 text-base font-medium dark:text-white">{{ $t('message.udp.tagStyle') }}</p>
328
+ <el-segmented :model-value="markValue" :options="markOptions" @change="onChange" />
329
+
330
+ <p class="mt-5 mb-1 text-base font-medium dark:text-white">界面显示</p>
331
+ <ul class="setting">
332
+ <li>
333
+ <span class="dark:text-white">灰色模式</span>
334
+ <el-switch
335
+ v-model="settings.greyVal"
336
+ inline-prompt
337
+ active-text="开"
338
+ inactive-text="关"
339
+ @change="greyChange"
340
+ />
341
+ </li>
342
+ <li>
343
+ <span class="dark:text-white">色弱模式</span>
344
+ <el-switch
345
+ v-model="settings.weakVal"
346
+ inline-prompt
347
+ active-text="开"
348
+ inactive-text="关"
349
+ @change="weekChange"
350
+ />
351
+ </li>
352
+ <li>
353
+ <span class="dark:text-white">隐藏标签页</span>
354
+ <el-switch
355
+ v-model="settings.tabsVal"
356
+ inline-prompt
357
+ active-text="开"
358
+ inactive-text="关"
359
+ @change="tagsChange"
360
+ />
361
+ </li>
362
+ <li>
363
+ <span class="dark:text-white">Logo</span>
364
+ <el-switch
365
+ v-model="logoVal"
366
+ inline-prompt
367
+ :active-value="true"
368
+ :inactive-value="false"
369
+ active-text="开"
370
+ inactive-text="关"
371
+ @change="logoChange"
372
+ />
373
+ </li>
374
+ <li>
375
+ <span class="dark:text-white">页签持久化</span>
376
+ <el-switch
377
+ v-model="settings.multiTagsCache"
378
+ inline-prompt
379
+ active-text="开"
380
+ inactive-text="关"
381
+ @change="multiTagsCacheChange"
382
+ />
383
+ </li>
384
+ </ul>
385
+ </div>
386
+ </panel>
387
+ </template>
388
+
389
+ <style lang="scss" scoped>
390
+ ::v-deep(.el-divider__text) {
391
+ font-size: 16px;
392
+ font-weight: 700;
393
+ }
394
+
395
+ ::v-deep(.el-switch__core) {
396
+ --el-switch-off-color: var(--udp-switch-off-color);
397
+
398
+ min-width: 36px;
399
+ height: 18px;
400
+ }
401
+
402
+ ::v-deep(.el-switch__core .el-switch__action) {
403
+ height: 14px;
404
+ }
405
+
406
+ .theme-color {
407
+ height: 20px;
408
+
409
+ li {
410
+ float: left;
411
+ height: 20px;
412
+ margin-right: 8px;
413
+ cursor: pointer;
414
+ border-radius: 4px;
415
+
416
+ &:nth-child(2) {
417
+ border: 1px solid #ddd;
418
+ }
419
+ }
420
+ }
421
+
422
+ .udp-theme {
423
+ display: flex;
424
+ gap: 12px;
425
+
426
+ li {
427
+ position: relative;
428
+ width: 46px;
429
+ height: 36px;
430
+ overflow: hidden;
431
+ cursor: pointer;
432
+ background: #f0f2f5;
433
+ border-radius: 4px;
434
+ box-shadow: 0 1px 2.5px 0 rgb(0 0 0 / 18%);
435
+
436
+ &:nth-child(1) {
437
+ div {
438
+ &:nth-child(1) {
439
+ width: 30%;
440
+ height: 100%;
441
+ background: #1b2a47;
442
+ }
443
+
444
+ &:nth-child(2) {
445
+ position: absolute;
446
+ top: 0;
447
+ right: 0;
448
+ width: 70%;
449
+ height: 30%;
450
+ background: #fff;
451
+ box-shadow: 0 0 1px #888;
452
+ }
453
+ }
454
+ }
455
+
456
+ &:nth-child(2) {
457
+ div {
458
+ &:nth-child(1) {
459
+ width: 100%;
460
+ height: 30%;
461
+ background: #1b2a47;
462
+ box-shadow: 0 0 1px #888;
463
+ }
464
+ }
465
+ }
466
+
467
+ &:nth-child(3) {
468
+ div {
469
+ &:nth-child(1) {
470
+ width: 100%;
471
+ height: 30%;
472
+ background: #1b2a47;
473
+ box-shadow: 0 0 1px #888;
474
+ }
475
+
476
+ &:nth-child(2) {
477
+ position: absolute;
478
+ bottom: 0;
479
+ left: 0;
480
+ width: 30%;
481
+ height: 70%;
482
+ background: #fff;
483
+ box-shadow: 0 0 1px #888;
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
489
+
490
+ .is-select {
491
+ border: 2px solid var(--el-color-primary);
492
+ }
493
+
494
+ .setting {
495
+ li {
496
+ display: flex;
497
+ align-items: center;
498
+ justify-content: space-between;
499
+ padding: 4px 0;
500
+ font-size: 14px;
501
+ }
502
+ }
503
+ </style>