@zat-design/sisyphus-react 3.3.0 → 3.3.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/dist/index.esm.css +13 -2
- package/es/ProDownload/utils.js +0 -2
- package/es/ProEditTable/components/RenderField/index.js +6 -4
- package/es/ProEditTable/index.js +29 -18
- package/es/ProEnum/index.js +7 -18
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/index.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +22 -25
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +9 -2
- package/es/ProForm/components/render/Render.js +17 -24
- package/es/ProForm/components/render/RenderFields.js +7 -3
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useForm.js +15 -7
- package/es/ProForm/utils/useRules.js +6 -5
- package/es/ProStep/index.js +2 -2
- package/es/ProTable/style/index.less +6 -6
- package/es/ProTreeModal/components/Trigger.js +2 -0
- package/es/ProTreeModal/index.js +3 -3
- package/es/ProTreeModal/style/index.less +85 -84
- package/es/ProUpload/components/DragRender.js +2 -1
- package/es/ProUpload/components/ImageRender.js +4 -5
- package/lib/ProEditTable/components/RenderField/index.js +6 -6
- package/lib/ProEditTable/index.js +29 -18
- package/lib/ProEnum/index.js +6 -17
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProForm/components/base/RangePicker/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/index.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +22 -25
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +9 -2
- package/lib/ProForm/components/old/InputRange/index.js +1 -0
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +17 -25
- package/lib/ProForm/components/render/RenderFields.js +6 -2
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useForm.js +15 -7
- package/lib/ProForm/utils/useRules.js +5 -4
- package/lib/ProStep/index.js +1 -1
- package/lib/ProTable/components/TableResizable/index.js +0 -8
- package/lib/ProTable/style/index.less +6 -6
- package/lib/ProTabs/index.js +0 -1
- package/lib/ProThemeTools/index.js +0 -1
- package/lib/ProTree/components/Tree.js +0 -7
- package/lib/ProTree/index.js +1 -0
- package/lib/ProTreeModal/components/Tree.js +0 -1
- package/lib/ProTreeModal/components/Trigger.js +2 -0
- package/lib/ProTreeModal/index.js +3 -3
- package/lib/ProTreeModal/style/index.less +85 -84
- package/lib/ProUpload/components/DragRender.js +2 -1
- package/lib/ProUpload/components/ImageRender.js +4 -5
- package/lib/ProUpload/index.js +0 -7
- package/lib/ProViewer/index.js +0 -1
- package/lib/old/ProCertValidity/index.js +1 -1
- package/package.json +1 -1
|
@@ -11,31 +11,31 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
&-content {
|
|
14
|
-
display
|
|
14
|
+
display: flex;
|
|
15
15
|
flex-direction: row;
|
|
16
|
-
height
|
|
17
|
-
margin-bottom
|
|
16
|
+
height: 482px;
|
|
17
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
18
18
|
|
|
19
19
|
.@{ant-prefix}-tree-checkbox {
|
|
20
20
|
margin-top: 2px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.@{ant-prefix}-tree-switcher {
|
|
24
|
-
width
|
|
24
|
+
width: 20px;
|
|
25
25
|
line-height: 20px;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.@{ant-prefix}-tree-treenode {
|
|
29
|
-
width
|
|
30
|
-
padding
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: 0;
|
|
31
31
|
padding-bottom: var(--zaui-font-size-sm, 12px);
|
|
32
|
-
color
|
|
33
|
-
font-size
|
|
34
|
-
line-height
|
|
32
|
+
color: var(--zaui-text);
|
|
33
|
+
font-size: var(--zaui-font-size, 14px);
|
|
34
|
+
line-height: 20px;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.@{ant-prefix}-tree-node-content-wrapper {
|
|
38
|
-
min-height
|
|
38
|
+
min-height: 20px;
|
|
39
39
|
line-height: 20px;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -45,27 +45,27 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&-box {
|
|
48
|
-
display
|
|
48
|
+
display: flex;
|
|
49
49
|
flex-direction: column;
|
|
50
|
-
width
|
|
51
|
-
height
|
|
52
|
-
color
|
|
53
|
-
font-size
|
|
54
|
-
line-height
|
|
55
|
-
border
|
|
56
|
-
border-radius
|
|
50
|
+
width: 456px;
|
|
51
|
+
height: 100%;
|
|
52
|
+
color: var(--zaui-text);
|
|
53
|
+
font-size: var(--zaui-font-size, 14px);
|
|
54
|
+
line-height: 20px;
|
|
55
|
+
border: 1px solid #e6e6e6;
|
|
56
|
+
border-radius: var(--zaui-border-radius, 4px);
|
|
57
57
|
|
|
58
58
|
&:first-child {
|
|
59
59
|
margin-right: var(--zaui-space-size-md, 16px);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.viewSvg>div {
|
|
62
|
+
.viewSvg > div {
|
|
63
63
|
display: flex;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* 修改滚动条样式 */
|
|
67
67
|
::-webkit-scrollbar {
|
|
68
|
-
width
|
|
68
|
+
width: 0;
|
|
69
69
|
height: 0;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -79,38 +79,38 @@
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
&-search {
|
|
82
|
-
width
|
|
82
|
+
width: auto;
|
|
83
83
|
margin: var(--zaui-space-size-sm, 8px) var(--zaui-space-size-md, 16px) 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
&-cascader-flex {
|
|
87
|
-
display
|
|
87
|
+
display: flex;
|
|
88
88
|
flex-direction: row;
|
|
89
|
-
height
|
|
90
|
-
overflow
|
|
89
|
+
height: 100%;
|
|
90
|
+
overflow: hidden;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
&-cascader-warp {
|
|
94
|
-
display
|
|
94
|
+
display: flex;
|
|
95
95
|
flex-direction: column;
|
|
96
|
-
width
|
|
97
|
-
margin-left
|
|
98
|
-
overflow
|
|
96
|
+
width: 350px;
|
|
97
|
+
margin-left: var(--zaui-space-size-md, 16px);
|
|
98
|
+
overflow: auto;
|
|
99
99
|
|
|
100
100
|
&:first-child {
|
|
101
|
-
width
|
|
102
|
-
margin-left
|
|
101
|
+
width: 192px;
|
|
102
|
+
margin-left: 0;
|
|
103
103
|
border-right: 1px solid #e6e6e6;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
&-box-header {
|
|
108
|
-
display
|
|
109
|
-
align-items
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
110
|
justify-content: space-between;
|
|
111
|
-
height
|
|
112
|
-
padding
|
|
113
|
-
background
|
|
111
|
+
height: 40px;
|
|
112
|
+
padding: 0 var(--zaui-space-size-md, 16px);
|
|
113
|
+
background: #fafafa;
|
|
114
114
|
|
|
115
115
|
&:first-child {
|
|
116
116
|
color: #616161;
|
|
@@ -122,20 +122,20 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
&-tree-warp {
|
|
125
|
-
flex
|
|
126
|
-
margin
|
|
125
|
+
flex: 1;
|
|
126
|
+
margin: 0 var(--zaui-space-size-md, 16px);
|
|
127
127
|
padding-top: var(--zaui-space-size-sm, 8px);
|
|
128
|
-
overflow-y
|
|
128
|
+
overflow-y: auto;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
&-checkbox-content {
|
|
132
|
-
display
|
|
133
|
-
flex-direction
|
|
134
|
-
align-items
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: row;
|
|
134
|
+
align-items: center;
|
|
135
135
|
justify-content: space-between;
|
|
136
|
-
margin-bottom
|
|
137
|
-
line-height
|
|
138
|
-
cursor
|
|
136
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
137
|
+
line-height: 20px;
|
|
138
|
+
cursor: pointer;
|
|
139
139
|
|
|
140
140
|
&-look {
|
|
141
141
|
color: #333;
|
|
@@ -148,16 +148,16 @@
|
|
|
148
148
|
|
|
149
149
|
&-cascader-content {
|
|
150
150
|
margin-bottom: 0;
|
|
151
|
-
padding
|
|
151
|
+
padding: 6px;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
&-check-cascader-content {
|
|
155
|
-
color
|
|
155
|
+
color: var(--zaui-brand);
|
|
156
156
|
background: rgba(0, 106, 255, 0.1);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
&-isView {
|
|
160
|
-
display
|
|
160
|
+
display: flex;
|
|
161
161
|
align-items: center;
|
|
162
162
|
|
|
163
163
|
.viewSvg {
|
|
@@ -175,11 +175,12 @@
|
|
|
175
175
|
|
|
176
176
|
&-checkbox-close {
|
|
177
177
|
padding-left: var(--zaui-space-size-sm, 8px);
|
|
178
|
-
|
|
178
|
+
color: #c5c7cd;
|
|
179
|
+
font-size: var(--zaui-font-size-sm, 12px);
|
|
179
180
|
}
|
|
180
181
|
|
|
181
182
|
&-tree-node {
|
|
182
|
-
display
|
|
183
|
+
display: flex;
|
|
183
184
|
flex-direction: row;
|
|
184
185
|
|
|
185
186
|
&:last-child {
|
|
@@ -188,34 +189,34 @@
|
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
&-tree-node-tag {
|
|
191
|
-
display
|
|
192
|
-
align-items
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
193
194
|
justify-content: center;
|
|
194
|
-
height
|
|
195
|
-
margin-right
|
|
196
|
-
padding
|
|
197
|
-
font-weight
|
|
198
|
-
line-height
|
|
199
|
-
white-space
|
|
200
|
-
border-radius
|
|
195
|
+
height: 20px;
|
|
196
|
+
margin-right: var(--zaui-space-size-sm, 8px);
|
|
197
|
+
padding: 0 var(--zaui-space-size-xs);
|
|
198
|
+
font-weight: 400;
|
|
199
|
+
line-height: 24px;
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
border-radius: var(--zaui-border-radius-card);
|
|
201
202
|
|
|
202
203
|
span {
|
|
203
|
-
font-size
|
|
204
|
+
font-size: var(--zaui-font-size-sm, 12px);
|
|
204
205
|
line-height: 20px;
|
|
205
|
-
text-align
|
|
206
|
-
transform
|
|
206
|
+
text-align: center;
|
|
207
|
+
transform: scale(0.83, 0.83);
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
.pro-tree-modal-no-checks {
|
|
212
|
-
display
|
|
213
|
-
align-items
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
214
215
|
justify-content: center;
|
|
215
|
-
height
|
|
216
|
-
color
|
|
217
|
-
font-weight
|
|
218
|
-
font-size
|
|
216
|
+
height: 100%;
|
|
217
|
+
color: #939599;
|
|
218
|
+
font-weight: 400;
|
|
219
|
+
font-size: var(--zaui-font-size, 14px);
|
|
219
220
|
}
|
|
220
221
|
|
|
221
222
|
.pro-transfer-right {
|
|
@@ -227,37 +228,37 @@
|
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
.@{ant-prefix}-tag {
|
|
230
|
-
display
|
|
231
|
-
align-items
|
|
231
|
+
display: flex;
|
|
232
|
+
align-items: center;
|
|
232
233
|
justify-content: space-between;
|
|
233
|
-
width
|
|
234
|
-
height
|
|
235
|
-
padding
|
|
236
|
-
color
|
|
237
|
-
font-size
|
|
238
|
-
background
|
|
239
|
-
border
|
|
240
|
-
border-radius
|
|
234
|
+
width: 100%;
|
|
235
|
+
height: 32px;
|
|
236
|
+
padding: 2px var(--zaui-space-size-sm, 8px);
|
|
237
|
+
color: var(--zaui-text, #343434);
|
|
238
|
+
font-size: var(--zaui-font-size, 14px);
|
|
239
|
+
background: #f2f2f2;
|
|
240
|
+
border: none;
|
|
241
|
+
border-radius: var(--zaui-border-radius, 4px);
|
|
241
242
|
|
|
242
243
|
.drag-icon {
|
|
243
|
-
height
|
|
244
|
+
height: 20px;
|
|
244
245
|
margin-right: var(--zaui-space-size-xs, 4px);
|
|
245
|
-
cursor
|
|
246
|
+
cursor: move;
|
|
246
247
|
}
|
|
247
248
|
|
|
248
249
|
.pro-tooltip {
|
|
249
|
-
flex
|
|
250
|
+
flex: 1;
|
|
250
251
|
max-width: calc(100% - 42px);
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
.disabled-icon {
|
|
254
|
-
height
|
|
255
|
+
height: 20px;
|
|
255
256
|
margin-right: var(--zaui-space-size-xs, 4px);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
.anticon-close {
|
|
259
|
-
margin
|
|
260
|
-
color
|
|
260
|
+
margin: 0;
|
|
261
|
+
color: #999;
|
|
261
262
|
font-size: var(--zaui-font-size-sm, 12px);
|
|
262
263
|
}
|
|
263
264
|
}
|
|
@@ -265,7 +266,7 @@
|
|
|
265
266
|
&.dragable {
|
|
266
267
|
.anticon-close {
|
|
267
268
|
position: relative;
|
|
268
|
-
left
|
|
269
|
+
left: -4px;
|
|
269
270
|
}
|
|
270
271
|
}
|
|
271
272
|
|
|
@@ -52,7 +52,8 @@ var DragRender = function DragRender(props) {
|
|
|
52
52
|
*/
|
|
53
53
|
var handleReSelect = function handleReSelect(file) {
|
|
54
54
|
if (disabled) return;
|
|
55
|
-
handleDelFile(file);
|
|
55
|
+
// handleDelFile(file);
|
|
56
|
+
setFileList([]);
|
|
56
57
|
setTimeout(function () {
|
|
57
58
|
refReSelect.current.click();
|
|
58
59
|
}, 1);
|
|
@@ -17,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
17
17
|
* @Author: wangshengqiang
|
|
18
18
|
* @Date: 2023-07-27 20:13:07
|
|
19
19
|
* @LastEditors: wangshengqiang
|
|
20
|
-
* @LastEditTime: 2023-11-15
|
|
20
|
+
* @LastEditTime: 2023-11-21 15:24:56
|
|
21
21
|
* @Description: 图片类型
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
@@ -97,11 +97,11 @@ var ImageRender = function ImageRender(props) {
|
|
|
97
97
|
disabled: disabled || isView,
|
|
98
98
|
itemRender: function itemRender(originNode, file, fileList, actions) {
|
|
99
99
|
var _file$url, _locale$ProUpload, _locale$ProUpload2, _locale$ProUpload3;
|
|
100
|
-
var _showPreview = file.status === 'done';
|
|
101
100
|
var _isShowDownload = !!onDownload && file.status === 'done';
|
|
102
101
|
var _fileExt = getFileExt(file.name || (file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('?')[0]));
|
|
103
102
|
var _fileIcon = getFileIcon(_fileExt);
|
|
104
103
|
var isImg = ['.PNG', '.JPG', '.JPEG', '.GIF', '.BMP', '.JPE'].includes(_fileExt.toLocaleUpperCase());
|
|
104
|
+
var _showPreview = isImg;
|
|
105
105
|
return _jsx(DraggableUploadListItem, {
|
|
106
106
|
file: file,
|
|
107
107
|
children: _jsxs("div", {
|
|
@@ -255,8 +255,7 @@ var ImageRender = function ImageRender(props) {
|
|
|
255
255
|
style: {
|
|
256
256
|
width: '400px'
|
|
257
257
|
},
|
|
258
|
-
open:
|
|
259
|
-
// showType="Modal"
|
|
258
|
+
open: (previewImg === null || previewImg === void 0 ? void 0 : previewImg.url) || (previewImg === null || previewImg === void 0 ? void 0 : previewImg.thumbUrl),
|
|
260
259
|
wrapClassName: "proupload-modal-preview",
|
|
261
260
|
onCancel: handlePreviewCancel,
|
|
262
261
|
footer: false,
|
|
@@ -265,7 +264,7 @@ var ImageRender = function ImageRender(props) {
|
|
|
265
264
|
style: {
|
|
266
265
|
width: '100%'
|
|
267
266
|
},
|
|
268
|
-
src: previewImg === null || previewImg === void 0 ? void 0 : previewImg.url
|
|
267
|
+
src: (previewImg === null || previewImg === void 0 ? void 0 : previewImg.url) || previewImg.thumbUrl
|
|
269
268
|
})
|
|
270
269
|
})]
|
|
271
270
|
});
|
|
@@ -30,8 +30,6 @@ var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"
|
|
|
30
30
|
var _utils = require("../../../ProForm/utils");
|
|
31
31
|
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
32
32
|
var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
|
|
33
|
-
/* eslint-disable prefer-destructuring */
|
|
34
|
-
/* eslint-disable prefer-const */
|
|
35
33
|
var RenderField = function RenderField(_ref) {
|
|
36
34
|
var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
|
|
37
35
|
var value = _ref.text,
|
|
@@ -509,7 +507,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
509
507
|
delete _formItemProps.rules;
|
|
510
508
|
}
|
|
511
509
|
var _className = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, 'pro-form-item-changed', changed), _classNames));
|
|
512
|
-
var originalTitle = (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
510
|
+
var originalTitle = originalTip ? (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
513
511
|
children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])), {}, {
|
|
514
512
|
isView: true,
|
|
515
513
|
value: originalValue,
|
|
@@ -519,14 +517,16 @@ var RenderField = function RenderField(_ref) {
|
|
|
519
517
|
value: originalValue,
|
|
520
518
|
checked: type === 'Switch' ? originalValue : undefined
|
|
521
519
|
}))]
|
|
522
|
-
});
|
|
523
|
-
var FormItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
520
|
+
}) : null;
|
|
521
|
+
var FormItem = TargetComponent ? (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
524
522
|
validateFirst: true
|
|
525
523
|
}, (0, _lodash.omit)(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
|
|
526
524
|
className: _className,
|
|
527
525
|
name: cellName,
|
|
528
526
|
children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange']))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])))
|
|
529
|
-
}))
|
|
527
|
+
})) : (0, _jsxRuntime.jsx)(_Container.default, {
|
|
528
|
+
viewEmpty: viewEmpty
|
|
529
|
+
});
|
|
530
530
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
531
531
|
value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
|
|
532
532
|
children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
@@ -23,7 +23,7 @@ var _tools = require("./utils/tools");
|
|
|
23
23
|
var _components = require("./components");
|
|
24
24
|
var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
25
25
|
var _locale = _interopRequireWildcard(require("../locale"));
|
|
26
|
-
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip"];
|
|
26
|
+
var _excluded = ["value", "onChange", "className", "columns", "type", "mode", "stripe", "draggable", "disabled", "insertType", "emptyBtnText", "actionWidth", "actionProps", "toolbarProps", "rowSelection", "onlyOneLineMsg", "deletePoConfirmMsg", "mulDeletePoConfirmMsg", "otherProps", "requiredAlign", "summary", "max", "headerRender", "pagination", "originalValues", "originalTip", "rowKey"];
|
|
27
27
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
28
28
|
var _resetProps$id, _resetProps$id$split, _value$2;
|
|
29
29
|
var value = _ref.value,
|
|
@@ -53,6 +53,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
53
53
|
pagination = _ref.pagination,
|
|
54
54
|
originalValues = _ref.originalValues,
|
|
55
55
|
originalTip = _ref.originalTip,
|
|
56
|
+
rowKey = _ref.rowKey,
|
|
56
57
|
resetProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
58
|
// 上下文form
|
|
58
59
|
var contentForm = _antd.Form.useFormInstance();
|
|
@@ -100,21 +101,14 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
100
101
|
'pro-table-no-stripe': !stripe,
|
|
101
102
|
className: className
|
|
102
103
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var _rowSelection = (0, _objectSpread2.default)({
|
|
109
|
-
fixed: true,
|
|
110
|
-
selectedRowKeys: selectedRowKeys,
|
|
111
|
-
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
112
|
-
setState({
|
|
113
|
-
selectedRowKeys: selectedRowKeys,
|
|
114
|
-
selectedRows: selectedRows
|
|
115
|
-
});
|
|
104
|
+
var getRowKey = function getRowKey(record) {
|
|
105
|
+
var key = record.rowKey || (0, _tools.getRandom)();
|
|
106
|
+
if (rowKey) {
|
|
107
|
+
var _ref2;
|
|
108
|
+
key = (_ref2 = typeof rowKey === 'function' ? rowKey(record) : record[rowKey]) !== null && _ref2 !== void 0 ? _ref2 : key;
|
|
116
109
|
}
|
|
117
|
-
|
|
110
|
+
return key;
|
|
111
|
+
};
|
|
118
112
|
var config = {
|
|
119
113
|
form: form,
|
|
120
114
|
mode: mode,
|
|
@@ -147,6 +141,23 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
147
141
|
originalTip: originalTip,
|
|
148
142
|
prefixCls: prefixCls
|
|
149
143
|
};
|
|
144
|
+
// 编辑行设置下样式
|
|
145
|
+
var _rowClassName = function _rowClassName(record) {
|
|
146
|
+
var isEdit = !virtualKey || editingKeys.includes(record.rowKey);
|
|
147
|
+
var className = isEdit ? 'is-editing' : '';
|
|
148
|
+
return className;
|
|
149
|
+
};
|
|
150
|
+
// 复选框
|
|
151
|
+
var _rowSelection = (0, _objectSpread2.default)({
|
|
152
|
+
fixed: true,
|
|
153
|
+
selectedRowKeys: selectedRowKeys,
|
|
154
|
+
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
155
|
+
setState({
|
|
156
|
+
selectedRowKeys: selectedRowKeys,
|
|
157
|
+
selectedRows: selectedRows
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}, rowSelection);
|
|
150
161
|
// 判断是否禁止添加、批量删除
|
|
151
162
|
var isForbiddenBtn = (0, _react.useCallback)(function (type) {
|
|
152
163
|
// 当工具栏不渲染时,都不渲染
|
|
@@ -205,7 +216,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
205
216
|
return isForbiddenBtn('mulDelete') ? rowSelection : _rowSelection;
|
|
206
217
|
};
|
|
207
218
|
var setColumns = /*#__PURE__*/function () {
|
|
208
|
-
var
|
|
219
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
209
220
|
var nextColumns;
|
|
210
221
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
211
222
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -224,7 +235,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
224
235
|
}, _callee);
|
|
225
236
|
}));
|
|
226
237
|
return function setColumns() {
|
|
227
|
-
return
|
|
238
|
+
return _ref3.apply(this, arguments);
|
|
228
239
|
};
|
|
229
240
|
}();
|
|
230
241
|
(0, _ahooks.useDebounceEffect)(function () {
|
|
@@ -240,7 +251,7 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
240
251
|
if ((value === null || value === void 0 ? void 0 : value.length) && !(value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.rowKey)) {
|
|
241
252
|
var nextValues = value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
242
253
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
243
|
-
rowKey: (
|
|
254
|
+
rowKey: getRowKey(item)
|
|
244
255
|
});
|
|
245
256
|
});
|
|
246
257
|
onChange(nextValues);
|
package/lib/ProEnum/index.js
CHANGED
|
@@ -80,7 +80,6 @@ var ProEnum = function ProEnum(props) {
|
|
|
80
80
|
var _useProConfig = (0, _ProConfigProvider.useProConfig)('ProEnum'),
|
|
81
81
|
_useProConfig$dics = _useProConfig.dics,
|
|
82
82
|
dics = _useProConfig$dics === void 0 ? {} : _useProConfig$dics;
|
|
83
|
-
// const enumList = dics?.[code] || [];
|
|
84
83
|
var _useRequestFunc = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
85
84
|
manual: true,
|
|
86
85
|
cacheTime: -1
|
|
@@ -174,26 +173,16 @@ var ProEnum = function ProEnum(props) {
|
|
|
174
173
|
onChange: onChange
|
|
175
174
|
}));
|
|
176
175
|
case 'Radio':
|
|
177
|
-
return (0, _jsxRuntime.jsx)(_antd.Radio.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
176
|
+
return (0, _jsxRuntime.jsx)(_antd.Radio.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames'])), {}, {
|
|
177
|
+
options: list,
|
|
178
178
|
value: value,
|
|
179
|
-
onChange: onChange
|
|
180
|
-
children: list.map(function (item) {
|
|
181
|
-
return (0, _jsxRuntime.jsx)(_antd.Radio, {
|
|
182
|
-
value: item[fieldValue],
|
|
183
|
-
children: item[label]
|
|
184
|
-
}, item[fieldValue]);
|
|
185
|
-
})
|
|
179
|
+
onChange: onChange
|
|
186
180
|
}));
|
|
187
181
|
case 'Checkbox':
|
|
188
|
-
return (0, _jsxRuntime.jsx)(_antd.Checkbox.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
182
|
+
return (0, _jsxRuntime.jsx)(_antd.Checkbox.Group, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(enumProps, ['fieldNames'])), {}, {
|
|
183
|
+
options: list,
|
|
189
184
|
value: value,
|
|
190
|
-
onChange: onChange
|
|
191
|
-
children: list.map(function (item) {
|
|
192
|
-
return (0, _jsxRuntime.jsx)(_antd.Checkbox, {
|
|
193
|
-
value: item[fieldValue],
|
|
194
|
-
children: item[label]
|
|
195
|
-
}, item[fieldValue]);
|
|
196
|
-
})
|
|
185
|
+
onChange: onChange
|
|
197
186
|
}));
|
|
198
187
|
case 'Tag':
|
|
199
188
|
return (0, _jsxRuntime.jsx)(_Tag.default, {
|
|
@@ -14,7 +14,7 @@ var _moment = _interopRequireDefault(require("moment"));
|
|
|
14
14
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
15
15
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
16
16
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
17
|
-
var _excluded = ["format", "otherProps", "separator"];
|
|
17
|
+
var _excluded = ["format", "otherProps", "separator"];
|
|
18
18
|
var AntRangePicker = _antd.DatePicker.RangePicker;
|
|
19
19
|
var RangePicker = function RangePicker(props) {
|
|
20
20
|
var _props$format = props.format,
|
|
@@ -146,13 +146,13 @@ var ActionButton = function ActionButton(props) {
|
|
|
146
146
|
align: "start",
|
|
147
147
|
className: "pro-form-list-action",
|
|
148
148
|
children: actionProps === null || actionProps === void 0 ? void 0 : actionProps.map(function (item) {
|
|
149
|
-
if (item.show === false) return (0, _jsxRuntime.jsx)(
|
|
149
|
+
if (item.show === false) return (0, _jsxRuntime.jsx)("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
|
|
150
150
|
if ((0, _lodash.isFunction)(item.show) && !item.show(form.getFieldValue(namePath), {
|
|
151
151
|
namePath: namePath,
|
|
152
152
|
index: index,
|
|
153
153
|
form: form
|
|
154
154
|
})) {
|
|
155
|
-
return (0, _jsxRuntime.jsx)(
|
|
155
|
+
return (0, _jsxRuntime.jsx)("span", {}, "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
|
|
156
156
|
}
|
|
157
157
|
var label = item.label,
|
|
158
158
|
onClick = item.onClick,
|
|
@@ -68,7 +68,7 @@ var FormList = function FormList(props, ref) {
|
|
|
68
68
|
var handleDragEnd = function handleDragEnd(drag) {
|
|
69
69
|
var active = drag.active,
|
|
70
70
|
over = drag.over;
|
|
71
|
-
if (active.id !== over.id) {
|
|
71
|
+
if (_fields.length > 1 && active.id !== over.id) {
|
|
72
72
|
var activeIndex = _fields.findIndex(function (item) {
|
|
73
73
|
return item.key === active.id;
|
|
74
74
|
});
|
|
@@ -420,19 +420,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
420
420
|
useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
|
421
421
|
}
|
|
422
422
|
if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
|
|
423
|
-
_context4.next =
|
|
423
|
+
_context4.next = 10;
|
|
424
424
|
break;
|
|
425
425
|
}
|
|
426
|
-
if (readOnly) {
|
|
427
|
-
_context4.next = 5;
|
|
428
|
-
break;
|
|
429
|
-
}
|
|
430
|
-
setState({
|
|
431
|
-
_value: value,
|
|
432
|
-
isInit: false
|
|
433
|
-
});
|
|
434
|
-
return _context4.abrupt("return");
|
|
435
|
-
case 5:
|
|
436
426
|
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || {});
|
|
437
427
|
page = (0, _objectSpread2.default)({
|
|
438
428
|
pageNum: 1,
|
|
@@ -442,9 +432,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
442
432
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
|
443
433
|
}) : queryBean;
|
|
444
434
|
params = transformParams ? transformParams(params) : params;
|
|
445
|
-
_context4.next =
|
|
435
|
+
_context4.next = 8;
|
|
446
436
|
return runAsync(params);
|
|
447
|
-
case
|
|
437
|
+
case 8:
|
|
448
438
|
res = _context4.sent;
|
|
449
439
|
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
450
440
|
list = [];
|
|
@@ -454,19 +444,27 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
454
444
|
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
|
455
445
|
}
|
|
456
446
|
_data2 = isMultiple ? list : (_list = list) === null || _list === void 0 ? void 0 : _list[0];
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
447
|
+
if (_data2) {
|
|
448
|
+
nextSelectRowKeys = isMultiple ? value : [value];
|
|
449
|
+
if (labelInValue) {
|
|
450
|
+
onChange(_data2);
|
|
451
|
+
}
|
|
452
|
+
// 更新内部展示值
|
|
453
|
+
setState({
|
|
454
|
+
_value: _data2,
|
|
455
|
+
isInit: false,
|
|
456
|
+
selectedRows: list,
|
|
457
|
+
selectedRowKeys: nextSelectRowKeys
|
|
458
|
+
});
|
|
459
|
+
} else if (!readOnly) {
|
|
460
|
+
// 当传入initParams且文本框非只读时,不调用接口获取初始化数据
|
|
461
|
+
setState({
|
|
462
|
+
_value: value,
|
|
463
|
+
isInit: false
|
|
464
|
+
});
|
|
460
465
|
}
|
|
461
|
-
// 更新内部展示值
|
|
462
|
-
setState({
|
|
463
|
-
_value: _data2,
|
|
464
|
-
isInit: false,
|
|
465
|
-
selectedRows: list,
|
|
466
|
-
selectedRowKeys: nextSelectRowKeys
|
|
467
|
-
});
|
|
468
466
|
}
|
|
469
|
-
case
|
|
467
|
+
case 10:
|
|
470
468
|
case "end":
|
|
471
469
|
return _context4.stop();
|
|
472
470
|
}
|
|
@@ -654,7 +652,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
654
652
|
onChange: handleChangeValue,
|
|
655
653
|
disabled: disabled,
|
|
656
654
|
addonAfter: forceAddonAfterRender(),
|
|
657
|
-
placeholder: _locale.default.ProModalSelect.select,
|
|
658
655
|
autoComplete: "off"
|
|
659
656
|
}, restInputProps)), (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
660
657
|
type: "hidden",
|