@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,456 @@
|
|
|
1
|
+
<!-- 通知组件 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div
|
|
4
|
+
class="art-notification-panel art-card-sm !shadow-xl"
|
|
5
|
+
:style="{
|
|
6
|
+
transform: show ? 'scaleY(1)' : 'scaleY(0.9)',
|
|
7
|
+
opacity: show ? 1 : 0
|
|
8
|
+
}"
|
|
9
|
+
v-show="visible"
|
|
10
|
+
@click.stop
|
|
11
|
+
>
|
|
12
|
+
<div class="flex-cb px-3.5 mt-3.5">
|
|
13
|
+
<span class="text-base font-medium text-g-800">{{ $t('notice.title') }}</span>
|
|
14
|
+
<span class="text-xs text-g-800 px-1.5 py-1 c-p select-none rounded hover:bg-g-200">
|
|
15
|
+
{{ $t('notice.btnRead') }}
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<ul class="box-border flex items-end w-full h-12.5 px-3.5 border-b-d">
|
|
20
|
+
<li
|
|
21
|
+
v-for="(item, index) in barList"
|
|
22
|
+
:key="index"
|
|
23
|
+
class="h-12 leading-12 mr-5 overflow-hidden text-[13px] text-g-700 c-p select-none"
|
|
24
|
+
:class="{ 'bar-active': barActiveIndex === index }"
|
|
25
|
+
@click="changeBar(index)"
|
|
26
|
+
>
|
|
27
|
+
{{ item.name }} ({{ item.num }})
|
|
28
|
+
</li>
|
|
29
|
+
</ul>
|
|
30
|
+
|
|
31
|
+
<div class="w-full h-[calc(100%-95px)]">
|
|
32
|
+
<div class="h-[calc(100%-60px)] overflow-y-scroll scrollbar-thin">
|
|
33
|
+
<!-- 通知 -->
|
|
34
|
+
<ul v-show="barActiveIndex === 0">
|
|
35
|
+
<li
|
|
36
|
+
v-for="(item, index) in noticeList"
|
|
37
|
+
:key="index"
|
|
38
|
+
class="box-border flex-c px-3.5 py-3.5 c-p last:border-b-0 hover:bg-g-200/60"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
class="size-9 leading-9 text-center rounded-lg flex-cc"
|
|
42
|
+
:class="[getNoticeStyle(item.type).iconClass]"
|
|
43
|
+
>
|
|
44
|
+
<ArtSvgIcon class="text-lg !bg-transparent" :icon="getNoticeStyle(item.type).icon" />
|
|
45
|
+
</div>
|
|
46
|
+
<div class="w-[calc(100%-45px)] ml-3.5">
|
|
47
|
+
<h4 class="text-sm font-normal leading-5.5 text-g-900">{{ item.title }}</h4>
|
|
48
|
+
<p class="mt-1.5 text-xs text-g-500">{{ item.time }}</p>
|
|
49
|
+
</div>
|
|
50
|
+
</li>
|
|
51
|
+
</ul>
|
|
52
|
+
|
|
53
|
+
<!-- 消息 -->
|
|
54
|
+
<ul v-show="barActiveIndex === 1">
|
|
55
|
+
<li
|
|
56
|
+
v-for="(item, index) in msgList"
|
|
57
|
+
:key="index"
|
|
58
|
+
class="box-border flex-c px-3.5 py-3.5 c-p last:border-b-0 hover:bg-g-200/60"
|
|
59
|
+
>
|
|
60
|
+
<div class="w-9 h-9">
|
|
61
|
+
<img :src="item.avatar" class="w-full h-full rounded-lg" />
|
|
62
|
+
</div>
|
|
63
|
+
<div class="w-[calc(100%-45px)] ml-3.5">
|
|
64
|
+
<h4 class="text-xs font-normal leading-5.5">{{ item.title }}</h4>
|
|
65
|
+
<p class="mt-1.5 text-xs text-g-500">{{ item.time }}</p>
|
|
66
|
+
</div>
|
|
67
|
+
</li>
|
|
68
|
+
</ul>
|
|
69
|
+
|
|
70
|
+
<!-- 待办 -->
|
|
71
|
+
<ul v-show="barActiveIndex === 2">
|
|
72
|
+
<li
|
|
73
|
+
v-for="(item, index) in pendingList"
|
|
74
|
+
:key="index"
|
|
75
|
+
class="box-border px-5 py-3.5 last:border-b-0"
|
|
76
|
+
>
|
|
77
|
+
<h4>{{ item.title }}</h4>
|
|
78
|
+
<p class="text-xs text-g-500">{{ item.time }}</p>
|
|
79
|
+
</li>
|
|
80
|
+
</ul>
|
|
81
|
+
|
|
82
|
+
<!-- 空状态 -->
|
|
83
|
+
<div
|
|
84
|
+
v-show="currentTabIsEmpty"
|
|
85
|
+
class="relative top-25 h-full text-g-500 text-center !bg-transparent"
|
|
86
|
+
>
|
|
87
|
+
<ArtSvgIcon icon="system-uicons:inbox" class="text-5xl" />
|
|
88
|
+
<p class="mt-3.5 text-xs !bg-transparent"
|
|
89
|
+
>{{ $t('notice.text[0]') }}{{ barList[barActiveIndex].name }}</p
|
|
90
|
+
>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="relative box-border w-full px-3.5">
|
|
95
|
+
<ElButton class="w-full mt-3" @click="handleViewAll" v-ripple>
|
|
96
|
+
{{ $t('notice.viewAll') }}
|
|
97
|
+
</ElButton>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="h-25"></div>
|
|
102
|
+
</div>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
import { computed, ref, watch, type Ref, type ComputedRef } from 'vue'
|
|
107
|
+
import { useI18n } from 'vue-i18n'
|
|
108
|
+
|
|
109
|
+
// 导入头像图片
|
|
110
|
+
import avatar1 from '@/assets/images/avatar/avatar1.webp'
|
|
111
|
+
import avatar2 from '@/assets/images/avatar/avatar2.webp'
|
|
112
|
+
import avatar3 from '@/assets/images/avatar/avatar3.webp'
|
|
113
|
+
import avatar4 from '@/assets/images/avatar/avatar4.webp'
|
|
114
|
+
import avatar5 from '@/assets/images/avatar/avatar5.webp'
|
|
115
|
+
import avatar6 from '@/assets/images/avatar/avatar6.webp'
|
|
116
|
+
|
|
117
|
+
defineOptions({ name: 'ArtNotification' })
|
|
118
|
+
|
|
119
|
+
interface NoticeItem {
|
|
120
|
+
/** 标题 */
|
|
121
|
+
title: string
|
|
122
|
+
/** 时间 */
|
|
123
|
+
time: string
|
|
124
|
+
/** 类型 */
|
|
125
|
+
type: NoticeType
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface MessageItem {
|
|
129
|
+
/** 标题 */
|
|
130
|
+
title: string
|
|
131
|
+
/** 时间 */
|
|
132
|
+
time: string
|
|
133
|
+
/** 头像 */
|
|
134
|
+
avatar: string
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface PendingItem {
|
|
138
|
+
/** 标题 */
|
|
139
|
+
title: string
|
|
140
|
+
/** 时间 */
|
|
141
|
+
time: string
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface BarItem {
|
|
145
|
+
/** 名称 */
|
|
146
|
+
name: ComputedRef<string>
|
|
147
|
+
/** 数量 */
|
|
148
|
+
num: number
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface NoticeStyle {
|
|
152
|
+
/** 图标 */
|
|
153
|
+
icon: string
|
|
154
|
+
/** icon 样式 */
|
|
155
|
+
iconClass: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
type NoticeType = 'email' | 'message' | 'collection' | 'user' | 'notice'
|
|
159
|
+
|
|
160
|
+
const { t } = useI18n()
|
|
161
|
+
|
|
162
|
+
const props = defineProps<{
|
|
163
|
+
value: boolean
|
|
164
|
+
}>()
|
|
165
|
+
|
|
166
|
+
const emit = defineEmits<{
|
|
167
|
+
'update:value': [value: boolean]
|
|
168
|
+
}>()
|
|
169
|
+
|
|
170
|
+
const show = ref(false)
|
|
171
|
+
const visible = ref(false)
|
|
172
|
+
const barActiveIndex = ref(0)
|
|
173
|
+
|
|
174
|
+
const useNotificationData = () => {
|
|
175
|
+
// 通知数据
|
|
176
|
+
const noticeList = ref<NoticeItem[]>([
|
|
177
|
+
{
|
|
178
|
+
title: '新增国际化',
|
|
179
|
+
time: '2024-6-13 0:10',
|
|
180
|
+
type: 'notice'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
title: '冷月呆呆给你发了一条消息',
|
|
184
|
+
time: '2024-4-21 8:05',
|
|
185
|
+
type: 'message'
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
title: '小肥猪关注了你',
|
|
189
|
+
time: '2020-3-17 21:12',
|
|
190
|
+
type: 'collection'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
title: '新增使用文档',
|
|
194
|
+
time: '2024-02-14 0:20',
|
|
195
|
+
type: 'notice'
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
title: '小肥猪给你发了一封邮件',
|
|
199
|
+
time: '2024-1-20 0:15',
|
|
200
|
+
type: 'email'
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
title: '菜单mock本地真实数据',
|
|
204
|
+
time: '2024-1-17 22:06',
|
|
205
|
+
type: 'notice'
|
|
206
|
+
}
|
|
207
|
+
])
|
|
208
|
+
|
|
209
|
+
// 消息数据
|
|
210
|
+
const msgList = ref<MessageItem[]>([
|
|
211
|
+
{
|
|
212
|
+
title: '池不胖 关注了你',
|
|
213
|
+
time: '2021-2-26 23:50',
|
|
214
|
+
avatar: avatar1
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
title: '唐不苦 关注了你',
|
|
218
|
+
time: '2021-2-21 8:05',
|
|
219
|
+
avatar: avatar2
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: '中小鱼 关注了你',
|
|
223
|
+
time: '2020-1-17 21:12',
|
|
224
|
+
avatar: avatar3
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
title: '何小荷 关注了你',
|
|
228
|
+
time: '2021-01-14 0:20',
|
|
229
|
+
avatar: avatar4
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
title: '誶誶淰 关注了你',
|
|
233
|
+
time: '2020-12-20 0:15',
|
|
234
|
+
avatar: avatar5
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
title: '冷月呆呆 关注了你',
|
|
238
|
+
time: '2020-12-17 22:06',
|
|
239
|
+
avatar: avatar6
|
|
240
|
+
}
|
|
241
|
+
])
|
|
242
|
+
|
|
243
|
+
// 待办数据
|
|
244
|
+
const pendingList = ref<PendingItem[]>([])
|
|
245
|
+
|
|
246
|
+
// 标签栏数据
|
|
247
|
+
const barList = computed<BarItem[]>(() => [
|
|
248
|
+
{
|
|
249
|
+
name: computed(() => t('notice.bar[0]')),
|
|
250
|
+
num: noticeList.value.length
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: computed(() => t('notice.bar[1]')),
|
|
254
|
+
num: msgList.value.length
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: computed(() => t('notice.bar[2]')),
|
|
258
|
+
num: pendingList.value.length
|
|
259
|
+
}
|
|
260
|
+
])
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
noticeList,
|
|
264
|
+
msgList,
|
|
265
|
+
pendingList,
|
|
266
|
+
barList
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// 样式管理
|
|
271
|
+
const useNotificationStyles = () => {
|
|
272
|
+
const noticeStyleMap: Record<NoticeType, NoticeStyle> = {
|
|
273
|
+
email: {
|
|
274
|
+
icon: 'ri:mail-line',
|
|
275
|
+
iconClass: 'bg-warning/12 text-warning'
|
|
276
|
+
},
|
|
277
|
+
message: {
|
|
278
|
+
icon: 'ri:volume-down-line',
|
|
279
|
+
iconClass: 'bg-success/12 text-success'
|
|
280
|
+
},
|
|
281
|
+
collection: {
|
|
282
|
+
icon: 'ri:heart-3-line',
|
|
283
|
+
iconClass: 'bg-danger/12 text-danger'
|
|
284
|
+
},
|
|
285
|
+
user: {
|
|
286
|
+
icon: 'ri:volume-down-line',
|
|
287
|
+
iconClass: 'bg-info/12 text-info'
|
|
288
|
+
},
|
|
289
|
+
notice: {
|
|
290
|
+
icon: 'ri:notification-3-line',
|
|
291
|
+
iconClass: 'bg-theme/12 text-theme'
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const getNoticeStyle = (type: NoticeType): NoticeStyle => {
|
|
296
|
+
const defaultStyle: NoticeStyle = {
|
|
297
|
+
icon: 'ri:arrow-right-circle-line',
|
|
298
|
+
iconClass: 'bg-theme/12 text-theme'
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return noticeStyleMap[type] || defaultStyle
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return {
|
|
305
|
+
getNoticeStyle
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// 动画管理
|
|
310
|
+
const useNotificationAnimation = () => {
|
|
311
|
+
const showNotice = (open: boolean) => {
|
|
312
|
+
if (open) {
|
|
313
|
+
visible.value = true
|
|
314
|
+
setTimeout(() => {
|
|
315
|
+
show.value = true
|
|
316
|
+
}, 5)
|
|
317
|
+
} else {
|
|
318
|
+
show.value = false
|
|
319
|
+
setTimeout(() => {
|
|
320
|
+
visible.value = false
|
|
321
|
+
}, 350)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return {
|
|
326
|
+
showNotice
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// 标签页管理
|
|
331
|
+
const useTabManagement = (
|
|
332
|
+
noticeList: Ref<NoticeItem[]>,
|
|
333
|
+
msgList: Ref<MessageItem[]>,
|
|
334
|
+
pendingList: Ref<PendingItem[]>,
|
|
335
|
+
businessHandlers: {
|
|
336
|
+
handleNoticeAll: () => void
|
|
337
|
+
handleMsgAll: () => void
|
|
338
|
+
handlePendingAll: () => void
|
|
339
|
+
}
|
|
340
|
+
) => {
|
|
341
|
+
const changeBar = (index: number) => {
|
|
342
|
+
barActiveIndex.value = index
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// 检查当前标签页是否为空
|
|
346
|
+
const currentTabIsEmpty = computed(() => {
|
|
347
|
+
const tabDataMap = [noticeList.value, msgList.value, pendingList.value]
|
|
348
|
+
|
|
349
|
+
const currentData = tabDataMap[barActiveIndex.value]
|
|
350
|
+
return currentData && currentData.length === 0
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
const handleViewAll = () => {
|
|
354
|
+
// 查看全部处理器映射
|
|
355
|
+
const viewAllHandlers: Record<number, () => void> = {
|
|
356
|
+
0: businessHandlers.handleNoticeAll,
|
|
357
|
+
1: businessHandlers.handleMsgAll,
|
|
358
|
+
2: businessHandlers.handlePendingAll
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const handler = viewAllHandlers[barActiveIndex.value]
|
|
362
|
+
handler?.()
|
|
363
|
+
|
|
364
|
+
// 关闭通知面板
|
|
365
|
+
emit('update:value', false)
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return {
|
|
369
|
+
changeBar,
|
|
370
|
+
currentTabIsEmpty,
|
|
371
|
+
handleViewAll
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// 业务逻辑处理
|
|
376
|
+
const useBusinessLogic = () => {
|
|
377
|
+
const handleNoticeAll = () => {
|
|
378
|
+
// 处理查看全部通知
|
|
379
|
+
console.log('查看全部通知')
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
const handleMsgAll = () => {
|
|
383
|
+
// 处理查看全部消息
|
|
384
|
+
console.log('查看全部消息')
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const handlePendingAll = () => {
|
|
388
|
+
// 处理查看全部待办
|
|
389
|
+
console.log('查看全部待办')
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
handleNoticeAll,
|
|
394
|
+
handleMsgAll,
|
|
395
|
+
handlePendingAll
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// 组合所有逻辑
|
|
400
|
+
const { noticeList, msgList, pendingList, barList } = useNotificationData()
|
|
401
|
+
const { getNoticeStyle } = useNotificationStyles()
|
|
402
|
+
const { showNotice } = useNotificationAnimation()
|
|
403
|
+
const { handleNoticeAll, handleMsgAll, handlePendingAll } = useBusinessLogic()
|
|
404
|
+
const { changeBar, currentTabIsEmpty, handleViewAll } = useTabManagement(
|
|
405
|
+
noticeList,
|
|
406
|
+
msgList,
|
|
407
|
+
pendingList,
|
|
408
|
+
{ handleNoticeAll, handleMsgAll, handlePendingAll }
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
// 监听属性变化
|
|
412
|
+
watch(
|
|
413
|
+
() => props.value,
|
|
414
|
+
(newValue) => {
|
|
415
|
+
showNotice(newValue)
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
</script>
|
|
419
|
+
|
|
420
|
+
<style scoped>
|
|
421
|
+
@reference '@styles/core/tailwind.css';
|
|
422
|
+
|
|
423
|
+
.art-notification-panel {
|
|
424
|
+
@apply absolute
|
|
425
|
+
top-14.5
|
|
426
|
+
right-5
|
|
427
|
+
w-90
|
|
428
|
+
h-125
|
|
429
|
+
overflow-hidden
|
|
430
|
+
transition-all
|
|
431
|
+
duration-300
|
|
432
|
+
origin-top
|
|
433
|
+
will-change-[top,left]
|
|
434
|
+
max-[640px]:top-[65px]
|
|
435
|
+
max-[640px]:right-0
|
|
436
|
+
max-[640px]:w-full
|
|
437
|
+
max-[640px]:h-[80vh];
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.bar-active {
|
|
441
|
+
color: var(--theme-color) !important;
|
|
442
|
+
border-bottom: 2px solid var(--theme-color);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.scrollbar-thin::-webkit-scrollbar {
|
|
446
|
+
width: 5px !important;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.dark .scrollbar-thin::-webkit-scrollbar-track {
|
|
450
|
+
background-color: var(--default-box-color);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.dark .scrollbar-thin::-webkit-scrollbar-thumb {
|
|
454
|
+
background-color: #222 !important;
|
|
455
|
+
}
|
|
456
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<!-- 布局内容 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div class="layout-content" :class="{ 'overflow-auto': isFullPage }" :style="containerStyle">
|
|
4
|
+
<div id="app-content-header">
|
|
5
|
+
<!-- 节日滚动 -->
|
|
6
|
+
<ArtFestivalTextScroll v-if="AppConfig.features.festivalEffects && !isFullPage" />
|
|
7
|
+
|
|
8
|
+
<!-- 路由信息调试 -->
|
|
9
|
+
<div
|
|
10
|
+
v-if="isOpenRouteInfo === 'true'"
|
|
11
|
+
class="px-2 py-1.5 mb-3 text-sm text-g-500 bg-g-200 border-full-d rounded-md"
|
|
12
|
+
>
|
|
13
|
+
router meta:{{ route.meta }}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<RouterView v-if="isRefresh" v-slot="{ Component, route }" :style="contentStyle">
|
|
18
|
+
<!-- 缓存路由动画 -->
|
|
19
|
+
<Transition :name="showTransitionMask ? '' : actualTransition" mode="out-in" appear>
|
|
20
|
+
<KeepAlive :max="10" :exclude="keepAliveExclude">
|
|
21
|
+
<component
|
|
22
|
+
class="art-page-view"
|
|
23
|
+
:is="Component"
|
|
24
|
+
:key="route.path"
|
|
25
|
+
v-if="route.meta.keepAlive"
|
|
26
|
+
/>
|
|
27
|
+
</KeepAlive>
|
|
28
|
+
</Transition>
|
|
29
|
+
|
|
30
|
+
<!-- 非缓存路由动画 -->
|
|
31
|
+
<Transition :name="showTransitionMask ? '' : actualTransition" mode="out-in" appear>
|
|
32
|
+
<component
|
|
33
|
+
class="art-page-view"
|
|
34
|
+
:is="Component"
|
|
35
|
+
:key="route.path"
|
|
36
|
+
v-if="!route.meta.keepAlive"
|
|
37
|
+
/>
|
|
38
|
+
</Transition>
|
|
39
|
+
</RouterView>
|
|
40
|
+
|
|
41
|
+
<!-- 全屏页面切换过渡遮罩(用于提升页面切换视觉体验) -->
|
|
42
|
+
<Teleport to="body">
|
|
43
|
+
<div
|
|
44
|
+
v-show="showTransitionMask"
|
|
45
|
+
class="fixed top-0 left-0 z-[2000] w-screen h-screen pointer-events-none bg-box"
|
|
46
|
+
/>
|
|
47
|
+
</Teleport>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
<script setup lang="ts">
|
|
51
|
+
import type { CSSProperties } from 'vue'
|
|
52
|
+
import { useRoute } from 'vue-router'
|
|
53
|
+
import { useAutoLayoutHeight } from '@/hooks/core/useLayoutHeight'
|
|
54
|
+
import { useSettingStore } from '@/store/modules/setting'
|
|
55
|
+
import { useWorktabStore } from '@/store/modules/worktab'
|
|
56
|
+
import AppConfig from '@/config'
|
|
57
|
+
|
|
58
|
+
defineOptions({ name: 'ArtPageContent' })
|
|
59
|
+
|
|
60
|
+
const route = useRoute()
|
|
61
|
+
const { containerMinHeight } = useAutoLayoutHeight()
|
|
62
|
+
const { pageTransition, containerWidth, refresh } = storeToRefs(useSettingStore())
|
|
63
|
+
const { keepAliveExclude } = storeToRefs(useWorktabStore())
|
|
64
|
+
|
|
65
|
+
const isRefresh = shallowRef(true)
|
|
66
|
+
const isOpenRouteInfo = import.meta.env.VITE_OPEN_ROUTE_INFO
|
|
67
|
+
const showTransitionMask = ref(false)
|
|
68
|
+
|
|
69
|
+
// 标记是否是首次加载(浏览器刷新)
|
|
70
|
+
const isFirstLoad = ref(true)
|
|
71
|
+
|
|
72
|
+
// 检查当前路由是否需要使用无基础布局模式
|
|
73
|
+
const isFullPage = computed(() => route.matched.some((r) => r.meta?.isFullPage))
|
|
74
|
+
const prevIsFullPage = ref(isFullPage.value)
|
|
75
|
+
|
|
76
|
+
// 切换动画名称:首次加载、从全屏返回时不使用动画
|
|
77
|
+
const actualTransition = computed(() => {
|
|
78
|
+
if (isFirstLoad.value) return ''
|
|
79
|
+
if (prevIsFullPage.value && !isFullPage.value) return ''
|
|
80
|
+
return pageTransition.value
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
// 监听全屏状态变化,显示过渡遮罩
|
|
84
|
+
watch(isFullPage, (val, oldVal) => {
|
|
85
|
+
if (val !== oldVal) {
|
|
86
|
+
showTransitionMask.value = true
|
|
87
|
+
// 延迟隐藏遮罩,给足时间让页面完成切换
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
showTransitionMask.value = false
|
|
90
|
+
}, 50)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
nextTick(() => {
|
|
94
|
+
prevIsFullPage.value = val
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const containerStyle = computed(
|
|
99
|
+
(): CSSProperties =>
|
|
100
|
+
isFullPage.value
|
|
101
|
+
? {
|
|
102
|
+
position: 'fixed',
|
|
103
|
+
top: 0,
|
|
104
|
+
left: 0,
|
|
105
|
+
width: '100%',
|
|
106
|
+
height: '100vh',
|
|
107
|
+
zIndex: 2500,
|
|
108
|
+
background: 'var(--default-bg-color)'
|
|
109
|
+
}
|
|
110
|
+
: {
|
|
111
|
+
maxWidth: containerWidth.value
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const contentStyle = computed(
|
|
116
|
+
(): CSSProperties => ({
|
|
117
|
+
minHeight: containerMinHeight.value
|
|
118
|
+
})
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
const reload = () => {
|
|
122
|
+
isRefresh.value = false
|
|
123
|
+
nextTick(() => {
|
|
124
|
+
isRefresh.value = true
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
watch(refresh, reload, { flush: 'post' })
|
|
129
|
+
|
|
130
|
+
// 组件挂载后标记首次加载完成
|
|
131
|
+
onMounted(() => {
|
|
132
|
+
// 延迟一帧,确保首次渲染完成
|
|
133
|
+
nextTick(() => {
|
|
134
|
+
isFirstLoad.value = false
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
</script>
|