lu-lowcode-package-form 0.10.53 → 0.10.55
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +236 -236
- package/dist/index.es.js +18838 -18818
- package/package.json +1 -1
- package/src/App.jsx +1 -1
- package/src/components/field/table/index.jsx +11 -0
- package/src/components/form-container/index.jsx +1 -1
package/package.json
CHANGED
package/src/App.jsx
CHANGED
@@ -277,7 +277,7 @@ function App() {
|
|
277
277
|
</Field.Table>
|
278
278
|
</Layout.FormRow>
|
279
279
|
<Layout.FormRow layout={'1'}>
|
280
|
-
<Field.Table label="子表格" __id="table" isAllowAdd={false} isAllowCopy={
|
280
|
+
<Field.Table label="子表格" __id="table" isAllowAdd={false} isAllowCopy={true} >
|
281
281
|
|
282
282
|
<Field.WithSingleSelect
|
283
283
|
isRequired={true} ref={testRef}
|
@@ -175,6 +175,17 @@ const Table = ({ children, onTableAddRow, disabled, readonly, onTableRemoveRow,
|
|
175
175
|
const copyRow = {...tableValues[index]}
|
176
176
|
tableValues.splice(index + 1, 0, copyRow)
|
177
177
|
form?.setFieldValue(fieldName, tableValues)
|
178
|
+
|
179
|
+
let changedFields = {}
|
180
|
+
let tableName = fieldName;
|
181
|
+
for (let i = index + 1; i < tableValues.length; i++) {
|
182
|
+
let value = tableValues[i]
|
183
|
+
for (let key in value) {
|
184
|
+
let changedFieldName = [tableName,i,key]
|
185
|
+
changedFields[changedFieldName] = { name: changedFieldName, value: value[key] }
|
186
|
+
}
|
187
|
+
}
|
188
|
+
typeof recordFieldsChange == "function" && recordFieldsChange(changedFields,true)
|
178
189
|
}} />}
|
179
190
|
<Popconfirm
|
180
191
|
title="删除确认"
|
@@ -562,7 +562,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
|
|
562
562
|
const fieldsValue = getFieldsValue();
|
563
563
|
let element = React.cloneElement(child, {
|
564
564
|
onTableAddRow: handleTableAddRow, onTableRemoveRow: handleTableRemoveRow, form: form, fieldName: identifier, onCustomChange, fieldsValue, initializeFormRender, recordFieldsChange,
|
565
|
-
shouldUpdateKey: shouldUpdateKey.current[
|
565
|
+
shouldUpdateKey: shouldUpdateKey.current[identifier],
|
566
566
|
})
|
567
567
|
return componentName === "show.WithTable" ? <>{element}</> : <Form.Item
|
568
568
|
style={{ marginBottom: 0 }}
|