@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,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 通用类型定义模块
|
|
3
|
+
*
|
|
4
|
+
* 提供项目中常用的通用类型定义
|
|
5
|
+
*
|
|
6
|
+
* ## 主要功能
|
|
7
|
+
*
|
|
8
|
+
* - 状态类型(启用/禁用)
|
|
9
|
+
* - 性别类型
|
|
10
|
+
* - 排序方向类型
|
|
11
|
+
* - 操作类型(增删改查)
|
|
12
|
+
* - 记录类型(键值对)
|
|
13
|
+
* - 时间范围类型
|
|
14
|
+
* - 文件信息类型
|
|
15
|
+
* - 坐标和尺寸类型
|
|
16
|
+
* - 响应式断点类型
|
|
17
|
+
* - 主题和语言类型
|
|
18
|
+
* - 环境和弹窗类型
|
|
19
|
+
*
|
|
20
|
+
* ## 使用场景
|
|
21
|
+
*
|
|
22
|
+
* - 通用数据结构定义
|
|
23
|
+
* - 类型约束和提示
|
|
24
|
+
* - 减少重复类型定义
|
|
25
|
+
*
|
|
26
|
+
* @module types/common/index
|
|
27
|
+
* @author Art Design Pro Team
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
// 导出响应类型
|
|
31
|
+
export * from './response'
|
|
32
|
+
|
|
33
|
+
// 状态类型
|
|
34
|
+
export type Status = 0 | 1 // 0: 禁用, 1: 启用
|
|
35
|
+
|
|
36
|
+
// 性别类型
|
|
37
|
+
export type Gender = 'male' | 'female' | 'unknown'
|
|
38
|
+
|
|
39
|
+
// 排序方向
|
|
40
|
+
export type SortOrder = 'ascending' | 'descending'
|
|
41
|
+
|
|
42
|
+
// 操作类型
|
|
43
|
+
export type ActionType = 'create' | 'update' | 'delete' | 'view'
|
|
44
|
+
|
|
45
|
+
// 可选的记录类型
|
|
46
|
+
export type Recordable<T = any> = Record<string, T>
|
|
47
|
+
|
|
48
|
+
// 键值对类型
|
|
49
|
+
export type KeyValue<T = any> = {
|
|
50
|
+
key: string
|
|
51
|
+
value: T
|
|
52
|
+
label?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 时间范围类型
|
|
56
|
+
export interface TimeRange {
|
|
57
|
+
startTime: string
|
|
58
|
+
endTime: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 文件类型
|
|
62
|
+
export interface FileInfo {
|
|
63
|
+
name: string
|
|
64
|
+
url: string
|
|
65
|
+
size: number
|
|
66
|
+
type: string
|
|
67
|
+
lastModified?: number
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 坐标类型
|
|
71
|
+
export interface Position {
|
|
72
|
+
x: number
|
|
73
|
+
y: number
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 尺寸类型
|
|
77
|
+
export interface Size {
|
|
78
|
+
width: number
|
|
79
|
+
height: number
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 响应式断点类型
|
|
83
|
+
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
84
|
+
|
|
85
|
+
// 主题类型
|
|
86
|
+
export type ThemeMode = 'light' | 'dark' | 'auto'
|
|
87
|
+
|
|
88
|
+
// 语言类型
|
|
89
|
+
export type Language = 'zh-CN' | 'en-US'
|
|
90
|
+
|
|
91
|
+
// 环境类型
|
|
92
|
+
export type Environment = 'development' | 'production' | 'test'
|
|
93
|
+
|
|
94
|
+
// 弹窗类型
|
|
95
|
+
export type DialogType = 'add' | 'edit'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API 响应类型定义模块
|
|
3
|
+
*
|
|
4
|
+
* 提供统一的 API 响应结构类型定义
|
|
5
|
+
*
|
|
6
|
+
* ## 主要功能
|
|
7
|
+
*
|
|
8
|
+
* - 基础响应结构定义
|
|
9
|
+
* - 泛型支持(适配不同数据类型)
|
|
10
|
+
* - 统一的响应格式约束
|
|
11
|
+
*
|
|
12
|
+
* ## 使用场景
|
|
13
|
+
*
|
|
14
|
+
* - API 请求响应类型约束
|
|
15
|
+
* - 接口数据类型定义
|
|
16
|
+
* - 响应数据解析
|
|
17
|
+
*
|
|
18
|
+
* @module types/common/response
|
|
19
|
+
* @author Art Design Pro Team
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** 基础 API 响应结构 */
|
|
23
|
+
export interface BaseResponse<T = unknown> {
|
|
24
|
+
/** 状态码 */
|
|
25
|
+
code: number | string
|
|
26
|
+
/** 模板接口消息 */
|
|
27
|
+
msg?: string
|
|
28
|
+
/** 部分接口使用的消息字段 */
|
|
29
|
+
message?: string
|
|
30
|
+
/** 数据 */
|
|
31
|
+
data: T
|
|
32
|
+
}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图表组件类型定义模块
|
|
3
|
+
*
|
|
4
|
+
* 提供 ECharts 图表组件的完整类型定义
|
|
5
|
+
*
|
|
6
|
+
* ## 主要功能
|
|
7
|
+
*
|
|
8
|
+
* - 基础图表配置类型
|
|
9
|
+
* - 柱状图类型定义
|
|
10
|
+
* - 折线图类型定义
|
|
11
|
+
* - 饼图/环形图类型定义
|
|
12
|
+
* - 雷达图类型定义
|
|
13
|
+
* - K线图类型定义
|
|
14
|
+
* - 散点图类型定义
|
|
15
|
+
* - 地图图表类型定义
|
|
16
|
+
* - 双向堆叠柱状图类型定义
|
|
17
|
+
* - 图表主题配置类型
|
|
18
|
+
* - 图表事件回调类型
|
|
19
|
+
*
|
|
20
|
+
* ## 使用场景
|
|
21
|
+
*
|
|
22
|
+
* - 图表组件 Props 类型约束
|
|
23
|
+
* - 图表配置类型定义
|
|
24
|
+
* - 图表数据结构定义
|
|
25
|
+
* - 图表事件处理
|
|
26
|
+
*
|
|
27
|
+
* @module types/component/chart
|
|
28
|
+
* @author Art Design Pro Team
|
|
29
|
+
*/
|
|
30
|
+
import type { EChartsOption } from '@/plugins/echarts'
|
|
31
|
+
|
|
32
|
+
// 图例位置类型
|
|
33
|
+
export type LegendPosition = 'bottom' | 'top' | 'left' | 'right'
|
|
34
|
+
|
|
35
|
+
export type SymbolType =
|
|
36
|
+
| 'circle'
|
|
37
|
+
| 'rect'
|
|
38
|
+
| 'roundRect'
|
|
39
|
+
| 'triangle'
|
|
40
|
+
| 'diamond'
|
|
41
|
+
| 'pin'
|
|
42
|
+
| 'arrow'
|
|
43
|
+
| 'none'
|
|
44
|
+
|
|
45
|
+
// 图表主题配置
|
|
46
|
+
export interface ChartThemeConfig {
|
|
47
|
+
/** 图表高度 */
|
|
48
|
+
chartHeight: string
|
|
49
|
+
/** 字体大小 */
|
|
50
|
+
fontSize: number
|
|
51
|
+
/** 字体颜色 */
|
|
52
|
+
fontColor: string
|
|
53
|
+
/** 主题颜色 */
|
|
54
|
+
themeColor: string
|
|
55
|
+
/** 颜色组 */
|
|
56
|
+
colors: string[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 图表初始化选项
|
|
60
|
+
export interface UseChartOptions {
|
|
61
|
+
/** 初始化选项 */
|
|
62
|
+
initOptions?: EChartsOption
|
|
63
|
+
/** 延迟初始化时间(ms) */
|
|
64
|
+
initDelay?: number
|
|
65
|
+
/** IntersectionObserver阈值 */
|
|
66
|
+
threshold?: number
|
|
67
|
+
/** 是否自动响应主题变化 */
|
|
68
|
+
autoTheme?: boolean
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 基础图表 Props 接口 - 统一所有图表的基础属性
|
|
72
|
+
export interface BaseChartProps {
|
|
73
|
+
/** 图表高度 */
|
|
74
|
+
height?: string
|
|
75
|
+
/** 是否加载中 */
|
|
76
|
+
loading?: boolean
|
|
77
|
+
isEmpty?: boolean
|
|
78
|
+
/** 颜色配置 */
|
|
79
|
+
colors?: string[]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 轴线显示控制接口 - 统一轴线相关配置
|
|
83
|
+
export interface AxisDisplayProps {
|
|
84
|
+
/** 是否显示坐标轴标签 */
|
|
85
|
+
showAxisLabel?: boolean
|
|
86
|
+
/** 是否显示坐标轴线 */
|
|
87
|
+
showAxisLine?: boolean
|
|
88
|
+
/** 是否显示分割线 */
|
|
89
|
+
showSplitLine?: boolean
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 交互显示控制接口 - 统一交互相关配置
|
|
93
|
+
export interface InteractionProps {
|
|
94
|
+
/** 是否显示提示框 */
|
|
95
|
+
showTooltip?: boolean
|
|
96
|
+
/** 是否显示图例 */
|
|
97
|
+
showLegend?: boolean
|
|
98
|
+
/** 图例位置 */
|
|
99
|
+
legendPosition?: LegendPosition
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 柱状图数据项接口
|
|
103
|
+
export interface BarDataItem {
|
|
104
|
+
/** 系列名称 */
|
|
105
|
+
name: string
|
|
106
|
+
/** 数据值 */
|
|
107
|
+
data: number[]
|
|
108
|
+
/** 柱状图宽度 */
|
|
109
|
+
barWidth?: string | number
|
|
110
|
+
/** 堆叠分组名称 */
|
|
111
|
+
stack?: string
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// 柱状图 Props 接口 - 统一柱状图配置
|
|
115
|
+
export interface BarChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
|
116
|
+
/** 图表数据 - 支持单组数据或多组数据 */
|
|
117
|
+
data: number[] | BarDataItem[]
|
|
118
|
+
/** X轴标签数据 */
|
|
119
|
+
xAxisData?: string[]
|
|
120
|
+
/** 柱状图宽度 */
|
|
121
|
+
barWidth?: string | number
|
|
122
|
+
/** 是否堆叠显示 */
|
|
123
|
+
stack?: boolean
|
|
124
|
+
/** 圆角 */
|
|
125
|
+
borderRadius?: number | number[]
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 折线图数据项接口
|
|
129
|
+
export interface LineDataItem {
|
|
130
|
+
/** 系列名称 */
|
|
131
|
+
name: string
|
|
132
|
+
/** 数据值 */
|
|
133
|
+
data: number[]
|
|
134
|
+
/** 线条宽度 */
|
|
135
|
+
lineWidth?: number
|
|
136
|
+
/** 是否显示区域填充 */
|
|
137
|
+
showAreaColor?: boolean
|
|
138
|
+
/** 区域样式配置 */
|
|
139
|
+
areaStyle?: {
|
|
140
|
+
/** 渐变开始透明度 */
|
|
141
|
+
startOpacity?: number
|
|
142
|
+
/** 渐变结束透明度 */
|
|
143
|
+
endOpacity?: number
|
|
144
|
+
/** 自定义 ECharts areaStyle 配置 */
|
|
145
|
+
custom?: any
|
|
146
|
+
}
|
|
147
|
+
/** 是否平滑曲线 */
|
|
148
|
+
smooth?: boolean
|
|
149
|
+
/** 数据点符号 */
|
|
150
|
+
symbol?: SymbolType
|
|
151
|
+
/** 数据点大小 */
|
|
152
|
+
symbolSize?: number
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 折线图 Props 接口 - 统一折线图配置
|
|
156
|
+
export interface LineChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
|
157
|
+
/** 图表数据 - 支持单组数据或多组数据 */
|
|
158
|
+
data: number[] | LineDataItem[]
|
|
159
|
+
/** X轴标签数据 */
|
|
160
|
+
xAxisData?: string[]
|
|
161
|
+
/** 线条宽度 */
|
|
162
|
+
lineWidth?: number
|
|
163
|
+
/** 是否显示区域填充 */
|
|
164
|
+
showAreaColor?: boolean
|
|
165
|
+
/** 是否平滑曲线 */
|
|
166
|
+
smooth?: boolean
|
|
167
|
+
/** 数据点符号 */
|
|
168
|
+
symbol?: SymbolType
|
|
169
|
+
/** 数据点大小 */
|
|
170
|
+
symbolSize?: number
|
|
171
|
+
/** 多数据动画延迟间隔(毫秒) */
|
|
172
|
+
animationDelay?: number
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// 雷达图数据项接口
|
|
176
|
+
export interface RadarDataItem {
|
|
177
|
+
/** 系列名称 */
|
|
178
|
+
name: string
|
|
179
|
+
/** 数据值 */
|
|
180
|
+
value: number[]
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 雷达图 Props 接口 - 统一雷达图配置
|
|
184
|
+
export interface RadarChartProps extends BaseChartProps, InteractionProps {
|
|
185
|
+
/** 雷达图指标配置 */
|
|
186
|
+
indicator?: Array<{ name: string; max: number }>
|
|
187
|
+
/** 图表数据 */
|
|
188
|
+
data?: RadarDataItem[]
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// 饼图/环形图数据项接口
|
|
192
|
+
export interface PieDataItem {
|
|
193
|
+
/** 数据值 */
|
|
194
|
+
value: number
|
|
195
|
+
/** 数据名称 */
|
|
196
|
+
name: string
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// 环形图 Props 接口 - 统一环形图配置
|
|
200
|
+
export interface RingChartProps extends BaseChartProps, InteractionProps {
|
|
201
|
+
/** 图表数据 */
|
|
202
|
+
data: PieDataItem[]
|
|
203
|
+
/** 内外半径 */
|
|
204
|
+
radius?: string[]
|
|
205
|
+
/** 边框圆角 */
|
|
206
|
+
borderRadius?: number
|
|
207
|
+
/** 中心文本 */
|
|
208
|
+
centerText?: string
|
|
209
|
+
/** 是否显示标签 */
|
|
210
|
+
showLabel?: boolean
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// K线图数据项接口
|
|
214
|
+
export interface KLineDataItem {
|
|
215
|
+
/** 时间标签 */
|
|
216
|
+
time: string
|
|
217
|
+
/** 开盘价 */
|
|
218
|
+
open: number
|
|
219
|
+
/** 收盘价 */
|
|
220
|
+
close: number
|
|
221
|
+
/** 最高价 */
|
|
222
|
+
high: number
|
|
223
|
+
/** 最低价 */
|
|
224
|
+
low: number
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// K线图 Props 接口 - 统一K线图配置
|
|
228
|
+
export interface KLineChartProps extends BaseChartProps {
|
|
229
|
+
/** 图表数据 */
|
|
230
|
+
data?: KLineDataItem[]
|
|
231
|
+
/** 是否显示数据缩放控件 */
|
|
232
|
+
showDataZoom?: boolean
|
|
233
|
+
/** 数据缩放初始开始位置 */
|
|
234
|
+
dataZoomStart?: number
|
|
235
|
+
/** 数据缩放初始结束位置 */
|
|
236
|
+
dataZoomEnd?: number
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// 散点图数据项接口
|
|
240
|
+
export interface ScatterDataItem {
|
|
241
|
+
/** 坐标值 [x, y] */
|
|
242
|
+
value: number[]
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// 散点图 Props 接口 - 统一散点图配置
|
|
246
|
+
export interface ScatterChartProps extends BaseChartProps, AxisDisplayProps, InteractionProps {
|
|
247
|
+
/** 图表数据 */
|
|
248
|
+
data?: ScatterDataItem[]
|
|
249
|
+
/** 散点大小 */
|
|
250
|
+
symbolSize?: number
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// 双柱对比图 Props 接口 - 统一双柱对比图配置
|
|
254
|
+
export interface DualBarCompareChartProps extends BaseChartProps {
|
|
255
|
+
/** 上方数据 */
|
|
256
|
+
topData: number[]
|
|
257
|
+
/** 下方数据 */
|
|
258
|
+
bottomData: number[]
|
|
259
|
+
/** X轴标签数据 */
|
|
260
|
+
xAxisData: string[]
|
|
261
|
+
/** 上方柱子颜色 */
|
|
262
|
+
topColor?: string
|
|
263
|
+
/** 下方柱子颜色 */
|
|
264
|
+
bottomColor?: string
|
|
265
|
+
/** 柱状图宽度 */
|
|
266
|
+
barWidth?: number
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// 地图图表 Props 接口 - 统一地图图表配置
|
|
270
|
+
export interface MapChartProps extends BaseChartProps {
|
|
271
|
+
/** 地图数据 */
|
|
272
|
+
mapData?: any[]
|
|
273
|
+
/** 选中区域 */
|
|
274
|
+
selectedRegion?: string
|
|
275
|
+
/** 是否显示标签 */
|
|
276
|
+
showLabels?: boolean
|
|
277
|
+
/** 是否显示散点 */
|
|
278
|
+
showScatter?: boolean
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// 双向堆叠柱状图 Props 接口(人口金字塔样式)
|
|
282
|
+
export interface BidirectionalBarChartProps
|
|
283
|
+
extends BaseChartProps,
|
|
284
|
+
AxisDisplayProps,
|
|
285
|
+
InteractionProps {
|
|
286
|
+
/** 正向数据(向上显示) */
|
|
287
|
+
positiveData: number[]
|
|
288
|
+
/** 负向数据(向下显示) */
|
|
289
|
+
negativeData: number[]
|
|
290
|
+
/** X轴标签数据 */
|
|
291
|
+
xAxisData?: string[]
|
|
292
|
+
/** 正向数据名称 */
|
|
293
|
+
positiveName?: string
|
|
294
|
+
/** 负向数据名称 */
|
|
295
|
+
negativeName?: string
|
|
296
|
+
/** 柱状图宽度 */
|
|
297
|
+
barWidth?: string | number
|
|
298
|
+
/** Y轴最小值 */
|
|
299
|
+
yAxisMin?: number
|
|
300
|
+
/** Y轴最大值 */
|
|
301
|
+
yAxisMax?: number
|
|
302
|
+
/** 是否显示数据标签 */
|
|
303
|
+
showDataLabel?: boolean
|
|
304
|
+
/** 正向数据圆角配置 */
|
|
305
|
+
positiveBorderRadius?: number | number[]
|
|
306
|
+
/** 负向数据圆角配置 */
|
|
307
|
+
negativeBorderRadius?: number | number[]
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// 图表配置生成器函数类型
|
|
311
|
+
export type ChartOptionGenerator = () => EChartsOption
|
|
312
|
+
|
|
313
|
+
// 图表事件回调类型
|
|
314
|
+
export type ChartEventCallback = (params: any) => void
|
|
315
|
+
|
|
316
|
+
// 图表错误信息接口
|
|
317
|
+
export interface ChartError {
|
|
318
|
+
/** 错误码 */
|
|
319
|
+
code: string
|
|
320
|
+
/** 错误信息 */
|
|
321
|
+
message: string
|
|
322
|
+
/** 错误详情 */
|
|
323
|
+
details?: any
|
|
324
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件类型定义模块
|
|
3
|
+
*
|
|
4
|
+
* 提供项目组件的类型定义
|
|
5
|
+
*
|
|
6
|
+
* ## 主要功能
|
|
7
|
+
*
|
|
8
|
+
* - 搜索组件类型定义
|
|
9
|
+
* - 表格列配置类型
|
|
10
|
+
* - 分页配置类型
|
|
11
|
+
* - 表单规则类型
|
|
12
|
+
* - 对话框配置类型
|
|
13
|
+
*
|
|
14
|
+
* ## 使用场景
|
|
15
|
+
*
|
|
16
|
+
* - 组件 Props 类型约束
|
|
17
|
+
* - 组件配置类型定义
|
|
18
|
+
* - 组件事件参数类型
|
|
19
|
+
*
|
|
20
|
+
* @module types/component/index
|
|
21
|
+
* @author Art Design Pro Team
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export type { ColumnOption, SearchComponentType, SearchFormItem } from '@kevairy/components'
|
|
25
|
+
|
|
26
|
+
// 搜索框值变化参数
|
|
27
|
+
export interface SearchChangeParams {
|
|
28
|
+
prop: string
|
|
29
|
+
val: unknown
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 分页配置
|
|
33
|
+
export interface PaginationConfig {
|
|
34
|
+
// 当前页
|
|
35
|
+
currentPage: number
|
|
36
|
+
// 每页条数
|
|
37
|
+
pageSize: number
|
|
38
|
+
// 总条数
|
|
39
|
+
total: number
|
|
40
|
+
// 每页显示个数选择器的选项
|
|
41
|
+
pageSizes?: number[]
|
|
42
|
+
// 组件布局
|
|
43
|
+
layout?: string
|
|
44
|
+
// 是否为小型分页
|
|
45
|
+
small?: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 表单规则
|
|
49
|
+
export interface FormRule {
|
|
50
|
+
// 是否必填
|
|
51
|
+
required?: boolean
|
|
52
|
+
// 错误提示信息
|
|
53
|
+
message?: string
|
|
54
|
+
// 触发方式
|
|
55
|
+
trigger?: string | string[]
|
|
56
|
+
// 最小长度
|
|
57
|
+
min?: number
|
|
58
|
+
// 最大长度
|
|
59
|
+
max?: number
|
|
60
|
+
// 正则表达式
|
|
61
|
+
pattern?: RegExp
|
|
62
|
+
// 自定义验证函数
|
|
63
|
+
validator?: (rule: any, value: any, callback: any) => void
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 对话框配置
|
|
67
|
+
export interface DialogConfig {
|
|
68
|
+
// 标题
|
|
69
|
+
title: string
|
|
70
|
+
// 是否显示
|
|
71
|
+
visible: boolean
|
|
72
|
+
// 宽度
|
|
73
|
+
width?: string | number
|
|
74
|
+
// 是否可以通过点击 modal 关闭
|
|
75
|
+
closeOnClickModal?: boolean
|
|
76
|
+
// 是否可以通过按下 ESC 关闭
|
|
77
|
+
closeOnPressEscape?: boolean
|
|
78
|
+
// 是否显示关闭按钮
|
|
79
|
+
showClose?: boolean
|
|
80
|
+
// 是否在 Dialog 出现时将 body 滚动锁定
|
|
81
|
+
lockScroll?: boolean
|
|
82
|
+
// 是否显示遮罩层
|
|
83
|
+
modal?: boolean
|
|
84
|
+
// 自定义类名
|
|
85
|
+
customClass?: string
|
|
86
|
+
}
|