@pubinfo/module-rbac 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.
- package/package.json +53 -0
- package/src/api/modules/assist/gonggaofuwu.ts +109 -0
- package/src/api/modules/assist/index.ts +5 -0
- package/src/api/modules/assist/qunzujiekou.ts +95 -0
- package/src/api/modules/assist/quyujiekou.ts +97 -0
- package/src/api/modules/assist/typings.d.ts +364 -0
- package/src/api/modules/configData/heibaimingdanfuwu.ts +95 -0
- package/src/api/modules/configData/index.ts +5 -0
- package/src/api/modules/configData/typings.d.ts +347 -0
- package/src/api/modules/configData/xitongpeizhifuwu.ts +322 -0
- package/src/api/modules/configData/zidianfuwu.ts +151 -0
- package/src/api/modules/log/caozuorizhifuwu.ts +37 -0
- package/src/api/modules/log/denglurizhifuwu.ts +37 -0
- package/src/api/modules/log/index.ts +4 -0
- package/src/api/modules/log/typings.d.ts +179 -0
- package/src/api/modules/rbac/gangweijiekou.ts +93 -0
- package/src/api/modules/rbac/index.ts +13 -0
- package/src/api/modules/rbac/jiaosejiekou.ts +124 -0
- package/src/api/modules/rbac/pubJiaosezukongzhiqi.ts +113 -0
- package/src/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.ts +186 -0
- package/src/api/modules/rbac/typings.d.ts +2001 -0
- package/src/api/modules/rbac/yonghujiekou.ts +225 -0
- package/src/api/modules/rbac/yonghushoucangbiaojiekou.ts +93 -0
- package/src/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +72 -0
- package/src/api/modules/rbac/ziyuanjiekou.ts +223 -0
- package/src/api/modules/rbac/zuhuguanlijiekou.ts +91 -0
- package/src/api/modules/rbac/zuzhijiaosebiaokongzhiqi.ts +76 -0
- package/src/api/modules/rbac/zuzhijiekou.ts +171 -0
- package/src/api/request.ts +3 -0
- package/src/assets/icons/403.svg +1 -0
- package/src/assets/icons/403_dark.svg +1 -0
- package/src/assets/icons/404.svg +1 -0
- package/src/assets/icons/404_dark.svg +1 -0
- package/src/assets/icons/add-child.svg +1 -0
- package/src/assets/icons/authority.svg +1 -0
- package/src/assets/icons/authorize.svg +1 -0
- package/src/assets/icons/blacklist-disable.svg +1 -0
- package/src/assets/icons/blacklist-enable.svg +1 -0
- package/src/assets/icons/browser-360.svg +1 -0
- package/src/assets/icons/browser-chrome.svg +1 -0
- package/src/assets/icons/browser-edge.svg +1 -0
- package/src/assets/icons/browser-ie.svg +1 -0
- package/src/assets/icons/browser-other.svg +1 -0
- package/src/assets/icons/browser-qq.svg +1 -0
- package/src/assets/icons/browser-safari.svg +1 -0
- package/src/assets/icons/browser-uc.svg +1 -0
- package/src/assets/icons/change-org.svg +1 -0
- package/src/assets/icons/edit.svg +1 -0
- package/src/assets/icons/empty-data.svg +1 -0
- package/src/assets/icons/favorites.svg +1 -0
- package/src/assets/icons/icard.svg +1 -0
- package/src/assets/icons/icon_animation.svg +1 -0
- package/src/assets/icons/icon_breadcrumb.svg +1 -0
- package/src/assets/icons/icon_copyright.svg +1 -0
- package/src/assets/icons/icon_jt.svg +1 -0
- package/src/assets/icons/icon_layout.svg +1 -0
- package/src/assets/icons/icon_mainpage.svg +1 -0
- package/src/assets/icons/icon_menu.svg +1 -0
- package/src/assets/icons/icon_page_size.svg +1 -0
- package/src/assets/icons/icon_position_type.svg +1 -0
- package/src/assets/icons/icon_safe_manage.svg +1 -0
- package/src/assets/icons/icon_screen_scale.svg +6 -0
- package/src/assets/icons/icon_system_manage.svg +1 -0
- package/src/assets/icons/icon_tabbar.svg +1 -0
- package/src/assets/icons/icon_toolbar.svg +1 -0
- package/src/assets/icons/icon_topbar.svg +1 -0
- package/src/assets/icons/icon_watermark.svg +1 -0
- package/src/assets/icons/image-load-fail.svg +1 -0
- package/src/assets/icons/log-center.svg +1 -0
- package/src/assets/icons/logo-sig.svg +1 -0
- package/src/assets/icons/logo.svg +1 -0
- package/src/assets/icons/mima.svg +1 -0
- package/src/assets/icons/not-data.svg +1 -0
- package/src/assets/icons/org-main.svg +1 -0
- package/src/assets/icons/org-unmain.svg +1 -0
- package/src/assets/icons/process-management.svg +1 -0
- package/src/assets/icons/project-management.svg +1 -0
- package/src/assets/icons/rbac.svg +1 -0
- package/src/assets/icons/remove.svg +1 -0
- package/src/assets/icons/resource-app.svg +1 -0
- package/src/assets/icons/resource-btn.svg +1 -0
- package/src/assets/icons/resource-index.svg +1 -0
- package/src/assets/icons/resource-menu.svg +1 -0
- package/src/assets/icons/resource-nonmenu.svg +1 -0
- package/src/assets/icons/setting-manage.svg +1 -0
- package/src/assets/icons/test.svg +1 -0
- package/src/assets/icons/theme-check-mark.svg +1 -0
- package/src/assets/icons/theme-title.svg +1 -0
- package/src/assets/icons/toolbar-collapse.svg +1 -0
- package/src/assets/icons/tree_icon.svg +1 -0
- package/src/assets/icons/tree_icon_checked.svg +1 -0
- package/src/assets/icons/view.svg +1 -0
- package/src/assets/icons/workbench.svg +1 -0
- package/src/assets/icons/zddata.svg +1 -0
- package/src/assets/icons/zy_checked.svg +1 -0
- package/src/assets/icons/zy_default.svg +1 -0
- package/src/assets/images/layout/item1.webp +0 -0
- package/src/assets/images/layout/item1_dark.webp +0 -0
- package/src/assets/images/layout/item2.webp +0 -0
- package/src/assets/images/layout/item2_dark.webp +0 -0
- package/src/assets/images/layout/item3.webp +0 -0
- package/src/assets/images/layout/item3_dark.webp +0 -0
- package/src/assets/images/layout/item4.webp +0 -0
- package/src/assets/images/layout/item4_dark.webp +0 -0
- package/src/assets/images/layout/item5.webp +0 -0
- package/src/assets/images/layout/item5_dark.webp +0 -0
- package/src/assets/images/page-width/anto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/auto.webp +0 -0
- package/src/assets/images/page-width/auto_dark.webp +0 -0
- package/src/assets/images/page-width/auto_min_w.webp +0 -0
- package/src/assets/images/page-width/auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto.webp +0 -0
- package/src/assets/images/page-width/icon_auto_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle.webp +0 -0
- package/src/assets/images/page-width/icon_middle_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w_dark.webp +0 -0
- package/src/assets/images/page-width/middle.webp +0 -0
- package/src/assets/images/page-width/middle_dark.webp +0 -0
- package/src/assets/images/page-width/middle_max_w.webp +0 -0
- package/src/assets/images/page-width/middle_max_w_dark.webp +0 -0
- package/src/assets/lottie/breadcrumb/dark/enable.json +1 -0
- package/src/assets/lottie/breadcrumb/dark/enableMainMenu.json +1 -0
- package/src/assets/lottie/breadcrumb/dark/style.json +1 -0
- package/src/assets/lottie/breadcrumb/light/enable.json +1 -0
- package/src/assets/lottie/breadcrumb/light/enableMainMenu.json +1 -0
- package/src/assets/lottie/breadcrumb/light/style.json +1 -0
- package/src/assets/lottie/layout/data-test.json +1 -0
- package/src/assets/lottie/layout/data.json +1 -0
- package/src/assets/lottie/menu/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/menu/dark/enableSubMenuCollapseButton.json +1 -0
- package/src/assets/lottie/menu/dark/isRounded.json +1 -0
- package/src/assets/lottie/menu/dark/menuActiveStyle.json +1 -0
- package/src/assets/lottie/menu/dark/subMenuCollapse.json +1 -0
- package/src/assets/lottie/menu/dark/subMenuUniqueOpened.json +1 -0
- package/src/assets/lottie/menu/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/menu/light/enableSubMenuCollapseButton.json +1 -0
- package/src/assets/lottie/menu/light/isRounded.json +1 -0
- package/src/assets/lottie/menu/light/menuActiveStyle.json +1 -0
- package/src/assets/lottie/menu/light/subMenuCollapse.json +1 -0
- package/src/assets/lottie/menu/light/subMenuUniqueOpened.json +1 -0
- package/src/assets/lottie/other/dark/enableCopyright.json +1 -0
- package/src/assets/lottie/other/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/other/dark/switchTabbarAndToolbar.json +1 -0
- package/src/assets/lottie/other/light/enableCopyright.json +1 -0
- package/src/assets/lottie/other/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/other/light/switchTabbarAndToolbar.json +1 -0
- package/src/assets/lottie/page_animation/dark/fadeinout.json +1 -0
- package/src/assets/lottie/page_animation/dark/fadeinout_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/tobottom.json +1 -0
- package/src/assets/lottie/page_animation/dark/tobottom_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/toleft.json +1 -0
- package/src/assets/lottie/page_animation/dark/toleft_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/toright.json +1 -0
- package/src/assets/lottie/page_animation/dark/toright_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/totop.json +1 -0
- package/src/assets/lottie/page_animation/dark/totop_old.json +1 -0
- package/src/assets/lottie/page_animation/light/fadeinout.json +1 -0
- package/src/assets/lottie/page_animation/light/tobottom.json +1 -0
- package/src/assets/lottie/page_animation/light/toleft.json +1 -0
- package/src/assets/lottie/page_animation/light/toright.json +1 -0
- package/src/assets/lottie/page_animation/light/totop.json +1 -0
- package/src/assets/lottie/tabbar/dark/enable.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableIcon.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableMemory.json +1 -0
- package/src/assets/lottie/tabbar/dark/style.json +1 -0
- package/src/assets/lottie/tabbar/light/enable.json +1 -0
- package/src/assets/lottie/tabbar/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/tabbar/light/enableIcon.json +1 -0
- package/src/assets/lottie/tabbar/light/enableMemory.json +1 -0
- package/src/assets/lottie/tabbar/light/style.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableColorScheme.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableFullscreen.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableI18n.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableNotification.json +1 -0
- package/src/assets/lottie/toolbar/dark/enablePageReload.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableUserPreferences.json +1 -0
- package/src/assets/lottie/toolbar/dark/navSearchEnable.json +1 -0
- package/src/assets/lottie/toolbar/dark/navSearchEnableHotkeys.json +1 -0
- package/src/assets/lottie/toolbar/light/enableColorScheme.json +1 -0
- package/src/assets/lottie/toolbar/light/enableFullscreen.json +1 -0
- package/src/assets/lottie/toolbar/light/enableI18n.json +1 -0
- package/src/assets/lottie/toolbar/light/enableNotification.json +1 -0
- package/src/assets/lottie/toolbar/light/enablePageReload.json +1 -0
- package/src/assets/lottie/toolbar/light/enableUserPreferences.json +1 -0
- package/src/assets/lottie/toolbar/light/navSearchEnable.json +1 -0
- package/src/assets/lottie/toolbar/light/navSearchEnableHotkeys.json +1 -0
- package/src/assets/lottie/watermark/dark/enableWatermark.json +1 -0
- package/src/assets/lottie/watermark/light/enableWatermark.json +1 -0
- package/src/assets/styles/vxe-table.css +13 -0
- package/src/components/GroupSelector/index.vue +311 -0
- package/src/components/OrgTree/index.vue +91 -0
- package/src/components/OrgUserSelector/OrgSelector.vue +135 -0
- package/src/components/OrgUserSelector/UserSelector.vue +164 -0
- package/src/components/OrgUserSelector/index.ts +47 -0
- package/src/components/OrgUserSelector/provider.ts +373 -0
- package/src/components/ResourceSelector/enum.ts +5 -0
- package/src/components/ResourceSelector/hooks/useAppAndResource.ts +96 -0
- package/src/components/ResourceSelector/index.vue +432 -0
- package/src/composables/useLottie.ts +65 -0
- package/src/index.ts +31 -0
- package/src/interface.ts +54 -0
- package/src/routes/index.ts +156 -0
- package/src/routes/modules/authority.manage.menu.ts +105 -0
- package/src/routes/modules/log.manage.menu.ts +45 -0
- package/src/routes/modules/safe.manage.menu.ts +71 -0
- package/src/routes/modules/stylesetting.manage.menu.ts +130 -0
- package/src/routes/modules/system.manage.menu.ts +92 -0
- package/src/stores/index.ts +1 -0
- package/src/views/blackWhiteList/components/drawerBlackWhiteList.vue +132 -0
- package/src/views/blackWhiteList/enum.ts +7 -0
- package/src/views/blackWhiteList/index.vue +309 -0
- package/src/views/blackWhiteList/types.ts +4 -0
- package/src/views/breadcrumb_setting/animationData.ts +15 -0
- package/src/views/breadcrumb_setting/index.vue +147 -0
- package/src/views/components/HCheckList.vue +47 -0
- package/src/views/components/animation_item.vue +37 -0
- package/src/views/components/setItem.vue +126 -0
- package/src/views/data-permission/components/createAndEditDataPermission.vue +354 -0
- package/src/views/data-permission/enum.ts +59 -0
- package/src/views/data-permission/index.vue +190 -0
- package/src/views/dictionary/components/drawerDictionary.vue +108 -0
- package/src/views/dictionary/components/drawerDictionaryItem.vue +115 -0
- package/src/views/dictionary/enum.ts +8 -0
- package/src/views/dictionary/index.vue +194 -0
- package/src/views/dictionary/itemlist.vue +164 -0
- package/src/views/group/components/drawerGroup.vue +177 -0
- package/src/views/group/enum.ts +25 -0
- package/src/views/group/index.vue +207 -0
- package/src/views/layout_setting/index.vue +306 -0
- package/src/views/log_center/components/browserType.vue +35 -0
- package/src/views/log_center/components/loginHistoryDetail.vue +71 -0
- package/src/views/log_center/components/operateHistoryDetail.vue +80 -0
- package/src/views/log_center/login_history.vue +239 -0
- package/src/views/log_center/operate_history.vue +233 -0
- package/src/views/menu_setting/animationData.ts +27 -0
- package/src/views/menu_setting/index.vue +207 -0
- package/src/views/organization/components/drawerOrganization.vue +161 -0
- package/src/views/organization/components/drawerRole.vue +159 -0
- package/src/views/organization/components/roleSelect.vue +258 -0
- package/src/views/organization/enum.ts +26 -0
- package/src/views/organization/index.vue +516 -0
- package/src/views/other_setting/animationData.ts +15 -0
- package/src/views/other_setting/index.vue +250 -0
- package/src/views/other_setting/interface.ts +26 -0
- package/src/views/page_animation_setting/animationData.ts +23 -0
- package/src/views/page_animation_setting/index.vue +200 -0
- package/src/views/page_w_setting/index.vue +238 -0
- package/src/views/position/components/drawerPosition.vue +131 -0
- package/src/views/position/enum.ts +8 -0
- package/src/views/position/index.vue +167 -0
- package/src/views/region/components/drawerRegion.vue +143 -0
- package/src/views/region/enum.ts +24 -0
- package/src/views/region/index.vue +246 -0
- package/src/views/resource/components/ResourceEdit.vue +209 -0
- package/src/views/resource/components/RoleRelation.vue +100 -0
- package/src/views/resource/enum.ts +35 -0
- package/src/views/resource/index.vue +237 -0
- package/src/views/resource/interface.ts +6 -0
- package/src/views/role/components/ResourceRelation.vue +113 -0
- package/src/views/role/components/drawerRole.vue +191 -0
- package/src/views/role/enum.ts +26 -0
- package/src/views/role/index.vue +183 -0
- package/src/views/role/interface.ts +6 -0
- package/src/views/role_group/components/ResourceRelation.vue +91 -0
- package/src/views/role_group/components/drawerRole.vue +153 -0
- package/src/views/role_group/components/roleSelect.vue +224 -0
- package/src/views/role_group/enum.ts +22 -0
- package/src/views/role_group/index.vue +170 -0
- package/src/views/role_group/interface.ts +6 -0
- package/src/views/safe_setting/index.vue +237 -0
- package/src/views/tabbar_setting/animationData.ts +23 -0
- package/src/views/tabbar_setting/index.vue +186 -0
- package/src/views/tenant/components/TenantEdit.vue +226 -0
- package/src/views/tenant/index.vue +192 -0
- package/src/views/tenant/interface.ts +4 -0
- package/src/views/theme_setting/index.vue +465 -0
- package/src/views/toolbar_setting/animationData.ts +42 -0
- package/src/views/toolbar_setting/index.vue +189 -0
- package/src/views/user/components/OrgAndPosition.vue +156 -0
- package/src/views/user/components/UserAuthorization.vue +260 -0
- package/src/views/user/components/UserEdit.vue +267 -0
- package/src/views/user/components/roleSelect.vue +258 -0
- package/src/views/user/enum.ts +13 -0
- package/src/views/user/index.vue +266 -0
- package/src/views/user/interface.ts +43 -0
- package/src/views/watermark_setting/animationData.ts +7 -0
- package/src/views/watermark_setting/index.vue +236 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { colorScheme, cssVarKey } from 'pubinfo/client';
|
|
3
|
+
import { postSysconfigAddOrEidtSysThemeStyleConfig } from '@/api/modules/configData';
|
|
4
|
+
import { useSettingsStore } from '@/stores';
|
|
5
|
+
import { message } from 'ant-design-vue';
|
|
6
|
+
import { useTheme } from 'pubinfo';
|
|
7
|
+
import { themes } from 'pubinfo/client';
|
|
8
|
+
|
|
9
|
+
interface ThemeListCard {
|
|
10
|
+
label: string
|
|
11
|
+
value: colorScheme
|
|
12
|
+
colors: string[]
|
|
13
|
+
name?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'SettingGlobalThemes',
|
|
18
|
+
});
|
|
19
|
+
const { isDark } = useTheme();
|
|
20
|
+
|
|
21
|
+
const settingsStore = useSettingsStore();
|
|
22
|
+
|
|
23
|
+
const modeLabel = computed(() =>
|
|
24
|
+
settingsStore.globalSettings.app.colorScheme === 'light' ? '亮色模式颜色' : '暗色模式颜色',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const isLight = computed(() => {
|
|
28
|
+
return settingsStore.globalSettings.app.colorScheme === 'light';
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const benchmark: cssVarKey[] = [
|
|
32
|
+
'--ui-primary',
|
|
33
|
+
'--ui-text',
|
|
34
|
+
'--g-bg',
|
|
35
|
+
'--g-header-bg',
|
|
36
|
+
'--g-main-sidebar-bg',
|
|
37
|
+
'--g-sub-sidebar-bg',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const themeList = computed<ThemeListCard[]>(() => {
|
|
41
|
+
const list = Object.keys(themes)
|
|
42
|
+
.map((key) => {
|
|
43
|
+
const value = themes[key];
|
|
44
|
+
const colors = benchmark.map((cssVar) => {
|
|
45
|
+
const cssValue = value[cssVar].startsWith('#')
|
|
46
|
+
? value[cssVar]
|
|
47
|
+
: `rgb(${value[cssVar]})`;
|
|
48
|
+
return cssValue;
|
|
49
|
+
});
|
|
50
|
+
const name = themes[key].label;
|
|
51
|
+
return {
|
|
52
|
+
label: key,
|
|
53
|
+
value,
|
|
54
|
+
colors,
|
|
55
|
+
name,
|
|
56
|
+
};
|
|
57
|
+
})
|
|
58
|
+
.filter(
|
|
59
|
+
cssVarScheme =>
|
|
60
|
+
cssVarScheme.value['color-scheme'] === settingsStore.globalSettings.app.colorScheme,
|
|
61
|
+
);
|
|
62
|
+
return list;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function changeTheme(theme: ThemeListCard) {
|
|
66
|
+
const label = theme.label;
|
|
67
|
+
const o = {} as any;
|
|
68
|
+
if (!isLight.value) {
|
|
69
|
+
settingsStore.globalSettings.app.darkTheme = label;
|
|
70
|
+
o.darkTheme = label;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
settingsStore.globalSettings.app.lightTheme = label;
|
|
74
|
+
o.lightTheme = label;
|
|
75
|
+
}
|
|
76
|
+
updateConfig({
|
|
77
|
+
app: o,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async function changeMode(checked: boolean | string | number) {
|
|
82
|
+
const value = !checked ? 'dark' : 'light';
|
|
83
|
+
settingsStore.globalSettings.app.colorScheme = value;
|
|
84
|
+
await updateConfig({
|
|
85
|
+
app: {
|
|
86
|
+
colorScheme: value,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function updateConfig(options: object) {
|
|
92
|
+
const jsonStr = JSON.stringify(options);
|
|
93
|
+
await postSysconfigAddOrEidtSysThemeStyleConfig({ content: jsonStr })
|
|
94
|
+
.then((res: API.ResponseDataBoolean) => {
|
|
95
|
+
if (res.success) {
|
|
96
|
+
message.success('设置成功');
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<div
|
|
104
|
+
w-full
|
|
105
|
+
h-full
|
|
106
|
+
p-10px
|
|
107
|
+
pb-0
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
class="w-full h-full bg-white overflow-y-auto p-10px pb-0 flex flex-col box-border dark:bg-[#141414]"
|
|
111
|
+
>
|
|
112
|
+
<div
|
|
113
|
+
class="bg-[#F0F4FF] h-[38px] pl-[16px] flex flex-row items-center b-rd-4px dark:bg-[#32353B]"
|
|
114
|
+
>
|
|
115
|
+
<PubinfoIcon name="theme-title" class="text-base mr-[6px]" :size="22" />
|
|
116
|
+
<span class="text-[16px] text-[#1d2129] dark:text-[#C9CDD4]">颜色主题风格</span>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="mt-20px flex flex-row items-center">
|
|
119
|
+
<div
|
|
120
|
+
class="flex-none w-[136px] text-right font-400 text-[#4e5969] text-[14px] dark:text-[#C9CDD4]"
|
|
121
|
+
>
|
|
122
|
+
亮色/暗色切换
|
|
123
|
+
</div>
|
|
124
|
+
<a-switch
|
|
125
|
+
:checked="isLight"
|
|
126
|
+
class="ml-16px!"
|
|
127
|
+
checked-children="亮"
|
|
128
|
+
un-checked-children="暗"
|
|
129
|
+
@change="changeMode"
|
|
130
|
+
/>
|
|
131
|
+
</div>
|
|
132
|
+
<div class="mt-20px pb-24px flex flex-row">
|
|
133
|
+
<div
|
|
134
|
+
class="flex-none w-[136px] text-right font-400 text-[#4e5969] text-[14px] dark:text-[#C9CDD4]"
|
|
135
|
+
>
|
|
136
|
+
{{ modeLabel }}
|
|
137
|
+
</div>
|
|
138
|
+
<div
|
|
139
|
+
class="grid grid-cols-3 gap-x-[32px] gap-y-[16px] ml-16px mr-27px w-full max-w-1400px"
|
|
140
|
+
>
|
|
141
|
+
<div
|
|
142
|
+
v-for="(theme, index) in themeList"
|
|
143
|
+
:key="index"
|
|
144
|
+
class="theme-item"
|
|
145
|
+
:class="{
|
|
146
|
+
active: !isLight
|
|
147
|
+
? settingsStore.globalSettings.app.darkTheme === theme.label
|
|
148
|
+
: settingsStore.globalSettings.app.lightTheme === theme.label,
|
|
149
|
+
dark: isDark,
|
|
150
|
+
}"
|
|
151
|
+
aspect="[4/3]"
|
|
152
|
+
@click="changeTheme(theme)"
|
|
153
|
+
>
|
|
154
|
+
<p class="item-title">
|
|
155
|
+
<span
|
|
156
|
+
class="text-[#4e5969] text-[14px] dark:text-[#C9CDD4]"
|
|
157
|
+
>
|
|
158
|
+
{{
|
|
159
|
+
theme.name
|
|
160
|
+
}}
|
|
161
|
+
</span>
|
|
162
|
+
<PubinfoIcon
|
|
163
|
+
v-if="!isLight
|
|
164
|
+
? settingsStore.globalSettings.app.darkTheme === theme.label
|
|
165
|
+
: settingsStore.globalSettings.app.lightTheme === theme.label"
|
|
166
|
+
name="theme-check-mark"
|
|
167
|
+
class="text-base ml-[6px] text-#fff position-relative top--1px"
|
|
168
|
+
:size="20"
|
|
169
|
+
/>
|
|
170
|
+
</p>
|
|
171
|
+
<div class="item-content">
|
|
172
|
+
<div
|
|
173
|
+
flex
|
|
174
|
+
items-center
|
|
175
|
+
justify-center
|
|
176
|
+
class="spots-wrap"
|
|
177
|
+
>
|
|
178
|
+
<!-- colors 颜色会有重复使用的地方,key多段拼接 -->
|
|
179
|
+
<template
|
|
180
|
+
v-for="(color, _index) in theme.colors"
|
|
181
|
+
:key="theme.name + color + _index"
|
|
182
|
+
>
|
|
183
|
+
<div class="color-spot" :style="{ backgroundColor: color }" />
|
|
184
|
+
</template>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="skeleton">
|
|
187
|
+
<header :style="{ backgroundColor: theme.colors[0] }">
|
|
188
|
+
<div class="dot" />
|
|
189
|
+
<div class="bar" />
|
|
190
|
+
</header>
|
|
191
|
+
<main class="skeleton-body">
|
|
192
|
+
<div class="aside">
|
|
193
|
+
<div class="side-line" :style="{ backgroundColor: theme.colors[0] }" />
|
|
194
|
+
<div v-for="i in 4" :key="i" class="side-line" />
|
|
195
|
+
</div>
|
|
196
|
+
<div class="main">
|
|
197
|
+
<div class="left">
|
|
198
|
+
<div v-for="i in 3" :key="i" class="left-item">
|
|
199
|
+
<div class="dot" />
|
|
200
|
+
<div class="lines-wrap">
|
|
201
|
+
<div class="line1" />
|
|
202
|
+
<div class="line2" />
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="right">
|
|
207
|
+
<div class="right-item" />
|
|
208
|
+
<div class="right-item" />
|
|
209
|
+
<div class="right-item" :style="{ backgroundColor: theme.colors[0], opacity: 0.3 }" />
|
|
210
|
+
<div class="right-item" />
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</main>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
|
|
223
|
+
<style lang="scss" scoped>
|
|
224
|
+
.theme-item {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
padding: 12px 24px 0;
|
|
228
|
+
cursor: pointer;
|
|
229
|
+
background: linear-gradient(180deg, #f4f7ff -22.05%, #fff 85.58%);
|
|
230
|
+
border: 1px solid var(--border-2, #e5e6eb);
|
|
231
|
+
border-radius: 8px;
|
|
232
|
+
|
|
233
|
+
.item-title {
|
|
234
|
+
display: flex;
|
|
235
|
+
align-items: center;
|
|
236
|
+
justify-content: center;
|
|
237
|
+
padding: 0;
|
|
238
|
+
margin: 0;
|
|
239
|
+
font-size: 14px;
|
|
240
|
+
line-height: 22px;
|
|
241
|
+
text-align: center;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.item-content {
|
|
245
|
+
display: flex;
|
|
246
|
+
flex: 1;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
padding: calc(12 / 320 * 100%) calc(20 / 320 * 100%);
|
|
249
|
+
margin-top: calc(12 / 320 * 100%);
|
|
250
|
+
background: linear-gradient(180deg, #fff 0%, #fff0 100%);
|
|
251
|
+
border-radius: calc(8 / 320 * 100%);
|
|
252
|
+
|
|
253
|
+
.spots-wrap {
|
|
254
|
+
margin-left: calc(32 / 270 / 2 * 100%);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.color-spot {
|
|
258
|
+
flex-shrink: 0;
|
|
259
|
+
width: calc(30 / 270 * 100%);
|
|
260
|
+
max-width: 30px;
|
|
261
|
+
aspect-ratio: 1;
|
|
262
|
+
background: #fff;
|
|
263
|
+
border: 2px solid #fff;
|
|
264
|
+
border-radius: 30px;
|
|
265
|
+
box-shadow: 0 0 4px 0 #00000026;
|
|
266
|
+
|
|
267
|
+
&:nth-child(1) {
|
|
268
|
+
transform: translateX(0);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
&:nth-child(2) {
|
|
272
|
+
transform: translateX(calc(-6 / 30 * 100%));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&:nth-child(3) {
|
|
276
|
+
transform: translateX(calc(-12 / 30 * 100%));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&:nth-child(4) {
|
|
280
|
+
transform: translateX(calc(-18 / 30 * 100%));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
&:nth-child(5) {
|
|
284
|
+
transform: translateX(calc(-24 / 30 * 100%));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&:nth-child(6) {
|
|
288
|
+
transform: translateX(calc(-30 / 30 * 100%));
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.skeleton {
|
|
293
|
+
display: flex;
|
|
294
|
+
flex: auto;
|
|
295
|
+
flex-direction: column;
|
|
296
|
+
height: 0;
|
|
297
|
+
margin-top: 22px;
|
|
298
|
+
background: #f5f8fe;
|
|
299
|
+
border-radius: 4px;
|
|
300
|
+
|
|
301
|
+
header {
|
|
302
|
+
display: flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
aspect-ratio: 10.45;
|
|
305
|
+
padding-left: 10px;
|
|
306
|
+
border-radius: 4px 4px 0 0;
|
|
307
|
+
|
|
308
|
+
.dot {
|
|
309
|
+
width: calc(8.5 / 230 * 100%);
|
|
310
|
+
aspect-ratio: 1;
|
|
311
|
+
margin-right: calc(5 / 230 * 100%);
|
|
312
|
+
background: rgb(255 255 255 / 50%);
|
|
313
|
+
border-radius: 50%;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.bar {
|
|
317
|
+
width: calc(68 / 230 * 100%);
|
|
318
|
+
aspect-ratio: calc(68 / 7);
|
|
319
|
+
background: rgb(255 255 255 / 50%);
|
|
320
|
+
border-radius: 2px;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.skeleton-body {
|
|
325
|
+
display: flex;
|
|
326
|
+
flex: 1;
|
|
327
|
+
height: 0;
|
|
328
|
+
padding: calc(7 / 230 * 100%);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.aside {
|
|
332
|
+
width: calc(36 / 230 * 100%);
|
|
333
|
+
height: 100%;
|
|
334
|
+
padding-top: calc(12 / 230 * 100%);
|
|
335
|
+
margin-right: calc(7 / 230 * 100%);
|
|
336
|
+
background: #fff;
|
|
337
|
+
border-radius: 4px;
|
|
338
|
+
|
|
339
|
+
.side-line {
|
|
340
|
+
width: calc(24.1 / 36.6 * 100%);
|
|
341
|
+
aspect-ratio: calc(24.1 / 6.5);
|
|
342
|
+
margin: 0 auto calc(4 / 36.6 * 100%);
|
|
343
|
+
background: #eaeff7;
|
|
344
|
+
border-radius: 2px;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.main {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex: auto;
|
|
351
|
+
justify-content: space-between;
|
|
352
|
+
height: 100%;
|
|
353
|
+
padding: 5.2% 5.6% 3%;
|
|
354
|
+
background: #fff;
|
|
355
|
+
border-radius: 2px;
|
|
356
|
+
|
|
357
|
+
.left {
|
|
358
|
+
flex: 1;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.right {
|
|
362
|
+
width: 30%;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.left-item {
|
|
366
|
+
display: flex;
|
|
367
|
+
margin-bottom: 6.5;
|
|
368
|
+
|
|
369
|
+
.dot {
|
|
370
|
+
width: calc(15 / 108) * 100%;
|
|
371
|
+
aspect-ratio: 1;
|
|
372
|
+
margin-right: calc(7.4 / 108) * 100%;
|
|
373
|
+
margin-bottom: calc(6.7 / 108) * 100%;
|
|
374
|
+
background: #eaeff7;
|
|
375
|
+
border-radius: 50%;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.lines-wrap {
|
|
379
|
+
flex: 1;
|
|
380
|
+
padding-top: calc(2 / 108) * 100%;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.line1 {
|
|
384
|
+
width: calc(53.4 / 82) * 100%;
|
|
385
|
+
aspect-ratio: calc(53.4 / 3.4);
|
|
386
|
+
background: #eaeff7;
|
|
387
|
+
border-radius: 1px;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.line2 {
|
|
391
|
+
width: calc(25.4 / 82) * 100%;
|
|
392
|
+
aspect-ratio: calc(25.4 / 3.4);
|
|
393
|
+
margin-top: 5px;
|
|
394
|
+
background: #eaeff7;
|
|
395
|
+
border-radius: 1px;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.right-item {
|
|
400
|
+
width: 100%;
|
|
401
|
+
aspect-ratio: calc(44 / 8.8);
|
|
402
|
+
margin-bottom: calc(10.14 / 44 * 100%);
|
|
403
|
+
background: #eaeff7;
|
|
404
|
+
border-radius: calc(1.1 / 44 * 100%);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
&.active {
|
|
411
|
+
background: linear-gradient(180deg, #f4f7ff -22.05%, #fff 85.58%);
|
|
412
|
+
border: 2.6px solid rgb(var(--ui-primary));
|
|
413
|
+
box-shadow: 0 2.6px 13px 0 #59626940;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// 暗色模式
|
|
417
|
+
&.dark {
|
|
418
|
+
background: linear-gradient(0deg, #3a3e43 0%, #3a3e43 100%), linear-gradient(180deg, #f4f7ff -22.05%, #fff 85.58%);
|
|
419
|
+
border-color: transparent;
|
|
420
|
+
|
|
421
|
+
&.active {
|
|
422
|
+
border-color: rgb(var(--ui-primary));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.item-content {
|
|
426
|
+
background: linear-gradient(180deg, #ffffff1a 0%, #fff0 100%);
|
|
427
|
+
|
|
428
|
+
.skeleton {
|
|
429
|
+
background: #111213;
|
|
430
|
+
|
|
431
|
+
header {
|
|
432
|
+
background: #26272a !important;
|
|
433
|
+
|
|
434
|
+
.dot,
|
|
435
|
+
.bar {
|
|
436
|
+
background: rgb(255 255 255 / 20%);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.skeleton-body {
|
|
441
|
+
.aside {
|
|
442
|
+
background: #25282d;
|
|
443
|
+
|
|
444
|
+
.side-line {
|
|
445
|
+
background: #32353b;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.main {
|
|
450
|
+
background: #25282d;
|
|
451
|
+
|
|
452
|
+
.dot,
|
|
453
|
+
.line1,
|
|
454
|
+
.line2,
|
|
455
|
+
.right-item {
|
|
456
|
+
background: #32353b;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
</style>
|
|
465
|
+
32
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import darkEnableColorSchemeData from '@/assets/lottie/toolbar/dark/enableColorScheme.json?url';
|
|
2
|
+
import darkEnableFullscreenData from '@/assets/lottie/toolbar/dark/enableFullscreen.json?url';
|
|
3
|
+
import darkEnableI18nData from '@/assets/lottie/toolbar/dark/enableI18n.json?url';
|
|
4
|
+
import darkEnableNotificationData from '@/assets/lottie/toolbar/dark/enableNotification.json?url';
|
|
5
|
+
import darkEnablePageReloadData from '@/assets/lottie/toolbar/dark/enablePageReload.json?url';
|
|
6
|
+
import darkEnableUserPreferencesData from '@/assets/lottie/toolbar/dark/enableUserPreferences.json?url';
|
|
7
|
+
|
|
8
|
+
import darkNavSearchEnableData from '@/assets/lottie/toolbar/dark/navSearchEnable.json?url';
|
|
9
|
+
import darkNavSearchEnableHotkeysData from '@/assets/lottie/toolbar/dark/navSearchEnableHotkeys.json?url';
|
|
10
|
+
|
|
11
|
+
import lightEnableColorSchemeData from '@/assets/lottie/toolbar/light/enableColorScheme.json?url';
|
|
12
|
+
import lightEnableFullscreenData from '@/assets/lottie/toolbar/light/enableFullscreen.json?url';
|
|
13
|
+
|
|
14
|
+
import lightEnableI18nData from '@/assets/lottie/toolbar/light/enableI18n.json?url';
|
|
15
|
+
import lightEnableNotificationData from '@/assets/lottie/toolbar/light/enableNotification.json?url';
|
|
16
|
+
|
|
17
|
+
import lightEnablePageReloadData from '@/assets/lottie/toolbar/light/enablePageReload.json?url';
|
|
18
|
+
import lightEnableUserPreferencesData from '@/assets/lottie/toolbar/light/enableUserPreferences.json?url';
|
|
19
|
+
|
|
20
|
+
import lightNavSearchEnableData from '@/assets/lottie/toolbar/light/navSearchEnable.json?url';
|
|
21
|
+
import lightNavSearchEnableHotkeysData from '@/assets/lottie/toolbar/light/navSearchEnableHotkeys.json?url';
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
darkEnableColorSchemeData,
|
|
25
|
+
darkEnableFullscreenData,
|
|
26
|
+
darkEnableI18nData,
|
|
27
|
+
darkEnableNotificationData,
|
|
28
|
+
darkEnablePageReloadData,
|
|
29
|
+
darkEnableUserPreferencesData,
|
|
30
|
+
|
|
31
|
+
darkNavSearchEnableData,
|
|
32
|
+
darkNavSearchEnableHotkeysData,
|
|
33
|
+
lightEnableColorSchemeData,
|
|
34
|
+
lightEnableFullscreenData,
|
|
35
|
+
lightEnableI18nData,
|
|
36
|
+
lightEnableNotificationData,
|
|
37
|
+
|
|
38
|
+
lightEnablePageReloadData,
|
|
39
|
+
lightEnableUserPreferencesData,
|
|
40
|
+
lightNavSearchEnableData,
|
|
41
|
+
lightNavSearchEnableHotkeysData,
|
|
42
|
+
};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { postSysconfigAddOrEidtSysThemeStyleConfig } from '@/api/modules/configData';
|
|
3
|
+
import { useSettingsStore } from '@/stores';
|
|
4
|
+
|
|
5
|
+
import { message } from 'ant-design-vue';
|
|
6
|
+
import SetItem from '../components/setItem.vue';
|
|
7
|
+
import {
|
|
8
|
+
darkEnableColorSchemeData,
|
|
9
|
+
darkEnableFullscreenData,
|
|
10
|
+
darkEnableI18nData,
|
|
11
|
+
darkEnableNotificationData,
|
|
12
|
+
darkEnablePageReloadData,
|
|
13
|
+
darkEnableUserPreferencesData,
|
|
14
|
+
|
|
15
|
+
darkNavSearchEnableData,
|
|
16
|
+
darkNavSearchEnableHotkeysData,
|
|
17
|
+
lightEnableColorSchemeData,
|
|
18
|
+
lightEnableFullscreenData,
|
|
19
|
+
lightEnableI18nData,
|
|
20
|
+
lightEnableNotificationData,
|
|
21
|
+
|
|
22
|
+
lightEnablePageReloadData,
|
|
23
|
+
lightEnableUserPreferencesData,
|
|
24
|
+
lightNavSearchEnableData,
|
|
25
|
+
lightNavSearchEnableHotkeysData,
|
|
26
|
+
} from './animationData.ts';
|
|
27
|
+
|
|
28
|
+
defineOptions({
|
|
29
|
+
name: 'ToolbarSetting',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const settingsStore = useSettingsStore();
|
|
33
|
+
|
|
34
|
+
const toolbarList = reactive([
|
|
35
|
+
{
|
|
36
|
+
name: '通知中心',
|
|
37
|
+
type: 'switch',
|
|
38
|
+
descripe: '该功能具体业务功能需自行开发,框架仅提供示例模版',
|
|
39
|
+
open: settingsStore.globalSettings.toolbar.enableNotification,
|
|
40
|
+
parentName: 'toolbar',
|
|
41
|
+
childName: 'enableNotification',
|
|
42
|
+
activeStyle: '',
|
|
43
|
+
lightData: lightEnableNotificationData,
|
|
44
|
+
darkData: darkEnableNotificationData,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: '国际化',
|
|
48
|
+
type: 'switch',
|
|
49
|
+
descripe: '',
|
|
50
|
+
parentName: 'toolbar',
|
|
51
|
+
childName: 'enableI18n',
|
|
52
|
+
open: settingsStore.globalSettings.toolbar.enableI18n,
|
|
53
|
+
activeStyle: '',
|
|
54
|
+
lightData: lightEnableI18nData,
|
|
55
|
+
darkData: darkEnableI18nData,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: '全屏',
|
|
59
|
+
type: 'switch',
|
|
60
|
+
descripe: '',
|
|
61
|
+
parentName: 'toolbar',
|
|
62
|
+
childName: 'enableFullscreen',
|
|
63
|
+
open: settingsStore.globalSettings.toolbar.enableFullscreen,
|
|
64
|
+
activeStyle: '',
|
|
65
|
+
lightData: lightEnableFullscreenData,
|
|
66
|
+
darkData: darkEnableFullscreenData,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: '页面刷新',
|
|
70
|
+
type: 'switch',
|
|
71
|
+
descripe: '使用框架内提供的刷新功能进行页面刷新',
|
|
72
|
+
parentName: 'toolbar',
|
|
73
|
+
childName: 'enablePageReload',
|
|
74
|
+
open: settingsStore.globalSettings.toolbar.enablePageReload,
|
|
75
|
+
activeStyle: '',
|
|
76
|
+
lightData: lightEnablePageReloadData,
|
|
77
|
+
darkData: darkEnablePageReloadData,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: '暗黑主题切换',
|
|
81
|
+
type: 'switch',
|
|
82
|
+
descripe: '开启后可在明亮/暗黑模式中切换',
|
|
83
|
+
parentName: 'toolbar',
|
|
84
|
+
childName: 'enableColorScheme',
|
|
85
|
+
open: settingsStore.globalSettings.toolbar.enableColorScheme,
|
|
86
|
+
activeStyle: '',
|
|
87
|
+
lightData: lightEnableColorSchemeData,
|
|
88
|
+
darkData: darkEnableColorSchemeData,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: '个性偏好设置',
|
|
92
|
+
type: 'switch',
|
|
93
|
+
descripe: '',
|
|
94
|
+
parentName: 'app',
|
|
95
|
+
childName: 'enableUserPreferences',
|
|
96
|
+
open: settingsStore.globalSettings.app.enableUserPreferences,
|
|
97
|
+
activeStyle: '',
|
|
98
|
+
lightData: lightEnableUserPreferencesData,
|
|
99
|
+
darkData: darkEnableUserPreferencesData,
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: '导航搜索',
|
|
103
|
+
type: 'switch',
|
|
104
|
+
descripe: '',
|
|
105
|
+
parentName: 'navSearch',
|
|
106
|
+
childName: 'enable',
|
|
107
|
+
open: settingsStore.globalSettings.navSearch.enable,
|
|
108
|
+
activeStyle: '',
|
|
109
|
+
lightData: lightNavSearchEnableData,
|
|
110
|
+
darkData: darkNavSearchEnableData,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: '导航搜索快捷键',
|
|
114
|
+
type: 'switch',
|
|
115
|
+
descripe: '',
|
|
116
|
+
parentName: 'navSearch',
|
|
117
|
+
childName: 'enableHotkeys',
|
|
118
|
+
open: settingsStore.globalSettings.navSearch.enableHotkeys,
|
|
119
|
+
activeStyle: '',
|
|
120
|
+
lightData: lightNavSearchEnableHotkeysData,
|
|
121
|
+
darkData: darkNavSearchEnableHotkeysData,
|
|
122
|
+
},
|
|
123
|
+
] as const);
|
|
124
|
+
|
|
125
|
+
type SettingsKeys = keyof Required<Settings.all>;
|
|
126
|
+
|
|
127
|
+
function onChange<K extends SettingsKeys, V extends keyof Required<Settings.all>[K]>(
|
|
128
|
+
parentName: K,
|
|
129
|
+
childName: V,
|
|
130
|
+
ck: Required<Settings.all>[K][V],
|
|
131
|
+
) {
|
|
132
|
+
if (settingsStore.globalSettings[parentName]
|
|
133
|
+
&& settingsStore.globalSettings[parentName][childName] !== undefined) {
|
|
134
|
+
(settingsStore.globalSettings as Required<Settings.all>)[parentName][childName] = ck;
|
|
135
|
+
|
|
136
|
+
const result: Settings.all = {};
|
|
137
|
+
result[parentName] = {};
|
|
138
|
+
// @ts-expect-error always true
|
|
139
|
+
result[parentName][childName] = ck;
|
|
140
|
+
|
|
141
|
+
const jsonStr = JSON.stringify(result);
|
|
142
|
+
setStyle(jsonStr);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function setStyle(jsonStr: string) {
|
|
147
|
+
postSysconfigAddOrEidtSysThemeStyleConfig({ content: jsonStr }).then((res: API.ResponseDataBoolean) => {
|
|
148
|
+
if (res.success) {
|
|
149
|
+
message.success('设置成功');
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<template>
|
|
156
|
+
<div
|
|
157
|
+
w-full
|
|
158
|
+
h-full
|
|
159
|
+
p-10px
|
|
160
|
+
>
|
|
161
|
+
<div class="w-full h-full bg-white overflow-y-auto p-10px pb-30px flex flex-col box-border dark:bg-[#141414]">
|
|
162
|
+
<div class="h-[38px] pl-[16px] flex flex-row items-center bar-header">
|
|
163
|
+
<PubinfoIcon name="icon_toolbar" class="text-base mr-[6px]" :size="22" />
|
|
164
|
+
<span class="text-[16px] text-[#1d2129] dark:text-[#C9CDD4]">工具栏</span>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="mt-[22px] grid grid-cols-3 gap-x-[20px] px-30px w-full h-0 max-w-1500px" aspect="[3/2] ">
|
|
167
|
+
<SetItem
|
|
168
|
+
v-for="item in toolbarList"
|
|
169
|
+
:key="item.name"
|
|
170
|
+
class="mb-20px"
|
|
171
|
+
aspect="[9/6]"
|
|
172
|
+
:name="item.name"
|
|
173
|
+
:descripe="item.descripe"
|
|
174
|
+
:open="item.open"
|
|
175
|
+
:type="item.type"
|
|
176
|
+
:light-animation-data="item.lightData"
|
|
177
|
+
:dark-animation-data="item.darkData"
|
|
178
|
+
@change="(val) => onChange<any, any>(item.parentName, item.childName, val)"
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
</template>
|
|
184
|
+
|
|
185
|
+
<style lang="scss" scoped>
|
|
186
|
+
.bar-header {
|
|
187
|
+
background: var(--g-bg);
|
|
188
|
+
}
|
|
189
|
+
</style>
|