aldehyde 0.2.333 → 0.2.335

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 (130) hide show
  1. package/lib/controls/rfield/index.js +1 -1
  2. package/lib/controls/rfield/index.js.map +1 -1
  3. package/lib/detail/button/inline-edit-button.d.ts +13 -0
  4. package/lib/detail/button/inline-edit-button.d.ts.map +1 -0
  5. package/lib/detail/button/inline-edit-button.js +17 -0
  6. package/lib/detail/button/inline-edit-button.js.map +1 -0
  7. package/lib/index.d.ts +2 -1
  8. package/lib/index.d.ts.map +1 -1
  9. package/lib/index.js +3 -1
  10. package/lib/index.js.map +1 -1
  11. package/lib/layout2/components/theme-button.js +1 -1
  12. package/lib/layout2/components/theme-button.js.map +1 -1
  13. package/lib/layout2/components/user-button.d.ts +2 -1
  14. package/lib/layout2/components/user-button.d.ts.map +1 -1
  15. package/lib/layout2/components/user-button.js +8 -2
  16. package/lib/layout2/components/user-button.js.map +1 -1
  17. package/lib/layout3/components/tabs-layout.js +1 -1
  18. package/lib/layout3/components/tabs-layout.js.map +1 -1
  19. package/lib/layout3/css/header.css +166 -138
  20. package/lib/layout3/css/main.css +74 -4
  21. package/lib/layout3/css/sider.css +5 -4
  22. package/lib/layout3/css/tabs-layout.css +1 -4
  23. package/lib/layout3/header.d.ts.map +1 -1
  24. package/lib/layout3/header.js +2 -1
  25. package/lib/layout3/header.js.map +1 -1
  26. package/lib/layout3/page.d.ts.map +1 -1
  27. package/lib/layout3/page.js +1 -1
  28. package/lib/layout3/page.js.map +1 -1
  29. package/lib/layout3/sider.js +1 -1
  30. package/lib/layout3/sider.js.map +1 -1
  31. package/lib/layout4/components/tabs-layout.d.ts +5 -0
  32. package/lib/layout4/components/tabs-layout.d.ts.map +1 -0
  33. package/lib/layout4/components/tabs-layout.js +68 -0
  34. package/lib/layout4/components/tabs-layout.js.map +1 -0
  35. package/lib/layout4/css/header.css +164 -0
  36. package/lib/layout4/css/main.css +119 -0
  37. package/lib/layout4/css/sider.css +11 -0
  38. package/lib/layout4/css/tabs-layout.css +43 -0
  39. package/lib/layout4/header.d.ts +11 -0
  40. package/lib/layout4/header.d.ts.map +1 -0
  41. package/lib/layout4/header.js +137 -0
  42. package/lib/layout4/header.js.map +1 -0
  43. package/lib/layout4/imgs/header-bg.png +0 -0
  44. package/lib/layout4/imgs/home.png +0 -0
  45. package/lib/layout4/imgs/menu-item-bg.png +0 -0
  46. package/lib/layout4/imgs/user.png +0 -0
  47. package/lib/layout4/main.d.ts +8 -0
  48. package/lib/layout4/main.d.ts.map +1 -0
  49. package/lib/layout4/main.js +14 -0
  50. package/lib/layout4/main.js.map +1 -0
  51. package/lib/layout4/page.d.ts +8 -0
  52. package/lib/layout4/page.d.ts.map +1 -0
  53. package/lib/layout4/page.js +60 -0
  54. package/lib/layout4/page.js.map +1 -0
  55. package/lib/layout4/sider.d.ts +10 -0
  56. package/lib/layout4/sider.d.ts.map +1 -0
  57. package/lib/layout4/sider.js +125 -0
  58. package/lib/layout4/sider.js.map +1 -0
  59. package/lib/lowcode-components/base-table/index.d.ts.map +1 -1
  60. package/lib/lowcode-components/base-table/index.js +9 -6
  61. package/lib/lowcode-components/base-table/index.js.map +1 -1
  62. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.d.ts +0 -4
  63. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.d.ts.map +1 -1
  64. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js +7 -5
  65. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.js.map +1 -1
  66. package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -1
  67. package/lib/lowcode-components/lowcode-view/index.js +3 -8
  68. package/lib/lowcode-components/lowcode-view/index.js.map +1 -1
  69. package/lib/table/act-table.d.ts +8 -0
  70. package/lib/table/act-table.d.ts.map +1 -1
  71. package/lib/table/act-table.js +52 -13
  72. package/lib/table/act-table.js.map +1 -1
  73. package/lib/table/column/column-builder.d.ts.map +1 -1
  74. package/lib/table/column/column-builder.js +32 -8
  75. package/lib/table/column/column-builder.js.map +1 -1
  76. package/lib/table/relation-table.d.ts.map +1 -1
  77. package/lib/table/relation-table.js +2 -0
  78. package/lib/table/relation-table.js.map +1 -1
  79. package/lib/tmpl/hcservice-v3.d.ts +4 -0
  80. package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
  81. package/lib/tmpl/hcservice-v3.js +6 -0
  82. package/lib/tmpl/hcservice-v3.js.map +1 -1
  83. package/lib/tmpl/interface.d.ts +6 -1
  84. package/lib/tmpl/interface.d.ts.map +1 -1
  85. package/lib/tmpl/interface.js.map +1 -1
  86. package/lib/tmpl/tmpl-config-analysis.d.ts.map +1 -1
  87. package/lib/tmpl/tmpl-config-analysis.js +2 -2
  88. package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
  89. package/lib/tree/index.css +11 -9
  90. package/lib/tree/tmpl-tree.js +1 -1
  91. package/lib/tree/tmpl-tree.js.map +1 -1
  92. package/package.json +1 -1
  93. package/src/aldehyde/controls/rfield/index.tsx +1 -1
  94. package/src/aldehyde/detail/button/inline-edit-button.tsx +40 -0
  95. package/src/aldehyde/index.tsx +6 -1
  96. package/src/aldehyde/layout2/components/theme-button.tsx +1 -1
  97. package/src/aldehyde/layout2/components/user-button.tsx +23 -14
  98. package/src/aldehyde/layout3/components/tabs-layout.tsx +1 -1
  99. package/src/aldehyde/layout3/css/header.css +166 -138
  100. package/src/aldehyde/layout3/css/main.css +74 -4
  101. package/src/aldehyde/layout3/css/sider.css +5 -4
  102. package/src/aldehyde/layout3/css/tabs-layout.css +1 -4
  103. package/src/aldehyde/layout3/header.tsx +8 -6
  104. package/src/aldehyde/layout3/page.tsx +1 -0
  105. package/src/aldehyde/layout3/sider.tsx +1 -1
  106. package/src/aldehyde/layout4/components/tabs-layout.tsx +106 -0
  107. package/src/aldehyde/layout4/css/header.css +164 -0
  108. package/src/aldehyde/layout4/css/main.css +119 -0
  109. package/src/aldehyde/layout4/css/sider.css +11 -0
  110. package/src/aldehyde/layout4/css/tabs-layout.css +43 -0
  111. package/src/aldehyde/layout4/header.tsx +182 -0
  112. package/src/aldehyde/layout4/imgs/header-bg.png +0 -0
  113. package/src/aldehyde/layout4/imgs/home.png +0 -0
  114. package/src/aldehyde/layout4/imgs/menu-item-bg.png +0 -0
  115. package/src/aldehyde/layout4/imgs/user.png +0 -0
  116. package/src/aldehyde/layout4/imgs/user.svg +27 -0
  117. package/src/aldehyde/layout4/main.tsx +27 -0
  118. package/src/aldehyde/layout4/page.tsx +91 -0
  119. package/src/aldehyde/layout4/sider.tsx +178 -0
  120. package/src/aldehyde/lowcode-components/base-table/index.tsx +22 -19
  121. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +7 -10
  122. package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +2 -7
  123. package/src/aldehyde/table/act-table.tsx +275 -229
  124. package/src/aldehyde/table/column/column-builder.tsx +550 -505
  125. package/src/aldehyde/table/relation-table.tsx +1 -0
  126. package/src/aldehyde/tmpl/hcservice-v3.tsx +16 -0
  127. package/src/aldehyde/tmpl/interface.tsx +6 -1
  128. package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +6 -6
  129. package/src/aldehyde/tree/index.css +11 -9
  130. package/src/aldehyde/tree/tmpl-tree.tsx +1 -1
