aldehyde 0.2.304 → 0.2.305
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/detail/button/index.css +2 -2
- package/lib/detail/dtmpl.css +4 -0
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +3 -1
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/layout2/page.d.ts +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +9 -9
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout3/components/tabs-layout.d.ts +5 -0
- package/lib/layout3/components/tabs-layout.d.ts.map +1 -0
- package/lib/layout3/components/tabs-layout.js +68 -0
- package/lib/layout3/components/tabs-layout.js.map +1 -0
- package/lib/layout3/components/time.d.ts +7 -0
- package/lib/layout3/components/time.d.ts.map +1 -0
- package/lib/layout3/components/time.js +18 -0
- package/lib/layout3/components/time.js.map +1 -0
- package/lib/layout3/components/user-button.d.ts +5 -0
- package/lib/layout3/components/user-button.d.ts.map +1 -0
- package/lib/layout3/components/user-button.js +146 -0
- package/lib/layout3/components/user-button.js.map +1 -0
- package/lib/layout3/css/header.css +156 -0
- package/lib/layout3/css/main.css +18 -0
- package/lib/layout3/css/sider.css +13 -0
- package/lib/layout3/css/tabs-layout.css +41 -0
- package/lib/layout3/header.d.ts +11 -0
- package/lib/layout3/header.d.ts.map +1 -0
- package/lib/layout3/header.js +117 -0
- package/lib/layout3/header.js.map +1 -0
- package/lib/layout3/imgs/header-bg.png +0 -0
- package/lib/layout3/imgs/home-bg.png +0 -0
- package/lib/layout3/main.d.ts +8 -0
- package/lib/layout3/main.d.ts.map +1 -0
- package/lib/layout3/main.js +15 -0
- package/lib/layout3/main.js.map +1 -0
- package/lib/layout3/page.d.ts +8 -0
- package/lib/layout3/page.d.ts.map +1 -0
- package/lib/layout3/page.js +57 -0
- package/lib/layout3/page.js.map +1 -0
- package/lib/layout3/sider.d.ts +10 -0
- package/lib/layout3/sider.d.ts.map +1 -0
- package/lib/layout3/sider.js +124 -0
- package/lib/layout3/sider.js.map +1 -0
- package/lib/lowcode-components/bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/bar-chart/index.js +4 -1
- package/lib/lowcode-components/bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/capsule-bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/capsule-bar-chart/index.js +4 -1
- package/lib/lowcode-components/capsule-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/column-3d-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-3d-chart/index.js +4 -1
- package/lib/lowcode-components/column-3d-chart/index.js.map +1 -1
- package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-chart/index.js +4 -1
- package/lib/lowcode-components/column-chart/index.js.map +1 -1
- package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-bar-chart/index.js +4 -1
- package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-chart/index.js +5 -2
- package/lib/lowcode-components/line-chart/index.js.map +1 -1
- package/lib/lowcode-components/pie-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/pie-chart/index.js +60 -6
- package/lib/lowcode-components/pie-chart/index.js.map +1 -1
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +1 -2
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/relation-table.d.ts +2 -2
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +29 -7
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/resizable-table.js +1 -1
- package/lib/table/resizable-table.js.map +1 -1
- package/lib/tmpl/interface.d.ts +2 -0
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/detail/button/index.css +2 -2
- package/src/aldehyde/detail/dtmpl.css +4 -0
- package/src/aldehyde/form/dtmpl-form.tsx +8 -1
- package/src/aldehyde/index.tsx +5 -1
- package/src/aldehyde/layout2/page.tsx +9 -8
- package/src/aldehyde/layout3/components/tabs-layout.tsx +106 -0
- package/src/aldehyde/layout3/components/time.tsx +25 -0
- package/src/aldehyde/layout3/components/user-button.tsx +189 -0
- package/src/aldehyde/layout3/css/header.css +156 -0
- package/src/aldehyde/layout3/css/main.css +18 -0
- package/src/aldehyde/layout3/css/sider.css +13 -0
- package/src/aldehyde/layout3/css/tabs-layout.css +41 -0
- package/src/aldehyde/layout3/header.tsx +160 -0
- package/src/aldehyde/layout3/imgs/header-bg.png +0 -0
- package/src/aldehyde/layout3/imgs/home-bg.png +0 -0
- package/src/aldehyde/layout3/main.tsx +28 -0
- package/src/aldehyde/layout3/page.tsx +82 -0
- package/src/aldehyde/layout3/sider.tsx +176 -0
- package/src/aldehyde/lowcode-components/bar-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +4 -1
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +5 -2
- package/src/aldehyde/lowcode-components/pie-chart/index.tsx +61 -6
- package/src/aldehyde/table/act-table.tsx +1 -2
- package/src/aldehyde/table/relation-table.tsx +28 -8
- package/src/aldehyde/table/resizable-table.tsx +1 -1
- package/src/aldehyde/tmpl/interface.tsx +2 -0
|
@@ -143,6 +143,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
143
143
|
) => {
|
|
144
144
|
const { currentDtmplData } = this.state;
|
|
145
145
|
currentDtmplData["arrayMap"][fieldGroupConfig.id] = selectdDatas;
|
|
146
|
+
debugger
|
|
146
147
|
let currentDtmplData_1 = { ...currentDtmplData };
|
|
147
148
|
this.setState({
|
|
148
149
|
currentDtmplData: currentDtmplData_1,
|
|
@@ -372,6 +373,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
372
373
|
if (dtmplData) {
|
|
373
374
|
data = dtmplData.arrayMap[item.id];
|
|
374
375
|
}
|
|
376
|
+
debugger
|
|
375
377
|
return (
|
|
376
378
|
<RelationTable
|
|
377
379
|
showRightNav={showRightNav}
|
|
@@ -404,6 +406,11 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
404
406
|
loading={loading}
|
|
405
407
|
styles={{body:{ padding: "6px" },header:{ background: "#f2f4f5" }}}
|
|
406
408
|
>
|
|
409
|
+
{item.readOnly?<FieldViewGroup fields={item ? item.fields : undefined}
|
|
410
|
+
dataCode={dtmplData ? dtmplData.code:null}
|
|
411
|
+
serverKey={serverKey}
|
|
412
|
+
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
413
|
+
/>:
|
|
407
414
|
<FormItemGroup layout={HcserviceV3.isForeignLanguageMode()?"vertical":"horizontal"}
|
|
408
415
|
serverKey={serverKey}
|
|
409
416
|
formRef={formRef}
|
|
@@ -412,7 +419,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
412
419
|
fields={item ? item.fields : undefined}
|
|
413
420
|
dataCode={dtmplData ? dtmplData.code : undefined}
|
|
414
421
|
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
415
|
-
></FormItemGroup>
|
|
422
|
+
></FormItemGroup>}
|
|
416
423
|
</CollapseCard>
|
|
417
424
|
);
|
|
418
425
|
}
|
package/src/aldehyde/index.tsx
CHANGED
|
@@ -126,6 +126,9 @@ import ContextPage from "./layout2/page";
|
|
|
126
126
|
import LoginPage from "./login2/login-page";
|
|
127
127
|
// import { LoginPage } from "./login2";
|
|
128
128
|
|
|
129
|
+
// v3 Layout
|
|
130
|
+
import ContextPage3 from "./layout3/page";
|
|
131
|
+
|
|
129
132
|
import LowcodeComponents from "./lowcode-components";
|
|
130
133
|
|
|
131
134
|
export {
|
|
@@ -178,5 +181,6 @@ export {
|
|
|
178
181
|
TmplConfigAnalysis,
|
|
179
182
|
ContextPage,
|
|
180
183
|
LoginPage,
|
|
181
|
-
LowcodeComponents
|
|
184
|
+
LowcodeComponents,
|
|
185
|
+
ContextPage3
|
|
182
186
|
};
|
|
@@ -30,10 +30,11 @@ const handleMenuItemUrl = (
|
|
|
30
30
|
customPath?: string,
|
|
31
31
|
dragDropPageId?: string,
|
|
32
32
|
fullScreen?: boolean,
|
|
33
|
+
version?: string, // 版本路由 v2/v3
|
|
33
34
|
) => {
|
|
34
|
-
if (customPath) return `${fullScreen ? "" :
|
|
35
|
+
if (customPath) return `${fullScreen ? "" : `${version}/`}page/${id}/${customPath}?menuId=${id}`;
|
|
35
36
|
if (dragDropPageId) {
|
|
36
|
-
return `${fullScreen ? "" :
|
|
37
|
+
return `${fullScreen ? "" : `${version}/`}ddpage/${id}/${dragDropPageId}?menuId=${id}`;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
const queryParam = { ...query };
|
|
@@ -76,12 +77,12 @@ const handleMenuItemUrl = (
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
if (operator !== "") queryParam["codeSource"] = operator;
|
|
79
|
-
return
|
|
80
|
+
return `${version}/${id}/${routePath}?${Object.entries(queryParam)
|
|
80
81
|
.map(([key, val]) => `${key}=${val}`)
|
|
81
82
|
.join("&")}`;
|
|
82
83
|
};
|
|
83
84
|
|
|
84
|
-
const handleMenuRes = (menuList: MenuConfigAPIType["blocks"]): MenuType[] => {
|
|
85
|
+
const handleMenuRes = (menuList: MenuConfigAPIType["blocks"], version: string): MenuType[] => {
|
|
85
86
|
const retList: MenuType[] = [];
|
|
86
87
|
|
|
87
88
|
menuList.sort((a, b) => {
|
|
@@ -109,9 +110,9 @@ const handleMenuRes = (menuList: MenuConfigAPIType["blocks"]): MenuType[] => {
|
|
|
109
110
|
id,
|
|
110
111
|
label: title,
|
|
111
112
|
disabled: disabled === undefined ? false : disabled,
|
|
112
|
-
url: handleMenuItemUrl(id, pageType, defaultCriteriaValue, customPath, dragDropPageId, fullScreen),
|
|
113
|
+
url: handleMenuItemUrl(id, pageType, defaultCriteriaValue, customPath, dragDropPageId, fullScreen, version),
|
|
113
114
|
linkTarget,
|
|
114
|
-
children: items?.length ? handleMenuRes(items) : [],
|
|
115
|
+
children: items?.length ? handleMenuRes(items, version) : [],
|
|
115
116
|
};
|
|
116
117
|
|
|
117
118
|
retList.push(menu);
|
|
@@ -123,7 +124,7 @@ const handleMenuRes = (menuList: MenuConfigAPIType["blocks"]): MenuType[] => {
|
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
export const getMenuConfig = async (): Promise<{
|
|
127
|
+
export const getMenuConfig = async (version = "v2"): Promise<{
|
|
127
128
|
systemName: string;
|
|
128
129
|
menu: MenuType[];
|
|
129
130
|
}> => {
|
|
@@ -131,7 +132,7 @@ export const getMenuConfig = async (): Promise<{
|
|
|
131
132
|
const res = await HcserviceV3.requestBlocks("", "");
|
|
132
133
|
let menuList: MenuType[] = [];
|
|
133
134
|
if (res?.blocks) {
|
|
134
|
-
menuList = handleMenuRes(res.blocks);
|
|
135
|
+
menuList = handleMenuRes(res.blocks, version);
|
|
135
136
|
}
|
|
136
137
|
let tmp = {};
|
|
137
138
|
menuList.forEach((menu: MenuType) => {
|
|
@@ -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="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;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
format?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Index = (props: Props) => {
|
|
9
|
+
const { format = "YYYY年MM月DD日" } = props;
|
|
10
|
+
const [time, setTime] = useState<string>();
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setTime(dayjs().format(format));
|
|
14
|
+
const timeInterval = setInterval(() => {
|
|
15
|
+
setTime(dayjs().format(format));
|
|
16
|
+
}, 1000);
|
|
17
|
+
return () => {
|
|
18
|
+
clearInterval(timeInterval);
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return (<span>{time}</span>);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default Index;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import React, { ReactNode, useEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
CaretDownOutlined,
|
|
4
|
+
ClearOutlined,
|
|
5
|
+
LoginOutlined,
|
|
6
|
+
LogoutOutlined, MenuFoldOutlined, MenuUnfoldOutlined,
|
|
7
|
+
SettingOutlined,
|
|
8
|
+
UnlockOutlined,
|
|
9
|
+
UserOutlined,
|
|
10
|
+
} from "@ant-design/icons";
|
|
11
|
+
import { Button, ButtonProps, Dropdown, GetProp, MenuProps } from "antd";
|
|
12
|
+
import HcserviceV3 from "../../tmpl/hcservice-v3";
|
|
13
|
+
import { UserInfo } from "../../tmpl/interface";
|
|
14
|
+
import UserInfoBar from "../../layout/menu/userinfo-bar";
|
|
15
|
+
import { useLocale } from "../../locale/useLocale";
|
|
16
|
+
import { NavLink, useNavigate } from "react-router-dom";
|
|
17
|
+
import ResetPassword from "../../layout/menu/reset-password";
|
|
18
|
+
import HCDataSource from "../../tmpl/hc-data-source";
|
|
19
|
+
import { useSessionStorageState } from 'ahooks';
|
|
20
|
+
import {KeepAliveTab} from "../../hooks/use-tabs";
|
|
21
|
+
import Units from "../../units";
|
|
22
|
+
|
|
23
|
+
type DropDownMenuType = {
|
|
24
|
+
label: string | number | ReactNode;
|
|
25
|
+
key: string;
|
|
26
|
+
icon?: ReactNode;
|
|
27
|
+
show?: () => boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const UserButton: React.FC<ButtonProps> = (props) => {
|
|
31
|
+
// translate
|
|
32
|
+
const { translate,changeSiderCollapsed,getSiderCollapsed } = useLocale();
|
|
33
|
+
const [keepAliveTabs, setKeepAliveTabs] = useSessionStorageState<KeepAliveTab[]>('keepAliveTabs', {
|
|
34
|
+
defaultValue: [],
|
|
35
|
+
});
|
|
36
|
+
// navigation
|
|
37
|
+
const navigate = useNavigate();
|
|
38
|
+
|
|
39
|
+
// 用户配置信息
|
|
40
|
+
const [userConfig, setUserConfig] = useState<UserInfo>({
|
|
41
|
+
id: undefined,
|
|
42
|
+
name: undefined,
|
|
43
|
+
});
|
|
44
|
+
const initUserConfig = async () => {
|
|
45
|
+
const userInfo: UserInfo = await Units.getUserInfo();
|
|
46
|
+
setUserConfig(userInfo);
|
|
47
|
+
};
|
|
48
|
+
useEffect(() => {}, [userConfig]);
|
|
49
|
+
|
|
50
|
+
// 上下文配置信息
|
|
51
|
+
const [globalContext, setGlobalContext] = useState<any[]>();
|
|
52
|
+
const initContext = async () => {
|
|
53
|
+
let context = await HcserviceV3.getContextSourceValue();
|
|
54
|
+
setGlobalContext(context);
|
|
55
|
+
};
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
initContext();
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
// 用户是否登录
|
|
61
|
+
const [isLogin, setIsLogin] = useState<boolean>(false);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (userConfig?.name !== undefined && userConfig?.name !== null)
|
|
64
|
+
setIsLogin(true);
|
|
65
|
+
else setIsLogin(false);
|
|
66
|
+
}, [userConfig]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
initUserConfig();
|
|
69
|
+
}, []);
|
|
70
|
+
|
|
71
|
+
// logout
|
|
72
|
+
const logout = async () => {
|
|
73
|
+
setKeepAliveTabs([]);
|
|
74
|
+
await HcserviceV3.logout2();
|
|
75
|
+
navigate("/login2");
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// dropdown menu
|
|
79
|
+
const onClick: MenuProps["onClick"] = ({ key }) => {};
|
|
80
|
+
const dropdownMenuList: DropDownMenuType[] = [
|
|
81
|
+
{
|
|
82
|
+
label: <NavLink to="/login2">{translate("${登录}")}</NavLink>,
|
|
83
|
+
key: "login",
|
|
84
|
+
icon: <LoginOutlined />,
|
|
85
|
+
show: () => {
|
|
86
|
+
return !isLogin;
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: (
|
|
91
|
+
<UserInfoBar
|
|
92
|
+
gtmplSourceId={userConfig?.gtmplSourceId}
|
|
93
|
+
editable={userConfig?.changePersonalInfoable}
|
|
94
|
+
userCode={userConfig?.id}
|
|
95
|
+
/>
|
|
96
|
+
),
|
|
97
|
+
key: "userInfo",
|
|
98
|
+
icon: <UserOutlined />,
|
|
99
|
+
show: () => {
|
|
100
|
+
return isLogin && userConfig?.viewPersonalInfoable;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: <NavLink to="/context-setter">{translate("${全局配置}")}</NavLink>,
|
|
105
|
+
key: "globalContext",
|
|
106
|
+
icon: <SettingOutlined />,
|
|
107
|
+
show: () => {
|
|
108
|
+
return (
|
|
109
|
+
isLogin && Array.isArray(globalContext) && globalContext.length > 0
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: <ResetPassword></ResetPassword>,
|
|
115
|
+
key: "resetPwd",
|
|
116
|
+
icon: <UnlockOutlined />,
|
|
117
|
+
show: () => {
|
|
118
|
+
return isLogin && userConfig.changePasswordable;
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: (
|
|
123
|
+
<span onClick={() => HCDataSource.reload([])}>
|
|
124
|
+
{translate("${清空缓存}")}
|
|
125
|
+
</span>
|
|
126
|
+
),
|
|
127
|
+
key: "cleanCache",
|
|
128
|
+
icon: <ClearOutlined />,
|
|
129
|
+
show: () => {
|
|
130
|
+
return isLogin && userConfig.cleanCachable;
|
|
131
|
+
},
|
|
132
|
+
},{
|
|
133
|
+
label: (
|
|
134
|
+
<span onClick={() => changeSiderCollapsed()}>
|
|
135
|
+
{getSiderCollapsed()?translate("${显示侧边栏}"):translate("${隐藏侧边栏}")}
|
|
136
|
+
</span>
|
|
137
|
+
),
|
|
138
|
+
key: "collapseSider",
|
|
139
|
+
icon: <span>{getSiderCollapsed()? <MenuUnfoldOutlined /> :<MenuFoldOutlined /> }</span>,
|
|
140
|
+
show: () => {
|
|
141
|
+
return isLogin ;
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: <span onClick={logout}>{translate("${退出}")}</span>,
|
|
146
|
+
key: "logout",
|
|
147
|
+
icon: <LogoutOutlined />,
|
|
148
|
+
show: () => {
|
|
149
|
+
return isLogin;
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
];
|
|
154
|
+
const cleanDropdownMenuList: GetProp<MenuProps, "items"> = dropdownMenuList
|
|
155
|
+
.filter((item) => {
|
|
156
|
+
if (!item.show) return true;
|
|
157
|
+
return item.show();
|
|
158
|
+
})
|
|
159
|
+
.map(({ label, key, icon }) => {
|
|
160
|
+
return {
|
|
161
|
+
label,
|
|
162
|
+
key,
|
|
163
|
+
icon,
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<Dropdown
|
|
169
|
+
overlayClassName="localeButton"
|
|
170
|
+
menu={{ items: cleanDropdownMenuList, onClick }}
|
|
171
|
+
>
|
|
172
|
+
<Button
|
|
173
|
+
type="text"
|
|
174
|
+
icon={<CaretDownOutlined />}
|
|
175
|
+
style={{
|
|
176
|
+
width: "100%",
|
|
177
|
+
height: "100%",
|
|
178
|
+
borderRadius: 0,
|
|
179
|
+
color: "#fff",
|
|
180
|
+
}}
|
|
181
|
+
{...props}
|
|
182
|
+
>
|
|
183
|
+
{isLogin ? userConfig?.name : translate("${请登录}")}
|
|
184
|
+
</Button>
|
|
185
|
+
</Dropdown>
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export default UserButton;
|
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.header-right{
|
|
51
|
+
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;
|
|
63
|
+
}
|
|
64
|
+
.header-user{
|
|
65
|
+
button .ant-btn-icon{
|
|
66
|
+
margin-top: 4px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
.header-nav{
|
|
71
|
+
margin: 0 0 16px 0;
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: start;
|
|
74
|
+
align-items: center;
|
|
75
|
+
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;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
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);
|
|
119
|
+
border-radius: 120px 120px 120px 120px;
|
|
120
|
+
border: 1px solid;
|
|
121
|
+
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
|
+
}
|
|
142
|
+
}
|
|
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;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.main{
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
position: absolute;
|
|
5
|
+
min-width: 1280px;
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
.ant-layout{
|
|
8
|
+
background: #041B3B !important;
|
|
9
|
+
}
|
|
10
|
+
.act-table-title{
|
|
11
|
+
font-family: YouSheBiaoTiHei;
|
|
12
|
+
background: linear-gradient(180deg, #FFFFFF 0%, #90DEFF 100%);
|
|
13
|
+
-webkit-background-clip: text;
|
|
14
|
+
background-clip: text;
|
|
15
|
+
-webkit-text-fill-color: transparent;
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.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;
|
|
6
|
+
border-image: linear-gradient(180deg, rgba(39, 95, 180, 0.3), rgba(68, 118, 235, 1)) 1 1;
|
|
7
|
+
.ant-menu-item-selected{
|
|
8
|
+
background: linear-gradient(90deg,#88EFFF00,rgba(163,194,255,0.2),#88EFFF00);
|
|
9
|
+
}
|
|
10
|
+
.ant-menu-item{
|
|
11
|
+
padding: 0 !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.tabs-layout {
|
|
2
|
+
height: 100%;
|
|
3
|
+
.ant-tabs-nav {
|
|
4
|
+
margin-bottom: 0;
|
|
5
|
+
}
|
|
6
|
+
.ant-tabs-tab {
|
|
7
|
+
min-width: 110px;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ant-tabs-content,.ant-tabs-tabpane {
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.tabs-children {
|
|
18
|
+
height: 100%;
|
|
19
|
+
overflow: auto;
|
|
20
|
+
border: 1px solid;
|
|
21
|
+
border-image: linear-gradient(180deg, rgba(39, 95, 180, 0.3), rgba(68, 118, 235, 1)) 1 1;
|
|
22
|
+
padding: 3px 12px 12px;
|
|
23
|
+
border-top: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* 组件样式异常覆盖 */
|
|
27
|
+
.ant-card-head{
|
|
28
|
+
background: transparent !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.ant-drawer,.ant-modal-content {
|
|
32
|
+
.ant-drawer-content{
|
|
33
|
+
border: none !important;
|
|
34
|
+
}
|
|
35
|
+
.ant-card-head{
|
|
36
|
+
background: transparent !important;
|
|
37
|
+
}
|
|
38
|
+
.ant-layout{
|
|
39
|
+
background: #041B3B !important;
|
|
40
|
+
}
|
|
41
|
+
}
|