lu-lowcode-package-form 0.10.54 → 0.10.55

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.10.54",
3
+ "version": "0.10.55",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@dnd-kit/core": "^6.1.0",
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={false} >
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="删除确认"