lu-lowcode-package-form 0.9.86 → 0.9.89

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/src/App.jsx CHANGED
@@ -99,13 +99,15 @@ function App() {
99
99
  }
100
100
  }
101
101
  const setFormFields = () => {
102
- formRef?.current?.formRef?.setFieldsValue({ datetime: "2024-08-25",datetime2: "2024-08-25",datetime3: "",
103
- "remark11": { "label": "选项2", value: '1'},
104
- "remark12": [{ "label": "选项1", "value": "1" }, { "label": "选项2", "value": "2" }],
105
- "userselect": "1213131", "DeptSelect": ["leaf11"],
106
- "searchuser": [{ "id": 2, "name": "2222", "label": "2222", "value": 2 }, { "id": 4, "name": "4444", "label": "4444", "value": 4 }],
107
- "PostSelect": '["parent 1-1","leaf11"]', "table": [{ "product_price1": "12", "product_num1": "123", "product_sum1": "1476", "node_oclxmzswzti": "", "select2": "" }, { "product_price1": "123", "product_num1": "213", "product_sum1": "26199", "node_oclxmzswzti": "", "select2": "" }],
108
- "product_total_price": "0.00", "product_price": "213", "product_num": "21", "product_num_range": [1, 22], "product_sum": "4473", "switch": false })
102
+ formRef?.current?.formRef?.setFieldsValue({
103
+ datetime: "2024-08-25", datetime2: "2024-08-25", datetime3: "",
104
+ "remark11": "{ \"label\": \"选项2\", \"value\": \"1\" }",
105
+ "remark12": [{ "label": "选项1", "value": "1" }, { "label": "选项2", "value": "2" }],
106
+ "userselect": "1213131", "DeptSelect": ["leaf11"],
107
+ "searchuser": [{ "id": 2, "name": "2222", "label": "2222", "value": 2 }, { "id": 4, "name": "4444", "label": "4444", "value": 4 }],
108
+ "PostSelect": '["parent 1-1","leaf11"]', "table": [{ "product_price1": "12", "product_num1": "123", "product_sum1": "1476", "node_oclxmzswzti": "", "select2": "" }, { "product_price1": "123", "product_num1": "213", "product_sum1": "26199", "node_oclxmzswzti": "", "select2": "" }],
109
+ "product_total_price": "0.00", "product_price": "213", "product_num": "21", "product_num_range": [1, 22], "product_sum": "4473", "switch": false
110
+ })
109
111
  }
