aldehyde 0.2.412 → 0.2.413
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/lib/controls/color-picker/index.d.ts.map +1 -1
- package/lib/controls/color-picker/index.js +2 -1
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/layout2/components/theme-button.d.ts +5 -1
- package/lib/layout2/components/theme-button.d.ts.map +1 -1
- package/lib/layout2/components/theme-button.js +13 -2
- package/lib/layout2/components/theme-button.js.map +1 -1
- package/lib/layout2/components/user-button.d.ts.map +1 -1
- package/lib/layout2/components/user-button.js +20 -3
- package/lib/layout2/components/user-button.js.map +1 -1
- package/lib/layout2/header.js +2 -4
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/main.js +1 -1
- package/lib/layout2/main.js.map +1 -1
- package/lib/layout3/header.js +2 -4
- package/lib/layout3/header.js.map +1 -1
- package/lib/layout4/header.js +2 -4
- package/lib/layout4/header.js.map +1 -1
- package/lib/layout5/header.js +2 -4
- package/lib/layout5/header.js.map +1 -1
- package/lib/list/vertical-list/index.less +12 -3
- package/lib/list/vertical-list/item.js +11 -7
- package/lib/list/vertical-list/item.js.map +1 -1
- package/lib/locale/LocaleButton.d.ts +5 -1
- package/lib/locale/LocaleButton.d.ts.map +1 -1
- package/lib/locale/LocaleButton.js +13 -3
- package/lib/locale/LocaleButton.js.map +1 -1
- package/lib/login3/img/login-bg.png +0 -0
- package/lib/lowcode-components/assets/china.json +1 -99420
- package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/lib/module/dtmpl-view-modal.d.ts +1 -0
- package/lib/module/dtmpl-view-modal.d.ts.map +1 -1
- package/lib/module/dtmpl-view-modal.js +2 -1
- package/lib/module/dtmpl-view-modal.js.map +1 -1
- package/lib/module/index.less +5 -0
- package/lib/table/act-table.d.ts +1 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +28 -2
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/index.css +57 -0
- package/lib/table/query-table.d.ts +0 -4
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +7 -63
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/report-table.d.ts.map +1 -1
- package/lib/table/report-table.js +1 -1
- package/lib/table/report-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +4 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +1 -1
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/welcome/HCWelcome.js +20 -3
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/lib/welcome/img/welcome2.png +0 -0
- package/package.json +1 -1
- package/src/aldehyde/controls/color-picker/index.tsx +3 -1
- package/src/aldehyde/layout2/components/theme-button.tsx +9 -3
- package/src/aldehyde/layout2/components/user-button.tsx +19 -4
- package/src/aldehyde/layout2/header.tsx +4 -4
- package/src/aldehyde/layout2/main.tsx +2 -2
- package/src/aldehyde/layout3/header.tsx +4 -4
- package/src/aldehyde/layout4/header.tsx +4 -4
- package/src/aldehyde/layout5/header.tsx +4 -4
- package/src/aldehyde/list/vertical-list/index.less +12 -3
- package/src/aldehyde/list/vertical-list/item.tsx +17 -17
- package/src/aldehyde/locale/LocaleButton.tsx +11 -10
- package/src/aldehyde/login3/img/login-bg.png +0 -0
- package/src/aldehyde/lowcode-components/assets/china.json +1 -99420
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk-JinBuTi.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.woff +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +4 -4
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/PangMenZhengDaoBiaoTiTiMianFeiBan.woff2 +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/YouSheBiaoTiHei.woff2 +0 -0
- package/src/aldehyde/module/dtmpl-view-modal.tsx +26 -24
- package/src/aldehyde/module/index.less +5 -0
- package/src/aldehyde/table/act-table.tsx +35 -2
- package/src/aldehyde/table/index.css +57 -0
- package/src/aldehyde/table/query-table.tsx +6 -63
- package/src/aldehyde/table/report-table.tsx +69 -69
- package/src/aldehyde/tmpl/interface.tsx +4 -0
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +1 -1
- package/src/aldehyde/welcome/HCWelcome.js +17 -1
- package/src/aldehyde/welcome/img/welcome2.png +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/lib/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DingTalk JinBuTi.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/DouyinSansBold.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//344/274/230/350/256/276/346/240/207/351/242/230/351/273/221.ttf +0 -0
- package/src/aldehyde/lowcode-components/lowcode-view/component/font//345/272/236/351/227/250/346/255/243/351/201/223/346/240/207/351/242/230/344/275/223/345/205/215/350/264/271/347/211/210.ttf +0 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ColorPicker } from "antd";
|
|
3
3
|
|
|
4
|
+
const presets = [{ label: "预设颜色", colors: ["#52c41a", "#faad14", "#ff4d4f", "#1677ff", "#21d5ed", "#af57db"] }];
|
|
5
|
+
|
|
4
6
|
export interface Props {
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
value?: string;
|
|
@@ -13,7 +15,7 @@ const Index: React.FC<Props> = (props) => {
|
|
|
13
15
|
const { onChange, disabled, value, id, viewOrEdit } = props;
|
|
14
16
|
|
|
15
17
|
return (
|
|
16
|
-
<ColorPicker allowClear showText key={id} disabled={viewOrEdit === "view" || disabled} value={value} onClear={() => onChange(undefined)} onChange={(val) => onChange(val.toHexString())} />
|
|
18
|
+
<ColorPicker presets={presets} allowClear showText key={id} disabled={viewOrEdit === "view" || disabled} value={value} onClear={() => onChange(undefined)} onChange={(val) => onChange(val.toHexString())} />
|
|
17
19
|
)
|
|
18
20
|
};
|
|
19
21
|
|
|
@@ -10,7 +10,13 @@ const { useToken } = theme;
|
|
|
10
10
|
const regex = /#\/v\d+\/(.*)/;
|
|
11
11
|
const defThemes = [{ label: "默认", value: "v2" }, { label: "科技风一", value: "v3" }, { label: "科技风二", value: "v4" }, { label: "侧边布局", value: "v5" }];
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface Props extends ButtonProps {
|
|
14
|
+
children?: React.ReactNode,
|
|
15
|
+
placement?: "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight" | "top" | "bottom",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const ThemeButton = (props: Props) => {
|
|
19
|
+
const { children, placement, ...otherProps } = props;
|
|
14
20
|
const { token } = useToken();
|
|
15
21
|
const [version, setVersion] = useState<string>();
|
|
16
22
|
const [themes, setThemes] = useState<{ label: string, value: string }[]>([]);
|
|
@@ -48,8 +54,8 @@ const ThemeButton = (props: ButtonProps) => {
|
|
|
48
54
|
})), [themes]);
|
|
49
55
|
|
|
50
56
|
return (
|
|
51
|
-
themes.length > 1 ? <Dropdown overlayClassName="themeButton" menu={{ items, onClick, selectedKeys: [version] }}>
|
|
52
|
-
<Button type="text" icon={<AliIcon type="icon-theme" />} {...
|
|
57
|
+
themes.length > 1 ? <Dropdown arrow={{ pointAtCenter: true }} placement={placement} overlayStyle={{ minWidth: "105px" }} overlayClassName="themeButton" menu={{ items, onClick, selectedKeys: [version] }}>
|
|
58
|
+
{children || <Button type="text" icon={<AliIcon type="icon-theme" />} {...otherProps} />}
|
|
53
59
|
</Dropdown> : undefined
|
|
54
60
|
);
|
|
55
61
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
SettingOutlined,
|
|
8
8
|
UnlockOutlined,
|
|
9
9
|
UserOutlined,
|
|
10
|
-
CompressOutlined
|
|
10
|
+
CompressOutlined, GlobalOutlined
|
|
11
11
|
} from "@ant-design/icons";
|
|
12
12
|
import { Button, ButtonProps, Dropdown, GetProp, MenuProps } from "antd";
|
|
13
13
|
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
@@ -20,6 +20,9 @@ import HCDataSource from "../../tmpl/hc-data-source";
|
|
|
20
20
|
import { useSessionStorageState } from 'ahooks';
|
|
21
21
|
import { KeepAliveTab } from "../../hooks/use-tabs";
|
|
22
22
|
import Units from "../../units";
|
|
23
|
+
import ThemeButton from "./theme-button";
|
|
24
|
+
import LocaleButton from "../../locale/LocaleButton";
|
|
25
|
+
import AliIcon from "../../icon/aliIcon";
|
|
23
26
|
|
|
24
27
|
type DropDownMenuType = {
|
|
25
28
|
label: string | number | ReactNode;
|
|
@@ -143,16 +146,28 @@ const UserButton: React.FC<Props> = (props) => {
|
|
|
143
146
|
},
|
|
144
147
|
},
|
|
145
148
|
{
|
|
146
|
-
label: <span onClick={() => changeCompactTheme()}>{compactTheme ? "默认主题" : "紧凑主题"}</span>,
|
|
149
|
+
label: <span onClick={() => changeCompactTheme()}>{translate(compactTheme ? "${默认主题}" : "${紧凑主题}")}</span>,
|
|
147
150
|
key: "compactTheme",
|
|
148
151
|
icon: <CompressOutlined />,
|
|
149
152
|
show: () => isLogin,
|
|
150
153
|
},
|
|
154
|
+
{
|
|
155
|
+
label: <ThemeButton placement="bottomRight"><div style={{ width: "100%" }}>{translate("${主题切换}")}</div></ThemeButton>,
|
|
156
|
+
key: "changeTheme",
|
|
157
|
+
icon: <AliIcon type="icon-theme" />,
|
|
158
|
+
show: () => isLogin,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: <LocaleButton placement="bottomRight"><div style={{ width: "100%" }}>{translate("${语言}")}</div></LocaleButton>,
|
|
162
|
+
key: "changeLocale",
|
|
163
|
+
icon: <GlobalOutlined />,
|
|
164
|
+
show: () => isLogin,
|
|
165
|
+
},
|
|
151
166
|
{
|
|
152
167
|
label: (
|
|
153
168
|
<span onClick={() => changeSiderCollapsed()}>
|
|
154
|
-
{getSiderCollapsed() ? translate("${显示侧边栏}") : translate("${隐藏侧边栏}")}
|
|
155
|
-
</span>
|
|
169
|
+
{getSiderCollapsed() ? translate("${显示侧边栏}") : translate("${ 隐藏侧边栏 }")}
|
|
170
|
+
</span >
|
|
156
171
|
),
|
|
157
172
|
key: "collapseSider",
|
|
158
173
|
icon: <span>{getSiderCollapsed() ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}</span>,
|
|
@@ -10,7 +10,7 @@ import React, { useEffect, useState, CSSProperties } from "react";
|
|
|
10
10
|
import "./css/header.css";
|
|
11
11
|
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
12
12
|
import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
|
|
13
|
-
import LocaleButton from "../locale/LocaleButton";
|
|
13
|
+
// import LocaleButton from "../locale/LocaleButton";
|
|
14
14
|
import UserButton from "./components/user-button";
|
|
15
15
|
import { MenuType } from "./type/layout-type";
|
|
16
16
|
import { NavLink, useParams, useSearchParams } from "react-router-dom";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import { useLocale } from "../locale/useLocale";
|
|
22
22
|
import { generate } from "@ant-design/colors";
|
|
23
23
|
import { useLayoutContext } from "./layout-context";
|
|
24
|
-
import ThemeButton from "./components/theme-button";
|
|
24
|
+
// import ThemeButton from "./components/theme-button";
|
|
25
25
|
import IconFont from "./components/icon-font";
|
|
26
26
|
import SearchMenu from "./components/search-menu";
|
|
27
27
|
import ScreenfullButton from "./components/screenfull-button";
|
|
@@ -249,7 +249,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style, logoIm
|
|
|
249
249
|
<SearchMenu menuList={menuList} />
|
|
250
250
|
<L2MenuQuickBar style={{ color: "#fff" }} />
|
|
251
251
|
<L2MenuMessageBar version="v2" style={{ color: "#fff" }} />
|
|
252
|
-
<LocaleButton
|
|
252
|
+
{/* <LocaleButton
|
|
253
253
|
shape="default"
|
|
254
254
|
size="large"
|
|
255
255
|
type="link"
|
|
@@ -259,7 +259,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style, logoIm
|
|
|
259
259
|
size="large"
|
|
260
260
|
type="link"
|
|
261
261
|
style={toolbarStyle}
|
|
262
|
-
/>
|
|
262
|
+
/> */}
|
|
263
263
|
<UserButton style={{ padding: 0, marginRight: "15px", color: "#ffffff" }} />
|
|
264
264
|
</Space>
|
|
265
265
|
</div>
|
|
@@ -10,7 +10,7 @@ type MainPropsType = {
|
|
|
10
10
|
|
|
11
11
|
const Main: React.FC<MainPropsType> = ({ style, children }) => {
|
|
12
12
|
return (
|
|
13
|
-
<Layout.Content style={{ background: "#fff", overflow: "auto", ...style }}>
|
|
13
|
+
<Layout.Content style={{ background: "#fff", overflow: "auto", paddingBottom: 10, ...style }}>
|
|
14
14
|
<div
|
|
15
15
|
style={{
|
|
16
16
|
width: "100%",
|
|
@@ -19,7 +19,7 @@ const Main: React.FC<MainPropsType> = ({ style, children }) => {
|
|
|
19
19
|
padding: 10,
|
|
20
20
|
}}
|
|
21
21
|
>
|
|
22
|
-
{children ? children
|
|
22
|
+
{children ? children : <TabsLayout />}
|
|
23
23
|
</div>
|
|
24
24
|
</Layout.Content>
|
|
25
25
|
);
|
|
@@ -4,8 +4,8 @@ import { NavLink, useParams, useSearchParams } from "react-router-dom";
|
|
|
4
4
|
import { HomeFilled } from '@ant-design/icons';
|
|
5
5
|
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
6
6
|
import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
|
|
7
|
-
import LocaleButton from "../locale/LocaleButton";
|
|
8
|
-
import ThemeButton from "../layout2/components/theme-button";
|
|
7
|
+
// import LocaleButton from "../locale/LocaleButton";
|
|
8
|
+
// import ThemeButton from "../layout2/components/theme-button";
|
|
9
9
|
import { getLeftMostRouteInfo, handlePropsMenuToAntdMenu } from "../layout2/util/menu-util";
|
|
10
10
|
import { MenuType } from "../layout2/type/layout-type";
|
|
11
11
|
import { useLocale } from "../locale/useLocale";
|
|
@@ -143,7 +143,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
|
|
|
143
143
|
<SearchMenu menuList={menuList} style={toolbarStyle} />
|
|
144
144
|
<L2MenuQuickBar style={{ color: "#009BFF" }} />
|
|
145
145
|
<L2MenuMessageBar version="v3" style={{ color: "#009BFF" }} />
|
|
146
|
-
<LocaleButton
|
|
146
|
+
{/* <LocaleButton
|
|
147
147
|
shape="default"
|
|
148
148
|
size="large"
|
|
149
149
|
type="link"
|
|
@@ -154,7 +154,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList }) => {
|
|
|
154
154
|
size="large"
|
|
155
155
|
type="link"
|
|
156
156
|
style={toolbarStyle}
|
|
157
|
-
/>
|
|
157
|
+
/> */}
|
|
158
158
|
<div className="header-user"><UserButton logoutUrl="/login3" style={{ padding: 0, color: "#fff" }} /></div>
|
|
159
159
|
</Space>
|
|
160
160
|
</div>
|
|
@@ -3,8 +3,8 @@ import React, { useEffect, useState, CSSProperties } from "react";
|
|
|
3
3
|
import { NavLink, useParams, useSearchParams } from "react-router-dom";
|
|
4
4
|
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
5
5
|
import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
|
|
6
|
-
import LocaleButton from "../locale/LocaleButton";
|
|
7
|
-
import ThemeButton from "../layout2/components/theme-button";
|
|
6
|
+
// import LocaleButton from "../locale/LocaleButton";
|
|
7
|
+
// import ThemeButton from "../layout2/components/theme-button";
|
|
8
8
|
import { getLeftMostRouteInfo, handlePropsMenuToAntdMenu } from "../layout2/util/menu-util";
|
|
9
9
|
import { MenuType } from "../layout2/type/layout-type";
|
|
10
10
|
import { useLocale } from "../locale/useLocale";
|
|
@@ -158,7 +158,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, logoImg }) =>
|
|
|
158
158
|
<SearchMenu menuList={menuList} style={toolbarStyle} />
|
|
159
159
|
<L2MenuQuickBar style={{ color: colorPrimary, fontSize: "20px" }} />
|
|
160
160
|
<L2MenuMessageBar version="v4" style={{ color: colorPrimary, fontSize: "20px" }} />
|
|
161
|
-
<LocaleButton
|
|
161
|
+
{/* <LocaleButton
|
|
162
162
|
shape="default"
|
|
163
163
|
size="large"
|
|
164
164
|
type="link"
|
|
@@ -169,7 +169,7 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, logoImg }) =>
|
|
|
169
169
|
size="large"
|
|
170
170
|
type="link"
|
|
171
171
|
style={toolbarStyle}
|
|
172
|
-
/>
|
|
172
|
+
/> */}
|
|
173
173
|
<div className="header-user">
|
|
174
174
|
<UserButton logoutUrl="/login4" style={{ padding: 0, color: "#fff" }} customRender={<img src={userImg} alt="" className="userButton" />} />
|
|
175
175
|
</div>
|
|
@@ -4,8 +4,8 @@ import { NavLink, useParams, useSearchParams, useLocation } from "react-router-d
|
|
|
4
4
|
import { LeftOutlined, RightOutlined, UnorderedListOutlined } from '@ant-design/icons';
|
|
5
5
|
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
6
6
|
import L2MenuMessageBar from "../layout/menu/l2menu-message-bar";
|
|
7
|
-
import LocaleButton from "../locale/LocaleButton";
|
|
8
|
-
import ThemeButton from "../layout2/components/theme-button";
|
|
7
|
+
// import LocaleButton from "../locale/LocaleButton";
|
|
8
|
+
// import ThemeButton from "../layout2/components/theme-button";
|
|
9
9
|
import UserButton from "../layout2/components/user-button";
|
|
10
10
|
import SearchMenu from "../layout2/components/search-menu";
|
|
11
11
|
import ScreenfullButton from "../layout2/components/screenfull-button";
|
|
@@ -177,7 +177,7 @@ const Header: React.FC<HeaderPropsType> = ({ menuList }) => {
|
|
|
177
177
|
}
|
|
178
178
|
<L2MenuQuickBar style={{ color: colorPrimary }} />
|
|
179
179
|
<L2MenuMessageBar version="v5" style={{ color: colorPrimary }} />
|
|
180
|
-
<LocaleButton
|
|
180
|
+
{/* <LocaleButton
|
|
181
181
|
shape="default"
|
|
182
182
|
size="large"
|
|
183
183
|
type="link"
|
|
@@ -188,7 +188,7 @@ const Header: React.FC<HeaderPropsType> = ({ menuList }) => {
|
|
|
188
188
|
size="large"
|
|
189
189
|
type="link"
|
|
190
190
|
style={toolbarStyle}
|
|
191
|
-
/>
|
|
191
|
+
/> */}
|
|
192
192
|
<UserButton logoutUrl="/login2" style={{ padding: 0, color: "#000" }} />
|
|
193
193
|
</Space>
|
|
194
194
|
</Layout.Header>
|
|
@@ -175,10 +175,19 @@
|
|
|
175
175
|
padding: 12px 12px 0;
|
|
176
176
|
animation: slide-down .3s ease-out;
|
|
177
177
|
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
.detail-content-item {
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: start;
|
|
182
|
+
|
|
183
|
+
.title {
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
color: var(--ant-color-text-secondary);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.element {
|
|
181
189
|
text-overflow: ellipsis;
|
|
190
|
+
overflow: hidden;
|
|
182
191
|
white-space: nowrap;
|
|
183
192
|
}
|
|
184
193
|
}
|
|
@@ -23,29 +23,29 @@ const Index = (props: Props) => {
|
|
|
23
23
|
const { translate } = useLocale();
|
|
24
24
|
|
|
25
25
|
const initViewList = () => {
|
|
26
|
-
const
|
|
26
|
+
const itemList = [];
|
|
27
27
|
if (detailColumn.length > 0) {
|
|
28
28
|
detailColumn.forEach((item, index) => {
|
|
29
29
|
let fieldValue = current ? current[item.id] : undefined;
|
|
30
30
|
//fieldValue 没有值时不能为null 要为 undefined。antd input所限制
|
|
31
31
|
fieldValue = fieldValue ? fieldValue : item.defaultValue ? item.defaultValue : undefined;
|
|
32
|
-
const
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</
|
|
32
|
+
const domItem = (
|
|
33
|
+
<div className="detail-content-item" key={index}>
|
|
34
|
+
<div className="title">{translate("${" + item.title + "}")}:</div>
|
|
35
|
+
<div className="element">
|
|
36
|
+
<ViewControl
|
|
37
|
+
serverKey={serverKey}
|
|
38
|
+
holderType={"table"}
|
|
39
|
+
value={fieldValue}
|
|
40
|
+
fieldConfig={item}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
itemList.push(domItem);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return itemList;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
const handleData = (item, type: string) => {
|
|
@@ -124,9 +124,9 @@ const Index = (props: Props) => {
|
|
|
124
124
|
</div>
|
|
125
125
|
{detailOpen ?
|
|
126
126
|
<div className="detail-content">
|
|
127
|
-
<
|
|
127
|
+
<Space size="middle" wrap={true}>
|
|
128
128
|
{initViewList()}
|
|
129
|
-
</
|
|
129
|
+
</Space>
|
|
130
130
|
</div> : ""}
|
|
131
131
|
</div>
|
|
132
132
|
</div>
|
|
@@ -6,7 +6,13 @@ import React from "react";
|
|
|
6
6
|
|
|
7
7
|
const { useToken } = theme;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface Props extends ButtonProps {
|
|
10
|
+
children?: React.ReactNode,
|
|
11
|
+
placement?: "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight" | "top" | "bottom",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const LocaleButton = (props: Props) => {
|
|
15
|
+
const { children, placement, ...otherProps } = props;
|
|
10
16
|
const { token } = useToken();
|
|
11
17
|
const { getLocale, setLocale, availableLang } = useLocale();
|
|
12
18
|
|
|
@@ -14,11 +20,10 @@ const LocaleButton = (props: ButtonProps) => {
|
|
|
14
20
|
setLocale(key as LocaleType);
|
|
15
21
|
};
|
|
16
22
|
|
|
17
|
-
console.log(availableLang);
|
|
18
23
|
const items: MenuProps["items"] = availableLang.map((lang) => ({
|
|
19
24
|
label: (
|
|
20
25
|
<span style={getLocale() === lang ? { color: token.colorPrimary } : {}}>
|
|
21
|
-
{
|
|
26
|
+
{lang}
|
|
22
27
|
</span>
|
|
23
28
|
),
|
|
24
29
|
key: lang,
|
|
@@ -32,14 +37,10 @@ const LocaleButton = (props: ButtonProps) => {
|
|
|
32
37
|
),
|
|
33
38
|
key: "zh",
|
|
34
39
|
});
|
|
40
|
+
|
|
35
41
|
return (
|
|
36
|
-
<Dropdown overlayClassName="localeButton" menu={{ items, onClick }}>
|
|
37
|
-
<Button
|
|
38
|
-
type="primary"
|
|
39
|
-
shape="circle"
|
|
40
|
-
icon={<GlobalOutlined />}
|
|
41
|
-
{...props}
|
|
42
|
-
/>
|
|
42
|
+
<Dropdown arrow={{ pointAtCenter: true }} placement={placement} overlayStyle={{ minWidth: "105px" }} overlayClassName="localeButton" menu={{ items, onClick }}>
|
|
43
|
+
{children || <Button type="primary" shape="circle" icon={<GlobalOutlined />} {...otherProps} />}
|
|
43
44
|
</Dropdown>
|
|
44
45
|
);
|
|
45
46
|
};
|
|
Binary file
|