lu-lowcode-package-form 0.9.80 → 0.9.82
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.cjs.js +218 -218
- package/dist/index.es.js +4819 -4815
- package/package.json +1 -1
- package/src/components/field/table/index.jsx +5 -5
- package/src/components/field/upload/upload-image.jsx +4 -2
package/package.json
CHANGED
@@ -28,7 +28,7 @@ const TableCol = ({ children, width, ...props }) => {
|
|
28
28
|
</div>
|
29
29
|
}
|
30
30
|
|
31
|
-
const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
|
31
|
+
const Table = ({ children, onTableAddRow,disabled,readonly,onTableRemoveRow, ...props }) => {
|
32
32
|
const [init, setInit] = useState(false);
|
33
33
|
const name = props.componentId || props.__id
|
34
34
|
const childrenIds = React.Children.map(children, (child) => `${name}.${child.props.componentId || child.props.__id}`)
|
@@ -56,7 +56,7 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
|
|
56
56
|
})}
|
57
57
|
</TableCol>
|
58
58
|
})}
|
59
|
-
{
|
59
|
+
{disabled != true && readonly != true && <TableAction subTableHead={true} key={`row_${0}_action`} subTable={true} subTableIndex={0} label={"操作"}>
|
60
60
|
</TableAction>}
|
61
61
|
</div>}
|
62
62
|
{fields.map((field, index) => (
|
@@ -95,7 +95,7 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
|
|
95
95
|
</Form.Item>
|
96
96
|
</TableCol>
|
97
97
|
})}
|
98
|
-
{
|
98
|
+
{disabled != true && readonly != true && <TableAction subTableHead={index == 0} key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
|
99
99
|
<DeleteOutlined className="fcursor-pointer" onClick={() =>{
|
100
100
|
remove(index)
|
101
101
|
typeof onTableRemoveRow === "function" && onTableRemoveRow(childrenIds);
|
@@ -104,10 +104,10 @@ const Table = ({ children, onTableAddRow,onTableRemoveRow, ...props }) => {
|
|
104
104
|
</div>
|
105
105
|
))}
|
106
106
|
</div>
|
107
|
-
<Button onClick={() => {
|
107
|
+
{disabled != true && readonly != true && <Button onClick={() => {
|
108
108
|
add({ key: nanoid() })
|
109
109
|
typeof onTableAddRow === "function" && onTableAddRow(childrenIds);
|
110
|
-
}} className="fmy-2">新增一行</Button>
|
110
|
+
}} className="fmy-2">新增一行</Button>}
|
111
111
|
</div>
|
112
112
|
}}
|
113
113
|
</Form.List>
|
@@ -4,7 +4,7 @@ import { BaseWrapper } from "../base.jsx"
|
|
4
4
|
import { DeleteOutlined, EyeOutlined, PlusOutlined } from "@ant-design/icons";
|
5
5
|
import React, { useEffect, useRef, useState, version } from "react";
|
6
6
|
|
7
|
-
const UploadImage = ({ maxCount, value, onChange, ...props }) => {
|
7
|
+
const UploadImage = ({ maxCount, value, multiple, onChange, ...props }) => {
|
8
8
|
// console.log("uploadimage props", props)
|
9
9
|
useEffect(() => {
|
10
10
|
if (value) {
|
@@ -31,7 +31,8 @@ const UploadImage = ({ maxCount, value, onChange, ...props }) => {
|
|
31
31
|
setFileList(_fileList)
|
32
32
|
}
|
33
33
|
}, [value]);
|
34
|
-
maxCount = maxCount ||
|
34
|
+
maxCount = maxCount || 99;
|
35
|
+
multiple = multiple || true;
|
35
36
|
const [fileList, setFileList] = React.useState([]);
|
36
37
|
const [previewImage, setPreviewImage] = useState('');
|
37
38
|
const [previewImageIndex, setPreviewImageIndex] = useState(0);
|
@@ -147,6 +148,7 @@ const UploadImage = ({ maxCount, value, onChange, ...props }) => {
|
|
147
148
|
listType="picture-card"
|
148
149
|
fileList={fileList}
|
149
150
|
maxCount={maxCount}
|
151
|
+
multiple={multiple}
|
150
152
|
onPreview={handlePreview}
|
151
153
|
onChange={handleChange}
|
152
154
|
>
|