@cqsjjb/jjb-react-admin-component 3.3.11 → 3.3.13
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 +2 -4
- package/AdaptiveTree/index.js +103 -107
- package/BMap/index.js +0 -6
- package/ControlWrapper/index.js +0 -11
- package/Editor/index.js +0 -1
- package/ErrorBoundary/index.js +3 -5
- package/FileUploader/index.js +35 -36
- package/FormilyDescriptions/index.js +3 -13
- package/FormilyRenderer/index.js +0 -1
- package/ImageCropper/index.js +0 -1
- package/ImageUploader/index.js +0 -1
- package/ListDataContainer/index.js +48 -47
- package/MediaQuery/index.js +2 -9
- package/PageLayout/index.js +6 -11
- package/PageLayout/index.less +2 -2
- package/PhoneBox/index.js +21 -23
- package/SearchForm/index.js +11 -20
- package/Table/index.js +16 -35
- package/TableAction/index.js +9 -10
- package/package.json +2 -2
- package/tools/index.js +1 -1
- package/Layout/README.md +0 -41
- package/Layout/index.d.ts +0 -81
- package/Layout/index.js +0 -99
- package/Layout/index.less +0 -112
package/AMap/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const _A_MAP_DEFAULT_POINT_ = {
|
|
|
6
6
|
lng: 116.397437,
|
|
7
7
|
lat: 39.909148
|
|
8
8
|
};
|
|
9
|
-
function AMap({
|
|
9
|
+
export default function AMap({
|
|
10
10
|
lng: propLng,
|
|
11
11
|
lat: propLat,
|
|
12
12
|
title = '高德地图',
|
|
@@ -369,6 +369,4 @@ function AMap({
|
|
|
369
369
|
status: "error",
|
|
370
370
|
title: "\u52A0\u8F7D\u5730\u56FE\u5931\u8D25\uFF0C\u7F3A\u5C11\u5FC5\u8981\u7684\u6587\u4EF6\uFF01"
|
|
371
371
|
}));
|
|
372
|
-
}
|
|
373
|
-
AMap.displayName = 'AMap';
|
|
374
|
-
export default AMap;
|
|
372
|
+
}
|
package/AdaptiveTree/index.js
CHANGED
|
@@ -1,115 +1,113 @@
|
|
|
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
|
+
/**
|
|
3
|
+
* 自适应树组件
|
|
4
|
+
* @param {Object} props - 组件属性
|
|
5
|
+
* @param {Function} [props.titleAction] - 节点操作按钮生成函数
|
|
6
|
+
* @param {Object} node - 当前节点数据
|
|
7
|
+
* @returns {Array} 操作按钮配置数组,每项包含:
|
|
8
|
+
* @property {ReactNode} content - 按钮内容(文本或元素)
|
|
9
|
+
* @property {Function} onClick - 点击事件回调
|
|
10
|
+
* @param {Function} [props.titleIcon] - 节点标题图标生成函数
|
|
11
|
+
* @param {Object} node - 当前节点数据
|
|
12
|
+
* @returns {ReactNode} 图标元素(如 img、Icon 组件等)
|
|
13
|
+
*
|
|
14
|
+
* @note 说明:
|
|
15
|
+
* 1. 自动继承全局 Ant Design 前缀配置(window.process.env.app.antd['ant-prefix'])
|
|
16
|
+
* 2. 节点容器默认占满父元素空间,支持纵向滚动
|
|
17
|
+
* 3. 节点标题超长自动换行,且不会挤压标题图标和操作图标的空间
|
|
18
|
+
* 4. 节点选中时,返回的节点数据为当前节点及其所有父节点id(二维数组)、选中的节点数据(一维数组)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <AdaptiveTree
|
|
22
|
+
* treeData={[]}
|
|
23
|
+
* fieldNames={{
|
|
24
|
+
* title: 'name',
|
|
25
|
+
* key: 'id'
|
|
26
|
+
* }}
|
|
27
|
+
* titleAction={(node) => [
|
|
28
|
+
* {
|
|
29
|
+
* content: '添加',
|
|
30
|
+
* onClick: (node) => {
|
|
31
|
+
* console.warn("添加", node)
|
|
32
|
+
* }
|
|
33
|
+
* },
|
|
34
|
+
* {
|
|
35
|
+
* content: '编辑',
|
|
36
|
+
* onClick: (node) => {
|
|
37
|
+
* console.warn("编辑", node)
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ]}
|
|
41
|
+
* titleIcon={(node) => <FolderOpenOutlined />}
|
|
42
|
+
* />
|
|
43
|
+
*/
|
|
2
44
|
import React, { useState } from 'react';
|
|
45
|
+
import { Tree, Space } from "antd";
|
|
3
46
|
import { styled } from 'styled-components';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 自适应树组件
|
|
8
|
-
* @param {Object} props - 组件属性
|
|
9
|
-
* @param {Function} [props.titleAction] - 节点操作按钮生成函数
|
|
10
|
-
* @param {Object} node - 当前节点数据
|
|
11
|
-
* @returns {Array} 操作按钮配置数组,每项包含:
|
|
12
|
-
* @property {ReactNode} content - 按钮内容(文本或元素)
|
|
13
|
-
* @property {Function} onClick - 点击事件回调
|
|
14
|
-
* @param {Function} [props.titleIcon] - 节点标题图标生成函数
|
|
15
|
-
* @param {Object} node - 当前节点数据
|
|
16
|
-
* @returns {ReactNode} 图标元素(如 img、Icon 组件等)
|
|
17
|
-
*
|
|
18
|
-
* @note 说明:
|
|
19
|
-
* 1. 自动继承全局 Ant Design 前缀配置(window.process.env.app.antd['ant-prefix'])
|
|
20
|
-
* 2. 节点容器默认占满父元素空间,支持纵向滚动
|
|
21
|
-
* 3. 节点标题超长自动换行,且不会挤压标题图标和操作图标的空间
|
|
22
|
-
* 4. 节点选中时,返回的节点数据为当前节点及其所有父节点id(二维数组)、选中的节点数据(一维数组)
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* <AdaptiveTree
|
|
26
|
-
* treeData={[]}
|
|
27
|
-
* fieldNames={{
|
|
28
|
-
* title: 'name',
|
|
29
|
-
* key: 'id'
|
|
30
|
-
* }}
|
|
31
|
-
* titleAction={(node) => [
|
|
32
|
-
* {
|
|
33
|
-
* content: '添加',
|
|
34
|
-
* onClick: (node) => {
|
|
35
|
-
* console.warn("添加", node)
|
|
36
|
-
* }
|
|
37
|
-
* },
|
|
38
|
-
* {
|
|
39
|
-
* content: '编辑',
|
|
40
|
-
* onClick: (node) => {
|
|
41
|
-
* console.warn("编辑", node)
|
|
42
|
-
* }
|
|
43
|
-
* }
|
|
44
|
-
* ]}
|
|
45
|
-
* titleIcon={(node) => <FolderOpenOutlined />}
|
|
46
|
-
* />
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
function AdaptiveTree(props) {
|
|
47
|
+
export default props => {
|
|
50
48
|
const {
|
|
51
49
|
titleAction,
|
|
52
50
|
titleIcon,
|
|
53
51
|
draggable,
|
|
54
52
|
...rest
|
|
55
53
|
} = props;
|
|
56
|
-
const prefixCls = process.env.app.antd['ant-prefix'];
|
|
54
|
+
const prefixCls = window.process.env.app.antd['ant-prefix'];
|
|
57
55
|
const [expandedKeys, setExpandedKeys] = useState([]);
|
|
58
56
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
59
57
|
const StyledAntdComponents = styled.div`
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
.${prefixCls}-tree-switcher {
|
|
66
|
-
align-items: flex-start !important;
|
|
67
|
-
padding-top: 13px;
|
|
68
|
-
}
|
|
69
|
-
.${prefixCls}-tree-checkbox {
|
|
70
|
-
margin-top: 11px;
|
|
71
|
-
margin-left: 4px;
|
|
72
|
-
align-self: flex-start;
|
|
73
|
-
}
|
|
74
|
-
.${prefixCls}-tree-treenode {
|
|
75
|
-
width: 100%;
|
|
76
|
-
display: flex;
|
|
77
|
-
.${prefixCls}-tree-node-content-wrapper {
|
|
78
|
-
flex: 1;
|
|
79
|
-
}
|
|
80
|
-
.${prefixCls}-tree-switcher {
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
justify-content: flex-end;
|
|
84
|
-
}
|
|
85
|
-
.${prefixCls}-tree-switcher::before {
|
|
86
|
-
display: none;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
.adaptive-tree-title {
|
|
90
|
-
width: 100%;
|
|
91
|
-
display: flex;
|
|
92
|
-
justify-content: space-between;
|
|
93
|
-
gap: 8px;
|
|
94
|
-
align-items: flex-start;
|
|
95
|
-
padding: 6px 0;
|
|
96
|
-
transition: none;
|
|
97
|
-
cursor: ${props?.draggable ? 'grab' : 'point'};
|
|
98
|
-
.title-left {
|
|
99
|
-
display: flex;
|
|
100
|
-
align-items: flex-start;
|
|
101
|
-
gap: 2px;
|
|
102
|
-
.icon {
|
|
103
|
-
width: 14px;
|
|
104
|
-
height: 14px;
|
|
58
|
+
.${prefixCls}-tree {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
overflow-y: auto;
|
|
105
62
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
63
|
+
.${prefixCls}-tree-switcher {
|
|
64
|
+
align-items: flex-start !important;
|
|
65
|
+
padding-top: 13px;
|
|
66
|
+
}
|
|
67
|
+
.${prefixCls}-tree-checkbox {
|
|
68
|
+
margin-top: 11px;
|
|
69
|
+
margin-left: 4px;
|
|
70
|
+
align-self: flex-start;
|
|
71
|
+
}
|
|
72
|
+
.${prefixCls}-tree-treenode {
|
|
73
|
+
width: 100%;
|
|
74
|
+
display: flex;
|
|
75
|
+
.${prefixCls}-tree-node-content-wrapper {
|
|
76
|
+
flex: 1
|
|
77
|
+
}
|
|
78
|
+
.${prefixCls}-tree-switcher {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: flex-end;
|
|
82
|
+
}
|
|
83
|
+
.${prefixCls}-tree-switcher::before {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
.adaptive-tree-title {
|
|
88
|
+
width: 100%;
|
|
89
|
+
display: flex;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
gap: 8px;
|
|
92
|
+
align-items: flex-start;
|
|
93
|
+
padding: 6px 0;
|
|
94
|
+
transition: none;
|
|
95
|
+
cursor: ${props?.draggable ? 'grab' : 'point'};
|
|
96
|
+
.title-left {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: flex-start;
|
|
99
|
+
gap: 2px;
|
|
100
|
+
.icon {
|
|
101
|
+
width: 14px;
|
|
102
|
+
height: 14px;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.operation {
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
113
111
|
|
|
114
112
|
// 获得指定索引的节点 ID
|
|
115
113
|
const getLevelIndexNodeIds = (targetIndexArr, key) => {
|
|
@@ -148,7 +146,7 @@ function AdaptiveTree(props) {
|
|
|
148
146
|
ids.push(result[0]);
|
|
149
147
|
nodes.push(result[1]);
|
|
150
148
|
});
|
|
151
|
-
console.warn(
|
|
149
|
+
console.warn("onCheck", ids, nodes);
|
|
152
150
|
props?.onCheck && props.onCheck(ids, nodes, info);
|
|
153
151
|
};
|
|
154
152
|
const titleRender = node => {
|
|
@@ -160,8 +158,8 @@ function AdaptiveTree(props) {
|
|
|
160
158
|
key: 'key'
|
|
161
159
|
};
|
|
162
160
|
return /*#__PURE__*/React.createElement("div", {
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
className: "adaptive-tree-title",
|
|
162
|
+
key: node[key]
|
|
165
163
|
}, /*#__PURE__*/React.createElement("div", {
|
|
166
164
|
className: "title-left"
|
|
167
165
|
}, titleIcon ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -172,12 +170,12 @@ function AdaptiveTree(props) {
|
|
|
172
170
|
}
|
|
173
171
|
}, node[title])), /*#__PURE__*/React.createElement(Space, null, titleAction ? (titleAction(node) || []).map(item => {
|
|
174
172
|
return /*#__PURE__*/React.createElement("div", {
|
|
175
|
-
className: "operation",
|
|
176
173
|
onClick: e => {
|
|
177
174
|
e.stopPropagation();
|
|
178
175
|
e.preventDefault();
|
|
179
176
|
item.onClick && item.onClick(node);
|
|
180
|
-
}
|
|
177
|
+
},
|
|
178
|
+
className: "operation"
|
|
181
179
|
}, item?.content || '');
|
|
182
180
|
}) : ''));
|
|
183
181
|
};
|
|
@@ -200,6 +198,4 @@ function AdaptiveTree(props) {
|
|
|
200
198
|
selectedKeys: props?.selectedKeys || selectedKeys,
|
|
201
199
|
onSelect: onSelect
|
|
202
200
|
}, rest)));
|
|
203
|
-
}
|
|
204
|
-
AdaptiveTree.displayName = 'AdaptiveTree';
|
|
205
|
-
export default AdaptiveTree;
|
|
201
|
+
};
|
package/BMap/index.js
CHANGED
|
@@ -19,11 +19,6 @@ const BMap = ({
|
|
|
19
19
|
const GL = useRef(null);
|
|
20
20
|
const mapRef = useRef(null);
|
|
21
21
|
|
|
22
|
-
/** 显示弃用警告 */
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
console.warn('[BMap] 警告:该组件已弃用!请使用<AMap />组件替代!');
|
|
25
|
-
}, []);
|
|
26
|
-
|
|
27
22
|
/** 初始化地图 */
|
|
28
23
|
useEffect(() => {
|
|
29
24
|
if (typeof window.BMapGL === 'undefined') {
|
|
@@ -169,5 +164,4 @@ const BMap = ({
|
|
|
169
164
|
title: "\u52A0\u8F7D\u5730\u56FE\u5931\u8D25\uFF0C\u7F3A\u5C11\u5FC5\u8981\u7684\u6587\u4EF6\uFF01"
|
|
170
165
|
}));
|
|
171
166
|
};
|
|
172
|
-
BMap.displayName = 'BMap';
|
|
173
167
|
export default BMap;
|
package/ControlWrapper/index.js
CHANGED
|
@@ -33,40 +33,29 @@ function withLabel(WrappedComponent, extraProps = {}) {
|
|
|
33
33
|
|
|
34
34
|
// ============ 输入类 ============
|
|
35
35
|
const Input = withLabel(OriginInput);
|
|
36
|
-
Input.displayName = 'ControlWrapper.Input';
|
|
37
36
|
|
|
38
37
|
// ============ 选择类 ============
|
|
39
38
|
const Select = withLabel(OriginSelect, {
|
|
40
39
|
maxTagCount: 3
|
|
41
40
|
});
|
|
42
|
-
Select.displayName = 'ControlWrapper.Select';
|
|
43
41
|
const Cascader = withLabel(OriginCascader, {
|
|
44
42
|
maxTagCount: 3
|
|
45
43
|
});
|
|
46
|
-
Cascader.displayName = 'ControlWrapper.Cascader';
|
|
47
44
|
const TreeSelect = withLabel(OriginTreeSelect, {
|
|
48
45
|
showSearch: true,
|
|
49
46
|
allowClear: true,
|
|
50
47
|
showCheckedStrategy: OriginTreeSelect.SHOW_PARENT,
|
|
51
48
|
treeNodeFilterProp: 'title'
|
|
52
49
|
});
|
|
53
|
-
TreeSelect.displayName = 'ControlWrapper.TreeSelect';
|
|
54
50
|
|
|
55
51
|
// ============ 日期类 ============
|
|
56
52
|
const DatePicker = withLabel(OriginDatePicker);
|
|
57
|
-
DatePicker.displayName = 'ControlWrapper.DatePicker';
|
|
58
53
|
DatePicker.RangePicker = withLabel(OriginDatePicker.RangePicker);
|
|
59
|
-
DatePicker.RangePicker.displayName = 'ControlWrapper.RangePicker';
|
|
60
54
|
DatePicker.TimePicker = withLabel(OriginDatePicker.TimePicker);
|
|
61
|
-
DatePicker.TimePicker.displayName = 'ControlWrapper.TimePicker';
|
|
62
55
|
DatePicker.WeekPicker = withLabel(OriginDatePicker.WeekPicker);
|
|
63
|
-
DatePicker.WeekPicker.displayName = 'ControlWrapper.WeekPicker';
|
|
64
56
|
DatePicker.MonthPicker = withLabel(OriginDatePicker.MonthPicker);
|
|
65
|
-
DatePicker.MonthPicker.displayName = 'ControlWrapper.MonthPicker';
|
|
66
57
|
DatePicker.QuarterPicker = withLabel(OriginDatePicker.QuarterPicker);
|
|
67
|
-
DatePicker.QuarterPicker.displayName = 'ControlWrapper.QuarterPicker';
|
|
68
58
|
DatePicker.YearPicker = withLabel(OriginDatePicker.YearPicker);
|
|
69
|
-
DatePicker.YearPicker.displayName = 'ControlWrapper.YearPicker';
|
|
70
59
|
export default {
|
|
71
60
|
Input,
|
|
72
61
|
Select,
|
package/Editor/index.js
CHANGED
package/ErrorBoundary/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Result } from 'antd';
|
|
3
|
-
class ErrorBoundary extends React.Component {
|
|
3
|
+
export default class ErrorBoundary extends React.Component {
|
|
4
4
|
state = {
|
|
5
5
|
hasError: false,
|
|
6
6
|
errorInfo: '',
|
|
@@ -16,8 +16,8 @@ class ErrorBoundary extends React.Component {
|
|
|
16
16
|
render() {
|
|
17
17
|
if (this.state.hasError) {
|
|
18
18
|
return /*#__PURE__*/React.createElement(Result, {
|
|
19
|
-
title: "\u62B1\u6B49\uFF0C\u5E94\u7528\u5185\u90E8\u53D1\u751F\u5F02\u5E38\u9519\u8BEF\u3002",
|
|
20
19
|
status: "error",
|
|
20
|
+
title: "\u62B1\u6B49\uFF0C\u5E94\u7528\u5185\u90E8\u53D1\u751F\u5F02\u5E38\u9519\u8BEF\u3002",
|
|
21
21
|
subTitle: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, this.state.errorInfo), /*#__PURE__*/React.createElement("div", {
|
|
22
22
|
style: {
|
|
23
23
|
width: 700,
|
|
@@ -32,6 +32,4 @@ class ErrorBoundary extends React.Component {
|
|
|
32
32
|
}
|
|
33
33
|
return this.props.children;
|
|
34
34
|
}
|
|
35
|
-
}
|
|
36
|
-
ErrorBoundary.displayName = 'ErrorBoundary';
|
|
37
|
-
export default ErrorBoundary;
|
|
35
|
+
}
|
package/FileUploader/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
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
2
|
import MD5 from 'spark-md5';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
5
4
|
import { Tooltip, Button, message } from 'antd';
|
|
6
5
|
import { DeleteOutlined, PaperClipOutlined } from '@ant-design/icons';
|
|
6
|
+
import { getAppKey, getToken, isHttpUrl } from '../tools/index.js';
|
|
7
|
+
import { tools } from '@cqsjjb/jjb-common-lib';
|
|
7
8
|
import './index.less';
|
|
8
|
-
import { getAppKey, getToken, isHttpUrl, getAntPrefix } from '../tools/index.js';
|
|
9
9
|
const {
|
|
10
10
|
toObject,
|
|
11
11
|
isPromise,
|
|
12
12
|
isFunction,
|
|
13
13
|
parseObject
|
|
14
14
|
} = tools;
|
|
15
|
-
const prefixCls =
|
|
15
|
+
const prefixCls = window.process?.env?.app?.antd['ant-prefix'] || 'ant';
|
|
16
16
|
class FileUploader extends React.Component {
|
|
17
17
|
state = {
|
|
18
18
|
loading: false
|
|
19
19
|
};
|
|
20
20
|
inputFile = /*#__PURE__*/React.createRef();
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* @description http配置
|
|
24
|
-
* @returns {{headers: object, fieldName: string, data: object, action: string, url: string}}
|
|
22
|
+
/**
|
|
23
|
+
* @description http配置
|
|
24
|
+
* @returns {{headers: object, fieldName: string, data: object, action: string, url: string}}
|
|
25
25
|
*/
|
|
26
26
|
get httpConfig() {
|
|
27
27
|
const {
|
|
@@ -46,9 +46,9 @@ class FileUploader extends React.Component {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* @description 填充值
|
|
51
|
-
* @returns {string[]}
|
|
49
|
+
/**
|
|
50
|
+
* @description 填充值
|
|
51
|
+
* @returns {string[]}
|
|
52
52
|
*/
|
|
53
53
|
get value() {
|
|
54
54
|
const {
|
|
@@ -57,9 +57,9 @@ class FileUploader extends React.Component {
|
|
|
57
57
|
return Array.isArray(value) ? value : value ? [value] : [];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* @description 获取禁用状态
|
|
62
|
-
* @return {boolean}
|
|
60
|
+
/**
|
|
61
|
+
* @description 获取禁用状态
|
|
62
|
+
* @return {boolean}
|
|
63
63
|
*/
|
|
64
64
|
get disabled() {
|
|
65
65
|
const {
|
|
@@ -78,11 +78,11 @@ class FileUploader extends React.Component {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
/**
|
|
82
|
-
* @description 验证文件类型
|
|
83
|
-
* @param fileType {string}
|
|
84
|
-
* @param accept {string}
|
|
85
|
-
* @returns {Promise<never>|Promise<void>}
|
|
81
|
+
/**
|
|
82
|
+
* @description 验证文件类型
|
|
83
|
+
* @param fileType {string}
|
|
84
|
+
* @param accept {string}
|
|
85
|
+
* @returns {Promise<never>|Promise<void>}
|
|
86
86
|
*/
|
|
87
87
|
verifyFileAccept(fileType, accept) {
|
|
88
88
|
const {
|
|
@@ -110,11 +110,11 @@ class FileUploader extends React.Component {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
/**
|
|
114
|
-
* @description 验证文件大小
|
|
115
|
-
* @param fileSize {number}
|
|
116
|
-
* @param maxSize {number}
|
|
117
|
-
* @returns {Promise<never>|Promise<void>}
|
|
113
|
+
/**
|
|
114
|
+
* @description 验证文件大小
|
|
115
|
+
* @param fileSize {number}
|
|
116
|
+
* @param maxSize {number}
|
|
117
|
+
* @returns {Promise<never>|Promise<void>}
|
|
118
118
|
*/
|
|
119
119
|
verifyFileSize(fileSize, maxSize) {
|
|
120
120
|
const {
|
|
@@ -137,10 +137,10 @@ class FileUploader extends React.Component {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
/**
|
|
141
|
-
* @description 发起上传请求
|
|
142
|
-
* @param file {File}
|
|
143
|
-
* @returns {Promise<{url: string, fileName: string, respDesc: string}>}
|
|
140
|
+
/**
|
|
141
|
+
* @description 发起上传请求
|
|
142
|
+
* @param file {File}
|
|
143
|
+
* @returns {Promise<{url: string, fileName: string, respDesc: string}>}
|
|
144
144
|
*/
|
|
145
145
|
onFormRequest(file) {
|
|
146
146
|
const {
|
|
@@ -196,9 +196,9 @@ class FileUploader extends React.Component {
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
/**
|
|
200
|
-
* @description 回调
|
|
201
|
-
* @param value {string}
|
|
199
|
+
/**
|
|
200
|
+
* @description 回调
|
|
201
|
+
* @param value {string}
|
|
202
202
|
*/
|
|
203
203
|
onChange(value) {
|
|
204
204
|
const {
|
|
@@ -207,17 +207,17 @@ class FileUploader extends React.Component {
|
|
|
207
207
|
onChange && onChange(value || undefined);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
/**
|
|
211
|
-
* @description 删除
|
|
212
|
-
* @param sup {number}
|
|
210
|
+
/**
|
|
211
|
+
* @description 删除
|
|
212
|
+
* @param sup {number}
|
|
213
213
|
*/
|
|
214
214
|
onDelete(sup) {
|
|
215
215
|
this.onChange(this.props.multiple ? this.value.filter((_, sub) => sub !== sup) : undefined);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
/**
|
|
219
|
-
* @description 上传
|
|
220
|
-
* @param target {{files: FileList, value: any}}
|
|
218
|
+
/**
|
|
219
|
+
* @description 上传
|
|
220
|
+
* @param target {{files: FileList, value: any}}
|
|
221
221
|
*/
|
|
222
222
|
onUpload({
|
|
223
223
|
target
|
|
@@ -301,7 +301,6 @@ class FileUploader extends React.Component {
|
|
|
301
301
|
}));
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
FileUploader.displayName = 'FileUploader';
|
|
305
304
|
export default FileUploader;
|
|
306
305
|
export const getValueProps = value => ({
|
|
307
306
|
value: value ? {
|
|
@@ -6,7 +6,7 @@ import { Modal, Descriptions, Empty, Image, Tooltip, Spin, Table, Space, TreeSel
|
|
|
6
6
|
const formilyItemMargin = new Map([['small', 8], ['middle', 12], ['default', 16]]);
|
|
7
7
|
const IS_PDF_REG = /\.pdf$/;
|
|
8
8
|
const IS_VIDEO_REG = /\.(mp4|ogg|mkv|webm)$/;
|
|
9
|
-
function FormilyDescriptions({
|
|
9
|
+
export default function FormilyDescriptions({
|
|
10
10
|
schema,
|
|
11
11
|
values,
|
|
12
12
|
...props
|
|
@@ -34,8 +34,6 @@ function FormilyDescriptions({
|
|
|
34
34
|
dataSource: dataSource
|
|
35
35
|
}, props));
|
|
36
36
|
}
|
|
37
|
-
FormilyDescriptions.displayName = 'FormilyDescriptions';
|
|
38
|
-
export default FormilyDescriptions;
|
|
39
37
|
export function DescriptionsRender({
|
|
40
38
|
dataSource,
|
|
41
39
|
size = 'default',
|
|
@@ -75,7 +73,6 @@ export function DescriptionsRender({
|
|
|
75
73
|
});
|
|
76
74
|
});
|
|
77
75
|
}
|
|
78
|
-
DescriptionsRender.displayName = 'DescriptionsRender';
|
|
79
76
|
export function ItemRender({
|
|
80
77
|
data,
|
|
81
78
|
imageWidth,
|
|
@@ -92,7 +89,7 @@ export function ItemRender({
|
|
|
92
89
|
};
|
|
93
90
|
const renderContent = () => {
|
|
94
91
|
const systemStyle = props.systemStyle ? props.systemStyle(data.fieldCode) : {};
|
|
95
|
-
if (
|
|
92
|
+
if (tools.isArray(data.value)) {
|
|
96
93
|
if (tools.isStringArray(data.value) || tools.isNumberArray(data.value)) {
|
|
97
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
95
|
style: systemStyle
|
|
@@ -149,7 +146,6 @@ export function ItemRender({
|
|
|
149
146
|
height: 350
|
|
150
147
|
})));
|
|
151
148
|
}
|
|
152
|
-
ItemRender.displayName = 'ItemRender';
|
|
153
149
|
export function RenderText({
|
|
154
150
|
value,
|
|
155
151
|
name,
|
|
@@ -209,7 +205,6 @@ export function RenderText({
|
|
|
209
205
|
name
|
|
210
206
|
}) : tools.textPlaceholder(text));
|
|
211
207
|
}
|
|
212
|
-
RenderText.displayName = 'RenderText';
|
|
213
208
|
export function RenderFileItem(props) {
|
|
214
209
|
const {
|
|
215
210
|
isImage,
|
|
@@ -245,7 +240,6 @@ export function RenderFileItem(props) {
|
|
|
245
240
|
name: name
|
|
246
241
|
})));
|
|
247
242
|
}
|
|
248
|
-
RenderFileItem.displayName = 'RenderFileItem';
|
|
249
243
|
export function RenderImage({
|
|
250
244
|
url,
|
|
251
245
|
imageWidth,
|
|
@@ -274,7 +268,6 @@ export function RenderImage({
|
|
|
274
268
|
} : imagePreview
|
|
275
269
|
}));
|
|
276
270
|
}
|
|
277
|
-
RenderImage.displayName = 'RenderImage';
|
|
278
271
|
export function RenderValidFile({
|
|
279
272
|
url,
|
|
280
273
|
name,
|
|
@@ -291,7 +284,6 @@ export function RenderValidFile({
|
|
|
291
284
|
onClick: handleClick
|
|
292
285
|
}, /*#__PURE__*/React.createElement(FileOutlined, null), name);
|
|
293
286
|
}
|
|
294
|
-
RenderValidFile.displayName = 'RenderValidFile';
|
|
295
287
|
export function RenderInvalidFile({
|
|
296
288
|
url,
|
|
297
289
|
name
|
|
@@ -306,7 +298,6 @@ export function RenderInvalidFile({
|
|
|
306
298
|
}
|
|
307
299
|
}, /*#__PURE__*/React.createElement(LinkOutlined, null), name);
|
|
308
300
|
}
|
|
309
|
-
RenderInvalidFile.displayName = 'RenderInvalidFile';
|
|
310
301
|
export function RenderTable({
|
|
311
302
|
columns,
|
|
312
303
|
dataSource,
|
|
@@ -352,5 +343,4 @@ export function RenderTable({
|
|
|
352
343
|
dataSource: dataSource,
|
|
353
344
|
style: systemStyle
|
|
354
345
|
});
|
|
355
|
-
}
|
|
356
|
-
RenderTable.displayName = 'RenderTable';
|
|
346
|
+
}
|
package/FormilyRenderer/index.js
CHANGED
package/ImageCropper/index.js
CHANGED
package/ImageUploader/index.js
CHANGED