aldehyde 0.2.333 → 0.2.334

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 +157 -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 +157 -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
@@ -0,0 +1,157 @@
1
+ .v4-layout-header {
2
+ padding: 0;
3
+ color: #ffffff;
4
+ position: relative;
5
+ height: auto;
6
+ background: #001325;
7
+ margin-bottom: 12px;
8
+
9
+ .header-top {
10
+ background-size: 100% 100%;
11
+ background-repeat: no-repeat;
12
+ background-position: center;
13
+ width: 100%;
14
+ height: 3.75vw;
15
+ padding: 0 0.73vw;
16
+ background-color: #001325;
17
+ border: none;
18
+ display: flex;
19
+ justify-content: space-between;
20
+
21
+ .header-title {
22
+ font-family: YouSheBiaoTiHei;
23
+ font-size: 36px;
24
+ line-height: 3.75vw;
25
+ width: 21vw;
26
+ min-width: 268px;
27
+ height: 100%;
28
+ text-align: justify;
29
+ font-style: normal;
30
+ text-transform: none;
31
+ color: #ffffff;
32
+ display: flex;
33
+ align-items: center;
34
+
35
+ img {
36
+ height: 72%;
37
+ margin-right: 16px;
38
+ }
39
+ }
40
+
41
+ .header-right {
42
+ line-height: 3.75vw;
43
+ height: 95%;
44
+ width: 18vw;
45
+ min-width: 230px;
46
+ padding-right: 12px;
47
+ text-align: right;
48
+ overflow: hidden;
49
+
50
+ .ant-space {
51
+ height: 100%;
52
+ }
53
+
54
+ .message-bar {
55
+ min-width: 0;
56
+
57
+ svg {
58
+ color: var(--ant-color-primary);
59
+ }
60
+ }
61
+
62
+ .message-bar:hover {
63
+ background: transparent;
64
+ }
65
+
66
+ .header-user {
67
+ button .ant-btn-icon {
68
+ margin-top: 4px;
69
+ }
70
+
71
+ .userButton {
72
+ cursor: pointer;
73
+ width: 4vw;
74
+ min-width: 45px;
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ .header-nav {
81
+ display: flex;
82
+ justify-content: start;
83
+ width: 61vw;
84
+ min-width: 780px;
85
+ min-height: 50px;
86
+ padding-left: 1%;
87
+
88
+ .ant-menu-submenu-selected::after,
89
+ .ant-menu-submenu:hover::after,
90
+ .ant-menu-submenu-open::after,
91
+ .ant-menu-submenu::after {
92
+ border-bottom: none !important;
93
+ }
94
+
95
+ .menu-disabled {
96
+ cursor: not-allowed;
97
+ }
98
+
99
+ .menu-item {
100
+ position: relative;
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: center;
104
+ cursor: pointer;
105
+ font-size: clamp(12px, 1.1vw, 100px);
106
+ font-family: YouSheBiaoTiHei;
107
+ color: #bec8d6;
108
+ padding: 0 1.5vw;
109
+ height: 3.28vw;
110
+ min-height: 42px;
111
+ }
112
+
113
+ .menu-icon {
114
+ font-size: clamp(10px, 0.9vw, 100px);
115
+ font-family: YouSheBiaoTiHei;
116
+ color: #bec8d6;
117
+ }
118
+
119
+ .ant-menu-overflow-item {
120
+ padding: 0;
121
+ position: relative;
122
+ }
123
+
124
+ .ant-menu-overflow-item:not(:nth-last-child(-n+2))::before {
125
+ position: absolute;
126
+ top: 0.3125vw;
127
+ right: 0;
128
+ width: 1px;
129
+ height: 2.55208vw;
130
+ min-height: 33px;
131
+ border-right: 0.10417vw solid;
132
+ border-width: max(1px, 0.10417vw);
133
+ border-image: linear-gradient(180deg, rgba(12, 14, 29, 0), #1e415e, #2a658c, #1c3c57, rgba(12, 14, 29, 0)) 2 2;
134
+ content: " ";
135
+ }
136
+
137
+ .menu-item-selected {
138
+ color: var(--ant-menu-item-selected-color);
139
+ background-size: 100% 100%;
140
+
141
+ .menu-icon {
142
+ color: var(--ant-menu-item-selected-color);
143
+ }
144
+ }
145
+
146
+ .anticon-ellipsis {
147
+ padding: 0 12px;
148
+ }
149
+
150
+ .ant-menu-overflow-item-rest {
151
+ height: 3.28vw;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ }
156
+ }
157
+ }
@@ -0,0 +1,119 @@
1
+ .v4-main {
2
+ width: 100%;
3
+ height: 100%;
4
+ position: absolute;
5
+ min-width: 1280px;
6
+ overflow-x: auto;
7
+
8
+ .ant-layout {
9
+ background: var(--ant-layout-body-bg) !important;
10
+ }
11
+
12
+ .act-table-title {
13
+ font-family: YouSheBiaoTiHei;
14
+ background: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
15
+ -webkit-background-clip: text;
16
+ background-clip: text;
17
+ -webkit-text-fill-color: transparent;
18
+ font-size: 20px;
19
+ }
20
+
21
+ .ant-drawer,
22
+ .ant-modal-content {
23
+
24
+ .ant-card-head {
25
+ background: transparent !important;
26
+ }
27
+
28
+ .ant-layout {
29
+ background: #001325 !important;
30
+ }
31
+ }
32
+
33
+ .ant-menu-submenu-popup {
34
+ .menu-item-selected {
35
+ background: transparent !important;
36
+ }
37
+
38
+ .ant-menu-submenu-title a {
39
+ color: #bec8d6
40
+ }
41
+
42
+ .ant-menu-submenu-selected a {
43
+ color: var(--ant-primary-color)
44
+ }
45
+ }
46
+
47
+ .ant-table-tbody,
48
+ .ant-table-summary {
49
+ .ant-table-cell:has(.xiaoji) {
50
+ background-color: var(--color-5) !important;
51
+ }
52
+
53
+ .ant-table-cell:has(.heji) {
54
+ background-color: var(--color-8) !important;
55
+ }
56
+
57
+ .xiaoji {
58
+ background-color: var(--color-5) !important;
59
+ }
60
+
61
+ .heji {
62
+ background-color: var(--color-8) !important;
63
+ }
64
+ }
65
+ }
66
+
67
+ .v4-antd-table {
68
+ .ant-table-css-var {
69
+ --ant-table-border-color: #15325b;
70
+ }
71
+
72
+ .ant-table {
73
+ background: transparent;
74
+ scrollbar-color: var(--ant-table-header-bg) transparent;
75
+ }
76
+
77
+ .ant-table-tbody .ant-table-cell {
78
+ background: var(--ant-layout-body-bg) !important;
79
+ }
80
+ }
81
+
82
+ .v4-antd-drawer,
83
+ .v4-antd-modal {
84
+ .ant-table-css-var {
85
+ --ant-table-border-color: #05449a;
86
+ }
87
+ }
88
+
89
+ .v4-antd-modal {
90
+ .ant-modal-content {
91
+ background: var(--ant-color-bg-base) !important;
92
+ border: 1px solid var(--ant-color-border-secondary) !important;
93
+ }
94
+
95
+ .ant-modal-header {
96
+ background: transparent;
97
+ }
98
+ }
99
+
100
+ .v4-antd-drawer {
101
+ background: var(--ant-color-bg-base) !important;
102
+ border: 2px solid var(--ant-color-border-secondary) !important;
103
+ }
104
+
105
+ .v4-antd-card {
106
+ background: transparent;
107
+
108
+ .ant-card-head {
109
+ background: var(--ant-color-bg-container) !important;
110
+ }
111
+
112
+ .ant-card-body {
113
+ background: transparent;
114
+ }
115
+ }
116
+
117
+ .v4-antd-card:hover {
118
+ border-color: var(--ant-color-border-secondary);
119
+ }
@@ -0,0 +1,11 @@
1
+ .v4-layout-sider {
2
+ margin-bottom: 12px;
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%);
5
+ border: 1px solid #17375e;
6
+ box-shadow: inset 0 0 8px #17375e, inset 0 0 8px #17375e;
7
+
8
+ .ant-menu-item-selected {
9
+ background: linear-gradient(90deg, #88EFFF00, rgba(163, 194, 255, 0.2), #88EFFF00);
10
+ }
11
+ }
@@ -0,0 +1,43 @@
1
+ .v4-tabs-layout {
2
+ height: 100%;
3
+
4
+ .ant-tabs-nav {
5
+ margin-bottom: 0;
6
+ }
7
+
8
+ .ant-tabs-tab {
9
+ min-width: 110px;
10
+ display: flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ }
14
+
15
+ .ant-tabs-content,
16
+ .ant-tabs-tabpane {
17
+ height: 100%;
18
+ }
19
+
20
+ .tabs-children {
21
+ height: 100%;
22
+ overflow: auto;
23
+ border: 1px solid #17375e;
24
+ box-shadow: inset 0 0 16px #17375e,
25
+ inset 0 0 16px #17375e;
26
+ padding: 8px 16px 16px;
27
+ border-top: 0;
28
+ }
29
+
30
+ /* 组件样式异常覆盖 */
31
+ .ant-card-head {
32
+ background: transparent !important;
33
+ }
34
+
35
+ .actTable {
36
+ .ant-card {
37
+ background: transparent;
38
+ box-shadow: inset 0 0 12px #17375e,
39
+ inset 0 0 12px #17375e;
40
+ border: none;
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,182 @@
1
+ import { Layout, Menu, MenuProps, Space, theme } from "antd";
2
+ import React, { useEffect, useState } from "react";
3
+ import { NavLink, useParams, useSearchParams } from "react-router-dom";
4
+ import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
5
+ import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
6
+ import LocaleButton from "../locale/LocaleButton";
7
+ import ThemeButton from "../layout2/components/theme-button";
8
+ import { getLeftMostRouteInfo, handlePropsMenuToAntdMenu } from "../layout2/util/menu-util";
9
+ import { MenuType } from "../layout2/type/layout-type";
10
+ import { useLocale } from "../locale/useLocale";
11
+ import { useLayoutContext } from "../layout2/layout-context";
12
+ import UserButton from "../layout2/components/user-button";
13
+ import headerBgImg from "./imgs/header-bg.png";
14
+ import homeImg from "./imgs/home.png";
15
+ import menuItemBgImg from "./imgs/menu-item-bg.png";
16
+ import userImg from "./imgs/user.png";
17
+ import IconFont from "../layout2/components/icon-font";
18
+ import "./css/header.css";
19
+
20
+ // 查找当前选中菜单的顶层菜单id
21
+ const findPathToRoot = (menus, targetId) => {
22
+ // 使用栈来存储需要遍历的节点及其从根节点到该节点的路径
23
+ const stack = [];
24
+ // 初始化栈:将每个根节点及其路径(初始只包含自身ID)入栈
25
+ for (const node of menus) {
26
+ stack.push({ node, path: [node.id] });
27
+ }
28
+ while (stack.length > 0) {
29
+ const { node, path } = stack.pop(); // 弹出栈顶元素
30
+ // 检查当前节点是否是目标节点
31
+ if (node.id === targetId) {
32
+ return path[0]; // 返回路径的第一个元素,即最顶层根节点ID
33
+ }
34
+ // 如果当前节点有子节点,则将它们全部入栈,并记录从根到该子节点的路径
35
+ if (node.children && node.children.length > 0) {
36
+ for (const child of node.children) {
37
+ stack.push({ node: child, path: [...path, child.id] }); // 将子节点和新的路径入栈
38
+ }
39
+ }
40
+ }
41
+ return null;
42
+ }
43
+
44
+ const { useToken } = theme;
45
+
46
+ type HeaderPropsType = {
47
+ systemName: string;
48
+ menuList: MenuType[];
49
+ style?: any;
50
+ };
51
+
52
+ type MenuItem = Required<MenuProps>["items"][number];
53
+
54
+ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
55
+ const { setDocumentTitle, menuItemIdToFirstFloorIdxMap } = useLayoutContext();
56
+ const { translate, getLocale } = useLocale();
57
+ const [menu, setMenu] = useState<MenuItem[]>([]);
58
+ const [selectedKeys, setSelectedKeys] = useState([]);
59
+ const [selParentId, setSelParentId] = useState<string>();
60
+ const { sourceId } = useParams();
61
+ const [search] = useSearchParams();
62
+ const menuId: string = search.get("menuId");
63
+ const { token: { colorPrimary } } = useToken();
64
+
65
+ const renderMenuItem = (menuItem) => {
66
+ const { label, id, disabled, icon } = menuItem;
67
+ const renderIcon = icon ? <IconFont type={icon} className="menu-icon" /> : "";
68
+ return <div className={`menu-item ${disabled ? "menu-disabled" : ""} ${selParentId === id ? "menu-item-selected" : ""}`} style={{ backgroundImage: selParentId === id ? `url(${menuItemBgImg})` : undefined }}><Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space></div>;
69
+ }
70
+
71
+ const handleMenu = (menuItem, floor) => {
72
+ const { disabled, label, children, icon } = menuItem;
73
+ if (disabled) {
74
+ return renderMenuItem(menuItem);
75
+ }
76
+ const renderIcon = icon ? <IconFont type={icon} /> : "";
77
+ const { path, target } = getLeftMostRouteInfo(menuItem);
78
+ if (floor === 0) {
79
+ return path === null ? (
80
+ renderMenuItem(menuItem)
81
+ ) : (
82
+ <NavLink
83
+ to={`/${path}`}
84
+ target={target}
85
+ >
86
+ {renderMenuItem(menuItem)}
87
+ </NavLink>
88
+ );
89
+ }
90
+ if (Array.isArray(children) && !children.length) {
91
+ return (
92
+ <NavLink to={`/${path}`} target={target} >
93
+ <Space size={"small"}>{renderIcon}{translate("${" + label + "}")}</Space>
94
+ </NavLink>
95
+ );
96
+ }
97
+ return renderMenuItem(menuItem);
98
+ };
99
+
100
+ useEffect(() => {
101
+ if (menuId !== undefined) setSelectedKeys([menuId]);
102
+ }, [menuId]);
103
+
104
+ useEffect(() => {
105
+ if (menuList.length && selParentId) {
106
+ setMenu(handlePropsMenuToAntdMenu(menuList, handleMenu));
107
+ }
108
+ }, [menuList, getLocale(), selParentId]);
109
+
110
+ useEffect(() => {
111
+ if (sourceId === undefined) {
112
+ if (menuList[0] !== undefined) {
113
+ setSelectedKeys([menuList[0].id]);
114
+ setSelParentId(menuList[0].id);
115
+ }
116
+ setDocumentTitle("");
117
+ } else if (menuList.length) {
118
+ const documentTitle =
119
+ menuList[menuItemIdToFirstFloorIdxMap[sourceId]]?.label;
120
+ setDocumentTitle(translate("${" + documentTitle + "}"));
121
+ setSelectedKeys([sourceId]);
122
+ setSelParentId(findPathToRoot(menuList, sourceId));
123
+ }
124
+ }, [menuList, sourceId]);
125
+
126
+ return (
127
+ <Layout.Header className="v4-layout-header" >
128
+ <div className="header-top" style={{ backgroundImage: `url(${headerBgImg})` }}>
129
+ <NavLink to="/v4/home" style={{ display: "contents" }}>
130
+ <div className="header-title"><img src={homeImg} alt="" />{translate("${" + systemName + "}")}</div>
131
+ </NavLink>
132
+ <div className="header-nav">
133
+ <Menu
134
+ mode="horizontal"
135
+ items={menu}
136
+ selectedKeys={selectedKeys}
137
+ style={{ background: "transparent", border: "none", width: "100%" }}
138
+ />
139
+ </div>
140
+ <div className="header-right" >
141
+ <Space size={28}>
142
+ <L2MenuQuickBar />
143
+ <L2MenuMessageBar />
144
+ <LocaleButton
145
+ shape="default"
146
+ size="large"
147
+ type="text"
148
+ style={{
149
+ width: "100%",
150
+ height: "100%",
151
+ boxSizing: "border-box",
152
+ padding: 0,
153
+ borderRadius: 0,
154
+ color: colorPrimary,
155
+ fontSize: "20px"
156
+ }}
157
+ />
158
+ <ThemeButton
159
+ shape="default"
160
+ size="large"
161
+ type="text"
162
+ style={{
163
+ width: "100%",
164
+ height: "100%",
165
+ boxSizing: "border-box",
166
+ padding: 0,
167
+ borderRadius: 0,
168
+ color: colorPrimary,
169
+ fontSize: "20px"
170
+ }}
171
+ />
172
+ <div className="header-user">
173
+ <UserButton logoutUrl="/login3" style={{ padding: 0, color: "#fff" }} customRender={<img src={userImg} alt="" className="userButton" />} />
174
+ </div>
175
+ </Space>
176
+ </div>
177
+ </div>
178
+ </Layout.Header>
179
+ );
180
+ };
181
+
182
+ export default Header;
@@ -0,0 +1,27 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="75px" height="50px" viewBox="0 0 75 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>编组 28@2x</title>
4
+ <defs>
5
+ <linearGradient x1="56.7868058%" y1="100%" x2="56.7868058%" y2="0%" id="linearGradient-1">
6
+ <stop stop-color="#90DCFE" offset="0%"></stop>
7
+ <stop stop-color="#141F34" offset="100%"></stop>
8
+ </linearGradient>
9
+ <radialGradient cx="50%" cy="30.3951181%" fx="50%" fy="30.3951181%" r="135.534427%" gradientTransform="translate(0.500000,0.303951),scale(0.171272,1.000000),rotate(90.000000),scale(1.000000,2.145743),translate(-0.500000,-0.303951)" id="radialGradient-2">
10
+ <stop stop-color="#ACF4F7" offset="0%"></stop>
11
+ <stop stop-color="#96EEF2" stop-opacity="0.600017604" offset="75.2832594%"></stop>
12
+ <stop stop-color="#74E5EB" stop-opacity="0" offset="100%"></stop>
13
+ </radialGradient>
14
+ </defs>
15
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
16
+ <g id="2025-02-28-西安航天-导航" transform="translate(-1816.000000, -11.000000)">
17
+ <g id="编组-28" transform="translate(1816.900000, 11.000000)">
18
+ <rect id="矩形" fill="url(#linearGradient-1)" opacity="0.586283366" x="0" y="0" width="74" height="46" rx="23"></rect>
19
+ <path d="M52,44.0516405 L52,46.0516405 L40.137,46.0516405 L37,49.1897883 L33.862,46.0516405 L22,46.0516405 L22,44.0516405 L52,44.0516405 Z" id="形状结合" fill="url(#radialGradient-2)" fill-rule="nonzero"></path>
20
+ <g id="账号中心-账号管理" transform="translate(22.939298, 9.939298)" fill="#FFFFFF" fill-rule="nonzero">
21
+ <rect id="矩形" opacity="0" x="0" y="0" width="28.121403" height="28.121403"></rect>
22
+ <path d="M14.6998318,15.2110976 C16.6171677,14.0607015 17.8954283,12.0155285 17.8954283,9.71468147 C17.8954283,6.13560131 14.9554784,3.19565143 11.3763982,3.19565143 C7.79731808,3.19565143 4.60169411,6.13557384 4.60169411,9.71465401 C4.60169411,12.0155011 5.87992722,14.0607015 7.79729061,15.211125 C4.34604749,16.4893581 1.91736339,19.8128191 1.91736339,23.7753555 C1.91736339,24.4144858 2.42865664,24.925779 3.06778692,24.925779 C3.70691721,24.925779 4.21821045,24.4144858 4.21821045,23.775383 C4.21821045,19.9406287 7.41383441,16.7450322 11.2485612,16.7450322 C15.2110976,16.7450322 18.278912,19.9406287 18.278912,23.775383 C18.278912,24.4144858 18.7902052,24.925779 19.429308,24.925779 C20.0684108,24.925779 20.579759,24.4144858 20.579759,23.775383 C20.579759,19.9406287 18.1510749,16.6171952 14.6998043,15.211125 L14.6998318,15.2110976 Z M11.2485612,14.0607015 C8.81990456,14.0607015 6.90251371,12.1433381 6.90251371,9.71465401 C6.90251371,7.28596991 8.81990456,5.36863398 11.2485612,5.36863398 C13.6772178,5.36863398 15.5946087,7.28599737 15.5946087,9.71465401 C15.5946087,12.1433106 13.6772178,14.0607015 11.2485612,14.0607015 Z M20.9632152,9.45900739 L25.1814257,9.45900739 C25.8205559,9.45900739 26.2040396,8.94771414 26.2040396,8.4364209 C26.2040396,7.79729061 25.6927464,7.41383441 25.1814257,7.41383441 L20.9632152,7.41383441 C20.3241124,7.41383441 19.9406287,7.92512766 19.9406287,8.4364209 C19.8128191,8.94771414 20.3241124,9.45900739 20.9632152,9.45900739 Z M25.1814257,11.3763982 L19.8128191,11.3763982 C19.1736889,11.3763982 18.7902052,11.8876915 18.7902052,12.3989847 C18.7902052,13.038115 19.3014984,13.4215712 19.8128191,13.4215712 L25.1814257,13.4215712 C25.8205559,13.4215712 26.2040396,12.910278 26.2040396,12.3989847 C26.2040396,11.8876915 25.6927464,11.3763982 25.1814257,11.3763982 Z M25.1814257,15.4667717 L20.9632152,15.4667717 C20.3241124,15.4667717 19.9406287,15.9780649 19.9406287,16.4893581 C19.9406287,17.1284884 20.451922,17.5119721 20.9632152,17.5119721 L25.1814257,17.5119721 C25.8205559,17.5119721 26.2040396,17.0006788 26.2040396,16.4893581 C26.2040396,15.9780374 25.6927464,15.4667717 25.1814257,15.4667717 Z" id="形状"></path>
23
+ </g>
24
+ </g>
25
+ </g>
26
+ </g>
27
+ </svg>
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { Layout } from "antd";
3
+ import TabsLayout from "./components/tabs-layout";
4
+
5
+ type MainPropsType = {
6
+ style?: any;
7
+ children?: React.ReactNode;
8
+ };
9
+
10
+ const Main: React.FC<MainPropsType> = ({ style, children }) => {
11
+ return (
12
+ <Layout.Content style={{ overflow: "auto", ...style }}>
13
+ <div
14
+ style={{
15
+ width: "100%",
16
+ height: "100%",
17
+ overflow: "auto",
18
+ padding: "0 12px 12px 12px",
19
+ }}
20
+ >
21
+ {children ? children : <TabsLayout />}
22
+ </div>
23
+ </Layout.Content>
24
+ );
25
+ };
26
+
27
+ export default Main;
@@ -0,0 +1,91 @@
1
+ import { Layout, theme, ConfigProvider } from "antd";
2
+ import React, { useEffect, useRef, useState } from "react";
3
+ import DocumentTitle from "react-document-title";
4
+ import { useSessionStorageState } from "ahooks";
5
+ import { generate } from "@ant-design/colors";
6
+ import Header from "./header";
7
+ import Sider from "./sider";
8
+ import Main from "./main";
9
+ import { useVarCssColor } from "../hooks/useVarCssColor";
10
+ import { LayoutProvider, useLayoutContext } from "../layout2/layout-context";
11
+ import { MenuType } from "../layout2/type/layout-type";
12
+ import Units from '../units';
13
+ import { useLocale } from "../locale/useLocale";
14
+ import { KeepAliveTab } from "../hooks/use-tabs";
15
+ import { getMenuConfig } from "../layout2/page";
16
+ import "./css/main.css";
17
+
18
+ const { useToken } = theme;
19
+
20
+ type PagePropsType = {
21
+ children?: React.ReactNode;
22
+ };
23
+
24
+ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
25
+ const [systemName, setSystemName] = useState("");
26
+ const [menu, setMenu] = useState<MenuType[]>([]);
27
+ const pageRef = useRef<HTMLDivElement>(undefined); // page ref
28
+ //清空缓存
29
+ const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', { defaultValue: [] });
30
+ const { documentTitle, updateMenuItemIdToFirstFloorIdxMap } = useLayoutContext();
31
+ const { getSiderCollapsed } = useLocale();
32
+ const { token: { colorPrimary } } = useToken();
33
+
34
+ useEffect(() => {
35
+ getMenuConfig("v4").then(({ menu, systemName: name }) => {
36
+ setSystemName(name);
37
+ setMenu(menu);
38
+ updateMenuItemIdToFirstFloorIdxMap(menu);
39
+ });
40
+ useVarCssColor(generate(colorPrimary));
41
+ localStorage.setItem("version", "v4");
42
+ window.addEventListener('beforeunload', () => { setKeepAliveTabs([]); });
43
+ }, []);
44
+
45
+ return (
46
+ <DocumentTitle title={documentTitle}>
47
+ <div
48
+ ref={pageRef}
49
+ className="v4-main"
50
+ >
51
+ <ConfigProvider
52
+ getPopupContainer={() => pageRef.current}
53
+ theme={{
54
+ algorithm: [theme.darkAlgorithm],
55
+ token: {
56
+ colorBgBase: "#001325",
57
+ colorBorderSecondary: "#17375e",
58
+ },
59
+ components: {
60
+ Tabs: {
61
+ cardPadding: "4px 12px"
62
+ }
63
+ }
64
+ }}
65
+ table={{ className: "v4-antd-table" }}
66
+ drawer={{ className: "v4-antd-drawer" }}
67
+ modal={{ className: "v4-antd-modal" }}
68
+ card={{ className: "v4-antd-card" }}
69
+ >
70
+ <Layout style={{ height: "100%" }}>
71
+ <Header systemName={systemName ? systemName : Units.programName_NavLeft()} menuList={menu}></Header>
72
+ <Layout>
73
+ <Sider menuList={menu} collapsed={getSiderCollapsed()}></Sider>
74
+ <Main>{props.children}</Main>
75
+ </Layout>
76
+ </Layout>
77
+ </ConfigProvider>
78
+ </div>
79
+ </DocumentTitle >
80
+ );
81
+ };
82
+
83
+ const ContextPage: React.FC<PagePropsType> = (props: PagePropsType) => {
84
+ return (
85
+ <LayoutProvider>
86
+ <Page>{props.children}</Page>
87
+ </LayoutProvider>
88
+ );
89
+ };
90
+
91
+ export default ContextPage;