lu-lowcode-package-form 0.10.43 → 0.10.45
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +153 -153
- package/dist/index.es.js +5639 -5637
- package/package.json +1 -1
- package/src/App.jsx +2 -2
- package/src/components/field/table/index.jsx +4 -4
package/package.json
CHANGED
package/src/App.jsx
CHANGED
@@ -260,12 +260,12 @@ function App() {
|
|
260
260
|
<Field.Number label="测试规则" isRequired={true} __id="ceshi_rule1" />
|
261
261
|
</Layout.FormRow>
|
262
262
|
<Layout.FormRow layout={'1'}>
|
263
|
-
<Field.Table label="子表格" __id="table2" >
|
263
|
+
<Field.Table label="子表格" __id="table2" isAllowCopy={true} >
|
264
264
|
<Field.Number label="测试规则2" __id="ceshi_rule2" />
|
265
265
|
</Field.Table>
|
266
266
|
</Layout.FormRow>
|
267
267
|
<Layout.FormRow layout={'1'}>
|
268
|
-
<Field.Table label="子表格" __id="table"
|
268
|
+
<Field.Table label="子表格" __id="table" isAllowAdd={false} isAllowCopy={false} >
|
269
269
|
|
270
270
|
<Field.WithSingleSelect
|
271
271
|
isRequired={true} ref={testRef}
|
@@ -30,7 +30,7 @@ const TableCol = ({ children, width, hidden, ...props }) => {
|
|
30
30
|
</div>
|
31
31
|
}
|
32
32
|
|
33
|
-
const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, mode, ...props }) => {
|
33
|
+
const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow, form, fieldName, initializeFormRender, recordFieldsChange, mode, isAllowCopy=false, isAllowAdd=true, ...props }) => {
|
34
34
|
useEffect(() => {
|
35
35
|
// console.log("Table form reload", form)
|
36
36
|
}, [form])
|
@@ -169,12 +169,12 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
169
169
|
</TableCol>
|
170
170
|
})}
|
171
171
|
{disabled != true && readonly != true && <TableAction subTableHead={index == 0} key={`row_${index}_action`} subTable={true} subTableIndex={index} label={"操作"}>
|
172
|
-
<CopyOutlined className="fcursor-pointer" onClick={() => {
|
172
|
+
{isAllowCopy && <CopyOutlined className="fcursor-pointer" onClick={() => {
|
173
173
|
let tableValues = form.getFieldValue(fieldName)
|
174
174
|
const copyRow = {...tableValues[index]}
|
175
175
|
tableValues.splice(index + 1, 0, copyRow)
|
176
176
|
form?.setFieldValue(fieldName, tableValues)
|
177
|
-
}} />
|
177
|
+
}} />}
|
178
178
|
<Popconfirm
|
179
179
|
title="删除确认"
|
180
180
|
description="确定要删除这一行吗?"
|
@@ -191,7 +191,7 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
191
191
|
</div>
|
192
192
|
))}
|
193
193
|
</div>
|
194
|
-
{disabled != true && readonly != true && <Button onClick={() => {
|
194
|
+
{disabled != true && readonly != true && isAllowAdd && <Button onClick={() => {
|
195
195
|
add({ key: nanoid() })
|
196
196
|
typeof onTableAddRow === "function" && onTableAddRow(childrenIds);
|
197
197
|
}} className="fmy-2">新增一行</Button>}
|