beer-assembly-biz 1.1.2-alpha.1 → 1.1.2-alpha.10
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/AppLayout.js +13 -12
- package/BackPageContainer.js +4 -2
- package/MediaModals.js +3 -2
- package/MyPageContainer.d.ts +3 -1
- package/MyPageContainer.js +5 -4
- package/SubMenusContainer.d.ts +28 -0
- package/SubMenusContainer.js +72 -0
- package/UserModals.js +1 -1
- package/package.json +3 -3
package/AppLayout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { ProLayout } from '@ant-design/pro-components';
|
|
4
|
-
import { Dropdown, message, Typography } from 'antd';
|
|
4
|
+
import { Dropdown, message, theme, Typography } from 'antd';
|
|
5
5
|
import { Session } from 'beer-network/session';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import ImageLayout01 from './images/layout_01.png';
|
|
@@ -9,6 +9,7 @@ import ImageLayout02 from './images/layout_02.png';
|
|
|
9
9
|
import ImageLayout03 from './images/layout_03.png';
|
|
10
10
|
dayjs.locale('zh-cn');
|
|
11
11
|
const Component = (props) => {
|
|
12
|
+
const { token } = theme.useToken();
|
|
12
13
|
const [messageApi, contextHolder] = message.useMessage();
|
|
13
14
|
// App
|
|
14
15
|
const [app, setApp] = useState({});
|
|
@@ -136,7 +137,7 @@ const Component = (props) => {
|
|
|
136
137
|
padding: 3px;
|
|
137
138
|
|
|
138
139
|
& > div {
|
|
139
|
-
height:
|
|
140
|
+
height: ${token.controlHeight + 2}px;
|
|
140
141
|
line-height: 1.5;
|
|
141
142
|
}
|
|
142
143
|
}
|
|
@@ -177,12 +178,12 @@ const Component = (props) => {
|
|
|
177
178
|
heightLayoutHeader: 48
|
|
178
179
|
},
|
|
179
180
|
sider: {
|
|
180
|
-
menuHeight:
|
|
181
|
+
menuHeight: token.controlHeight + 2,
|
|
181
182
|
paddingBlockLayoutMenu: 4,
|
|
182
183
|
paddingInlineLayoutMenu: 4,
|
|
183
184
|
colorMenuBackground: '#fff',
|
|
184
185
|
colorTextMenu: 'rgb(87, 89, 102)',
|
|
185
|
-
colorTextMenuSelected: '
|
|
186
|
+
colorTextMenuSelected: 'rgba(0,0,0,0.8)',
|
|
186
187
|
colorBgMenuItemSelected: 'rgba(0,0,0,0.08)'
|
|
187
188
|
},
|
|
188
189
|
pageContainer: {
|
|
@@ -207,9 +208,9 @@ const Component = (props) => {
|
|
|
207
208
|
});
|
|
208
209
|
}
|
|
209
210
|
return React.createElement(React.Fragment, null, props?.collapsed ? undefined : React.createElement("div", { style: {
|
|
210
|
-
padding:
|
|
211
|
+
padding: '2px 0',
|
|
211
212
|
textIndent: 10,
|
|
212
|
-
fontSize:
|
|
213
|
+
fontSize: token.fontSize + 2,
|
|
213
214
|
color: '#333',
|
|
214
215
|
fontWeight: 500
|
|
215
216
|
} }, app?.name));
|
|
@@ -222,8 +223,8 @@ const Component = (props) => {
|
|
|
222
223
|
}
|
|
223
224
|
}, subMenuItemRender: (props, _defaultDom, menuProps) => {
|
|
224
225
|
return React.createElement("div", { style: {
|
|
225
|
-
height:
|
|
226
|
-
fontSize:
|
|
226
|
+
height: token.controlHeight + 2,
|
|
227
|
+
fontSize: token.fontSize,
|
|
227
228
|
display: 'flex',
|
|
228
229
|
alignItems: 'center',
|
|
229
230
|
justifyContent: menuProps.collapsed ? 'center' : undefined,
|
|
@@ -241,9 +242,9 @@ const Component = (props) => {
|
|
|
241
242
|
const isSub = (props.locale?.toString()
|
|
242
243
|
?.split('.') || []).length > 2;
|
|
243
244
|
return React.createElement("a", { style: {
|
|
244
|
-
fontSize:
|
|
245
|
+
fontSize: token.fontSize,
|
|
245
246
|
userSelect: 'none',
|
|
246
|
-
height:
|
|
247
|
+
height: token.controlHeight + 2,
|
|
247
248
|
display: 'flex',
|
|
248
249
|
alignItems: 'center',
|
|
249
250
|
justifyContent: menuProps.collapsed && !isSub ? 'center' : undefined,
|
|
@@ -283,7 +284,7 @@ const Component = (props) => {
|
|
|
283
284
|
size: 'small',
|
|
284
285
|
title: React.createElement("span", { style: {
|
|
285
286
|
color: '#333',
|
|
286
|
-
fontSize:
|
|
287
|
+
fontSize: token.fontSize + 1
|
|
287
288
|
} }, userInfo?.nickName || '系统用户'),
|
|
288
289
|
render: (_props, dom) => {
|
|
289
290
|
return (React.createElement(Dropdown, { menu: {
|
|
@@ -303,7 +304,7 @@ const Component = (props) => {
|
|
|
303
304
|
React.createElement(Typography.Text, { ellipsis: true, style: {
|
|
304
305
|
width: 200,
|
|
305
306
|
fontWeight: 500,
|
|
306
|
-
fontSize:
|
|
307
|
+
fontSize: token.fontSize + 1
|
|
307
308
|
} }, userInfo?.companyName || userInfo?.nickName)),
|
|
308
309
|
React.createElement("p", null,
|
|
309
310
|
React.createElement(Typography.Text, { ellipsis: true, style: { width: 200 } },
|
package/BackPageContainer.js
CHANGED
|
@@ -2,7 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { PageContainer } from '@ant-design/pro-components';
|
|
4
4
|
import { useNavigate } from 'react-router-dom';
|
|
5
|
+
import { theme } from 'antd';
|
|
5
6
|
export const Component = (props) => {
|
|
7
|
+
const { token } = theme.useToken();
|
|
6
8
|
const navigate = useNavigate();
|
|
7
9
|
return React.createElement(React.Fragment, null,
|
|
8
10
|
React.createElement(PageContainer, { onBack: () => {
|
|
@@ -13,14 +15,14 @@ export const Component = (props) => {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
.ant-page-header-heading-title {
|
|
16
|
-
font-size:
|
|
18
|
+
font-size: ${token.fontSize + 2}px;
|
|
17
19
|
line-height: 1.5;
|
|
18
20
|
color: #333;
|
|
19
21
|
}
|
|
20
22
|
`, header: {
|
|
21
23
|
style: {
|
|
22
24
|
background: '#fff',
|
|
23
|
-
padding: '10px 24px
|
|
25
|
+
padding: '10px 24px',
|
|
24
26
|
borderBottom: '1px solid rgba(0, 0, 0, 0.06)'
|
|
25
27
|
}
|
|
26
28
|
}, title: props.title, ghost: true, childrenContentStyle: {
|
package/MediaModals.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
|
-
import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, Typography } from 'antd';
|
|
3
|
+
import { Breadcrumb, Button, Dropdown, Input, message, Modal, Popconfirm, Space, Spin, theme, Typography } from 'antd';
|
|
4
4
|
import ElementUtils from 'beer-network/elementUtils';
|
|
5
5
|
import Flux from 'beer-assembly/Flux';
|
|
6
6
|
import { CloudDownloadOutlined, CopyOutlined, DeleteOutlined, ExclamationCircleFilled, HighlightOutlined, RightCircleOutlined, ScissorOutlined } from '@ant-design/icons';
|
|
@@ -11,6 +11,7 @@ import IconMedia from './icon/media.png';
|
|
|
11
11
|
export class MediaModals {
|
|
12
12
|
static useMedia(request) {
|
|
13
13
|
const [messageApi, contextHolder] = message.useMessage();
|
|
14
|
+
const { token } = theme.useToken();
|
|
14
15
|
const [isOpenModal, setIsOpenModal] = useState(false);
|
|
15
16
|
const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
|
|
16
17
|
const [isOpenRenameModal, setIsOpenRenameModal] = useState(false);
|
|
@@ -336,7 +337,7 @@ export class MediaModals {
|
|
|
336
337
|
React.createElement(Space, null,
|
|
337
338
|
React.createElement(Button, { type: "primary", onClick: () => onPutFile(), size: "small", style: {
|
|
338
339
|
height: 24,
|
|
339
|
-
fontSize:
|
|
340
|
+
fontSize: token.fontSize - 1
|
|
340
341
|
}, loading: isLoading }, "\u4E0A\u4F20\u6587\u4EF6"),
|
|
341
342
|
React.createElement(Popconfirm, { title: "\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0", description: React.createElement(Input, { value: selectName, onChange: (e) => setSelectName(e.currentTarget.value) }), onCancel: () => setSelectName(''), onConfirm: () => onCreateDirectory(selectName), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" },
|
|
342
343
|
React.createElement(Button, { size: "small", style: {
|
package/MyPageContainer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
1
|
+
import React, { CSSProperties, FC } from 'react';
|
|
2
2
|
import { TabPaneProps } from 'antd';
|
|
3
3
|
export interface Tab extends Omit<TabPaneProps, 'tab'> {
|
|
4
4
|
key: string;
|
|
@@ -6,6 +6,8 @@ export interface Tab extends Omit<TabPaneProps, 'tab'> {
|
|
|
6
6
|
}
|
|
7
7
|
export declare type MyPageContainerProps = {
|
|
8
8
|
title?: string | undefined;
|
|
9
|
+
padding?: string | number | undefined;
|
|
10
|
+
style?: CSSProperties | undefined;
|
|
9
11
|
children?: React.ReactNode | undefined;
|
|
10
12
|
tabList?: Tab[];
|
|
11
13
|
onTabChange?: (e: string) => void;
|
package/MyPageContainer.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { PageContainer } from '@ant-design/pro-components';
|
|
4
|
-
import { message, Modal, Tabs } from 'antd';
|
|
4
|
+
import { message, Modal, Tabs, theme } from 'antd';
|
|
5
5
|
import { Outlet, useLocation } from 'react-router-dom';
|
|
6
6
|
import ParentContext from './content/ParentContext';
|
|
7
7
|
const pathPartition = (sessionStorage.getItem('DETAIL_PARTITION') || '') === ''
|
|
8
8
|
? ['CREATE', 'EDIT', 'COPY', 'AUDIT', 'PREVIEW', 'DETAIL', 'READ', 'IN', 'INPUT', 'OUTPUT']
|
|
9
9
|
: JSON.parse(sessionStorage.getItem('DETAIL_PARTITION') || '[]');
|
|
10
10
|
export const Component = (props) => {
|
|
11
|
+
const { token } = theme.useToken();
|
|
11
12
|
const location = useLocation();
|
|
12
13
|
const [messageApi, contextHolder] = message.useMessage();
|
|
13
14
|
const [modal, contextModalHolder] = Modal.useModal();
|
|
@@ -40,7 +41,7 @@ export const Component = (props) => {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.ant-page-header-heading-title {
|
|
43
|
-
font-size:
|
|
44
|
+
font-size: ${token.fontSize + 2}px;
|
|
44
45
|
line-height: 1.5;
|
|
45
46
|
color: #333;
|
|
46
47
|
}
|
|
@@ -64,8 +65,8 @@ export const Component = (props) => {
|
|
|
64
65
|
`, tabBarStyle: { margin: '0 24px' }, onChange: (e) => props?.onTabChange?.(e) })) : undefined,
|
|
65
66
|
props?.banner,
|
|
66
67
|
React.createElement("div", { className: css `
|
|
67
|
-
padding: 12px 16px;
|
|
68
|
-
|
|
68
|
+
padding: ${props?.padding || '12px 16px'};
|
|
69
|
+
`, style: props?.style }, props.children)),
|
|
69
70
|
React.createElement(Outlet, null)));
|
|
70
71
|
};
|
|
71
72
|
export default Component;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { CSSProperties, FC } from 'react';
|
|
2
|
+
import type { ComponentToken as MenuComponentToken } from 'antd/es/menu/style';
|
|
3
|
+
export declare type MenusItem = {
|
|
4
|
+
key?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
label: string | React.ReactNode;
|
|
7
|
+
children: MenusItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare type SubMenusProps = {
|
|
10
|
+
items: MenusItem[];
|
|
11
|
+
token?: MenuComponentToken | undefined;
|
|
12
|
+
gap?: number | undefined;
|
|
13
|
+
height?: number | string | undefined;
|
|
14
|
+
width?: number | undefined;
|
|
15
|
+
padding?: number | string | undefined;
|
|
16
|
+
styles?: {
|
|
17
|
+
menus?: CSSProperties | undefined;
|
|
18
|
+
body?: CSSProperties | undefined;
|
|
19
|
+
};
|
|
20
|
+
header?: React.ReactNode | undefined;
|
|
21
|
+
children?: React.ReactNode | undefined;
|
|
22
|
+
value?: string | undefined;
|
|
23
|
+
openKeys?: string[] | undefined;
|
|
24
|
+
onChange?: (key: string) => void;
|
|
25
|
+
onOpenChange?: (keys: string[]) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const Component: FC<SubMenusProps>;
|
|
28
|
+
export default Component;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { ConfigProvider, Menu } from 'antd';
|
|
3
|
+
export const Component = (props) => {
|
|
4
|
+
const [selectKeys, setSelectKeys] = useState([]);
|
|
5
|
+
const [openKeys, setOpenKeys] = useState([]);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (props?.value === undefined) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
setSelectKeys([props.value]);
|
|
11
|
+
}, [props?.value]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (props?.openKeys === undefined) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
setOpenKeys(props.openKeys);
|
|
17
|
+
}, [props?.openKeys]);
|
|
18
|
+
return React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement(ConfigProvider, { theme: {
|
|
20
|
+
components: {
|
|
21
|
+
Menu: props?.token || {
|
|
22
|
+
itemHeight: 36,
|
|
23
|
+
itemBorderRadius: 0,
|
|
24
|
+
iconMarginInlineEnd: 0,
|
|
25
|
+
itemMarginBlock: 0,
|
|
26
|
+
itemMarginInline: 0,
|
|
27
|
+
itemPaddingInline: 0,
|
|
28
|
+
subMenuItemBg: 'transparent',
|
|
29
|
+
itemHoverBg: 'rgba(22,100,255,.04)',
|
|
30
|
+
itemHoverColor: '#000',
|
|
31
|
+
itemActiveBg: 'rgba(22,100,255,.08)',
|
|
32
|
+
itemSelectedBg: 'rgba(22,100,255,.08)'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} },
|
|
36
|
+
React.createElement("div", { style: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
gap: `${props?.gap || 12}px`,
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
width: '100%'
|
|
41
|
+
} },
|
|
42
|
+
React.createElement("div", { style: {
|
|
43
|
+
width: props?.width || 200,
|
|
44
|
+
backgroundColor: '#fff',
|
|
45
|
+
height: props?.height || '100vh',
|
|
46
|
+
userSelect: 'none',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
...(props?.styles?.menus || {})
|
|
49
|
+
} },
|
|
50
|
+
props?.header !== undefined ? React.createElement("div", { style: {
|
|
51
|
+
padding: '12px 0',
|
|
52
|
+
fontWeight: 500,
|
|
53
|
+
borderInlineEnd: '1px solid rgba(5,5,5,.06)',
|
|
54
|
+
borderBlockEnd: '1px solid rgba(5,5,5,.06)'
|
|
55
|
+
} }, props?.header) : undefined,
|
|
56
|
+
React.createElement(Menu, { style: {
|
|
57
|
+
height: '100%'
|
|
58
|
+
}, onClick: (e) => {
|
|
59
|
+
props?.onChange?.(e.key);
|
|
60
|
+
}, onOpenChange: (e) => {
|
|
61
|
+
props?.onOpenChange?.(e);
|
|
62
|
+
}, subMenuCloseDelay: 0, selectedKeys: selectKeys, openKeys: openKeys, mode: "inline", inlineIndent: 16, items: props?.items })),
|
|
63
|
+
React.createElement("div", { style: {
|
|
64
|
+
width: `calc(100% - ${(props?.width || 200) + (props?.gap || 12) + (props?.gap || 12)}px)`,
|
|
65
|
+
marginRight: (props?.gap || 12),
|
|
66
|
+
height: '100%',
|
|
67
|
+
padding: props?.padding || '12px 0',
|
|
68
|
+
...(props?.styles?.body || {}),
|
|
69
|
+
overflow: 'auto'
|
|
70
|
+
} }, props?.children))));
|
|
71
|
+
};
|
|
72
|
+
export default Component;
|
package/UserModals.js
CHANGED
|
@@ -28,7 +28,7 @@ export class UserModals {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
return [handler, React.createElement(React.Fragment, null,
|
|
31
|
-
React.createElement(Modal, { title: "\u91CD\u7F6E\u5BC6\u7801", width:
|
|
31
|
+
React.createElement(Modal, { title: "\u91CD\u7F6E\u5BC6\u7801", width: 340, open: isOpenModal, onOk: () => onConfirm(), onCancel: () => setIsOpenModal(false), styles: { body: { padding: '6px 0' } } },
|
|
32
32
|
React.createElement(Form, { form: form, labelCol: { span: 5 } },
|
|
33
33
|
React.createElement(Form.Item, { name: "password", style: { margin: 0 }, rules: [{
|
|
34
34
|
required: true,
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beer-assembly-biz",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.2-alpha.
|
|
4
|
+
"version": "1.1.2-alpha.10",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub-w": "tsc && copy package.json .\\dist\\package.json && npm publish ./dist",
|
|
7
7
|
"pub-m": "tsc && cp -a src/icon ./dist && cp -a src/fonts ./dist && cp -a src/images ./dist && cp package.json ./dist/package.json && npm publish ./dist"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@ant-design/icons": "5.5.2",
|
|
11
|
-
"@ant-design/pro-components": "2.
|
|
11
|
+
"@ant-design/pro-components": "2.8.4",
|
|
12
12
|
"@emotion/css": "^11.11.2",
|
|
13
13
|
"antd": "5.23.2",
|
|
14
14
|
"beer-network": "^1.1.1-alpha.17",
|
|
15
|
-
"beer-assembly": "^1.1.2-alpha.
|
|
15
|
+
"beer-assembly": "^1.1.2-alpha.2",
|
|
16
16
|
"dayjs": "^1.11.13",
|
|
17
17
|
"history": "^5.3.0",
|
|
18
18
|
"lodash": "^4.17.21",
|