hrp-ui-base 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/components.cjs +1 -1
  2. package/dist/components.es.js +3595 -1224
  3. package/dist/index.cjs +1 -1
  4. package/dist/index.es.js +86 -69
  5. package/dist/style.css +1 -1
  6. package/package.json +2 -1
  7. package/src/api/notice/NoticeController.ts +73 -0
  8. package/src/api/notice/bo/NoticePageBO.ts +24 -0
  9. package/src/api/notice/bo/NoticeVO.ts +31 -0
  10. package/src/assets/layout/avatar-default.svg +6 -0
  11. package/src/assets/layout/collect-active.svg +7 -0
  12. package/src/assets/layout/collect-default.svg +7 -0
  13. package/src/assets/layout/download-active.svg +8 -0
  14. package/src/assets/layout/download-default.svg +8 -0
  15. package/src/assets/layout/export-dark.svg +7 -0
  16. package/src/assets/layout/export-default.svg +7 -0
  17. package/src/assets/layout/font-active.svg +6 -0
  18. package/src/assets/layout/font-default.svg +6 -0
  19. package/src/assets/layout/help-active.svg +10 -0
  20. package/src/assets/layout/help-default.svg +10 -0
  21. package/src/assets/layout/home-active.svg +6 -0
  22. package/src/assets/layout/home.svg +6 -0
  23. package/src/assets/layout/menu-expand.svg +6 -0
  24. package/src/assets/layout/menu-icon.png +0 -0
  25. package/src/assets/layout/menu-position-active.svg +6 -0
  26. package/src/assets/layout/menu-position-default.svg +6 -0
  27. package/src/assets/layout/message-active.svg +9 -0
  28. package/src/assets/layout/message-default.svg +9 -0
  29. package/src/assets/layout/moon.svg +8 -0
  30. package/src/assets/layout/router-all-dark.svg +11 -0
  31. package/src/assets/layout/router-all-default.svg +17 -0
  32. package/src/assets/layout/search-active.svg +20 -0
  33. package/src/assets/layout/search-default.svg +20 -0
  34. package/src/assets/layout/star-active.svg +1 -0
  35. package/src/assets/layout/star-default.svg +3 -0
  36. package/src/assets/layout/sun-active.svg +6 -0
  37. package/src/assets/layout/sun-default.svg +6 -0
  38. package/src/assets/layout/switch-moon.svg +3 -0
  39. package/src/assets/layout/switch-sun.svg +41 -0
  40. package/src/assets/layout/todo-active.svg +12 -0
  41. package/src/assets/layout/todo-default.svg +12 -0
  42. package/src/assets/layout/user-dark.svg +13 -0
  43. package/src/assets/layout/user-default.svg +13 -0
  44. package/src/components/base-layout/index.vue +198 -0
  45. package/src/components/layout/SysHeader.vue +90 -0
  46. package/src/components/layout/SysHeaderLeft.vue +116 -0
  47. package/src/components/layout/SysHeaderRight.vue +112 -0
  48. package/src/components/layout/SysHeaderTabs.vue +289 -0
  49. package/src/components/layout/components/avatar-component.vue +77 -0
  50. package/src/components/layout/components/dark-component.vue +82 -0
  51. package/src/components/layout/components/download-component.vue +49 -0
  52. package/src/components/layout/components/font-size-component.vue +66 -0
  53. package/src/components/layout/components/menu-position-component.vue +97 -0
  54. package/src/components/layout/components/message-component.vue +64 -0
  55. package/src/components/layout/components/todo-component.vue +55 -0
  56. package/src/components/layout/index.ts +24 -0
  57. package/src/components/layout/message/message-dictionary.ts +27 -0
  58. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/350/223/235.svg +8 -0
  59. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245-/351/273/221.svg +8 -0
  60. package/src/components/layout/message/message-icon//345/205/250/351/203/250/351/200/232/347/237/245.svg +8 -0
  61. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/350/223/235.svg +12 -0
  62. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245-/351/273/221.svg +12 -0
  63. package/src/components/layout/message/message-icon//345/205/254/345/221/212/351/200/232/347/237/245.svg +12 -0
  64. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/350/223/235.svg +8 -0
  65. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245-/351/273/221.svg +8 -0
  66. package/src/components/layout/message/message-icon//345/256/241/346/211/271/351/200/232/347/237/245.svg +8 -0
  67. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/350/223/235.svg +13 -0
  68. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245-/351/273/221.svg +13 -0
  69. package/src/components/layout/message/message-icon//345/257/274/345/207/272/351/200/232/347/237/245.svg +13 -0
  70. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/350/223/235.svg +11 -0
  71. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245-/351/273/221.svg +11 -0
  72. package/src/components/layout/message/message-icon//346/234/252/350/257/273/351/200/232/347/237/245.svg +11 -0
  73. package/src/components/layout/message/message-icon//347/251/272/347/212/266/346/200/201.svg +17 -0
  74. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/350/223/235.svg +13 -0
  75. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245-/351/273/221.svg +13 -0
  76. package/src/components/layout/message/message-icon//347/263/273/347/273/237/351/200/232/347/237/245.svg +13 -0
  77. package/src/components/layout/message/message-notification-drawer.vue +529 -0
  78. package/src/components/layout/personalization-guide-dialog.vue +255 -0
  79. package/src/components/layout/sideMenu-global.scss +115 -0
  80. package/src/components/layout/sideMenu.scss +312 -0
  81. package/src/components/layout/sideMenu.vue +542 -0
  82. package/src/components/layout/sideMenuSonList.vue +185 -0
  83. package/src/components/layout/styles/icon.scss +72 -0
  84. package/src/components/layout/types.ts +98 -0
  85. package/src/components.ts +19 -4
