beer-assembly-biz 1.1.2-alpha.1 → 1.1.2-alpha.11

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 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: 36px;
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: 32,
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: 'rgb(51, 51, 51)',
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: props?.isMobile ? '12px 10px' : '2px 0',
211
+ padding: '2px 0',
211
212
  textIndent: 10,
212
- fontSize: 15,
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: 32,
226
- fontSize: 13,
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: 13,
245
+ fontSize: token.fontSize,
245
246
  userSelect: 'none',
246
- height: 32,
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: 14
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: 14
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 } },
@@ -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: 15px;
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 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: {
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
- import { App, ConfigProvider } from 'antd';
2
+ import { App, ConfigProvider, theme } from 'antd';
3
3
  export const Component = (props) => {
4
+ const { token } = theme.useToken();
4
5
  return React.createElement(App, null,
5
6
  React.createElement(ConfigProvider, { theme: {
6
7
  token: {
7
- fontSize: 12,
8
+ fontSize: token.fontSize - 1,
8
9
  controlHeight: 26,
9
10
  fontWeightStrong: 500
10
11
  },
@@ -20,7 +21,7 @@ export const Component = (props) => {
20
21
  cellPaddingBlockSM: 7
21
22
  },
22
23
  Switch: {
23
- fontSize: 10
24
+ fontSize: token.fontSize - 3
24
25
  }
25
26
  }
26
27
  } }, props?.children));
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);
@@ -272,7 +273,7 @@ export class MediaModals {
272
273
  } }),
273
274
  React.createElement(Typography.Text, { style: {
274
275
  width: 70,
275
- fontSize: 11,
276
+ fontSize: token.fontSize - 2,
276
277
  display: 'block',
277
278
  textAlign: 'center',
278
279
  color: '#323232',
@@ -323,12 +324,12 @@ export class MediaModals {
323
324
  title: (index + 1 === path.length
324
325
  ? React.createElement(Typography.Text, { style: {
325
326
  maxWidth: 70,
326
- fontSize: 12
327
+ fontSize: token.fontSize - 1
327
328
  }, ellipsis: true }, it.name)
328
329
  : React.createElement("a", { onClick: () => onBackDirectory(it.id) },
329
330
  React.createElement(Typography.Text, { style: {
330
331
  maxWidth: 70,
331
- fontSize: 12,
332
+ fontSize: token.fontSize - 1,
332
333
  color: 'rgba(0, 0, 0, 0.45)'
333
334
  }, ellipsis: true }, it.name)))
334
335
  };
@@ -336,12 +337,12 @@ 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: 12
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: {
343
344
  height: 24,
344
- fontSize: 12
345
+ fontSize: token.fontSize - 1
345
346
  }, loading: isLoading }, "\u65B0\u5EFA\u76EE\u5F55")))),