@@ -1,156 +1,184 @@
1
- .layout-header{
2
- padding: 0;
3
- color:#ffffff;
4
- position: relative;
5
- height: auto;
6
- background:#041B3B ;
7
- .header-top{
8
- background-size: 100% 100%;
9
- background-repeat: no-repeat;
10
- background-position: center;
11
- width: 100%;
12
- height: 103px;
13
- display: flex;
14
- justify-content: center;
15
- background-color: #041B3B;
16
- border: none;
17
- .header-title{
18
- font-family: YouSheBiaoTiHei;
19
- font-size: 48px;
20
- line-height: 62px;
21
- text-align: justify;
22
- font-style: normal;
23
- text-transform: none;
24
- background-image: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);/* 可以调整方向和颜色 */
25
- /* 2. 关键: 将背景裁剪到文字形状 */
26
- -webkit-background-clip: text; /* 对于 Webkit 内核浏览器 (如 Safari, 老版Chrome) */
27
- background-clip: text; /* 标准属性 */
28
- /* 3. 关键: 将文字颜色设置为透明,以显示背景渐变 */
29
- -webkit-text-fill-color: transparent; /* 对于 Webkit 内核浏览器 */
30
- color: transparent; /* 标准属性,但注意某些环境下可能需 -webkit-text-fill-color 配合 */
31
- }
32
- .header-time{
33
- font-size: 18px;
34
- line-height: 24px;
35
- letter-spacing: 1px;
36
- text-align: left;
37
- font-style: normal;
38
- text-transform: none;
39
- background-image: linear-gradient(180deg, #FFFFFF 36%, #008BFD 100%);
40
- -webkit-background-clip: text;
41
- background-clip: text;
42
- -webkit-text-fill-color: transparent;
43
- color: transparent;
44
- position: absolute;
45
- top: 46px;
46
- left: 33px;
47
- font-weight: 500;
48
- }
1
+ .layout-header {
2
+ padding: 0;
3
+ color: #ffffff;
4
+ position: relative;
5
+ height: auto;
6
+ background: #041B3B;
7
+
8
+ .header-top {
9
+ background-size: 100% 100%;
10
+ background-repeat: no-repeat;
11
+ background-position: center;
12
+ width: 100%;
13
+ height: 103px;
14
+ display: flex;
15
+ justify-content: center;
16
+ background-color: #041B3B;
17
+ border: none;
18
+
19
+ .header-title {
20
+ font-family: YouSheBiaoTiHei;
21
+ font-size: 48px;
22
+ line-height: 62px;
23
+ text-align: justify;
24
+ font-style: normal;
25
+ text-transform: none;
26
+ background-image: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
27
+ /* 可以调整方向和颜色 */
28
+ /* 2. 关键: 将背景裁剪到文字形状 */
29
+ -webkit-background-clip: text;
30
+ /* 对于 Webkit 内核浏览器 (如 Safari, 老版Chrome) */
31
+ background-clip: text;
32
+ /* 标准属性 */
33
+ /* 3. 关键: 将文字颜色设置为透明,以显示背景渐变 */
34
+ -webkit-text-fill-color: transparent;
35
+ /* 对于 Webkit 内核浏览器 */
36
+ color: transparent;
37
+ /* 标准属性,但注意某些环境下可能需 -webkit-text-fill-color 配合 */
49
38
  }
50
- .header-right{
39
+
40
+ .header-time {
41
+ font-size: 18px;
42
+ line-height: 24px;
43
+ letter-spacing: 1px;
44
+ text-align: left;
45
+ font-style: normal;
46
+ text-transform: none;
47
+ background-image: linear-gradient(180deg, #FFFFFF 36%, #008BFD 100%);
48
+ -webkit-background-clip: text;
49
+ background-clip: text;
50
+ -webkit-text-fill-color: transparent;
51
+ color: transparent;
51
52
  position: absolute;
52
- right: 28px;
53
- top: 52px;
54
- line-height: normal;
55
- .message-bar{
56
- min-width: 0;
57
- svg{
58
- color:#009BFF
59
- }
60
- }
61
- .message-bar:hover{
62
- background: transparent;
53
+ top: 46px;
54
+ left: 33px;
55
+ font-weight: 500;
56
+ }
57
+ }
58
+
59
+ .header-right {
60
+ position: absolute;
61
+ right: 28px;
62
+ top: 52px;
63
+ line-height: normal;
64
+
65
+ .message-bar {
66
+ min-width: 0;
67
+
68
+ svg {
69
+ color: #009BFF
63
70
  }
64
- .header-user{
65
- button .ant-btn-icon{
66
- margin-top: 4px;
67
- }
71
+ }
72
+
73
+ .message-bar:hover {
74
+ background: transparent;
75
+ }
76
+
77
+ .header-user {
78
+ button .ant-btn-icon {
79
+ margin-top: 4px;
68
80
  }
69
81
  }
70
- .header-nav{
71
- margin: 0 0 16px 0;
82
+ }
83
+
84
+ .header-nav {
85
+ margin: 0 0 16px 0;
86
+ display: flex;
87
+ justify-content: start;
88
+ align-items: center;
89
+ line-height: normal;
90
+
91
+ .header-home-page {
92
+ width: 220px;
72
93
  display: flex;
73
- justify-content: start;
74
94
  align-items: center;
95
+ justify-content: flex-start;
96
+ padding: 4px 0 4px 24px;
97
+ margin-right: 12px;
98
+ cursor: pointer;
99
+ background-size: 100% 100%;
100
+ background-repeat: no-repeat;
101
+ background-position: center;
102
+ }
103
+
104
+ .header-menu {
105
+ width: calc(100% - 220px);
106
+ }
107
+
108
+ .home-page-icon {
109
+ color: #90DEFF;
110
+ font-size: 18px;
111
+ }
112
+
113
+ .home-page-title {
114
+ margin-left: 10px;
115
+ font-family: YouSheBiaoTiHei;
116
+ background: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
117
+ -webkit-background-clip: text;
118
+ background-clip: text;
119
+ -webkit-text-fill-color: transparent;
120
+ font-size: 20px;
121
+ }
122
+
123
+ .ant-menu-submenu-selected::after,
124
+ .ant-menu-submenu:hover::after,
125
+ .ant-menu-submenu-open::after,
126
+ .ant-menu-submenu::after {
127
+ border-bottom: none !important;
128
+ }
129
+
130
+ .menu-disabled {
131
+ cursor: not-allowed;
132
+ }
133
+
134
+ .menu-item {
135
+ position: relative;
136
+ width: 126px;
137
+ height: 42px;
75
138
  line-height: normal;
76
- .header-home-page{
77
- width: 220px;
78
- display: flex;
79
- align-items: center;
80
- justify-content: flex-start;
81
- padding: 4px 0 4px 24px;
82
- margin-right: 12px;
83
- cursor: pointer;
84
- background-size: 100% 100%;
85
- background-repeat: no-repeat;
86
- background-position: center;
87
- }
88
- .home-page-icon{
89
- color: #90DEFF;
90
- font-size: 18px;
91
- }
92
- .home-page-title{
93
- margin-left: 10px;
94
- font-family: YouSheBiaoTiHei;
95
- background: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
96
- -webkit-background-clip: text;
97
- background-clip: text;
98
- -webkit-text-fill-color: transparent;
99
- font-size: 20px;
100
- }
101
- .ant-menu-submenu-selected::after,
102
- .ant-menu-submenu:hover::after,
103
- .ant-menu-submenu-open::after,
104
- .ant-menu-submenu::after{
105
- border-bottom: none !important;
106
- }
107
- .menu-disabled{
108
- cursor: not-allowed;
109
- }
110
- .menu-item {
111
- position: relative;
112
- width: 126px;
113
- height: 42px;
114
- line-height: normal;
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ background: linear-gradient(180deg, rgba(124, 208, 255, 0.3) 0%, rgba(0, 41, 147, 0) 100%), linear-gradient(360deg, rgba(0, 133, 255, 0.5) 0%, rgba(0, 163, 255, 0.15) 22%, rgba(0, 163, 255, 0) 100%), rgba(0, 0, 0, 0.75);
143
+ border-radius: 120px 120px 120px 120px;
144
+ border: 1px solid;
145
+ background-clip: padding-box;
146
+ color: #009BFF;
147
+ font-weight: 500;
148
+ z-index: 1;
149
+
150
+ .menu-item-border,
151
+ .menu-item-border-sel {
115
152
  display: flex;
116
153
  align-items: center;
117
154
  justify-content: center;
118
- background: linear-gradient( 180deg, rgba(124,208,255,0.3) 0%, rgba(0,41,147,0) 100%), linear-gradient( 360deg, rgba(0,133,255,0.5) 0%, rgba(0,163,255,0.15) 22%, rgba(0,163,255,0) 100%), rgba(0,0,0,0.75);
155
+ width: 118px;
156
+ height: 40px;
119
157
  border-radius: 120px 120px 120px 120px;
120
158
  border: 1px solid;
121
159
  background-clip: padding-box;
122
- color: #009BFF;
123
- font-weight: 500;
124
- z-index: 1;
125
- .menu-item-border,.menu-item-border-sel{
126
- display: flex;
127
- align-items: center;
128
- justify-content: center;
129
- width: 118px;
130
- height: 40px;
131
- border-radius: 120px 120px 120px 120px;
132
- border: 1px solid;
133
- background-clip: padding-box;
134
- background: linear-gradient(180deg, #203c51, #02243e);
135
- }
136
- .menu-item-border-sel{
137
- background: rgba(0,142,255,0.56);
138
- box-shadow: inset 0px 0px 20px 5px #000C27;
139
- color:#C4E8FF !important;
140
- font-weight: 700 !important;
141
- }
160
+ background: linear-gradient(180deg, #203c51, #02243e);
142
161
  }
143
- .menu-item::before {
144
- content: '';
145
- position: absolute;
146
- top: 0;
147
- left: 0;
148
- right: 0;
149
- bottom: 0;
150
- margin-bottom: -2px;
151
- background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0, 102, 255, 0.3), rgba(0, 102, 255, 1), rgba(0, 102, 255, 0.3),rgba(0,0,0,0));
152
- border-radius: inherit;
153
- z-index: -1;
162
+
163
+ .menu-item-border-sel {
164
+ background: rgba(0, 142, 255, 0.56);
165
+ box-shadow: inset 0px 0px 20px 5px #000C27;
166
+ color: #C4E8FF !important;
167
+ font-weight: 700 !important;
154
168
  }
155
169
  }
170
+
171
+ .menu-item::before {
172
+ content: '';
173
+ position: absolute;
174
+ top: 0;
175
+ left: 0;
176
+ right: 0;
177
+ bottom: 0;
178
+ margin-bottom: -2px;
179
+ background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 102, 255, 0.3), rgba(0, 102, 255, 1), rgba(0, 102, 255, 0.3), rgba(0, 0, 0, 0));
180
+ border-radius: inherit;
181
+ z-index: -1;
182
+ }
183
+ }
156
184
  }
@@ -20,9 +20,6 @@
20
20
 
21
21
  .ant-drawer,
22
22
  .ant-modal-content {
23
- .ant-drawer-content {
24
- border: none !important;
25
- }
26
23
 
27
24
  .ant-card-head {
28
25
  background: transparent !important;
@@ -32,6 +29,47 @@
32
29
  background: #041B3B !important;
33
30
  }
34
31
  }
32
+
33
+ .ant-menu-overflow-item-rest .ant-menu-submenu-title {
34
+ height: 100%;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ }
39
+
40
+ .ant-menu-submenu-popup {
41
+
42
+ .menu-item-selected {
43
+ background: transparent !important;
44
+ }
45
+
46
+ .ant-menu-submenu-title a {
47
+ color: #bec8d6
48
+ }
49
+
50
+ .ant-menu-submenu-selected a {
51
+ color: var(--ant-primary-color)
52
+ }
53
+ }
54
+
55
+ .ant-table-tbody,
56
+ .ant-table-summary {
57
+ .ant-table-cell:has(.xiaoji) {
58
+ background-color: var(--color-5) !important;
59
+ }
60
+
61
+ .ant-table-cell:has(.heji) {
62
+ background-color: var(--color-7) !important;
63
+ }
64
+
65
+ .xiaoji {
66
+ background-color: var(--color-5) !important;
67
+ }
68
+
69
+ .heji {
70
+ background-color: var(--color-7) !important;
71
+ }
72
+ }
35
73
  }
36
74
 
37
75
  .v3-antd-table {
@@ -45,7 +83,7 @@
45
83
  }
46
84
 
47
85
  .ant-table-tbody .ant-table-cell {
48
- background: transparent;
86
+ background: var(--ant-layout-body-bg) !important;
49
87
  }
50
88
  }
51
89
 
@@ -54,4 +92,36 @@
54
92
  .ant-table-css-var {
55
93
  --ant-table-border-color: #05449a;
56
94
  }
95
+ }
96
+
97
+ .v3-antd-modal {
98
+ .ant-modal-content {
99
+ background: var(--ant-color-bg-base) !important;
100
+ border: 1px solid var(--ant-color-border-secondary) !important;
101
+ }
102
+
103
+ .ant-modal-header {
104
+ background: transparent;
105
+ }
106
+ }
107
+
108
+ .v3-antd-drawer {
109
+ background: var(--ant-color-bg-base) !important;
110
+ border: 2px solid var(--ant-color-border-secondary) !important;
111
+ }
112
+
113
+ .v3-antd-card {
114
+ background: transparent;
115
+
116
+ .ant-card-head {
117
+ background: var(--ant-color-bg-container) !important;
118
+ }
119
+
120
+ .ant-card-body {
121
+ background: transparent;
122
+ }
123
+ }
124
+
125
+ .v3-antd-card:hover {
126
+ border-color: var(--ant-color-border-secondary);
57
127
  }
@@ -1,10 +1,11 @@
1
- .layout-sider{
1
+ .v3-layout-sider {
2
2
  margin-bottom: 12px;
3
3
  overflow: auto;
4
- background: linear-gradient( 180deg, rgba(7,27,67,0.1) 0%, rgba(13,46,89,0.2) 100%), radial-gradient( 188% 188% at -139% 100%, rgba(39,115,255,0.1) 0%, rgba(39,115,255,0) 100%), radial-gradient( 488% 488% at -439% 100%, rgba(39,115,255,0.2) 0%, rgba(39,115,255,0) 100%), radial-gradient( 716% 716% at -667% 100%, rgba(39,115,255,0.5) 0%, rgba(39,115,255,0) 100%);
4
+ background: linear-gradient(180deg, rgba(7, 27, 67, 0.1) 0%, rgba(13, 46, 89, 0.2) 100%), radial-gradient(188% 188% at -139% 100%, rgba(39, 115, 255, 0.1) 0%, rgba(39, 115, 255, 0) 100%), radial-gradient(488% 488% at -439% 100%, rgba(39, 115, 255, 0.2) 0%, rgba(39, 115, 255, 0) 100%), radial-gradient(716% 716% at -667% 100%, rgba(39, 115, 255, 0.5) 0%, rgba(39, 115, 255, 0) 100%);
5
5
  border: 1px solid #05449a;
6
6
  box-shadow: inset 0 0 8px #042c64, inset 0 0 8px #042c64;
7
- .ant-menu-item-selected{
8
- background: linear-gradient(90deg,#88EFFF00,rgba(163,194,255,0.2),#88EFFF00);
7
+
8
+ .ant-menu-item-selected {
9
+ background: linear-gradient(90deg, #88EFFF00, rgba(163, 194, 255, 0.2), #88EFFF00);
9
10
  }
10
11
  }
@@ -1,4 +1,4 @@
1
- .tabs-layout {
1
+ .v3-tabs-layout {
2
2
  height: 100%;
3
3
 
4
4
  .ant-tabs-nav {
@@ -28,9 +28,6 @@
28
28
  }
29
29
 
30
30
  /* 组件样式异常覆盖 */
31
- .ant-card-head {
32
- background: transparent !important;
33
- }
34
31
 
35
32
  .actTable {
36
33
  .ant-card {
@@ -164,12 +164,14 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
164
164
  <HomeFilled className="home-page-icon" />
165
165
  <div className="home-page-title">{translate("${首页}")}</div>
166
166
  </NavLink>
167
- <Menu
168
- mode="horizontal"
169
- items={menu}
170
- selectedKeys={selectedKeys}
171
- style={{ background: "#041B3B", border: "none" }}
172
- />
167
+ <div className="header-menu">
168
+ <Menu
169
+ mode="horizontal"
170
+ items={menu}
171
+ selectedKeys={selectedKeys}
172
+ style={{ background: "#041B3B", border: "none" }}
173
+ />
174
+ </div>
173
175
  </div>
174
176
  </Layout.Header>
175
177
  );
@@ -62,6 +62,7 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
62
62
  table={{ className: "v3-antd-table" }}
63
63
  drawer={{ className: "v3-antd-drawer" }}
64
64
  modal={{ className: "v3-antd-modal" }}
65
+ card={{ className: "v3-antd-card" }}
65
66
  >
66
67
  <Layout style={{ height: "100%" }}>
67
68
  <Header systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
@@ -139,7 +139,7 @@ const Sider: React.FC<SiderPropsType> = ({ menuList, collapsed }) => {
139
139
  collapsed={collapsed}
140
140
  collapsedWidth={0}
141
141
  width={200}
142
- className="layout-sider"
142
+ className="v3-layout-sider"
143
143
  >
144
144
  <ConfigProvider
145
145
  theme={{
@@ -0,0 +1,106 @@
1
+ import React, { useCallback, useMemo } from "react";
2
+ import { Dropdown, Tabs } from 'antd';
3
+ import { MenuItemType } from 'antd/es/menu/interface';
4
+ import { KeepAliveTabContext } from '../../layout2/tabs/tabs-context';
5
+ import { KeepAliveTab, useTabs } from "../../hooks/use-tabs";
6
+ import antdIcons from '@ant-design/icons';
7
+ import { useNavigate } from 'react-router-dom';
8
+ import Units from '../../units';
9
+ import { useLocale } from "../../locale/useLocale";
10
+ import "../css/tabs-layout.css";
11
+
12
+ const getIcon = (icon?: string): React.ReactElement | undefined => {
13
+ return icon && antdIcons[icon] && React.createElement(antdIcons[icon]);
14
+ }
15
+
16
+ const TabsLayout: React.FC = () => {
17
+ const { translate } = useLocale();
18
+ const navigate = useNavigate();
19
+ const { activeTabRoutePath, tabs = [], closeTab, refreshTab, closeOtherTab } = useTabs();
20
+
21
+ const menuItems: MenuItemType[] = useMemo(
22
+ () => tabs.length <= 1 ? [] : [
23
+ { label: translate("${关闭}"), key: "close" },
24
+ { label: translate("${关闭其他}"), key: "other" },
25
+ ],
26
+ [tabs]);
27
+
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ const menuClick = useCallback(({ key, domEvent }: any, tab: KeepAliveTab) => {
30
+ domEvent.stopPropagation();
31
+ if (key === 'refresh') {
32
+ refreshTab(tab.routePath);
33
+ } else if (key === "close") {
34
+ closeTab(tab.routePath);
35
+ } else if (key === "other") {
36
+ closeOtherTab(tab.routePath);
37
+ }
38
+ }, [closeOtherTab, closeTab, refreshTab]);
39
+
40
+ const renderTabTitle = useCallback((tab: KeepAliveTab) => {
41
+ let label = Units.mapMenu(tab.title) ? Units.mapMenu(tab.title) : tab.title;
42
+ label = translate("${" + label + "}");
43
+ return (
44
+ <Dropdown
45
+ menu={{
46
+ items: menuItems,
47
+ onClick: (e) => menuClick(e, tab),
48
+ }}
49
+ trigger={['contextMenu']}
50
+ onOpenChange={open => open && navigate(tab.pathname)}
51
+ >
52
+ <div className='flex gap-[6px]'>
53
+ {getIcon(tab.icon)}
54
+ {label}
55
+ </div>
56
+ </Dropdown >
57
+ )
58
+ }, [menuItems]);
59
+
60
+ const tabItems = useMemo(() => {
61
+ return tabs.map(tab => ({
62
+ key: tab.routePath,
63
+ label: renderTabTitle(tab),
64
+ children: (
65
+ <div key={tab.key} className="overflow-y-auto tabs-children">
66
+ {tab.children}
67
+ </div>
68
+ ),
69
+ closable: tabs.length > 1, // 剩最后一个就不能删除了
70
+ }))
71
+ }, [tabs]);
72
+
73
+ const onTabsChange = useCallback((tabKey: string) => {
74
+ const tab = tabs.find(r => r.routePath === tabKey);
75
+ if (tab) {
76
+ navigate(tab.pathname);
77
+ }
78
+ }, [tabs]);
79
+
80
+ const keepAliveContextValue = useMemo(
81
+ () => ({
82
+ closeTab,
83
+ closeOtherTab,
84
+ refreshTab,
85
+ }),
86
+ [closeTab, closeOtherTab, refreshTab]
87
+ );
88
+
89
+ return (
90
+ <KeepAliveTabContext.Provider value={keepAliveContextValue}>
91
+ <Tabs
92
+ className="v4-tabs-layout"
93
+ activeKey={activeTabRoutePath}
94
+ items={tabItems}
95
+ type="editable-card"
96
+ onChange={onTabsChange}
97
+ hideAdd
98
+ onEdit={(e) => closeTab(e.toString())}
99
+ size="small"
100
+ // tabBarGutter={10}
101
+ />
102
+ </KeepAliveTabContext.Provider>
103
+ )
104
+ }
105
+
106
+ export default TabsLayout;