@kevairy/template 0.1.0
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/LICENSE +21 -0
- package/README.md +14 -0
- package/package.json +37 -0
- package/template/.env +22 -0
- package/template/.env.development +13 -0
- package/template/.env.production +10 -0
- package/template/.prettierignore +3 -0
- package/template/.prettierrc +20 -0
- package/template/.stylelintignore +9 -0
- package/template/.stylelintrc.cjs +84 -0
- package/template/LICENSE +21 -0
- package/template/README.md +22 -0
- package/template/_gitignore +19 -0
- package/template/eslint-auto-import.json +324 -0
- package/template/eslint.config.mjs +83 -0
- package/template/index.html +25 -0
- package/template/package.json +79 -0
- package/template/playwright.config.ts +25 -0
- package/template/public/favicon.ico +0 -0
- package/template/src/App.vue +39 -0
- package/template/src/adapters/auth/index.ts +9 -0
- package/template/src/adapters/auth/mock.ts +10 -0
- package/template/src/adapters/auth/types.ts +11 -0
- package/template/src/adapters/navigation/index.ts +13 -0
- package/template/src/adapters/navigation/types.ts +6 -0
- package/template/src/api/auth.ts +23 -0
- package/template/src/assets/images/avatar/avatar.webp +0 -0
- package/template/src/assets/images/avatar/avatar1.webp +0 -0
- package/template/src/assets/images/avatar/avatar10.webp +0 -0
- package/template/src/assets/images/avatar/avatar2.webp +0 -0
- package/template/src/assets/images/avatar/avatar3.webp +0 -0
- package/template/src/assets/images/avatar/avatar4.webp +0 -0
- package/template/src/assets/images/avatar/avatar5.webp +0 -0
- package/template/src/assets/images/avatar/avatar6.webp +0 -0
- package/template/src/assets/images/avatar/avatar7.webp +0 -0
- package/template/src/assets/images/avatar/avatar8.webp +0 -0
- package/template/src/assets/images/avatar/avatar9.webp +0 -0
- package/template/src/assets/images/ceremony/hb.png +0 -0
- package/template/src/assets/images/ceremony/sd.png +0 -0
- package/template/src/assets/images/ceremony/xc.png +0 -0
- package/template/src/assets/images/ceremony/yd.png +0 -0
- package/template/src/assets/images/common/logo.webp +0 -0
- package/template/src/assets/images/draw/draw1.png +0 -0
- package/template/src/assets/images/favicon.ico +0 -0
- package/template/src/assets/images/lock/bg_dark.webp +0 -0
- package/template/src/assets/images/lock/bg_light.webp +0 -0
- package/template/src/assets/images/login/kylin-hero-source.png +0 -0
- package/template/src/assets/images/login/lf_icon2.webp +0 -0
- package/template/src/assets/images/settings/menu_layouts/dual_column.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/horizontal.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/mixed.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/vertical.png +0 -0
- package/template/src/assets/images/settings/menu_styles/dark.png +0 -0
- package/template/src/assets/images/settings/menu_styles/design.png +0 -0
- package/template/src/assets/images/settings/menu_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/dark.png +0 -0
- package/template/src/assets/images/settings/theme_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/system.png +0 -0
- package/template/src/assets/images/svg/403.svg +1 -0
- package/template/src/assets/images/svg/404.svg +1 -0
- package/template/src/assets/images/svg/500.svg +5 -0
- package/template/src/assets/images/svg/login_icon.svg +1 -0
- package/template/src/assets/images/user/avatar.webp +0 -0
- package/template/src/assets/images/user/bg.webp +0 -0
- package/template/src/assets/styles/core/app.scss +227 -0
- package/template/src/assets/styles/core/dark.scss +93 -0
- package/template/src/assets/styles/core/el-dark.scss +2 -0
- package/template/src/assets/styles/core/el-light.scss +34 -0
- package/template/src/assets/styles/core/el-ui.scss +519 -0
- package/template/src/assets/styles/core/md.scss +1036 -0
- package/template/src/assets/styles/core/mixin.scss +157 -0
- package/template/src/assets/styles/core/reset.scss +41 -0
- package/template/src/assets/styles/core/router-transition.scss +104 -0
- package/template/src/assets/styles/core/tailwind.css +219 -0
- package/template/src/assets/styles/core/theme-animation.scss +63 -0
- package/template/src/assets/styles/core/theme-change.scss +11 -0
- package/template/src/assets/styles/custom/one-dark-pro.scss +98 -0
- package/template/src/assets/styles/index.scss +23 -0
- package/template/src/assets/svg/loading.ts +32 -0
- package/template/src/bootstrap/initializeApp.ts +30 -0
- package/template/src/components/core/banners/art-basic-banner/index.vue +343 -0
- package/template/src/components/core/banners/art-card-banner/index.vue +114 -0
- package/template/src/components/core/base/art-back-to-top/index.vue +40 -0
- package/template/src/components/core/base/art-logo/index.vue +34 -0
- package/template/src/components/core/base/art-svg-icon/index.vue +24 -0
- package/template/src/components/core/cards/art-bar-chart-card/index.vue +103 -0
- package/template/src/components/core/cards/art-data-list-card/index.vue +74 -0
- package/template/src/components/core/cards/art-donut-chart-card/index.vue +124 -0
- package/template/src/components/core/cards/art-image-card/index.vue +89 -0
- package/template/src/components/core/cards/art-line-chart-card/index.vue +126 -0
- package/template/src/components/core/cards/art-progress-card/index.vue +86 -0
- package/template/src/components/core/cards/art-stats-card/index.vue +67 -0
- package/template/src/components/core/cards/art-timeline-list-card/index.vue +69 -0
- package/template/src/components/core/charts/art-bar-chart/index.vue +203 -0
- package/template/src/components/core/charts/art-dual-bar-compare-chart/index.vue +195 -0
- package/template/src/components/core/charts/art-h-bar-chart/index.vue +208 -0
- package/template/src/components/core/charts/art-k-line-chart/index.vue +152 -0
- package/template/src/components/core/charts/art-line-chart/index.vue +371 -0
- package/template/src/components/core/charts/art-radar-chart/index.vue +105 -0
- package/template/src/components/core/charts/art-ring-chart/index.vue +133 -0
- package/template/src/components/core/charts/art-scatter-chart/index.vue +115 -0
- package/template/src/components/core/feedback/art-page-loading/index.vue +281 -0
- package/template/src/components/core/forms/art-button-more/index.vue +71 -0
- package/template/src/components/core/forms/art-button-table/index.vue +59 -0
- package/template/src/components/core/forms/art-drag-verify/index.vue +430 -0
- package/template/src/components/core/forms/art-excel-export/index.vue +390 -0
- package/template/src/components/core/forms/art-excel-import/index.vue +62 -0
- package/template/src/components/core/forms/art-form/index.vue +507 -0
- package/template/src/components/core/forms/art-wang-editor/index.vue +261 -0
- package/template/src/components/core/forms/art-wang-editor/style.scss +273 -0
- package/template/src/components/core/layouts/art-breadcrumb/index.vue +142 -0
- package/template/src/components/core/layouts/art-chat-window/index.vue +262 -0
- package/template/src/components/core/layouts/art-fast-enter/index.vue +113 -0
- package/template/src/components/core/layouts/art-fireworks-effect/index.vue +633 -0
- package/template/src/components/core/layouts/art-global-component/index.vue +14 -0
- package/template/src/components/core/layouts/art-global-search/index.vue +431 -0
- package/template/src/components/core/layouts/art-header-bar/index.vue +485 -0
- package/template/src/components/core/layouts/art-header-bar/widget/ArtUserMenu.vue +118 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/index.vue +110 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue +106 -0
- package/template/src/components/core/layouts/art-menus/art-mixed-menu/index.vue +279 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/index.vue +354 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/style.scss +251 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss +258 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue +190 -0
- package/template/src/components/core/layouts/art-notification/index.vue +456 -0
- package/template/src/components/core/layouts/art-page-content/index.vue +137 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsConfig.ts +248 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsHandlers.ts +167 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsPanel.ts +233 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsState.ts +37 -0
- package/template/src/components/core/layouts/art-settings-panel/index.vue +72 -0
- package/template/src/components/core/layouts/art-settings-panel/style.scss +92 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BasicSettings.vue +77 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BoxStyleSettings.vue +38 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ColorSettings.vue +35 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ContainerSettings.vue +33 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuLayoutSettings.vue +31 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuStyleSettings.vue +44 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SectionTitle.vue +17 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingActions.vue +236 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingDrawer.vue +51 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingHeader.vue +18 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingItem.vue +101 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ThemeSettings.vue +28 -0
- package/template/src/components/core/layouts/art-work-tab/index.vue +584 -0
- package/template/src/components/core/media/art-cutter-img/index.vue +350 -0
- package/template/src/components/core/media/art-video-player/index.vue +111 -0
- package/template/src/components/core/others/art-menu-right/index.vue +415 -0
- package/template/src/components/core/others/art-watermark/index.vue +64 -0
- package/template/src/components/core/text-effect/art-count-to/index.vue +310 -0
- package/template/src/components/core/text-effect/art-festival-text-scroll/index.vue +32 -0
- package/template/src/components/core/text-effect/art-text-scroll/index.vue +285 -0
- package/template/src/components/core/theme/theme-svg/index.vue +100 -0
- package/template/src/components/core/views/exception/ArtException.vue +55 -0
- package/template/src/components/core/views/login/AuthTopBar.vue +149 -0
- package/template/src/components/core/views/login/LoginLeftView.vue +602 -0
- package/template/src/components/core/views/result/ArtResultPage.vue +43 -0
- package/template/src/components/core/widget/art-icon-button/index.vue +23 -0
- package/template/src/config/assets/images.ts +61 -0
- package/template/src/config/index.ts +170 -0
- package/template/src/config/modules/component.ts +98 -0
- package/template/src/config/modules/fastEnter.ts +16 -0
- package/template/src/config/modules/festival.ts +51 -0
- package/template/src/config/modules/headerBar.ts +64 -0
- package/template/src/config/setting.ts +109 -0
- package/template/src/directives/core/auth.ts +66 -0
- package/template/src/directives/core/highlight-loader.ts +37 -0
- package/template/src/directives/core/highlight.ts +253 -0
- package/template/src/directives/core/ripple.ts +116 -0
- package/template/src/directives/core/roles.ts +87 -0
- package/template/src/directives/index.ts +14 -0
- package/template/src/enums/appEnum.ts +81 -0
- package/template/src/enums/formEnum.ts +17 -0
- package/template/src/env.d.ts +32 -0
- package/template/src/hooks/core/useAppMode.ts +45 -0
- package/template/src/hooks/core/useAuth.ts +74 -0
- package/template/src/hooks/core/useCeremony.ts +184 -0
- package/template/src/hooks/core/useChart.ts +745 -0
- package/template/src/hooks/core/useCommon.ts +87 -0
- package/template/src/hooks/core/useFastEnter.ts +55 -0
- package/template/src/hooks/core/useHeaderBar.ts +201 -0
- package/template/src/hooks/core/useLayoutHeight.ts +148 -0
- package/template/src/hooks/core/useTableColumns.ts +313 -0
- package/template/src/hooks/core/useTheme.ts +174 -0
- package/template/src/hooks/index.ts +29 -0
- package/template/src/locales/index.ts +123 -0
- package/template/src/locales/langs/en.json +283 -0
- package/template/src/locales/langs/zh.json +283 -0
- package/template/src/main.ts +29 -0
- package/template/src/mock/auth.ts +46 -0
- package/template/src/plugins/echarts.ts +76 -0
- package/template/src/plugins/index.ts +6 -0
- package/template/src/router/core/ComponentLoader.ts +82 -0
- package/template/src/router/core/IframeRouteManager.ts +78 -0
- package/template/src/router/core/MenuProcessor.ts +280 -0
- package/template/src/router/core/RoutePermissionValidator.ts +161 -0
- package/template/src/router/core/RouteRegistry.ts +90 -0
- package/template/src/router/core/RouteTransformer.ts +132 -0
- package/template/src/router/core/RouteValidator.ts +187 -0
- package/template/src/router/core/index.ts +14 -0
- package/template/src/router/guards/afterEach.ts +34 -0
- package/template/src/router/guards/beforeEach.ts +442 -0
- package/template/src/router/index.ts +24 -0
- package/template/src/router/modules/dashboard.ts +23 -0
- package/template/src/router/modules/examples.ts +109 -0
- package/template/src/router/modules/exception.ts +46 -0
- package/template/src/router/modules/index.ts +12 -0
- package/template/src/router/modules/result.ts +32 -0
- package/template/src/router/routes/asyncRoutes.ts +9 -0
- package/template/src/router/routes/staticRoutes.ts +60 -0
- package/template/src/router/routesAlias.ts +8 -0
- package/template/src/services/auth.ts +15 -0
- package/template/src/store/index.ts +52 -0
- package/template/src/store/modules/menu.ts +109 -0
- package/template/src/store/modules/setting.ts +450 -0
- package/template/src/store/modules/user.ts +218 -0
- package/template/src/store/modules/worktab.ts +568 -0
- package/template/src/types/api/api.d.ts +86 -0
- package/template/src/types/common/index.ts +95 -0
- package/template/src/types/common/response.ts +32 -0
- package/template/src/types/component/chart.ts +324 -0
- package/template/src/types/component/index.ts +86 -0
- package/template/src/types/config/index.ts +253 -0
- package/template/src/types/directive/directive.d.ts +15 -0
- package/template/src/types/import/auto-imports.d.ts +319 -0
- package/template/src/types/import/components.d.ts +126 -0
- package/template/src/types/index.ts +22 -0
- package/template/src/types/router/index.ts +80 -0
- package/template/src/types/store/index.ts +157 -0
- package/template/src/utils/form/index.ts +9 -0
- package/template/src/utils/form/validator.ts +316 -0
- package/template/src/utils/http/contract.ts +39 -0
- package/template/src/utils/http/error.ts +182 -0
- package/template/src/utils/http/index.ts +226 -0
- package/template/src/utils/http/status.ts +18 -0
- package/template/src/utils/index.ts +31 -0
- package/template/src/utils/navigation/index.ts +10 -0
- package/template/src/utils/navigation/jump.ts +68 -0
- package/template/src/utils/navigation/route.ts +85 -0
- package/template/src/utils/navigation/worktab.ts +67 -0
- package/template/src/utils/router.ts +63 -0
- package/template/src/utils/socket/index.ts +423 -0
- package/template/src/utils/storage/index.ts +7 -0
- package/template/src/utils/storage/storage-config.ts +127 -0
- package/template/src/utils/storage/storage-key-manager.ts +97 -0
- package/template/src/utils/storage/storage.ts +250 -0
- package/template/src/utils/sys/console.ts +9 -0
- package/template/src/utils/sys/error-handle.ts +143 -0
- package/template/src/utils/sys/index.ts +2 -0
- package/template/src/utils/sys/mittBus.ts +61 -0
- package/template/src/utils/ui/animation.ts +80 -0
- package/template/src/utils/ui/colors.ts +273 -0
- package/template/src/utils/ui/emojo.ts +24 -0
- package/template/src/utils/ui/iconify-loader.ts +31 -0
- package/template/src/utils/ui/index.ts +11 -0
- package/template/src/utils/ui/loading.ts +158 -0
- package/template/src/utils/ui/tabs.ts +60 -0
- package/template/src/views/auth/forget-password/index.vue +62 -0
- package/template/src/views/auth/login/index.vue +166 -0
- package/template/src/views/auth/login/style.css +38 -0
- package/template/src/views/auth/register/index.vue +240 -0
- package/template/src/views/dashboard/console/index.vue +173 -0
- package/template/src/views/examples/analytics/index.vue +389 -0
- package/template/src/views/examples/complex-form/index.vue +395 -0
- package/template/src/views/examples/crud-workspace/index.vue +412 -0
- package/template/src/views/examples/navigation/detail/index.vue +151 -0
- package/template/src/views/examples/navigation/state/index.vue +226 -0
- package/template/src/views/examples/overview/index.vue +309 -0
- package/template/src/views/examples/permissions/index.vue +303 -0
- package/template/src/views/examples/search-table/index.vue +182 -0
- package/template/src/views/examples/search-table/search.config.ts +81 -0
- package/template/src/views/examples/search-table/service.ts +116 -0
- package/template/src/views/examples/search-table/table.config.ts +37 -0
- package/template/src/views/exception/403/index.vue +16 -0
- package/template/src/views/exception/404/index.vue +16 -0
- package/template/src/views/exception/500/index.vue +16 -0
- package/template/src/views/index/index.vue +29 -0
- package/template/src/views/index/style.scss +93 -0
- package/template/src/views/outside/Iframe.vue +42 -0
- package/template/src/views/result/fail/index.vue +28 -0
- package/template/src/views/result/success/index.vue +21 -0
- package/template/tests/e2e/auth.spec.ts +14 -0
- package/template/tests/e2e/search-table.spec.ts +154 -0
- package/template/tests/unit/adapters/auth.spec.ts +38 -0
- package/template/tests/unit/config/app-config.spec.ts +17 -0
- package/template/tests/unit/directives/highlight.spec.ts +20 -0
- package/template/tests/unit/http/contract.spec.ts +47 -0
- package/template/tests/unit/mock/search-table.spec.ts +62 -0
- package/template/tests/unit/router/examples.spec.ts +52 -0
- package/template/tsconfig.json +28 -0
- package/template/vite.config.ts +181 -0
- package/template/vitest.config.ts +27 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置图片资源
|
|
3
|
+
*
|
|
4
|
+
* 统一管理设置中心使用的预览图片资源。
|
|
5
|
+
* 包含主题样式、菜单布局、菜单风格的预览图。
|
|
6
|
+
*
|
|
7
|
+
* ## 图片分类
|
|
8
|
+
*
|
|
9
|
+
* - themeStyles: 系统主题预览图(亮色/暗色/自动)
|
|
10
|
+
* - menuLayouts: 菜单布局预览图(左侧/顶部/混合/双栏)
|
|
11
|
+
* - menuStyles: 菜单风格预览图(设计/暗色/亮色)
|
|
12
|
+
*
|
|
13
|
+
* @module config/assets/images
|
|
14
|
+
* @author Art Design Pro Team
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import lightTheme from '@imgs/settings/theme_styles/light.png'
|
|
18
|
+
import darkTheme from '@imgs/settings/theme_styles/dark.png'
|
|
19
|
+
import systemTheme from '@imgs/settings/theme_styles/system.png'
|
|
20
|
+
import verticalLayout from '@imgs/settings/menu_layouts/vertical.png'
|
|
21
|
+
import horizontalLayout from '@imgs/settings/menu_layouts/horizontal.png'
|
|
22
|
+
import mixedLayout from '@imgs/settings/menu_layouts/mixed.png'
|
|
23
|
+
import dualColumnLayout from '@imgs/settings/menu_layouts/dual_column.png'
|
|
24
|
+
import designStyle from '@imgs/settings/menu_styles/design.png'
|
|
25
|
+
import darkStyle from '@imgs/settings/menu_styles/dark.png'
|
|
26
|
+
import lightStyle from '@imgs/settings/menu_styles/light.png'
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 配置中心图片资源对象
|
|
30
|
+
*/
|
|
31
|
+
export const configImages = {
|
|
32
|
+
/** 系统主题预览图 */
|
|
33
|
+
themeStyles: {
|
|
34
|
+
/** 亮色主题 */
|
|
35
|
+
light: lightTheme,
|
|
36
|
+
/** 暗色主题 */
|
|
37
|
+
dark: darkTheme,
|
|
38
|
+
/** 自动主题(跟随系统) */
|
|
39
|
+
system: systemTheme
|
|
40
|
+
},
|
|
41
|
+
/** 菜单布局预览图 */
|
|
42
|
+
menuLayouts: {
|
|
43
|
+
/** 左侧菜单 */
|
|
44
|
+
vertical: verticalLayout,
|
|
45
|
+
/** 顶部菜单 */
|
|
46
|
+
horizontal: horizontalLayout,
|
|
47
|
+
/** 混合菜单 */
|
|
48
|
+
mixed: mixedLayout,
|
|
49
|
+
/** 双栏菜单 */
|
|
50
|
+
dualColumn: dualColumnLayout
|
|
51
|
+
},
|
|
52
|
+
/** 菜单风格预览图 */
|
|
53
|
+
menuStyles: {
|
|
54
|
+
/** 设计风格 */
|
|
55
|
+
design: designStyle,
|
|
56
|
+
/** 暗色风格 */
|
|
57
|
+
dark: darkStyle,
|
|
58
|
+
/** 亮色风格 */
|
|
59
|
+
light: lightStyle
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 系统全局配置
|
|
3
|
+
*
|
|
4
|
+
* 这是系统的核心配置文件,集中管理所有全局配置项。
|
|
5
|
+
* 包含系统信息、主题样式、菜单布局、颜色方案等所有可配置项。
|
|
6
|
+
*
|
|
7
|
+
* ## 主要功能
|
|
8
|
+
*
|
|
9
|
+
* - 系统信息 - 系统名称等基础信息
|
|
10
|
+
* - 主题配置 - 亮色/暗色/自动主题的样式配置
|
|
11
|
+
* - 菜单配置 - 菜单布局、主题、宽度等配置
|
|
12
|
+
* - 颜色方案 - 系统主色和预设颜色列表
|
|
13
|
+
* - 快速入口 - 快速入口应用和链接配置
|
|
14
|
+
* - 顶部栏配置 - 顶部栏功能模块配置
|
|
15
|
+
*
|
|
16
|
+
* ## 配置项说明
|
|
17
|
+
*
|
|
18
|
+
* - systemInfo: 系统基础信息(名称等)
|
|
19
|
+
* - systemThemeStyles: 系统主题样式映射
|
|
20
|
+
* - settingThemeList: 可选的系统主题列表
|
|
21
|
+
* - menuLayoutList: 可选的菜单布局列表
|
|
22
|
+
* - themeList: 菜单主题样式列表
|
|
23
|
+
* - darkMenuStyles: 暗黑模式下的菜单样式
|
|
24
|
+
* - systemMainColor: 预设的系统主色列表
|
|
25
|
+
* - fastEnter: 快速入口配置
|
|
26
|
+
*
|
|
27
|
+
* @module config
|
|
28
|
+
* @author Art Design Pro Team
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { MenuThemeEnum, MenuTypeEnum, SystemThemeEnum } from '@/enums/appEnum'
|
|
32
|
+
import { SystemConfig } from '@/types/config'
|
|
33
|
+
import { configImages } from './assets/images'
|
|
34
|
+
import fastEnterConfig from './modules/fastEnter'
|
|
35
|
+
import logo from '@imgs/common/logo.webp'
|
|
36
|
+
import favicon from '@imgs/favicon.ico'
|
|
37
|
+
import defaultAvatar from '@imgs/user/avatar.webp'
|
|
38
|
+
|
|
39
|
+
const appConfig: SystemConfig = {
|
|
40
|
+
// 系统信息
|
|
41
|
+
systemInfo: {
|
|
42
|
+
name: __DISPLAY_NAME_LITERAL__,
|
|
43
|
+
description: '基于 Vue 3、TypeScript 与 Element Plus 的通用管理后台模板',
|
|
44
|
+
logo,
|
|
45
|
+
favicon,
|
|
46
|
+
copyright: `© ${new Date().getFullYear()} ` + __DISPLAY_NAME_LITERAL__
|
|
47
|
+
},
|
|
48
|
+
navigation: {
|
|
49
|
+
homePath: '/dashboard/console',
|
|
50
|
+
loginRouteName: 'Login',
|
|
51
|
+
titleTemplate: '{page} - {app}'
|
|
52
|
+
},
|
|
53
|
+
features: {
|
|
54
|
+
menuButton: true,
|
|
55
|
+
refreshButton: true,
|
|
56
|
+
breadcrumb: true,
|
|
57
|
+
workTabs: true,
|
|
58
|
+
fullscreen: true,
|
|
59
|
+
settings: true,
|
|
60
|
+
themeToggle: true,
|
|
61
|
+
language: false,
|
|
62
|
+
fastEnter: false,
|
|
63
|
+
globalSearch: false,
|
|
64
|
+
notification: false,
|
|
65
|
+
chat: false,
|
|
66
|
+
watermark: false,
|
|
67
|
+
festivalEffects: false,
|
|
68
|
+
examples: true
|
|
69
|
+
},
|
|
70
|
+
storage: {
|
|
71
|
+
namespace: 'admin-template'
|
|
72
|
+
},
|
|
73
|
+
assets: {
|
|
74
|
+
defaultAvatar
|
|
75
|
+
},
|
|
76
|
+
links: {
|
|
77
|
+
documentation: '',
|
|
78
|
+
support: ''
|
|
79
|
+
},
|
|
80
|
+
// 系统主题
|
|
81
|
+
systemThemeStyles: {
|
|
82
|
+
[SystemThemeEnum.LIGHT]: { className: '' },
|
|
83
|
+
[SystemThemeEnum.DARK]: { className: SystemThemeEnum.DARK }
|
|
84
|
+
},
|
|
85
|
+
// 系统主题列表
|
|
86
|
+
settingThemeList: [
|
|
87
|
+
{
|
|
88
|
+
name: 'Light',
|
|
89
|
+
theme: SystemThemeEnum.LIGHT,
|
|
90
|
+
color: ['#fff', '#fff'],
|
|
91
|
+
leftLineColor: '#EDEEF0',
|
|
92
|
+
rightLineColor: '#EDEEF0',
|
|
93
|
+
img: configImages.themeStyles.light
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'Dark',
|
|
97
|
+
theme: SystemThemeEnum.DARK,
|
|
98
|
+
color: ['#22252A'],
|
|
99
|
+
leftLineColor: '#3F4257',
|
|
100
|
+
rightLineColor: '#3F4257',
|
|
101
|
+
img: configImages.themeStyles.dark
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'System',
|
|
105
|
+
theme: SystemThemeEnum.AUTO,
|
|
106
|
+
color: ['#fff', '#22252A'],
|
|
107
|
+
leftLineColor: '#EDEEF0',
|
|
108
|
+
rightLineColor: '#3F4257',
|
|
109
|
+
img: configImages.themeStyles.system
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
// 菜单布局列表
|
|
113
|
+
menuLayoutList: [
|
|
114
|
+
{ name: 'Left', value: MenuTypeEnum.LEFT, img: configImages.menuLayouts.vertical },
|
|
115
|
+
{ name: 'Top', value: MenuTypeEnum.TOP, img: configImages.menuLayouts.horizontal },
|
|
116
|
+
{ name: 'Mixed', value: MenuTypeEnum.TOP_LEFT, img: configImages.menuLayouts.mixed },
|
|
117
|
+
{ name: 'Dual Column', value: MenuTypeEnum.DUAL_MENU, img: configImages.menuLayouts.dualColumn }
|
|
118
|
+
],
|
|
119
|
+
// 菜单主题列表
|
|
120
|
+
themeList: [
|
|
121
|
+
{
|
|
122
|
+
theme: MenuThemeEnum.DESIGN,
|
|
123
|
+
background: '#FFFFFF',
|
|
124
|
+
systemNameColor: 'var(--art-gray-800)',
|
|
125
|
+
iconColor: '#6B6B6B',
|
|
126
|
+
textColor: '#29343D',
|
|
127
|
+
img: configImages.menuStyles.design
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
theme: MenuThemeEnum.DARK,
|
|
131
|
+
background: '#191A23',
|
|
132
|
+
systemNameColor: '#D9DADB',
|
|
133
|
+
iconColor: '#BABBBD',
|
|
134
|
+
textColor: '#BABBBD',
|
|
135
|
+
img: configImages.menuStyles.dark
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
theme: MenuThemeEnum.LIGHT,
|
|
139
|
+
background: '#ffffff',
|
|
140
|
+
systemNameColor: 'var(--art-gray-800)',
|
|
141
|
+
iconColor: '#6B6B6B',
|
|
142
|
+
textColor: '#29343D',
|
|
143
|
+
img: configImages.menuStyles.light
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
// 暗黑模式菜单样式
|
|
147
|
+
darkMenuStyles: [
|
|
148
|
+
{
|
|
149
|
+
theme: MenuThemeEnum.DARK,
|
|
150
|
+
background: 'var(--default-box-color)',
|
|
151
|
+
systemNameColor: '#DDDDDD',
|
|
152
|
+
iconColor: '#BABBBD',
|
|
153
|
+
textColor: 'rgba(#FFFFFF, 0.7)'
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
// 系统主色
|
|
157
|
+
systemMainColor: [
|
|
158
|
+
'#1E40AF',
|
|
159
|
+
'#2563EB',
|
|
160
|
+
'#3B82F6',
|
|
161
|
+
'#0F766E',
|
|
162
|
+
'#15803D',
|
|
163
|
+
'#D97706',
|
|
164
|
+
'#DC2626'
|
|
165
|
+
] as const,
|
|
166
|
+
// 快速入口配置
|
|
167
|
+
fastEnter: fastEnterConfig
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export default Object.freeze(appConfig)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局组件配置
|
|
3
|
+
*
|
|
4
|
+
* 统一管理系统级全局组件的注册。
|
|
5
|
+
* 这些组件会在应用启动时全局注册,可在任何地方使用。
|
|
6
|
+
*
|
|
7
|
+
* ## 主要功能
|
|
8
|
+
*
|
|
9
|
+
* - 组件配置 - 集中管理全局组件的配置信息
|
|
10
|
+
* - 异步加载 - 使用 defineAsyncComponent 实现按需加载
|
|
11
|
+
* - 开关控制 - 支持通过 enabled 字段启用/禁用组件
|
|
12
|
+
* - 配置查询 - 提供工具函数快速查询组件配置
|
|
13
|
+
*
|
|
14
|
+
* @module config/component
|
|
15
|
+
* @author Art Design Pro Team
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { defineAsyncComponent } from 'vue'
|
|
19
|
+
import AppConfig from '@/config'
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 全局组件配置列表
|
|
23
|
+
*/
|
|
24
|
+
export const globalComponentsConfig: GlobalComponentConfig[] = [
|
|
25
|
+
{
|
|
26
|
+
name: '设置面板',
|
|
27
|
+
key: 'settings-panel',
|
|
28
|
+
component: defineAsyncComponent(
|
|
29
|
+
() => import('@/components/core/layouts/art-settings-panel/index.vue')
|
|
30
|
+
),
|
|
31
|
+
enabled: AppConfig.features.settings
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: '全局搜索',
|
|
35
|
+
key: 'global-search',
|
|
36
|
+
component: defineAsyncComponent(
|
|
37
|
+
() => import('@/components/core/layouts/art-global-search/index.vue')
|
|
38
|
+
),
|
|
39
|
+
enabled: AppConfig.features.globalSearch
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: '聊天窗口',
|
|
43
|
+
key: 'chat-window',
|
|
44
|
+
component: defineAsyncComponent(
|
|
45
|
+
() => import('@/components/core/layouts/art-chat-window/index.vue')
|
|
46
|
+
),
|
|
47
|
+
enabled: AppConfig.features.chat
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: '礼花效果',
|
|
51
|
+
key: 'fireworks-effect',
|
|
52
|
+
component: defineAsyncComponent(
|
|
53
|
+
() => import('@/components/core/layouts/art-fireworks-effect/index.vue')
|
|
54
|
+
),
|
|
55
|
+
enabled: AppConfig.features.festivalEffects
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: '水印效果',
|
|
59
|
+
key: 'watermark',
|
|
60
|
+
component: defineAsyncComponent(
|
|
61
|
+
() => import('@/components/core/others/art-watermark/index.vue')
|
|
62
|
+
),
|
|
63
|
+
enabled: AppConfig.features.watermark
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 全局组件配置接口
|
|
69
|
+
*/
|
|
70
|
+
export interface GlobalComponentConfig {
|
|
71
|
+
/** 组件名称 */
|
|
72
|
+
name: string
|
|
73
|
+
/** 组件标识 */
|
|
74
|
+
key: string
|
|
75
|
+
/** 组件 */
|
|
76
|
+
component: any
|
|
77
|
+
/** 是否启用 */
|
|
78
|
+
enabled?: boolean
|
|
79
|
+
/** 组件描述 */
|
|
80
|
+
description?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 获取启用的全局组件
|
|
85
|
+
* @returns 已启用的组件配置列表
|
|
86
|
+
*/
|
|
87
|
+
export const getEnabledGlobalComponents = () => {
|
|
88
|
+
return globalComponentsConfig.filter((config) => config.enabled !== false)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 根据 key 获取组件配置
|
|
93
|
+
* @param key 组件标识
|
|
94
|
+
* @returns 组件配置对象
|
|
95
|
+
*/
|
|
96
|
+
export const getGlobalComponentByKey = (key: string) => {
|
|
97
|
+
return globalComponentsConfig.find((config) => config.key === key)
|
|
98
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 快速入口配置
|
|
3
|
+
* 包含:应用列表、快速链接等配置
|
|
4
|
+
*/
|
|
5
|
+
import type { FastEnterConfig } from '@/types/config'
|
|
6
|
+
|
|
7
|
+
const fastEnterConfig: FastEnterConfig = {
|
|
8
|
+
// 显示条件(屏幕宽度)
|
|
9
|
+
minWidth: 1200,
|
|
10
|
+
// 应用列表
|
|
11
|
+
applications: [],
|
|
12
|
+
// 快速链接
|
|
13
|
+
quickLinks: []
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default Object.freeze(fastEnterConfig)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 节日庆祝配置
|
|
3
|
+
*
|
|
4
|
+
* 配置系统的节日烟花效果和祝福文本。
|
|
5
|
+
* 支持单日节日和跨日期节日,可自定义烟花播放次数。
|
|
6
|
+
*
|
|
7
|
+
* ## 配置说明
|
|
8
|
+
*
|
|
9
|
+
* - name: 节日名称
|
|
10
|
+
* - date: 节日开始日期(格式:YYYY-MM-DD)
|
|
11
|
+
* - endDate: 节日结束日期(可选,用于跨日期节日)
|
|
12
|
+
* - image: 烟花图片(需要预先导入)
|
|
13
|
+
* - scrollText: 滚动显示的祝福文本
|
|
14
|
+
* - count: 烟花播放次数(可选,默认为 3 次)
|
|
15
|
+
*
|
|
16
|
+
* ## 注意事项
|
|
17
|
+
*
|
|
18
|
+
* - 图片需要预先导入并在配置中引用
|
|
19
|
+
* - 跨日期节日会在整个日期范围内生效
|
|
20
|
+
* - 每个用户每天只会播放一次烟花效果
|
|
21
|
+
*
|
|
22
|
+
* @module config/modules/festival
|
|
23
|
+
* @author Art Design Pro Team
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { FestivalConfig } from '@/types/config'
|
|
27
|
+
|
|
28
|
+
// 导入烟花图片(根据需要取消注释)
|
|
29
|
+
// import sd from '@imgs/ceremony/sd.png'
|
|
30
|
+
// import yd from '@imgs/ceremony/yd.png'
|
|
31
|
+
|
|
32
|
+
export const festivalConfigList: FestivalConfig[] = [
|
|
33
|
+
// 跨日期示例
|
|
34
|
+
// {
|
|
35
|
+
// name: 'v3.0 Sass 升级至 TailwindCSS',
|
|
36
|
+
// date: '2025-11-03',
|
|
37
|
+
// endDate: '2025-11-09',
|
|
38
|
+
// image: '',
|
|
39
|
+
// count: 3,
|
|
40
|
+
// scrollText:
|
|
41
|
+
// '🚀 系统 v3.0 测试阶段正式开启!测试周期为 11 月 3 日 - 11 月 16 日,通过 TailwindCSS 重构样式体系、统一 Iconify 图标方案,带来更高效现代的开发体验,正式发布敬请期待~'
|
|
42
|
+
// }
|
|
43
|
+
// 单日示例:圣诞节
|
|
44
|
+
// {
|
|
45
|
+
// name: '圣诞节',
|
|
46
|
+
// date: '2024-12-25',
|
|
47
|
+
// image: sd,
|
|
48
|
+
// count: 3 // 可选,不设置则使用默认值 3 次
|
|
49
|
+
// scrollText: 'Merry Christmas!Art Design Pro 祝您圣诞快乐,愿节日的欢乐与祝福如雪花般纷至沓来!',
|
|
50
|
+
// }
|
|
51
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 顶部栏功能配置
|
|
3
|
+
*
|
|
4
|
+
* 统一管理顶部栏各个功能模块的启用状态。
|
|
5
|
+
* 通过修改此配置文件可以快速启用或禁用顶部栏的功能按钮。
|
|
6
|
+
*
|
|
7
|
+
* @module config/headerBar
|
|
8
|
+
* @author Art Design Pro Team
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { HeaderBarFeatureConfig } from '@/types'
|
|
12
|
+
import AppConfig from '@/config'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 顶部栏功能配置对象
|
|
16
|
+
*/
|
|
17
|
+
export const headerBarConfig: HeaderBarFeatureConfig = {
|
|
18
|
+
menuButton: {
|
|
19
|
+
enabled: AppConfig.features.menuButton,
|
|
20
|
+
description: '控制左侧菜单的展开/收起按钮'
|
|
21
|
+
},
|
|
22
|
+
refreshButton: {
|
|
23
|
+
enabled: AppConfig.features.refreshButton,
|
|
24
|
+
description: '页面刷新按钮'
|
|
25
|
+
},
|
|
26
|
+
fastEnter: {
|
|
27
|
+
enabled: AppConfig.features.fastEnter,
|
|
28
|
+
description: '快速入口功能,提供常用应用和链接的快速访问'
|
|
29
|
+
},
|
|
30
|
+
breadcrumb: {
|
|
31
|
+
enabled: AppConfig.features.breadcrumb,
|
|
32
|
+
description: '面包屑导航,显示当前页面路径'
|
|
33
|
+
},
|
|
34
|
+
globalSearch: {
|
|
35
|
+
enabled: AppConfig.features.globalSearch,
|
|
36
|
+
description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K'
|
|
37
|
+
},
|
|
38
|
+
fullscreen: {
|
|
39
|
+
enabled: AppConfig.features.fullscreen,
|
|
40
|
+
description: '全屏切换功能'
|
|
41
|
+
},
|
|
42
|
+
notification: {
|
|
43
|
+
enabled: AppConfig.features.notification,
|
|
44
|
+
description: '通知中心,显示系统通知和消息'
|
|
45
|
+
},
|
|
46
|
+
chat: {
|
|
47
|
+
enabled: AppConfig.features.chat,
|
|
48
|
+
description: '聊天功能,提供实时沟通'
|
|
49
|
+
},
|
|
50
|
+
language: {
|
|
51
|
+
enabled: AppConfig.features.language,
|
|
52
|
+
description: '多语言切换功能'
|
|
53
|
+
},
|
|
54
|
+
settings: {
|
|
55
|
+
enabled: AppConfig.features.settings,
|
|
56
|
+
description: '系统设置面板'
|
|
57
|
+
},
|
|
58
|
+
themeToggle: {
|
|
59
|
+
enabled: AppConfig.features.themeToggle,
|
|
60
|
+
description: '主题切换功能(明暗主题)'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default headerBarConfig
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 系统设置默认值配置
|
|
3
|
+
*
|
|
4
|
+
* 统一管理系统设置的所有默认值
|
|
5
|
+
*
|
|
6
|
+
* ## 主要功能
|
|
7
|
+
*
|
|
8
|
+
* - 菜单相关默认配置
|
|
9
|
+
* - 主题相关默认配置
|
|
10
|
+
* - 界面显示默认配置
|
|
11
|
+
* - 功能开关默认配置
|
|
12
|
+
* - 样式相关默认配置
|
|
13
|
+
*
|
|
14
|
+
* ## 注意事项
|
|
15
|
+
*
|
|
16
|
+
* 1. 修改此文件的配置项时,需要同步更新以下文件:
|
|
17
|
+
* - src/components/core/layouts/art-settings-panel/widget/SettingActions.vue(复制配置和重置配置逻辑)
|
|
18
|
+
* - src/store/modules/setting.ts(Store 状态定义)
|
|
19
|
+
* 2. 可以通过设置面板的"复制配置"按钮快速生成配置代码
|
|
20
|
+
* 3. 枚举类型的值需要与 src/enums/appEnum.ts 中的定义保持一致
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import AppConfig from '@/config'
|
|
24
|
+
import { SystemThemeEnum, MenuThemeEnum, MenuTypeEnum, ContainerWidthEnum } from '@/enums/appEnum'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 系统设置默认值配置
|
|
28
|
+
*/
|
|
29
|
+
export const SETTING_DEFAULT_CONFIG = {
|
|
30
|
+
/** 菜单类型 */
|
|
31
|
+
menuType: MenuTypeEnum.LEFT,
|
|
32
|
+
/** 菜单展开宽度 */
|
|
33
|
+
menuOpenWidth: 230,
|
|
34
|
+
/** 菜单是否展开 */
|
|
35
|
+
menuOpen: true,
|
|
36
|
+
/** 双菜单是否显示文本 */
|
|
37
|
+
dualMenuShowText: false,
|
|
38
|
+
/** 系统主题类型 */
|
|
39
|
+
systemThemeType: SystemThemeEnum.AUTO,
|
|
40
|
+
/** 系统主题模式 */
|
|
41
|
+
systemThemeMode: SystemThemeEnum.AUTO,
|
|
42
|
+
/** 菜单风格 */
|
|
43
|
+
menuThemeType: MenuThemeEnum.DESIGN,
|
|
44
|
+
/** 系统主题颜色 */
|
|
45
|
+
systemThemeColor: AppConfig.systemMainColor[0],
|
|
46
|
+
/** 是否显示菜单按钮 */
|
|
47
|
+
showMenuButton: true,
|
|
48
|
+
/** 是否显示快速入口 */
|
|
49
|
+
showFastEnter: false,
|
|
50
|
+
/** 是否显示刷新按钮 */
|
|
51
|
+
showRefreshButton: true,
|
|
52
|
+
/** 是否显示面包屑 */
|
|
53
|
+
showCrumbs: true,
|
|
54
|
+
/** 是否显示工作台标签 */
|
|
55
|
+
showWorkTab: true,
|
|
56
|
+
/** 是否显示语言切换 */
|
|
57
|
+
showLanguage: false,
|
|
58
|
+
/** 是否显示进度条 */
|
|
59
|
+
showNprogress: true,
|
|
60
|
+
/** 是否显示设置引导 */
|
|
61
|
+
showSettingGuide: false,
|
|
62
|
+
/** 是否显示节日文本 */
|
|
63
|
+
showFestivalText: false,
|
|
64
|
+
/** 是否显示水印 */
|
|
65
|
+
watermarkVisible: false,
|
|
66
|
+
/** 是否自动关闭 */
|
|
67
|
+
autoClose: false,
|
|
68
|
+
/** 是否唯一展开 */
|
|
69
|
+
uniqueOpened: true,
|
|
70
|
+
/** 是否色弱模式 */
|
|
71
|
+
colorWeak: false,
|
|
72
|
+
/** 是否刷新 */
|
|
73
|
+
refresh: false,
|
|
74
|
+
/** 是否加载节日烟花 */
|
|
75
|
+
holidayFireworksLoaded: false,
|
|
76
|
+
/** 边框模式 */
|
|
77
|
+
boxBorderMode: true,
|
|
78
|
+
/** 页面过渡效果 */
|
|
79
|
+
pageTransition: 'fade',
|
|
80
|
+
/** 标签页样式 */
|
|
81
|
+
tabStyle: 'tab-default',
|
|
82
|
+
/** 自定义圆角 */
|
|
83
|
+
customRadius: '0.75',
|
|
84
|
+
/** 容器宽度 */
|
|
85
|
+
containerWidth: ContainerWidthEnum.FULL,
|
|
86
|
+
/** 节日日期 */
|
|
87
|
+
festivalDate: ''
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 获取设置默认值
|
|
92
|
+
* @returns 设置默认值对象
|
|
93
|
+
*/
|
|
94
|
+
export function getSettingDefaults() {
|
|
95
|
+
return { ...SETTING_DEFAULT_CONFIG }
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 重置为默认设置
|
|
100
|
+
* @param currentSettings 当前设置对象
|
|
101
|
+
*/
|
|
102
|
+
export function resetToDefaults(currentSettings: Record<string, any>) {
|
|
103
|
+
const defaults = getSettingDefaults()
|
|
104
|
+
Object.keys(defaults).forEach((key) => {
|
|
105
|
+
if (key in currentSettings) {
|
|
106
|
+
currentSettings[key] = defaults[key as keyof typeof defaults]
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v-auth 权限指令
|
|
3
|
+
*
|
|
4
|
+
* 适用于后端权限控制模式,基于权限标识控制 DOM 元素的显示和隐藏。
|
|
5
|
+
* 如果用户没有对应权限,元素将从 DOM 中移除。
|
|
6
|
+
*
|
|
7
|
+
* ## 主要功能
|
|
8
|
+
*
|
|
9
|
+
* - 权限验证 - 根据路由 meta 中的权限列表验证用户权限
|
|
10
|
+
* - DOM 控制 - 无权限时自动移除元素,而非隐藏
|
|
11
|
+
* - 响应式更新 - 权限变化时自动更新元素状态
|
|
12
|
+
*
|
|
13
|
+
* ## 使用示例
|
|
14
|
+
*
|
|
15
|
+
* ```vue
|
|
16
|
+
* <!-- 只有拥有 'add' 权限的用户才能看到新增按钮 -->
|
|
17
|
+
* <el-button v-auth="'add'">新增</el-button>
|
|
18
|
+
*
|
|
19
|
+
* <!-- 只有拥有 'edit' 权限的用户才能看到编辑按钮 -->
|
|
20
|
+
* <el-button v-auth="'edit'">编辑</el-button>
|
|
21
|
+
*
|
|
22
|
+
* <!-- 只有拥有 'delete' 权限的用户才能看到删除按钮 -->
|
|
23
|
+
* <el-button v-auth="'delete'">删除</el-button>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ## 注意事项
|
|
27
|
+
*
|
|
28
|
+
* - 该指令会直接移除 DOM 元素,而不是使用 v-if 隐藏
|
|
29
|
+
* - 权限列表从当前路由的 meta.authList 中获取
|
|
30
|
+
*
|
|
31
|
+
* @module directives/auth
|
|
32
|
+
* @author Art Design Pro Team
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import { router } from '@/router'
|
|
36
|
+
import { App, Directive, DirectiveBinding } from 'vue'
|
|
37
|
+
|
|
38
|
+
export type AuthDirective = Directive<HTMLElement, string>
|
|
39
|
+
|
|
40
|
+
function checkAuthPermission(el: HTMLElement, binding: DirectiveBinding<string>): void {
|
|
41
|
+
// 获取当前路由的权限列表
|
|
42
|
+
const authList = (router.currentRoute.value.meta.authList as Array<{ authMark: string }>) || []
|
|
43
|
+
|
|
44
|
+
// 检查是否有对应的权限标识
|
|
45
|
+
const hasPermission = authList.some((item) => item.authMark === binding.value)
|
|
46
|
+
|
|
47
|
+
// 如果没有权限,移除元素
|
|
48
|
+
if (!hasPermission) {
|
|
49
|
+
removeElement(el)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function removeElement(el: HTMLElement): void {
|
|
54
|
+
if (el.parentNode) {
|
|
55
|
+
el.parentNode.removeChild(el)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const authDirective: AuthDirective = {
|
|
60
|
+
mounted: checkAuthPermission,
|
|
61
|
+
updated: checkAuthPermission
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function setupAuthDirective(app: App): void {
|
|
65
|
+
app.directive('auth', authDirective)
|
|
66
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import highlighter from 'highlight.js/lib/core'
|
|
2
|
+
import bash from 'highlight.js/lib/languages/bash'
|
|
3
|
+
import css from 'highlight.js/lib/languages/css'
|
|
4
|
+
import java from 'highlight.js/lib/languages/java'
|
|
5
|
+
import javascript from 'highlight.js/lib/languages/javascript'
|
|
6
|
+
import json from 'highlight.js/lib/languages/json'
|
|
7
|
+
import markdown from 'highlight.js/lib/languages/markdown'
|
|
8
|
+
import php from 'highlight.js/lib/languages/php'
|
|
9
|
+
import python from 'highlight.js/lib/languages/python'
|
|
10
|
+
import scss from 'highlight.js/lib/languages/scss'
|
|
11
|
+
import sql from 'highlight.js/lib/languages/sql'
|
|
12
|
+
import typescript from 'highlight.js/lib/languages/typescript'
|
|
13
|
+
import xml from 'highlight.js/lib/languages/xml'
|
|
14
|
+
import yaml from 'highlight.js/lib/languages/yaml'
|
|
15
|
+
|
|
16
|
+
const languages = {
|
|
17
|
+
bash,
|
|
18
|
+
css,
|
|
19
|
+
java,
|
|
20
|
+
javascript,
|
|
21
|
+
json,
|
|
22
|
+
markdown,
|
|
23
|
+
php,
|
|
24
|
+
python,
|
|
25
|
+
scss,
|
|
26
|
+
sql,
|
|
27
|
+
typescript,
|
|
28
|
+
xml,
|
|
29
|
+
yaml
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (const [name, language] of Object.entries(languages)) {
|
|
33
|
+
highlighter.registerLanguage(name, language)
|
|
34
|
+
}
|
|
35
|
+
highlighter.registerAliases('vue', { languageName: 'xml' })
|
|
36
|
+
|
|
37
|
+
export { highlighter }
|