zy-react-library 1.0.25 → 1.0.27
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.
|
@@ -11,9 +11,9 @@ export interface CustomRenderProps {
|
|
|
11
11
|
/** 表单当前值 */
|
|
12
12
|
formValues: FormValues;
|
|
13
13
|
/** 字段值 */
|
|
14
|
-
value
|
|
14
|
+
value?: any;
|
|
15
15
|
/** 值变化回调 */
|
|
16
|
-
onChange
|
|
16
|
+
onChange?: (value: any) => void;
|
|
17
17
|
/** 其他属性 */
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
}
|
|
@@ -297,38 +297,40 @@ const FormItemsRenderer = ({
|
|
|
297
297
|
return (
|
|
298
298
|
option.customizeRender
|
|
299
299
|
? (renderFormControl(option))
|
|
300
|
-
: (
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
300
|
+
: (() => {
|
|
301
|
+
// 支持动态计算 hidden
|
|
302
|
+
const hidden = typeof option.hidden === "function"
|
|
303
|
+
? option.hidden(getFormValues())
|
|
304
|
+
: (option.hidden ?? false);
|
|
305
|
+
|
|
306
|
+
if (hidden)
|
|
307
|
+
return null;
|
|
308
|
+
|
|
309
|
+
return (
|
|
310
|
+
<Col key={option.name || index} span={itemSpan} style={style}>
|
|
311
|
+
<Form.Item
|
|
312
|
+
noStyle
|
|
313
|
+
shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate}
|
|
314
|
+
dependencies={option.dependencies || option?.componentProps?.dependencies}
|
|
315
|
+
>
|
|
316
|
+
{() => {
|
|
317
|
+
return (
|
|
318
|
+
<Form.Item
|
|
319
|
+
name={option.name}
|
|
320
|
+
label={renderLabel(option)}
|
|
321
|
+
rules={getRules(option)}
|
|
322
|
+
labelCol={itemLabelCol}
|
|
323
|
+
wrapperCol={itemWrapperCol}
|
|
324
|
+
{...getFormItemProps(option)}
|
|
325
|
+
>
|
|
326
|
+
{renderFormControl(option)}
|
|
327
|
+
</Form.Item>
|
|
328
|
+
);
|
|
329
|
+
}}
|
|
330
|
+
</Form.Item>
|
|
331
|
+
</Col>
|
|
332
|
+
);
|
|
333
|
+
})()
|
|
332
334
|
);
|
|
333
335
|
}
|
|
334
336
|
|
|
@@ -75,7 +75,7 @@ const ImportFile = (props) => {
|
|
|
75
75
|
>
|
|
76
76
|
{children && typeof children === "function" ? children({ form }) : children}
|
|
77
77
|
<Form.Item label="附件" name="file" rules={[{ required: true, message: "附件不能为空" }]}>
|
|
78
|
-
<Upload accept=".xls,.xlsx" />
|
|
78
|
+
<Upload accept=".xls,.xlsx" listType="text" />
|
|
79
79
|
</Form.Item>
|
|
80
80
|
</Form>
|
|
81
81
|
</Modal>
|