@@ -0,0 +1,185 @@
1
+ <template>
2
+ <div class="sidebar-menu-son-list-box">
3
+ <div
4
+ class="sidebar-menu-son-list"
5
+ v-for="(item, index) in currentData"
6
+ :key="index"
7
+ >
8
+ <!-- 分组标题 -->
9
+ <div class="sidebar-menu-son-list-title">{{ item.menuName }}</div>
10
+
11
+ <!-- 子菜单列表 -->
12
+ <div class="sidebar-menu-son-list-little-menu">
13
+ <div
14
+ v-for="(child, childIndex) in item.children"
15
+ :key="childIndex"
16
+ class="menu-item"
17
+ :class="{ 'is-active': isActive(child.url) }"
18
+ @click="handleMenuClick(child)"
19
+ >
20
+ <span class="menu-name">{{ child.menuName }}</span>
21
+ <i class="el-icon-arrow-right menu-arrow"></i>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </template>
27
+
28
+ <script lang="ts" setup>
29
+ import { PropType } from "vue";
30
+ import type HomeMenu from "../../../api/bms/home/bo/HomeMenu";
31
+
32
+ const props = defineProps({
33
+ currentData: {
34
+ type: Object as PropType<HomeMenu[]>,
35
+ required: true,
36
+ },
37
+ currentPath: {
38
+ type: String,
39
+ default: ''
40
+ }
41
+ });
42
+
43
+ const emit = defineEmits<{
44
+ (e: 'menu-click', menu: HomeMenu): void
45
+ }>();
46
+
47
+ // 判断菜单是否激活
48
+ const isActive = (url: string) => {
49
+ if (!url) return false;
50
+ return props.currentPath === url;
51
+ };
52
+
53
+ // 处理菜单点击
54
+ const handleMenuClick = (menu: HomeMenu) => {
55
+ if (!menu.url) {
56
+ return;
57
+ }
58
+ emit('menu-click', menu);
59
+ };
60
+ </script>
61
+
62
+ <style lang="scss" scoped>
63
+ .sidebar-menu-son-list-box {
64
+ width: 100%;
65
+ max-height: none;
66
+ overflow-y: visible;
67
+ padding: 12px;
68
+ background: transparent;
69
+
70
+ &::-webkit-scrollbar {
71
+ width: 6px;
72
+ }
73
+ &::-webkit-scrollbar-thumb {
74
+ background: var(--el-border-color-light);
75
+ border-radius: 3px;
76
+ &:hover {
77
+ background: var(--el-border-color);
78
+ }
79
+ }
80
+ }
81
+
82
+ .sidebar-menu-son-list {
83
+ margin-bottom: 24px;
84
+ &:last-child {
85
+ margin-bottom: 0;
86
+ }
87
+ }
88
+
89
+ .sidebar-menu-son-list-title {
90
+ padding: 10px 12px;
91
+ margin-bottom: 8px;
92
+ font-size: 15px;
93
+ font-weight: 700;
94
+ color: var(--el-text-color-primary);
95
+ background: var(--el-fill-color-light);
96
+ border-left: 4px solid var(--el-color-primary-light-7);
97
+ border-radius: 4px;
98
+ user-select: none;
99
+ }
100
+
101
+ .sidebar-menu-son-list-little-menu {
102
+ display: flex;
103
+ flex-wrap: wrap;
104
+ gap: 8px;
105
+ padding: 0 4px;
106
+
107
+ .menu-item {
108
+ position: relative;
109
+ display: flex;
110
+ align-items: center;
111
+ width: 250px;
112
+ padding: 10px 12px;
113
+ cursor: pointer;
114
+ border-radius: 6px;
115
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
116
+ user-select: none;
117
+ min-width: 0;
118
+ overflow: hidden;
119
+ box-sizing: border-box;
120
+ color: var(--el-text-color-primary);
121
+ background: transparent;
122
+
123
+ .menu-name {
124
+ flex: 1;
125
+ min-width: 0;
126
+ font-size: 14px;
127
+ font-weight: 400;
128
+ white-space: nowrap;
129
+ overflow: hidden;
130
+ text-overflow: ellipsis;
131
+ }
132
+
133
+ .menu-arrow {
134
+ flex-shrink: 0;
135
+ margin-left: 6px;
136
+ font-size: 12px;
137
+ color: var(--el-text-color-placeholder);
138
+ opacity: 0;
139
+ transform: translateX(-4px);
140
+ transition: all 0.2s;
141
+ }
142
+
143
+ &:hover {
144
+ background: var(--el-fill-color-light);
145
+ transform: translateX(2px);
146
+ .menu-arrow {
147
+ opacity: 1;
148
+ transform: translateX(0);
149
+ color: var(--el-color-primary);
150
+ }
151
+ }
152
+
153
+ &.is-active {
154
+ background: linear-gradient(135deg, var(--el-color-primary-light-9) 0%, var(--el-color-primary-light-8) 100%);
155
+ color: var(--el-color-primary);
156
+ font-weight: 500;
157
+ border: 1px solid var(--el-color-primary-light-7);
158
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
159
+
160
+ .menu-arrow {
161
+ opacity: 1;
162
+ transform: translateX(0);
163
+ color: var(--el-color-primary);
164
+ }
165
+
166
+ &::after {
167
+ content: '';
168
+ position: absolute;
169
+ right: 8px;
170
+ top: 50%;
171
+ transform: translateY(-50%);
172
+ width: 6px;
173
+ height: 6px;
174
+ background: var(--el-color-primary);
175
+ border-radius: 50%;
176
+ box-shadow: 0 0 0 2px var(--el-color-primary-light-8);
177
+ }
178
+ }
179
+
180
+ &:active {
181
+ transform: translateX(2px) scale(0.98);
182
+ }
183
+ }
184
+ }
185
+ </style>
@@ -0,0 +1,72 @@
1
+ .icon-box-component-box {
2
+ position: relative;
3
+ }
4
+
5
+ .icon-box {
6
+ width: 34px;
7
+ height: 34px;
8
+ margin: 0 18px 0 0;
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ cursor: pointer;
13
+ border-radius: 4px 4px 4px 4px;
14
+ overflow: hidden;
15
+
16
+ img {
17
+ width: 28px;
18
+ }
19
+ }
20
+
21
+ .icon-box:focus-visible {
22
+ outline: none;
23
+ }
24
+
25
+ .common-switch-box {
26
+ padding: 8px;
27
+
28
+ .common-switch-box-span {
29
+ margin-right: 8px;
30
+ }
31
+ }
32
+
33
+ .icon-box:hover {
34
+ background: var(--custom-theme-fill-1);
35
+ }
36
+
37
+ .icon-box-active:hover {
38
+ background: var(--custom-theme-fill-1);
39
+ }
40
+
41
+ .icon-box-active {
42
+ background: var(--custom-theme-normal-5);
43
+ }
44
+
45
+ // 弹出层提示词
46
+ .popover-tooltip-custom {
47
+ position: absolute;
48
+ top: 46px;
49
+ left: -31%;
50
+ z-index: 999;
51
+ background: #303133;
52
+ color: #ffffff;
53
+ padding: 8px;
54
+ font-size: 12px;
55
+ width: max-content;
56
+ max-width: 100vh;
57
+ border-radius: 6px;
58
+
59
+ .triangle-top {
60
+ width: 0;
61
+ height: 0;
62
+ border-left:
63
+ 5px solid transparent;
64
+ border-right:
65
+ 5px solid transparent;
66
+ border-bottom:
67
+ 7px solid black;
68
+ position: absolute;
69
+ top: -7px;
70
+ left: calc(50% - 5px);
71
+ }
72
+ }
@@ -0,0 +1,98 @@
1
+ import type HomeMenu from "../../api/bms/home/bo/HomeMenu";
2
+ import type NoticeVO from "../../api/notice/bo/NoticeVO";
3
+
4
+ /** 用户配置接口 */
5
+ export interface UserConfig {
6
+ /** 字体大小 */
7
+ fontSize: string;
8
+ /** 昼夜模式 */
9
+ dayOrNight: string;
10
+ /** 是否跟随系统 */
11
+ followSystem: boolean;
12
+ /** 菜单位置 */
13
+ menuPosition: string;
14
+ /** 导航栏折叠状态 */
15
+ navigationBar: boolean;
16
+ /** 是否新手引导 */
17
+ noviceGuide: boolean;
18
+ /** 暗黑模式状态 */
19
+ isDark?: string;
20
+ /** 用户头像 */
21
+ avatar?: string;
22
+ /** 文件上传类型 */
23
+ fileUploadType?: string;
24
+ }
25
+
26
+ /** Tab 接口 */
27
+ export interface TabItem {
28
+ /** 标签标题 */
29
+ title: string;
30
+ /** 路由路径 */
31
+ path: string;
32
+ /** 完整路径 */
33
+ fullPath?: string;
34
+ /** 路由查询参数 */
35
+ query?: Record<string, any>;
36
+ /** 路由name */
37
+ name?: string;
38
+ /** 缓存code */
39
+ cachedCode?: string;
40
+ /** 是否可关闭 */
41
+ closable?: boolean;
42
+ }
43
+
44
+ /** 域信息接口 */
45
+ export interface DomainInfo {
46
+ /** 域名 */
47
+ domainName: string;
48
+ /** 域ID */
49
+ domainId?: string;
50
+ /** 其他属性 */
51
+ [key: string]: any;
52
+ }
53
+
54
+ /** 用户信息接口 */
55
+ export interface UserInfo {
56
+ /** 用户名 */
57
+ userName?: string;
58
+ /** 头像 */
59
+ avatar?: string;
60
+ /** 其他属性 */
61
+ [key: string]: any;
62
+ }
63
+
64
+ /** SysHeader Props */
65
+ export interface SysHeaderProps {
66
+ /** 用户配置 */
67
+ userConfig: UserConfig;
68
+ /** 菜单列表 */
69
+ menuList: HomeMenu[];
70
+ /** 当前应用 */
71
+ currentApplication: DomainInfo;
72
+ /** 是否显示子菜单抽屉 */
73
+ showSubmenuDrawer?: boolean;
74
+ /** 未读消息数量 */
75
+ noticeCount?: number;
76
+ /** 审批数量 */
77
+ approvalCount?: number;
78
+ }
79
+
80
+ /** SysHeaderTabs Props */
81
+ export interface SysHeaderTabsProps {
82
+ /** 标签列表 */
83
+ tabs: TabItem[];
84
+ /** 当前激活的标签路径 */
85
+ activeTab: string;
86
+ /** 首页路径 */
87
+ homeUrl?: string;
88
+ }
89
+
90
+ /** PersonalizationGuide Props */
91
+ export interface PersonalizationGuideProps {
92
+ /** 是否显示 */
93
+ visible: boolean;
94
+ /** 用户配置 */
95
+ userConfig: UserConfig;
96
+ }
97
+
98
+ export type { HomeMenu, NoticeVO };
package/src/components.ts CHANGED
@@ -6,6 +6,10 @@ import AnnexUpload from './components/annex-upload/index.vue'
6
6
  import AnnexImgUpload from './components/annex-img-upload/index.vue'
