@cqsjjb/jjb-react-admin-component 3.3.12 → 3.4.0-dev.1
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/AMap/index.js +4 -2
- package/AdaptiveTree/index.js +107 -103
- package/BMap/index.js +6 -0
- package/ControlWrapper/index.js +11 -0
- package/Editor/index.js +1 -0
- package/ErrorBoundary/index.js +5 -3
- package/FileUploader/index.js +36 -35
- package/FormilyDescriptions/index.js +13 -3
- package/FormilyRenderer/index.js +1 -0
- package/ImageCropper/index.js +1 -0
- package/ImageUploader/index.js +2 -1
- package/Layout/README.md +41 -0
- package/Layout/index.d.ts +81 -0
- package/Layout/index.js +99 -0
- package/Layout/index.less +112 -0
- package/ListDataContainer/index.js +47 -48
- package/MediaQuery/index.js +9 -2
- package/PageLayout/index.js +11 -6
- package/PhoneBox/index.js +23 -21
- package/SearchForm/index.js +20 -11
- package/Table/index.js +35 -16
- package/TableAction/index.js +10 -7
- package/package.json +2 -2
- package/tools/index.js +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* LayoutHeader 组件属性
|
|
5
|
+
*/
|
|
6
|
+
export interface LayoutHeaderProps {
|
|
7
|
+
/** 自定义样式 */
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/** 标题文本 */
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** 右侧额外内容 */
|
|
12
|
+
extra?: React.ReactNode;
|
|
13
|
+
/** 是否显示返回按钮 */
|
|
14
|
+
previous?: boolean;
|
|
15
|
+
/** 头部下方内容 */
|
|
16
|
+
content?: React.ReactNode;
|
|
17
|
+
/** 自定义类名 */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 内容区域样式 */
|
|
20
|
+
contentStyle?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* LayoutBlock 组件属性
|
|
25
|
+
*/
|
|
26
|
+
export interface LayoutBlockProps {
|
|
27
|
+
/** 标题文本 */
|
|
28
|
+
title?: React.ReactNode;
|
|
29
|
+
/** 描述文本 */
|
|
30
|
+
description?: React.ReactNode;
|
|
31
|
+
/** 右侧额外内容 */
|
|
32
|
+
extra?: React.ReactNode;
|
|
33
|
+
/** 内容区域 */
|
|
34
|
+
content?: React.ReactNode;
|
|
35
|
+
/** 自定义样式 */
|
|
36
|
+
style?: React.CSSProperties;
|
|
37
|
+
/** 自定义类名 */
|
|
38
|
+
className?: string;
|
|
39
|
+
/** 内容区域样式 */
|
|
40
|
+
contentStyle?: React.CSSProperties;
|
|
41
|
+
/** 头部区域样式 */
|
|
42
|
+
headerStyle?: React.CSSProperties;
|
|
43
|
+
/** 头部区域类名 */
|
|
44
|
+
headerClassName?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Layout 组件属性
|
|
49
|
+
*/
|
|
50
|
+
export interface LayoutProps {
|
|
51
|
+
/** 自定义样式 */
|
|
52
|
+
style?: React.CSSProperties;
|
|
53
|
+
/** 数据节点ID */
|
|
54
|
+
'data-node-id'?: string;
|
|
55
|
+
/** 子元素 */
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
/** 自定义类名 */
|
|
58
|
+
className?: string;
|
|
59
|
+
/** 内容区域样式 */
|
|
60
|
+
contentStyle?: React.CSSProperties;
|
|
61
|
+
/** 内容区域类名 */
|
|
62
|
+
contentClassName?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 布局头部组件
|
|
67
|
+
*/
|
|
68
|
+
export const LayoutHeader: React.FC<LayoutHeaderProps>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 布局块组件
|
|
72
|
+
*/
|
|
73
|
+
export const LayoutBlock: React.FC<LayoutBlockProps>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 布局容器组件
|
|
77
|
+
*/
|
|
78
|
+
declare const Layout: React.FC<LayoutProps>;
|
|
79
|
+
|
|
80
|
+
export default Layout;
|
|
81
|
+
|
package/Layout/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { Space } from 'antd';
|
|
3
|
+
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
4
|
+
import { useField } from '@cqsjjb/jjb-data-provider';
|
|
5
|
+
import './index.less';
|
|
6
|
+
import { getPrefixCls } from '../tools/index.js';
|
|
7
|
+
const prefixCls = getPrefixCls();
|
|
8
|
+
export const LayoutHeader = props => {
|
|
9
|
+
const {
|
|
10
|
+
style,
|
|
11
|
+
title,
|
|
12
|
+
extra,
|
|
13
|
+
previous,
|
|
14
|
+
content,
|
|
15
|
+
className,
|
|
16
|
+
contentStyle,
|
|
17
|
+
contentClassName
|
|
18
|
+
} = props;
|
|
19
|
+
const {
|
|
20
|
+
checkField
|
|
21
|
+
} = useField();
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
style: style,
|
|
24
|
+
className: `${prefixCls}-layout-container-head${className ? ` ${className}` : ''}`
|
|
25
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: `${prefixCls}-layout-container-header`
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: `${prefixCls}-layout-container-header-left`
|
|
29
|
+
}, previous && /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: `${prefixCls}-layout-container-header-back`,
|
|
31
|
+
onClick: () => window.history.back()
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
role: "button",
|
|
34
|
+
className: `${prefixCls}-layout-container-header-back-icon`
|
|
35
|
+
}, /*#__PURE__*/React.createElement(ArrowLeftOutlined, null))), /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: `${prefixCls}-layout-container-header-title`
|
|
37
|
+
}, checkField('DEFAULT_MENU', title))), extra && /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: `${prefixCls}-layout-container-header-right`
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Space, null, extra))), content && /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
style: {
|
|
41
|
+
marginTop: 16,
|
|
42
|
+
...(contentStyle || {})
|
|
43
|
+
},
|
|
44
|
+
className: contentClassName
|
|
45
|
+
}, content));
|
|
46
|
+
};
|
|
47
|
+
LayoutHeader.displayName = 'LayoutHeader';
|
|
48
|
+
export const LayoutBlock = props => {
|
|
49
|
+
const {
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
extra,
|
|
53
|
+
content,
|
|
54
|
+
style,
|
|
55
|
+
className,
|
|
56
|
+
contentStyle,
|
|
57
|
+
contentClassName,
|
|
58
|
+
headerStyle,
|
|
59
|
+
headerClassName
|
|
60
|
+
} = props;
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
style: style,
|
|
63
|
+
className: `${prefixCls}-layout-container-block${className ? ` ${className}` : ''}`
|
|
64
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
style: headerStyle,
|
|
66
|
+
className: `${prefixCls}-layout-container-block-header${headerClassName ? ` ${headerClassName}` : ''}`
|
|
67
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: `${prefixCls}-layout-container-block-header-left`
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: `${prefixCls}-layout-container-block-header-title`
|
|
71
|
+
}, title), description && /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
className: `${prefixCls}-layout-container-block-header-description`
|
|
73
|
+
}, description)), extra && /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: `${prefixCls}-layout-container-block-header-right`
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Space, null, extra))), content && /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
style: contentStyle,
|
|
77
|
+
className: `${prefixCls}-layout-container-block-content${contentClassName ? ` ${contentClassName}` : ''}`
|
|
78
|
+
}, content));
|
|
79
|
+
};
|
|
80
|
+
LayoutBlock.displayName = 'LayoutBlock';
|
|
81
|
+
const Layout = props => {
|
|
82
|
+
const {
|
|
83
|
+
style = {},
|
|
84
|
+
'data-node-id': dataNodeId,
|
|
85
|
+
className,
|
|
86
|
+
contentStyle,
|
|
87
|
+
contentClassName
|
|
88
|
+
} = props;
|
|
89
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
style: style,
|
|
91
|
+
className: `${prefixCls}-layout-container${className ? ` ${className}` : ''}`,
|
|
92
|
+
"data-node-id": dataNodeId
|
|
93
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
style: contentStyle,
|
|
95
|
+
className: `${prefixCls}-layout-container-content${contentClassName ? ` ${contentClassName}` : ''}`
|
|
96
|
+
}, props.children));
|
|
97
|
+
};
|
|
98
|
+
Layout.displayName = 'Layout';
|
|
99
|
+
export default Layout;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@com-prefix-cls: if(isdefined(@ant-prefix), @ant-prefix, ant);
|
|
2
|
+
|
|
3
|
+
.@{com-prefix-cls}-layout-container {
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.@{com-prefix-cls}-layout-container-head {
|
|
10
|
+
padding: 24px;
|
|
11
|
+
border-radius: 12px 12px 12px 12px;
|
|
12
|
+
background: #FFFFFF;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.@{com-prefix-cls}-layout-container-header {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
color: rgba(0, 0, 0, 0.88);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
line-height: 1.5714285714285714;
|
|
22
|
+
list-style: none;
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
|
|
28
|
+
&-left {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-back {
|
|
35
|
+
margin-inline-end: 16px;
|
|
36
|
+
font-size: 16px;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
|
|
39
|
+
&-icon {
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
color: rgba(0, 0, 0, 0.88);
|
|
42
|
+
outline: none;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition: color 0.3s;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
&-title {
|
|
48
|
+
margin-inline-end: 12px;
|
|
49
|
+
margin-block-end: 0;
|
|
50
|
+
color: rgba(0, 0, 0, 0.88);
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
font-size: 20px;
|
|
53
|
+
line-height: 32px;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&-right {
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.@{com-prefix-cls}-layout-container-content {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
overflow-y: auto;
|
|
71
|
+
overflow-x: hidden;
|
|
72
|
+
scrollbar-width: none;
|
|
73
|
+
&::-webkit-scrollbar {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.@{com-prefix-cls}-layout-container-block {
|
|
79
|
+
border-radius: 12px 12px 12px 12px;
|
|
80
|
+
background: #FFFFFF;
|
|
81
|
+
padding: 24px;
|
|
82
|
+
|
|
83
|
+
&-header {
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: space-between;
|
|
86
|
+
align-items: center;
|
|
87
|
+
|
|
88
|
+
&-left {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
line-height: 32px;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&-title {
|
|
96
|
+
font-size: 16px;
|
|
97
|
+
color: rgba(0, 0, 0, 0.9);
|
|
98
|
+
font-weight: 600;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&-description {
|
|
102
|
+
font-size: 12px;
|
|
103
|
+
color: rgba(0, 0, 0, 0.4);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&:has(.@{com-prefix-cls}-layout-container-block-header) {
|
|
108
|
+
.@{com-prefix-cls}-layout-container-block-content {
|
|
109
|
+
margin-top: 12px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useState, useEffect, useCallback, useImperativeHandle, forwardRef, useRef } from 'react';
|
|
3
|
-
import { Table, Row, Col, Form } from 'antd';
|
|
4
|
-
import { isEqual } from 'lodash';
|
|
5
|
-
import SearchForm from '@cqsjjb/jjb-react-admin-component/SearchForm';
|
|
6
2
|
import ProTable from '@cqsjjb/jjb-react-admin-component/Table';
|
|
3
|
+
import SearchForm from '@cqsjjb/jjb-react-admin-component/SearchForm';
|
|
4
|
+
import React, { useState, useEffect, useCallback, useImperativeHandle, forwardRef, useRef } from 'react';
|
|
5
|
+
import { Table, Form } from 'antd';
|
|
7
6
|
|
|
8
|
-
/**
|
|
9
|
-
* @component ListDataContainer
|
|
10
|
-
* @description 通用列表数据容器组件,提供搜索表单、数据表格、分页等功能的完整列表页面解决方案
|
|
11
|
-
*
|
|
12
|
-
* @props {Array} columns - 表格列配置,遵循Ant Design Table组件的columns规范
|
|
13
|
-
* @props {Function} fetchDataApi - 数据获取API函数,接收分页和搜索参数,返回包含list和total的对象
|
|
14
|
-
* @props {Array} searchFormConfig - 搜索表单配置数组
|
|
15
|
-
* @param {React.Component} searchFormConfig[].field - 表单项组件(如ControlWrapper.Select)
|
|
16
|
-
* @param {string} searchFormConfig[].name - 表单项字段名
|
|
17
|
-
* @param {string} searchFormConfig[].label - 表单项标签
|
|
18
|
-
* @param {Object} searchFormConfig[].fieldProps - 传递给字段组件的属性
|
|
19
|
-
* @param {Object} searchFormConfig[].itemProps - 传递给Form.Item的属性
|
|
20
|
-
* @param {React.ReactNode} searchFormConfig[].content - 字段组件的子元素(如Select.Option列表)
|
|
21
|
-
* @param {boolean} searchFormConfig[].required - 是否必填
|
|
22
|
-
* @props {string} rowKey - 表格行键值,默认为'id'
|
|
23
|
-
* @props {Object} initialPagination - 初始分页配置,包含current、pageSize等分页属性
|
|
24
|
-
* @props {Object} tableProps - 传递给Table组件的属性
|
|
25
|
-
* @props {Object} searchFormProps - 传递给SearchForm组件的属性
|
|
26
|
-
* @props {boolean} proTable - 是否使用ProTable组件,默认为false
|
|
27
|
-
* @example
|
|
28
|
-
* // 基础用法
|
|
29
|
-
* <ListDataContainer
|
|
30
|
-
* columns={tableColumns}
|
|
31
|
-
* fetchDataApi={getCourseList}
|
|
32
|
-
* searchFormConfig={[
|
|
33
|
-
* {
|
|
34
|
-
* field: Select,
|
|
35
|
-
* name: 'status',
|
|
36
|
-
* label: '状态',
|
|
37
|
-
* }
|
|
38
|
-
* {
|
|
39
|
-
* field: Input,
|
|
40
|
-
* name: 'name',
|
|
41
|
-
* label: '名称',
|
|
42
|
-
* required: true,
|
|
43
|
-
* }
|
|
44
|
-
* ]}
|
|
45
|
-
* />
|
|
46
|
-
*
|
|
7
|
+
/**
|
|
8
|
+
* @component ListDataContainer
|
|
9
|
+
* @description 通用列表数据容器组件,提供搜索表单、数据表格、分页等功能的完整列表页面解决方案
|
|
10
|
+
*
|
|
11
|
+
* @props {Array} columns - 表格列配置,遵循Ant Design Table组件的columns规范
|
|
12
|
+
* @props {Function} fetchDataApi - 数据获取API函数,接收分页和搜索参数,返回包含list和total的对象
|
|
13
|
+
* @props {Array} searchFormConfig - 搜索表单配置数组
|
|
14
|
+
* @param {React.Component} searchFormConfig[].field - 表单项组件(如ControlWrapper.Select)
|
|
15
|
+
* @param {string} searchFormConfig[].name - 表单项字段名
|
|
16
|
+
* @param {string} searchFormConfig[].label - 表单项标签
|
|
17
|
+
* @param {Object} searchFormConfig[].fieldProps - 传递给字段组件的属性
|
|
18
|
+
* @param {Object} searchFormConfig[].itemProps - 传递给Form.Item的属性
|
|
19
|
+
* @param {React.ReactNode} searchFormConfig[].content - 字段组件的子元素(如Select.Option列表)
|
|
20
|
+
* @param {boolean} searchFormConfig[].required - 是否必填
|
|
21
|
+
* @props {string} rowKey - 表格行键值,默认为'id'
|
|
22
|
+
* @props {Object} initialPagination - 初始分页配置,包含current、pageSize等分页属性
|
|
23
|
+
* @props {Object} tableProps - 传递给Table组件的属性
|
|
24
|
+
* @props {Object} searchFormProps - 传递给SearchForm组件的属性
|
|
25
|
+
* @props {boolean} proTable - 是否使用ProTable组件,默认为false
|
|
26
|
+
* @example
|
|
27
|
+
* // 基础用法
|
|
28
|
+
* <ListDataContainer
|
|
29
|
+
* columns={tableColumns}
|
|
30
|
+
* fetchDataApi={getCourseList}
|
|
31
|
+
* searchFormConfig={[
|
|
32
|
+
* {
|
|
33
|
+
* field: Select,
|
|
34
|
+
* name: 'status',
|
|
35
|
+
* label: '状态',
|
|
36
|
+
* }
|
|
37
|
+
* {
|
|
38
|
+
* field: Input,
|
|
39
|
+
* name: 'name',
|
|
40
|
+
* label: '名称',
|
|
41
|
+
* required: true,
|
|
42
|
+
* }
|
|
43
|
+
* ]}
|
|
44
|
+
* />
|
|
45
|
+
*
|
|
47
46
|
*/
|
|
48
47
|
|
|
49
48
|
const SELECT_COMPONENTS = ['Select', 'TreeSelect', 'Cascader', 'DatePicker', 'TimePicker', 'Checkbox', 'Radio', 'Switch', 'Slider', 'Upload'];
|
|
@@ -76,10 +75,10 @@ const ListDataContainer = /*#__PURE__*/forwardRef(({
|
|
|
76
75
|
return Component.displayName || Component.constructor.name;
|
|
77
76
|
};
|
|
78
77
|
|
|
79
|
-
/**
|
|
80
|
-
* 数据加载与刷新方法
|
|
81
|
-
* @param {Object} [overrideParams={}] - 可选,用于覆盖内部参数的键值对
|
|
82
|
-
* 若传入,会覆盖同名的表单参数和分页参数(如page、pageSize或搜索字段)
|
|
78
|
+
/**
|
|
79
|
+
* 数据加载与刷新方法
|
|
80
|
+
* @param {Object} [overrideParams={}] - 可选,用于覆盖内部参数的键值对
|
|
81
|
+
* 若传入,会覆盖同名的表单参数和分页参数(如page、pageSize或搜索字段)
|
|
83
82
|
*/
|
|
84
83
|
const loadDataSource = useCallback(async (overrideParams = {}) => {
|
|
85
84
|
if (!fetchDataApi) return;
|
|
@@ -95,7 +94,7 @@ const ListDataContainer = /*#__PURE__*/forwardRef(({
|
|
|
95
94
|
|
|
96
95
|
// 1. 获取组件内部的表单参数
|
|
97
96
|
const formValues = await form.current.validateFields();
|
|
98
|
-
console.warn(
|
|
97
|
+
console.warn('formValues', formValues);
|
|
99
98
|
|
|
100
99
|
// 2. 构造基础参数:分页参数 + 表单参数
|
|
101
100
|
const baseParams = {
|
package/MediaQuery/index.js
CHANGED
|
@@ -7,11 +7,16 @@ const MEDIA_QUERY_LIST = {
|
|
|
7
7
|
MIN_WIDTH_1200_AND_MAX_WIDTH_1439: '(min-width: 1200px) and (max-width: 1439px)',
|
|
8
8
|
MIN_WIDTH_1440: '(min-width: 1440px)'
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
function MediaQuery({
|
|
11
11
|
children,
|
|
12
12
|
disabled
|
|
13
13
|
}) {
|
|
14
14
|
const [media, setMedia] = useState(undefined);
|
|
15
|
+
|
|
16
|
+
/** 显示弃用警告 */
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
console.warn('[MediaQuery] 警告:该组件已弃用!');
|
|
19
|
+
}, []);
|
|
15
20
|
const mediaQueries = useMemo(() => {
|
|
16
21
|
if (disabled) return {};
|
|
17
22
|
return Object.fromEntries(Object.entries(MEDIA_QUERY_LIST).map(([key, query]) => [key, window.matchMedia(query)]));
|
|
@@ -39,4 +44,6 @@ export default function MediaQuery({
|
|
|
39
44
|
key: index,
|
|
40
45
|
'data-media-query': media
|
|
41
46
|
}) : item));
|
|
42
|
-
}
|
|
47
|
+
}
|
|
48
|
+
MediaQuery.displayName = 'MediaQuery';
|
|
49
|
+
export default MediaQuery;
|
package/PageLayout/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import React, { memo, useCallback } from 'react';
|
|
1
|
+
import React, { memo, useCallback, useContext } from 'react';
|
|
2
2
|
import { PageHeader } from '@ant-design/pro-layout';
|
|
3
|
+
import { AppDataContext } from '@cqsjjb/jjb-data-provider';
|
|
3
4
|
import './index.less';
|
|
4
5
|
import { getPrefixCls } from '../tools/index.js';
|
|
5
6
|
const prefixCls = getPrefixCls();
|
|
@@ -24,6 +25,9 @@ const PageLayout = /*#__PURE__*/memo(props => {
|
|
|
24
25
|
onBack,
|
|
25
26
|
'data-node-id': dataNodeId
|
|
26
27
|
} = props;
|
|
28
|
+
const {
|
|
29
|
+
checkField
|
|
30
|
+
} = useContext(AppDataContext);
|
|
27
31
|
const containerClass = [`${prefixCls}-layout-container`, transparent && `${prefixCls}-layout-container-transparent`, noStyle && `${prefixCls}-layout-container-no-style`].filter(Boolean).join(' ');
|
|
28
32
|
const backHandler = useCallback(() => {
|
|
29
33
|
if (onBack) {
|
|
@@ -40,21 +44,22 @@ const PageLayout = /*#__PURE__*/memo(props => {
|
|
|
40
44
|
className: containerClass,
|
|
41
45
|
"data-node-id": dataNodeId
|
|
42
46
|
}, !header ? /*#__PURE__*/React.createElement(PageHeader, {
|
|
43
|
-
title: title,
|
|
47
|
+
title: checkField('DEFAULT_MENU', title),
|
|
44
48
|
extra: extra,
|
|
45
49
|
style: pageHeaderStyle,
|
|
46
50
|
onBack: previous || onBack ? backHandler : undefined
|
|
47
51
|
}) : header, formLine && /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
style: formLineStyle,
|
|
53
|
+
className: `${prefixCls}-layout-container-tools`
|
|
50
54
|
}, formLine), /*#__PURE__*/React.createElement("div", {
|
|
51
55
|
style: contentStyle,
|
|
52
56
|
className: `${prefixCls}-layout-container-content`
|
|
53
57
|
}, /*#__PURE__*/React.createElement("div", {
|
|
54
58
|
className: `${prefixCls}-layout-container-content-abs`
|
|
55
59
|
}, children)), footer && /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
style: footerStyle,
|
|
61
|
+
className: `${prefixCls}-lay-container-bottom`
|
|
58
62
|
}, footer));
|
|
59
63
|
});
|
|
64
|
+
PageLayout.displayName = 'PageLayout';
|
|
60
65
|
export default PageLayout;
|
package/PhoneBox/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
-
import { Empty, Space, message, Tooltip, Button, QRCode } from 'antd';
|
|
3
|
-
import { SyncOutlined } from '@ant-design/icons';
|
|
4
2
|
import { http } from '@cqsjjb/jjb-common-lib';
|
|
5
|
-
import
|
|
3
|
+
import { SyncOutlined } from '@ant-design/icons';
|
|
4
|
+
import { Empty, Space, Tooltip, Button, QRCode } from 'antd';
|
|
5
|
+
import phone from './phone.svg';
|
|
6
6
|
import xinhao from './xinhao.svg';
|
|
7
7
|
import wangluo from './wangluo.svg';
|
|
8
8
|
import dianchi from './dianchi.svg';
|
|
9
|
-
import
|
|
9
|
+
import shexiang from './shexiang.svg';
|
|
10
10
|
import './index.less';
|
|
11
|
-
|
|
11
|
+
function PhoneBox(props) {
|
|
12
12
|
const {
|
|
13
13
|
iframeUrl,
|
|
14
14
|
// 展示内容url
|
|
@@ -118,7 +118,7 @@ export default props => {
|
|
|
118
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
119
|
className: `phone-box ${size === 'small' ? 'phone-box-small' : ''}`
|
|
120
120
|
}, /*#__PURE__*/React.createElement("img", {
|
|
121
|
-
alt: "",
|
|
121
|
+
alt: "\u624B\u673A",
|
|
122
122
|
src: phone,
|
|
123
123
|
width: 356,
|
|
124
124
|
height: 720
|
|
@@ -130,23 +130,23 @@ export default props => {
|
|
|
130
130
|
className: "phone-header-time"
|
|
131
131
|
}, currentTime), /*#__PURE__*/React.createElement("img", {
|
|
132
132
|
src: shexiang,
|
|
133
|
+
alt: "\u6444\u50CF\u5934",
|
|
133
134
|
width: 76,
|
|
134
|
-
height: 23
|
|
135
|
-
alt: ""
|
|
135
|
+
height: 23
|
|
136
136
|
}), /*#__PURE__*/React.createElement(Space, {
|
|
137
137
|
className: "phone-header-status"
|
|
138
138
|
}, /*#__PURE__*/React.createElement("img", {
|
|
139
|
-
className: "status-xinhao",
|
|
140
139
|
src: xinhao,
|
|
141
|
-
alt: ""
|
|
140
|
+
alt: "\u4FE1\u53F7",
|
|
141
|
+
className: "status-xinhao"
|
|
142
142
|
}), /*#__PURE__*/React.createElement("img", {
|
|
143
|
-
className: "status-wangluo",
|
|
144
143
|
src: wangluo,
|
|
145
|
-
alt: ""
|
|
144
|
+
alt: "\u4E92\u8054\u7F51\u8FDE\u63A5",
|
|
145
|
+
className: "status-wangluo"
|
|
146
146
|
}), /*#__PURE__*/React.createElement("img", {
|
|
147
|
-
className: "status-dianchi",
|
|
148
147
|
src: dianchi,
|
|
149
|
-
alt: ""
|
|
148
|
+
alt: "\u7535\u6C60",
|
|
149
|
+
className: "status-dianchi"
|
|
150
150
|
}))), showEmpty && !iframeUrl ? /*#__PURE__*/React.createElement("div", {
|
|
151
151
|
style: {
|
|
152
152
|
width: 316,
|
|
@@ -165,10 +165,8 @@ export default props => {
|
|
|
165
165
|
className: "phone-box-action"
|
|
166
166
|
}, showPerview && /*#__PURE__*/React.createElement(Tooltip, {
|
|
167
167
|
open: qrcodeVisible,
|
|
168
|
-
placement: "bottom",
|
|
169
168
|
arrow: false,
|
|
170
169
|
color: "#FFF",
|
|
171
|
-
rootClassName: "qrcode-preview-tooltip",
|
|
172
170
|
title: /*#__PURE__*/React.createElement("div", {
|
|
173
171
|
className: "qrcode-preview-container"
|
|
174
172
|
}, /*#__PURE__*/React.createElement(QRCode, {
|
|
@@ -198,14 +196,18 @@ export default props => {
|
|
|
198
196
|
style: {
|
|
199
197
|
marginRight: '4px'
|
|
200
198
|
}
|
|
201
|
-
}), "\u91CD\u65B0\u751F\u6210"))
|
|
199
|
+
}), "\u91CD\u65B0\u751F\u6210")),
|
|
200
|
+
placement: "bottom",
|
|
201
|
+
rootClassName: "qrcode-preview-tooltip"
|
|
202
202
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
203
203
|
ref: qrcodeButtonRef,
|
|
204
|
+
color: "primary",
|
|
205
|
+
variant: "outlined",
|
|
204
206
|
onClick: () => {
|
|
205
207
|
setQrcodeVisible(!qrcodeVisible);
|
|
206
208
|
getQrCodeUrl();
|
|
207
|
-
}
|
|
208
|
-
color: "primary",
|
|
209
|
-
variant: "outlined"
|
|
209
|
+
}
|
|
210
210
|
}, "\u626B\u7801\u9884\u89C8")), extraAction));
|
|
211
|
-
}
|
|
211
|
+
}
|
|
212
|
+
PhoneBox.displayName = 'PhoneBox';
|
|
213
|
+
export default PhoneBox;
|
package/SearchForm/index.js
CHANGED
|
@@ -58,6 +58,7 @@ const SearchForm = ({
|
|
|
58
58
|
}, [formRef, onRef]);
|
|
59
59
|
const isControlled = expand !== undefined;
|
|
60
60
|
const isOpen = isControlled ? expand : internalOpen;
|
|
61
|
+
// 展开/收起
|
|
61
62
|
const handleToggle = () => {
|
|
62
63
|
if (isControlled) {
|
|
63
64
|
onExpand && onExpand(!expand);
|
|
@@ -72,8 +73,8 @@ const SearchForm = ({
|
|
|
72
73
|
const getButtons = () => /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
|
|
73
74
|
type: "primary",
|
|
74
75
|
icon: /*#__PURE__*/React.createElement(SearchOutlined, null),
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
loading: loading,
|
|
77
|
+
htmlType: "submit"
|
|
77
78
|
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
|
|
78
79
|
icon: /*#__PURE__*/React.createElement(UndoOutlined, null),
|
|
79
80
|
loading: loading,
|
|
@@ -91,21 +92,28 @@ const SearchForm = ({
|
|
|
91
92
|
onClick: handleToggle
|
|
92
93
|
}, isOpen ? '收起' : '展开'));
|
|
93
94
|
|
|
94
|
-
/**
|
|
95
|
-
* 处理 formLine,确保所有 Form.Item 都有 noStyle 属性
|
|
96
|
-
* @param {ReactNode[]} nodes - 表单节点数组
|
|
97
|
-
* @returns {ReactNode[]} - 处理后的节点数组
|
|
95
|
+
/**
|
|
96
|
+
* 处理 formLine,确保所有 Form.Item 都有 noStyle 属性
|
|
97
|
+
* @param {ReactNode[]} nodes - 表单节点数组
|
|
98
|
+
* @returns {ReactNode[]} - 处理后的节点数组
|
|
98
99
|
*/
|
|
99
100
|
const processFormLine = nodes => {
|
|
100
101
|
return nodes.map(node => {
|
|
101
102
|
// 检查是否是 Form.Item 组件
|
|
102
103
|
if (/*#__PURE__*/React.isValidElement(node) && node.type === Form.Item) {
|
|
103
104
|
// 如果没有 noStyle 属性,则克隆并添加
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
const control = React.Children.only(node.props.children);
|
|
106
|
+
return /*#__PURE__*/React.cloneElement(node, {
|
|
107
|
+
noStyle: true,
|
|
108
|
+
children: /*#__PURE__*/React.cloneElement(control, {
|
|
109
|
+
style: {
|
|
110
|
+
...(control.props.style || {}),
|
|
111
|
+
width: '100%'
|
|
112
|
+
},
|
|
113
|
+
allowClear: true,
|
|
114
|
+
...control.props
|
|
115
|
+
})
|
|
116
|
+
});
|
|
109
117
|
}
|
|
110
118
|
return node;
|
|
111
119
|
});
|
|
@@ -156,4 +164,5 @@ const SearchForm = ({
|
|
|
156
164
|
}
|
|
157
165
|
}, getButtons()))));
|
|
158
166
|
};
|
|
167
|
+
SearchForm.displayName = 'SearchForm';
|
|
159
168
|
export default SearchForm;
|