346
347
  React.createElement(Spin, { spinning: isLoading },
347
348
  React.createElement("div", { style: {
@@ -359,7 +360,7 @@ export class MediaModals {
359
360
  React.createElement(Modal, { title: React.createElement(React.Fragment, null,
360
361
  React.createElement(ExclamationCircleFilled, { style: {
361
362
  marginRight: 6,
362
- fontSize: 16,
363
+ fontSize: token.fontSize + 3,
363
364
  color: '#faad14'
364
365
  } }),
365
366
  "\u662F\u5426\u786E\u8BA4\u5220\u9664?"), width: 400, open: isOpenConfirmModal, onOk: () => onConfirmRemove(), onCancel: () => setIsOpenConfirmModal(false), okText: "\u786E\u5B9A", cancelText: "\u53D6\u6D88" }, "\u5220\u9664\u64CD\u4F5C\u4E0D\u80FD\u56DE\u590D\uFF0C\u786E\u5B9A\u8981\u5220\u9664\u9009\u4E2D\u7684\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u5417\uFF1F"),
@@ -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;
@@ -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: 15px;
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
- ` }, props.children)),
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/Upgrade.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
- import { Modal } from 'antd';
2
+ import { Modal, theme } from 'antd';
3
3
  const TIME_KEY = 'VERSION_TIME';
4
4
  const App = (props) => {
5
+ const { token } = theme.useToken();
5
6
  useEffect(() => {
6
7
  // 每5分钟执行一次
7
8
  setTimeout(async () => {
@@ -30,7 +31,7 @@ const App = (props) => {
30
31
  title: '版本更新提示',
31
32
  content: React.createElement(React.Fragment, null,
32
33
  React.createElement("p", { style: {
33
- fontSize: '15px',
34
+ fontSize: token.fontSize + 2,
34
35
  lineHeight: '26px'
35
36
  } }, "\u60A8\u5DF2\u7ECF\u957F\u65F6\u95F4\u672A\u4F7F\u7528\u6B64\u9875\u9762\uFF0C\u5728\u6B64\u671F\u95F4\u5E73\u53F0\u6709\u8FC7\u66F4\u65B0\uFF0C\u5982\u60A8\u6B64\u65F6\u5728\u9875\u9762\u4E2D\u6CA1\u6709\u586B\u5199\u76F8\u5173\u4FE1\u606F\u7B49\u64CD\u4F5C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u9875\u9762\u4F7F\u7528\u6700\u65B0\u7248\u672C\uFF01")),
36
37
  okText: '确定',
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: 380, open: isOpenModal, onOk: () => onConfirm(), onCancel: () => setIsOpenModal(false), styles: { body: { padding: '12px 0' } } },
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,
@@ -1,9 +1,10 @@
1
- import { Button, Checkbox, Dropdown, Form, Input } from 'antd';
1
+ import { Button, Checkbox, Dropdown, Form, Input, theme } from 'antd';
2
2
  import SliderCode from 'beer-assembly/SliderCode';
3
3
  import { css } from '@emotion/css';
4
4
  import React, { useState } from 'react';
5
5
  import { useForm } from 'antd/es/form/Form';
6
6
  const App = (props) => {
7
+ const { token } = theme.useToken();
7
8
  const [form] = useForm();
8
9
  const [isLoading, setIsLoading] = useState(false);
9
10
  const [protocol, setProtocol] = useState(false);
@@ -52,7 +53,7 @@ const App = (props) => {
52
53
  React.createElement(Form.Item, { name: "password", style: { marginBottom: 12 } },
53
54
  React.createElement(Input.Password, { className: "input", maxLength: 32, placeholder: "\u8BF7\u8F93\u5165\u5BC6\u7801", autoComplete: "on", style: { height: 36 } })),
54
55
  props?.protocol === undefined ? undefined : React.createElement(Form.Item, { style: { marginBottom: 12 } },
55
- React.createElement(Checkbox, { style: { fontSize: 13 }, onChange: (e) => {
56
+ React.createElement(Checkbox, { style: { fontSize: token.fontSize + 1 }, onChange: (e) => {
56
57
  setProtocol(e.target.checked);
57
58
  } },
58
59
  React.createElement("span", { dangerouslySetInnerHTML: { __html: props?.protocol } }))),
@@ -89,8 +89,8 @@ const App = (props) => {
89
89
  min-height: 200px;
90
90
  ` },
91
91
  errorMessage !== '' ? React.createElement(Alert, { style: {
92
- fontSize: '12px',
93
- marginBottom: '12px',
92
+ fontSize: token.fontSize - 1,
93
+ marginBottom: 12,
94
94
  color: '#fa2c19',
95
95
  padding: '6px 10px',
96
96
  fontWeight: '500'
@@ -82,8 +82,8 @@ const App = (props) => {
82
82
  min-height: 200px;
83
83
  ` },
84
84
  errorMessage !== '' ? React.createElement(Alert, { style: {
85
- fontSize: '12px',
86
- marginBottom: '12px',
85
+ fontSize: token.fontSize - 1,
86
+ marginBottom: 12,
87
87
  color: '#fa2c19',
88
88
  padding: '6px 10px',
89
89
  fontWeight: '500'
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.1",
4
+ "version": "1.1.2-alpha.11",
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.7.19",
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.1",
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",