7
7
  import ListSearchContent from './components/list-search-content/index.vue'
8
8
  import AnnexUploadWeijian from './components/annex-upload-weijian/index.vue'
9
+ import BaseLayout from './components/base-layout/index.vue'
10
+
11
+ // Layout components
12
+ import { SysHeader, SysHeaderTabs, PersonalizationGuideDialog, SideMenu } from './components/layout'
9
13
 
10
14
  /**
11
15
  * 这里默认导出一个vue支持的install方法
@@ -18,13 +22,16 @@ import AnnexUploadWeijian from './components/annex-upload-weijian/index.vue'
18
22
  export default {
19
23
  install(app: App) {
20
24
  app.component("CustomButton", CustomButton);
21
- // 如果还有更多的组件需要注册,可以在这里继续添加
22
25
  app.component("CustonSwitch", CustonSwitch);
23
26
  app.component("AnnexUpload", AnnexUpload);
24
27
  app.component("AnnexImgUpload", AnnexImgUpload);
25
28
  app.component("ListSearchContent", ListSearchContent);
26
29
  app.component("AnnexUploadWeijian", AnnexUploadWeijian);
27
-
30
+ app.component("BaseLayout", BaseLayout);
31
+ app.component("SysHeader", SysHeader);
32
+ app.component("SysHeaderTabs", SysHeaderTabs);
33
+ app.component("PersonalizationGuideDialog", PersonalizationGuideDialog);
34
+ app.component("SideMenu", SideMenu);
28
35
  }
29
36
  }
30
37
 
@@ -33,7 +40,10 @@ export default {
33
40
  * 为了将来支持类似这样按需使用 import {AnnexUpload} from "hrp-ui-base";
34
41
  * 有多少个组件就添加多少个组件
35
42
  */
36
- export { CustomButton, CustonSwitch, AnnexUpload, ListSearchContent, AnnexImgUpload, AnnexUploadWeijian };
43
+ export { CustomButton, CustonSwitch, AnnexUpload, ListSearchContent, AnnexImgUpload, AnnexUploadWeijian, BaseLayout };
44
+
45
+ // 重新导出布局组件
46
+ export * from './components/layout';
37
47
 
38
48
  /**
39
49
  * 这里是重点,需要将这些组件在ts中声明为全局组件;
@@ -45,6 +55,11 @@ declare module "vue" {
45
55
  AnnexUpload: typeof AnnexUpload,
46
56
  AnnexImgUpload: typeof AnnexImgUpload,
47
57
  ListSearchContent: typeof ListSearchContent,
48
- AnnexUploadWeijian: typeof AnnexUploadWeijian
58
+ AnnexUploadWeijian: typeof AnnexUploadWeijian,
59
+ BaseLayout: typeof BaseLayout,
60
+ SysHeader: typeof SysHeader,
61
+ SysHeaderTabs: typeof SysHeaderTabs,
62
+ PersonalizationGuideDialog: typeof PersonalizationGuideDialog,
63
+ SideMenu: typeof SideMenu
49
64
  }
50
65
  }