110
112
  const handleCols = () => {
111
113
  setCols(cols - 1)
@@ -113,20 +115,30 @@ function App() {
113
115
 
114
116
 
115
117
  return (
118
+ <div className='fflex fflex-col fitems-center fh-screen '>
119
+ <div className='fflex fgap-2 fitems-center fjustify-center fw-full'>
120
+ <Button type="primary" onClick={validateFields}>validateFields</Button>
121
+ <Button type="primary" onClick={getFormFields}>GetValues</Button>
122
+ <Button type="primary" onClick={setFormFields}>SetValues</Button>
123
+ <Button type="primary" onClick={() => {
124
+ console.log("testRef.current", testRef.current)
125
+ testRef.current?.handleChange({ label: '选项1', value: '1', name: "1111", table: "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2}]" })
126
+ }}>testwithref</Button>
127
+ <Button type="primary" onClick={handleCols}>UpdateCol</Button></div>
116
128
 
117
- <div className="App fflex fflex-col fitems-center">
118
- <DraggableBtn />
119
- {/* <MyPureComponentWithRef ref={testRef} />; */}
120
- {/* <div className=' fp-4 fflex fjustify-center fw-[960px]'>
129
+ <div className=" fflex fflex-col fitems-center fflex-1 foverflow-y-auto">
130
+ <DraggableBtn />
131
+ {/* <MyPureComponentWithRef ref={testRef} />; */}
132
+ {/* <div className=' fp-4 fflex fjustify-center fw-[960px]'>
121
133
  <WangEditorNext />
122
134
  </div> */}
123
- {/* <div className='fw-full fp-4 fflex fjustify-center'>
135
+ {/* <div className='fw-full fp-4 fflex fjustify-center'>
124
136
  <WangEditor />
125
137
  </div> */}
126
- {/* <div className='fw-full fp-4 fflex fjustify-center'>
138
+ {/* <div className='fw-full fp-4 fflex fjustify-center'>
127
139
  <EditorWang />
128
140
  </div> */}
129
- {/* <div className='fw-full fp-4'>
141
+ {/* <div className='fw-full fp-4'>
130
142
  <EditorQuill value={"[{\"insert\":\"sdfsd\"}]"} />
131
143
  </div>
132
144
  <div className='fw-full fp-4'>
@@ -138,308 +150,245 @@ function App() {
138
150
  />
139
151
  <Setter.OptionSetter />
140
152
  </div> */}
141
- <div className='fw-[960px] frounded fbg-slate-50 fflex fflex-col fitems-center fpb-10'>
142
-
143
-
144
- <FormContainerWrapper cols={cols} className="" ref={formRef} >
145
- <Field.UserSelect label="选择用户" __id="userselect" defaultValue={[{ id: 1, username: "十天" }]} />
146
- <Layout.FormGroupTitle title={"基本信息"} />
147
- <Field.Number label="税率(%)" __id="shuilv" />
148
-
149
- <Field.WithSingleSelect isRequired={true} ref={testRef} fillRules={[
150
- {
151
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
152
- "type": 0,
153
- "source": "name",
154
- "target": "name",
155
- "subRules": [
156
-
157
- ]
158
- },
159
- {
160
- "id": "93401e38-60a4-4acf-84a6-8958785a4a30",
161
- "type": 1,
162
- "source": "table",
163
- "target": "table",
164
- "subRules": [
165
- {
166
- "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
167
- "type": 0,
168
- "source": "price",
169
- "target": "product_price1"
170
- },
153
+ <div className='fw-[960px] frounded fbg-slate-50 fflex fflex-col fitems-center fpb-10'>
171
154
 
172
- {
173
- "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
174
- "type": 0,
175
- "source": "num",
176
- "target": "product_num1"
177
- },
178
- ]
179
- }
180
- ]} label="测试关联单选" options={[{ label: '选项1', value: '1', name: "1111", table: "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2},{\"price\":3,\"num\":3},{\"price\":3,\"num\":3}]" }, { label: '选项2', value: '2' }]} __id="remark11" />
181
- <Layout.FormRow layout={'1'}>
182
- <Field.Table label="子表格" __id="table" >
183
- <Field.Number label="税率(%)" __id="shuilv_table" withIds={[
155
+
156
+ <FormContainerWrapper cols={cols} className="" ref={formRef} >
157
+ <Field.UserSelect label="选择用户" __id="userselect" defaultValue={[{ id: 1, username: "十天" }]} />
158
+ <Layout.FormGroupTitle title={"基本信息"} />
159
+ <Field.Number label="税率(%)" __id="shuilv" />
160
+
161
+ <Field.WithSingleSelect isRequired={true} ref={testRef} fillRules={[
162
+ {
163
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
164
+ "type": 0,
165
+ "source": "name",
166
+ "target": "name",
167
+ "subRules": [
168
+
169
+ ]
170
+ },
171
+ {
172
+ "id": "93401e38-60a4-4acf-84a6-8958785a4a30",
173
+ "type": 1,
174
+ "source": "table",
175
+ "target": "table",
176
+ "subRules": [
177
+ {
178
+ "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
179
+ "type": 0,
180
+ "source": "price",
181
+ "target": "product_price1"
182
+ },
183
+
184
+ {
185
+ "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
186
+ "type": 0,
187
+ "source": "num",
188
+ "target": "product_num1"
189
+ },
190
+ ]
191
+ }
192
+ ]} label="测试关联单选" options={[{ label: '选项1', value: '1', name: "1111", table: "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2},{\"price\":3,\"num\":3},{\"price\":3,\"num\":3}]" }, { label: '选项2', value: '2' }]} __id="remark11" />
193
+ <Layout.FormRow layout={'1'}>
194
+ <Field.Table label="子表格" __id="table" >
195
+ <Field.Number label="税率(%)" __id="shuilv_table" withIds={[
184
196
  "shuilv"
185
197
  ]}
186
- withFill={{
187
- "value": [
198
+ withFill={{
199
+ "value": [
188
200
  {
189
- "insert": {
190
- "span": true
191
- },
192
- "attributes": {
193
- "id": "shuilv",
194
- "color": "blue",
195
- "tagKey": "fieldsValue",
196
- "content": "当前表单.税率(%)"
197
- }
201
+ "insert": {
202
+ "span": true
203
+ },
204
+ "attributes": {
205
+ "id": "shuilv",
206
+ "color": "blue",
207
+ "tagKey": "fieldsValue",
208
+ "content": "当前表单.税率(%)"
209
+ }
198
210
  },
199
-
200
- ],
201
- "version": 1723016911807,
202
- "withData": [
203
211
 
204
- ]
205
- }}/>
206
- <Field.DatePicker defaultNow={true} label="日期时间" prompt="" datetype="date" __id="datetime2" />
212
+ ],
213
+ "version": 1723016911807,
214
+ "withData": [
207
215
 
208
- <Field.WithSingleSelect ref={testRef} fillRules={[
209
- {
210
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
211
- "type": 0,
212
- "source": "product_price11",
213
- "target": "product_price11",
214
- "subRules": [
216
+ ]
217
+ }} />
218
+ <Field.DatePicker defaultNow={true} label="日期时间" prompt="" datetype="date" __id="datetime2" />
215
219
 
216
- ]
217
- },
218
- {
219
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
220
- "type": 0,
221
- "source": "product_price1",
222
- "target": "product_price1",
223
- "subRules": [
220
+ <Field.WithSingleSelect ref={testRef} fillRules={[
221
+ {
222
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
223
+ "type": 0,
224
+ "source": "product_price11",
225
+ "target": "product_price11",
226
+ "subRules": [
224
227
 
225
- ]
226
- },
228
+ ]
229
+ },
230
+ {
231
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
232
+ "type": 0,
233
+ "source": "product_price1",
234
+ "target": "product_price1",
235
+ "subRules": [
227
236
 
228
- ]} label="测试关联单选" options={[{ label: '选项1', value: '1', product_price11: "1111", product_price12: "2222", product_price1: 111 }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }]} __id="remark11" />
237
+ ]
238
+ },
229
239
 
230
- <Field.Switch label="开关" __id="switch_table"></Field.Switch>
231
- <Field.Input defaultValue={3} isRequired={true} label="含税单价" __id="product_price11" />
232
- <Field.Input isRequired={true} label="未税单价" __id="product_price12"
233
- withIds={[
234
- "table.product_price11",
235
- "shuilv"
236
- ]}
237
- withFill={{
238
- "value": [
240
+ ]} label="测试关联单选" options={[{ label: '选项1', value: '1', product_price11: "1111", product_price12: "2222", product_price1: 111 }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }]} __id="remark11" />
241
+
242
+ <Field.Switch label="开关" __id="switch_table"></Field.Switch>
243
+ <Field.Input defaultValue={3} isRequired={true} label="含税单价" __id="product_price11" />
244
+ <Field.Input isRequired={true} label="未税单价" __id="product_price12"
245
+ withIds={[
246
+ "table.product_price11",
247
+ "shuilv"
248
+ ]}
249
+ withFill={{
250
+ "value": [
239
251
  {
240
- "insert": "("
252
+ "insert": "("
241
253
  },
242
254
  {
243
- "insert": {
244
- "span": true
245
- },
246
- "attributes": {
247
- "id": "table.product_price11",
248
- "color": "blue",
249
- "tagKey": "fieldsValue",
250
- "content": "当前表单.产品列表.含税单价"
251
- }
255
+ "insert": {
256
+ "span": true
257
+ },
258
+ "attributes": {
259
+ "id": "table.product_price11",
260
+ "color": "blue",
261
+ "tagKey": "fieldsValue",
262
+ "content": "当前表单.产品列表.含税单价"
263
+ }
252
264
  },
253
265
  {
254
- "insert": "/(1+"
266
+ "insert": "/(1+"
255
267
  },
256
268
  {
257
- "insert": {
258
- "span": true
259
- },
260
- "attributes": {
261
- "id": "shuilv",
262
- "color": "blue",
263
- "tagKey": "fieldsValue",
264
- "content": "当前表单.税率(%)"
265
- }
269
+ "insert": {
270
+ "span": true
271
+ },
272
+ "attributes": {
273
+ "id": "shuilv",
274
+ "color": "blue",
275
+ "tagKey": "fieldsValue",
276
+ "content": "当前表单.税率(%)"
277
+ }
266
278
  },
267
279
  {
268
- "insert": "/ 100)).toFixed(2)\n\n\n"
280
+ "insert": "/ 100)).toFixed(2)\n\n\n"
269
281
  }
270
- ],
271
- "version": 1723016911807,
272
- "withData": [
273
-
274
- ]
275
- }}
276
- />
277
- <Field.Input isRequired={true} defaultValue={1} label="商品价格" __id="product_price13" />
278
- <Field.Input isRequired={true} defaultValue={2} label="商品价格" __id="product_price14" />
279
- <Field.Input isRequired={true} label="商品价格" __id="product_price1"/>
280
- <Field.Input isRequired={true} label="商品个数" __id="product_num1" />
281
- <Field.Input disabled={true} label="商品总价" __id="product_sum1"
282
- withIds={["table.product_price1", "table.product_num1"]}
283
- withFill={{
284
- "value": [
285
- {
286
- "insert": {
287
- "span": true
282
+ ],
283
+ "version": 1723016911807,
284
+ "withData": [
285
+
286
+ ]
287
+ }}
288
+ />
289
+ <Field.Input isRequired={true} defaultValue={1} label="商品价格" __id="product_price13" />
290
+ <Field.Input isRequired={true} defaultValue={2} label="商品价格" __id="product_price14" />
291
+ <Field.Input isRequired={true} label="商品价格" __id="product_price1" />
292
+ <Field.Input isRequired={true} label="商品个数" __id="product_num1" />
293
+ <Field.Input disabled={true} label="商品总价" __id="product_sum1"
294
+ withIds={["table.product_price1", "table.product_num1"]}
295
+ withFill={{
296
+ "value": [
297
+ {
298
+ "insert": {
299
+ "span": true
300
+ },
301
+ "attributes": {
302
+ "id": "table.product_price1",
303
+ "color": "blue",
304
+ "tagKey": "fieldsValue",
305
+ "content": "当前表单.商品价格"
306
+ }
288
307
  },
289
- "attributes": {
290
- "id": "table.product_price1",
291
- "color": "blue",
292
- "tagKey": "fieldsValue",
293
- "content": "当前表单.商品价格"
294
- }
295
- },
296
- {
297
- "insert": "*"
298
- },
299
- {
300
- "insert": {
301
- "span": true
308
+ {
309
+ "insert": "*"
302
310
  },
303
- "attributes": {
304
- "id": "table.product_num1",
305
- "color": "blue",
306
- "tagKey": "fieldsValue",
307
- "content": "当前表单.商品个数"
311
+ {
312
+ "insert": {
313
+ "span": true
314
+ },
315
+ "attributes": {
316
+ "id": "table.product_num1",
317
+ "color": "blue",
318
+ "tagKey": "fieldsValue",
319
+ "content": "当前表单.商品个数"
320
+ }
321
+ },
322
+ {
323
+ "insert": "\n\n"
308
324
  }
325
+ ],
326
+ "version": 1719296886283,
327
+ "withData": [
328
+
329
+ ]
330
+ }} />
331
+ <Field.Input label="分组名" __id="node_oclxmzswzti" />
332
+ <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
333
+
334
+ </Field.Table>
335
+ </Layout.FormRow>
336
+ <Field.Input label="总价" disabled={true} __id="product_total_price" withIds={[
337
+ "table.product_sum1"
338
+ ]}
339
+ withFill={{
340
+ "value": [
341
+ {
342
+ "insert": {
343
+ "span": true
309
344
  },
310
- {
311
- "insert": "\n\n"
345
+ "attributes": {
346
+ "id": "table.product_sum1",
347
+ "color": "blue",
348
+ "tagKey": "fieldsValue",
349
+ "content": "当前表单.标签.小计"
312
350
  }
313
- ],
314
- "version": 1719296886283,
315
- "withData": [
316
-
317
- ]
318
- }} />
319
- <Field.Input label="分组名" __id="node_oclxmzswzti" />
320
- <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
321
-
322
- </Field.Table>
323
- </Layout.FormRow>
324
- <Field.Input label="总价" disabled={true} __id="product_total_price" withIds={[
325
- "table.product_sum1"
326
- ]}
327
- withFill={{
328
- "value": [
329
- {
330
- "insert": {
331
- "span": true
332
351
  },
333
- "attributes": {
334
- "id": "table.product_sum1",
335
- "color": "blue",
336
- "tagKey": "fieldsValue",
337
- "content": "当前表单.标签.小计"
338
- }
339
- },
340
- {
341
- "insert": ".reduce((acc, curr) => parseFloat(acc||0) + parseFloat(curr||0), 0).toFixed(2)"
342
- },
343
- {
344
- "insert": "\n"
345
- }
346
- ],
347
- "version": 1719383786677,
348
- "withData": [
349
-
350
- ]
351
- }}
352
- />
353
- <Field.UserSelect label="选择用户" __id="userselect" customComponent={Input} />
354
- <Field.DeptSelect label="DeptSelect" __id="DeptSelect" treeData={[{
355
- value: 'parent 1-1',
356
- title: 'parent 1-1',
357
- children: [
358
- {
359
- value: 'leaf11',
360
- title: <b style={{ color: '#08c' }}>leaf11</b>,
361
- },
362
- ],
363
- },]}></Field.DeptSelect>
364
- <Field.PostSelect multiple={true} label="PostSelect" __id="PostSelect" treeData={[{
365
- value: 'parent 1-1',
366
- title: 'parent 1-1',
367
- children: [
368
- {
369
- value: 'leaf11',
370
- title: <b style={{ color: '#08c' }}>leaf11</b>,
371
- },
372
- ],
373
- },]}></Field.PostSelect>
374
- <Field.SearchSelect mode='multiple' label="搜组件" __id="searchuser" request={searchSelectRequest} option_search={"name"} option_label="name" option_value="id"></Field.SearchSelect>
375
- <Field.Input isRequired={true} label="商品价格" __id="product_price" defaultValue={"12"} disabled={true} />
376
- <Field.Input label="商品数量" __id="product_num" rules={"^(1[3-9]\\d{9})$"} />
377
- <Field.NumberRange label="数量范围" __id="product_num_range" />
378
- <Field.Input rules={["^(1[3-9]\\d{9})$", "^\\d+$"]} label="商品总价" __id="product_sum"
379
- withIds={["product_price", "product_num"]}
380
- withFill={{
381
- "value": [
382
- {
383
- "insert": {
384
- "span": true
352
+ {
353
+ "insert": ".reduce((acc, curr) => parseFloat(acc||0) + parseFloat(curr||0), 0).toFixed(2)"
385
354
  },
386
- "attributes": {
387
- "id": "product_price",
388
- "color": "blue",
389
- "tagKey": "fieldsValue",
390
- "content": "当前表单.商品价格"
355
+ {
356
+ "insert": "\n"
391
357
  }
392
- },
358
+ ],
359
+ "version": 1719383786677,
360
+ "withData": [
361
+
362
+ ]
363
+ }}
364
+ />
365
+ <Field.UserSelect label="选择用户" __id="userselect" customComponent={Input} />
366
+ <Field.DeptSelect label="DeptSelect" __id="DeptSelect" treeData={[{
367
+ value: 'parent 1-1',
368
+ title: 'parent 1-1',
369
+ children: [
393
370
  {
394
- "insert": "* "
371
+ value: 'leaf11',
372
+ title: <b style={{ color: '#08c' }}>leaf11</b>,
395
373
  },
374
+ ],
375
+ },]}></Field.DeptSelect>
376
+ <Field.PostSelect multiple={true} label="PostSelect" __id="PostSelect" treeData={[{
377
+ value: 'parent 1-1',
378
+ title: 'parent 1-1',
379
+ children: [
396
380
  {
397
- "insert": {
398
- "span": true
399
- },
400
- "attributes": {
401
- "id": "product_num",
402
- "color": "blue",
403
- "tagKey": "fieldsValue",
404
- "content": "当前表单.商品个数"
405
- }
381
+ value: 'leaf11',
382
+ title: <b style={{ color: '#08c' }}>leaf11</b>,
406
383
  },
407
- {
408
- "insert": "\n\n"
409
- }
410
384
  ],
411
- "version": 1719296886283,
412
- "withData": [
413
-
414
- ]
415
- }} />
416
- <Field.SingleSelect mode="single" label="测试单选" __id="select1" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.SingleSelect>
417
- <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
418
- <Field.TreeSelect label="分组名" __id="title11"></Field.TreeSelect>
419
- <Field.Switch label="开关" __id="switch"></Field.Switch>
420
- <Layout.FormGroupTitle title={"嘟嘟嘟嘟嘟"} />
421
- <Field.CodeMachine label="角色编号" prompt="" __id="code"
422
- withIds={["switch"]}
423
- withFunc={(fieldsValue) => {
424
- return fieldsValue?.switch ? true : false
425
- }}
426
- />
427
- <Field.DatePicker defaultNow={true} label="datetime" prompt="" datetype="month" value='2022-10-22' __id="datetime" />
428
- <Field.DatePicker label="datetime2" prompt="" datetype="date" __id="datetime2" />
429
- <Field.DatePicker isRequired={true} disabled={true} defaultNow={true} label="datetime3" prompt="" datetype="datetime" value={'2022-10-22'} __id="datetime3" />
430
- <Field.DatePicker defaultNow={true} label="datetime4" prompt="" datetype="year" value={'2022-10-22'} __id="datetime4" />
431
- <Field.Input label="角色名称" __id="name" />
432
- <Layout.FormRow layout={'1,1'}>
433
- <Field.Input label="角色名称布局" __id="name1" />
434
- <Field.Input label="角色名称布局2" __id="name2" />
435
- </Layout.FormRow>
436
- <Field.CheckboxTree label="角色权限" __id="permissions" addRoot={false} treeData={treeData} />
437
- <Layout.FormGroupTitle title={"关联信息"} />
438
- <Field.WithMultipleSelect disabled={true} label="测试关联多选" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} __id="remark12" />
439
- <Layout.FormRow > <Field.TextArea label="备注" __id="remark" /></Layout.FormRow>
440
-
441
- <Layout.FormRow layout={'1'}>
442
- <Field.RadioGroup withIds={["remark11"]}
385
+ },]}></Field.PostSelect>
386
+ <Field.SearchSelect mode='multiple' label="搜组件" __id="searchuser" request={searchSelectRequest} option_search={"name"} option_label="name" option_value="id"></Field.SearchSelect>
387
+ <Field.Input isRequired={true} label="商品价格" __id="product_price" defaultValue={"12"} disabled={true} />
388
+ <Field.Input label="商品数量" __id="product_num" rules={"^(1[3-9]\\d{9})$"} />
389
+ <Field.NumberRange label="数量范围" __id="product_num_range" />
390
+ <Field.Input rules={["^(1[3-9]\\d{9})$", "^\\d+$"]} label="商品总价" __id="product_sum"
391
+ withIds={["product_price", "product_num"]}
443
392
  withFill={{
444
393
  "value": [
445
394
  {
@@ -447,41 +396,98 @@ function App() {
447
396
  "span": true
448
397
  },
449
398
  "attributes": {
450
- "id": "remark11",
399
+ "id": "product_price",
400
+ "color": "blue",
401
+ "tagKey": "fieldsValue",
402
+ "content": "当前表单.商品价格"
403
+ }
404
+ },
405
+ {
406
+ "insert": "* "
407
+ },
408
+ {
409
+ "insert": {
410
+ "span": true
411
+ },
412
+ "attributes": {
413
+ "id": "product_num",
451
414
  "color": "blue",
452
415
  "tagKey": "fieldsValue",
453
- "content": "测试关联单选"
416
+ "content": "当前表单.商品个数"
454
417
  }
455
418
  },
419
+ {
420
+ "insert": "\n\n"
421
+ }
456
422
  ],
457
423
  "version": 1719296886283,
458
424
  "withData": [
459
425
 
460
426
  ]
461
- }} options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="单选框" __id="radio" ></Field.RadioGroup>
462
- </Layout.FormRow>
463
- <Layout.FormRow layout={'1'}>
464
- <Field.CheckboxGroup options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="多选框" __id="CheckboxGroup" ></Field.CheckboxGroup>
465
- </Layout.FormRow>
466
- <Field.UploadFile label="上传文件" __id="UploadFile" ></Field.UploadFile>
467
- <Field.UploadImage label="上传图片" __id="UploadImage" ></Field.UploadImage>
468
-
469
- </FormContainerWrapper>
470
- <div class="fgroup">11111
471
- <div class="fbg-red-500 group-hover:fbg-blue-500">
472
- Hover over me or my parent!
427
+ }} />
428
+ <Field.SingleSelect mode="single" label="测试单选" __id="select1" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.SingleSelect>
429
+ <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
430
+ <Field.TreeSelect label="分组名" __id="title11"></Field.TreeSelect>
431
+ <Field.Switch label="开关" __id="switch"></Field.Switch>
432
+ <Layout.FormGroupTitle title={"嘟嘟嘟嘟嘟"} />
433
+ <Field.CodeMachine label="角色编号" prompt="" __id="code"
434
+ withIds={["switch"]}
435
+ withFunc={(fieldsValue) => {
436
+ return fieldsValue?.switch ? true : false
437
+ }}
438
+ />
439
+ <Field.DatePicker defaultNow={true} label="datetime" prompt="" datetype="month" value='2022-10-22' __id="datetime" />
440
+ <Field.DatePicker label="datetime2" prompt="" datetype="date" __id="datetime2" />
441
+ <Field.DatePicker isRequired={true} disabled={true} defaultNow={true} label="datetime3" prompt="" datetype="datetime" value={'2022-10-22'} __id="datetime3" />
442
+ <Field.DatePicker defaultNow={true} label="datetime4" prompt="" datetype="year" value={'2022-10-22'} __id="datetime4" />
443
+ <Field.Input label="角色名称" __id="name" />
444
+ <Layout.FormRow layout={'1,1'}>
445
+ <Field.Input label="角色名称布局" __id="name1" />
446
+ <Field.Input label="角色名称布局2" __id="name2" />
447
+ </Layout.FormRow>
448
+ <Field.CheckboxTree label="角色权限" __id="permissions" addRoot={false} treeData={treeData} />
449
+ <Layout.FormGroupTitle title={"关联信息"} />
450
+ <Field.WithMultipleSelect disabled={true} label="测试关联多选" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} __id="remark12" />
451
+ <Layout.FormRow > <Field.TextArea label="备注" __id="remark" /></Layout.FormRow>
452
+
453
+ <Layout.FormRow layout={'1'}>
454
+ <Field.RadioGroup withIds={["remark11"]}
455
+ withFill={{
456
+ "value": [
457
+ {
458
+ "insert": {
459
+ "span": true
460
+ },
461
+ "attributes": {
462
+ "id": "remark11",
463
+ "color": "blue",
464
+ "tagKey": "fieldsValue",
465
+ "content": "测试关联单选"
466
+ }
467
+ },
468
+ ],
469
+ "version": 1719296886283,
470
+ "withData": [
471
+
472
+ ]
473
+ }} options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="单选框" __id="radio" ></Field.RadioGroup>
474
+ </Layout.FormRow>
475
+ <Layout.FormRow layout={'1'}>
476
+ <Field.CheckboxGroup options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="多选框" __id="CheckboxGroup" ></Field.CheckboxGroup>
477
+ </Layout.FormRow>
478
+ <Field.UploadFile label="上传文件" __id="UploadFile" ></Field.UploadFile>
479
+ <Field.UploadImage label="上传图片" __id="UploadImage" ></Field.UploadImage>
480
+
481
+ </FormContainerWrapper>
482
+ <div class="fgroup">11111
483
+ <div class="fbg-red-500 group-hover:fbg-blue-500">
484
+ Hover over me or my parent!
485
+ </div>
473
486
  </div>
487
+
474
488
  </div>
475
- <Button type="primary" onClick={validateFields}>validateFields</Button>
476
- <Button type="primary" onClick={getFormFields}>GetValues</Button>
477
- <Button type="primary" onClick={setFormFields}>SetValues</Button>
478
- <Button type="primary" onClick={() => {
479
- console.log("testRef.current", testRef.current)
480
- testRef.current?.handleChange({ label: '选项1', value: '1', name: "1111", table: "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2}]" })
481
- }}>testwithref</Button>
482
- <Button type="primary" onClick={handleCols}>UpdateCol</Button>
483
- </div>
484
489
 
490
+ </div>
485
491
  </div>
486
492
  );
487
493
  }