lu-lowcode-package-form 0.9.63 → 0.9.66

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.9.63",
3
+ "version": "0.9.66",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^4.8.1",
6
6
  "@testing-library/jest-dom": "^5.17.0",
package/src/App.jsx CHANGED
@@ -136,6 +136,7 @@ function App() {
136
136
 
137
137
 
138
138
  <FormContainerWrapper cols={cols} className="" ref={formRef} >
139
+ <Field.UserSelect label="选择用户" __id="userselect" defaultValue={ [{id:1,username: "十天"}]} />
139
140
  <Layout.FormGroupTitle title={"基本信息"} />
140
141
  <Layout.FormRow layout={'1'}>
141
142
  <Field.Table label="子表格" __id="table" >
@@ -158,11 +159,20 @@ function App() {
158
159
 
159
160
  ]
160
161
  },
162
+ {
163
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
164
+ "type": 0,
165
+ "source": "product_price1",
166
+ "target": "product_price1",
167
+ "subRules": [
168
+
169
+ ]
170
+ },
161
171
 
162
- ]} label="测试关联单选" options={[{ label: '选项1', value: '1', product_price11:"1111", product_price12:"2222"}, { label: '选项2', value: '2' }]} __id="remark11" />
172
+ ]} label="测试关联单选" options={[{ label: '选项1', value: '1', product_price11:"1111", product_price12:"2222",product_price1:111}, { label: '选项2', value: '2' }]} __id="remark11" />
163
173
 
164
174
  <Field.Switch label="开关" __id="switch_table"></Field.Switch>
165
- <Field.Input isRequired={true} label="商品价格" __id="product_price11" />
175
+ <Field.Input defaultValue={3} isRequired={true} label="商品价格" __id="product_price11" />
166
176
  <Field.Input isRequired={true} label="商品价格" __id="product_price12" />
167
177
  <Field.Input isRequired={true} label="商品价格" __id="product_price13" />
168
178
  <Field.Input isRequired={true} label="商品价格" __id="product_price14" />
@@ -24,12 +24,15 @@ export const BaseWrapper = ({
24
24
  hidePrompt = false,
25
25
  subTableIndex,
26
26
  addWrapper = true,
27
-
27
+ defaultValue,
28
+ onChange,
28
29
  readonly,
29
30
  isRequired,
30
31
  ...otherProps
31
32
  }) => {
32
-
33
+ useEffect(()=>{
34
+ if (defaultValue && typeof onChange === "function") onChange(defaultValue)
35
+ },[defaultValue])
33
36
  if (!addWrapper) return children;
34
37
  // 不接管只读属性的组件
35
38
  const ignoreReadonly = ["UploadImage", "UploadFile", "Table", "WithMultipleSelect", "WithSingleSelect"]
@@ -124,6 +124,7 @@ const WithMultipleSelect = ({ readItemRender, readonly, onChange, value, ...prop
124
124
 
125
125
  // 选择用户组件
126
126
  const UserSelect = ({ customComponent: CustomComponent, ...props }) => {
127
+ console.log("UserSelect ////// props",props)
127
128
  if (!CustomComponent) return <BaseWrapper {...props}><Input {...props} /></BaseWrapper>
128
129
  else return <BaseWrapper {...props}><CustomComponent {...props} /></BaseWrapper>
129
130
  }
@@ -185,6 +185,7 @@ const FormContainer = forwardRef(({ cols = 1, children, mode = "view" }, ref) =>
185
185
  }
186
186
  }
187
187
  form.setFieldValue(target, setValue)
188
+ handleFieldsWith(target, form.getFieldsValue())
188
189
  }
189
190
  console.log("current value", current_value)
190
191
  }