zy-react-library 1.0.67 → 1.0.69
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, Col, Form, Row, Space } from "antd";
|
|
1
|
+
import { Button, Col, Form, Row, Space, Spin } from "antd";
|
|
2
2
|
import FormItemsRenderer from "./FormItemsRenderer";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -19,6 +19,7 @@ const FormBuilder = (props) => {
|
|
|
19
19
|
showCancelButton = true,
|
|
20
20
|
customActionButtons,
|
|
21
21
|
extraActionButtons,
|
|
22
|
+
loading = false,
|
|
22
23
|
...restProps
|
|
23
24
|
} = props;
|
|
24
25
|
|
|
@@ -27,45 +28,47 @@ const FormBuilder = (props) => {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{showActionButtons && (
|
|
48
|
-
<Row gutter={gutter} style={{ marginTop: 24 }}>
|
|
49
|
-
<Col span={24} style={{ textAlign: "center" }}>
|
|
50
|
-
{customActionButtons || (
|
|
51
|
-
<Space>
|
|
52
|
-
{showSubmitButton && (
|
|
53
|
-
<Button type="primary" htmlType="submit">
|
|
54
|
-
{submitButtonText}
|
|
55
|
-
</Button>
|
|
56
|
-
)}
|
|
57
|
-
{showCancelButton && (
|
|
58
|
-
<Button onClick={handleCancel} style={{ marginRight: 8 }}>
|
|
59
|
-
{cancelButtonText}
|
|
60
|
-
</Button>
|
|
61
|
-
)}
|
|
62
|
-
{extraActionButtons}
|
|
63
|
-
</Space>
|
|
64
|
-
)}
|
|
65
|
-
</Col>
|
|
31
|
+
<Spin spinning={loading}>
|
|
32
|
+
<Form
|
|
33
|
+
labelCol={labelCol}
|
|
34
|
+
scrollToFirstError
|
|
35
|
+
wrapperCol={{ span: 24 - labelCol.span }}
|
|
36
|
+
initialValues={values}
|
|
37
|
+
style={{ width: `calc(100% - ${gutter * 2}px)`, margin: `0 auto` }}
|
|
38
|
+
{...restProps}
|
|
39
|
+
>
|
|
40
|
+
<Row gutter={gutter}>
|
|
41
|
+
<FormItemsRenderer
|
|
42
|
+
options={options}
|
|
43
|
+
labelCol={labelCol}
|
|
44
|
+
span={span}
|
|
45
|
+
useAutoGenerateRequired={useAutoGenerateRequired}
|
|
46
|
+
initialValues={values}
|
|
47
|
+
/>
|
|
66
48
|
</Row>
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
{showActionButtons && (
|
|
50
|
+
<Row gutter={gutter} style={{ marginTop: 24 }}>
|
|
51
|
+
<Col span={24} style={{ textAlign: "center" }}>
|
|
52
|
+
{customActionButtons || (
|
|
53
|
+
<Space>
|
|
54
|
+
{showSubmitButton && (
|
|
55
|
+
<Button type="primary" htmlType="submit">
|
|
56
|
+
{submitButtonText}
|
|
57
|
+
</Button>
|
|
58
|
+
)}
|
|
59
|
+
{showCancelButton && (
|
|
60
|
+
<Button onClick={handleCancel} style={{ marginRight: 8 }}>
|
|
61
|
+
{cancelButtonText}
|
|
62
|
+
</Button>
|
|
63
|
+
)}
|
|
64
|
+
{extraActionButtons}
|
|
65
|
+
</Space>
|
|
66
|
+
)}
|
|
67
|
+
</Col>
|
|
68
|
+
</Row>
|
|
69
|
+
)}
|
|
70
|
+
</Form>
|
|
71
|
+
</Spin>
|
|
69
72
|
);
|
|
70
73
|
};
|
|
71
74
|
|
|
@@ -22,6 +22,7 @@ function HiddenInfo(props) {
|
|
|
22
22
|
hiddenId = "",
|
|
23
23
|
hiddenIdKey = "hiddenId",
|
|
24
24
|
isShowHeaderBack = true,
|
|
25
|
+
onGetData,
|
|
25
26
|
} = props;
|
|
26
27
|
|
|
27
28
|
const [info, setInfo] = useState({
|
|
@@ -47,6 +48,7 @@ function HiddenInfo(props) {
|
|
|
47
48
|
request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
|
|
48
49
|
setInfo(res.data);
|
|
49
50
|
setLoading(false);
|
|
51
|
+
onGetData?.(res.data);
|
|
50
52
|
});
|
|
51
53
|
const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
|
|
52
54
|
setHiddenImageFiles(hiddenImageFiles);
|