lu-lowcode-package-form 0.11.33 → 0.11.35

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
@@ -87,12 +87,7 @@ function App() {
87
87
  }, 200))
88
88
 
89
89
 
90
- useEffect(() => {
91
- testdebounce(1, 2)
92
- testdebounce(11, 22)
93
- testdebounce(111, 222)
94
- // console.log("testRef //////", testRef.current)
95
- }, [testRef.current])
90
+
96
91
  const [cols, setCols] = React.useState(3);
97
92
 
98
93
  const getFormFields = () => {
@@ -147,88 +142,89 @@ function App() {
147
142
  </div>
148
143
 
149
144
  <div className=" fflex fflex-col fitems-center fflex-1 foverflow-y-auto">
145
+ <DraggableBtn />
146
+ {/* <MyPureComponentWithRef ref={testRef} />; */}
147
+ {/* <div className=' fp-4 fflex fjustify-center fw-[1336px]'>
148
+ <div className='fflex fflex-col'>
149
+ <SortList
150
+ items={sortItems}
151
+ setItems={setSortItems}
152
+ renderItem={(item, index, isDragging) => (
153
+ <div
154
+ style={{
155
+ padding: '8px',
156
+ margin: '4px',
157
+ border: '1px solid gray',
158
+ cursor: 'move',
159
+ opacity: isDragging ? 0.2 : 1,
160
+
161
+ }}
162
+ >
163
+ {item.content}
164
+ </div>
165
+ )}
166
+ /></div>
167
+ </div> */}
168
+ {/* <div className=' fp-4 fflex fjustify-center fw-[1336px]'>
169
+ <WangEditorNext />
170
+ </div> */}
171
+ {/* <div className='fw-full fp-4 fflex fjustify-center'>
172
+ <TinyMCEEditor />
173
+ </div> */}
174
+ {/* <div className='fw-full fp-4 fflex fjustify-center'>
175
+ <EditorWang />
176
+ </div> */}
177
+ {/* <div className='fw-full fp-4'>
178
+ <EditorQuill value={"[{\"insert\":\"sdfsd\"}]"} />
179
+ </div>
180
+ <div className='fw-full fp-4'>
181
+ <Select
182
+ mode="tags"
183
+ style={{ width: '100%' }}
184
+ placeholder="Tags Mode"
185
+ options={[{ label: '标签1', value: '1' }, { label: '标签2', value: '2' }]}
186
+ />
187
+ <Setter.OptionSetter />
188
+ </div> */}
150
189
  <div className='fw-[960px] frounded fbg-slate-50 fflex fflex-col fitems-center fpb-10'>
151
190
 
152
191
 
153
- <FormContainerWrapper cols={cols} className="" ref={formRef} >
154
- <Field.WithSingleSelect
192
+ <FormContainerWrapper cols={cols} key={"formc"} className="" ref={formRef} >
193
+
194
+ <Field.WithSingleSelect
195
+ ref={testRef}
155
196
  request={async (params) => {
156
- console.log("request params", params)
157
- return { code: 0, data: { list: [{ label: '选项1', value: '1', fill_tianchong1_test:{ label: "选项2", value: "2" } , table_fill: [{ fill_tianchong2: { label: "选项2", value: "2" } },{ fill_tianchong2: { label: "选项1", value: "1" } }] }] } }
197
+ return {
198
+ code: 0, data: {
199
+ list:
200
+ [
201
+ { label: '选项1', value: '1', routeType: 1 },
202
+ { label: '选项2', value: '2' , routeType:2 },
203
+ { label: '选项3', value: '3' }
204
+ ]
205
+ }
206
+ }
158
207
  }}
159
208
  option_label="label"
160
209
  option_value="value"
161
210
  fillRules={[
162
211
  {
163
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b21",
212
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
164
213
  "type": 0,
165
- "source": "table_fill",
166
- "target": "table_fill",
167
- "subRules": [
168
- {
169
- "id": "636d3924-0298-4e9b-809a-26d4a10d7ba1",
170
- "type": 0,
171
- "source": "fill_tianchong1",
172
- "target": "fill_tianchong1",
173
- "subRules": [
174
- ]
175
- }
176
- ]
177
- },
178
-
179
- {
180
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b51",
181
- "type": 0,
182
- "source": "fill_tianchong1_test",
183
- "target": "fill_tianchong1_test",
184
- "subRules": [
185
-
186
- ]
214
+ "source": "routeType",
215
+ "target": "routeType",
187
216
  },
188
217
 
189
- ]} label="测试填充子表1" __id="subtable_fill1" />
190
- <Field.WithSingleSelect
191
- ref={testRef}
192
- request={async (params) => {
193
- if (!params?.value) return { code: 0, data: { list: [{ label: '选项1', value: '1', }] } }
194
- await new Promise(resolve => setTimeout(resolve, 50))
195
- return { code: 0, data: { list: [{ label: '选项1', value: '1', }, { label: '选项2', value: '2', fill_tcinput1: "8989", fill_tcinput2: "2222" }, { label: '选项3', value: '3' }] } }
196
- }}
197
- option_label="label"
198
- option_value="value"
199
- option_search="label" label="测试填充2" __id="fill_tianchong1_test" />
200
-
201
- <Field.WithSingleSelect label="测试关联填充啥地方都是粉丝的" __id="fill_tianchong1_test2"
202
- withIds={["fill_tianchong1_test"]}
203
- withFill={{
204
- "value": [
205
- {
206
- "insert": {
207
- "span": true
208
- },
209
- "attributes": {
210
- "id": "fill_tianchong1_test",
211
- "color": "blue",
212
- "tagKey": "fieldsValue",
213
- "content": "当前表单.测试被填充2"
214
- }
215
- },
216
-
217
- ],
218
- "version": 1719296886283,
219
- "withData": [
220
-
221
- ]
222
- }}
223
- />
224
- <Field.RadioGroup
218
+ ]} label="类型填充" __id="fill_routeType" />
219
+ <Field.RadioGroup
225
220
  buttonStyle="solid"
226
221
  label="菜单类型"
227
222
  __id="routeType"
228
223
  defaultValue={2}
229
224
  options={[{ label: "菜单分组", value: 999 }, { label: "URL", value: 1 }, { label: "绑定表单", value: 2 }]} />
230
- <Layout.FormRow layout={'1'}>
231
- <Field.Input label="测试 withVisible" __id="withVisible"
225
+
226
+
227
+ <Field.Input label="测试 withVisible" __id="withVisible"
232
228
  isRequired={true}
233
229
  withIds={["routeType"]}
234
230
  withVisible={{
@@ -254,49 +250,135 @@ function App() {
254
250
  ]
255
251
  }}
256
252
  />
257
- </Layout.FormRow>
258
- <Layout.FormRow layout={'1'}>
253
+ <Field.Input label="测试 withVisible2" __id="withVisible2"
254
+ isRequired={true}
255
+ withIds={["routeType"]}
256
+ withVisible={{
257
+ "value": [
258
+ {
259
+ "insert": {
260
+ "span": true
261
+ },
262
+ "attributes": {
263
+ "id": "routeType",
264
+ "color": "blue",
265
+ "tagKey": "fieldsValue",
266
+ "content": "当前表单.开关2"
267
+ }
268
+ },
269
+ {
270
+ "insert": " == 2\n"
271
+ }
272
+ ],
273
+ "version": 1734400834533,
274
+ "withData": [
259
275
 
276
+ ]
277
+ }}
278
+ />
279
+ <Field.Input label="测试 withVisible21" __id="withVisible21"
280
+ isRequired={true}
281
+ withIds={["routeType"]}
282
+ withVisible={{
283
+ "value": [
284
+ {
285
+ "insert": {
286
+ "span": true
287
+ },
288
+ "attributes": {
289
+ "id": "routeType",
290
+ "color": "blue",
291
+ "tagKey": "fieldsValue",
292
+ "content": "当前表单.开关2"
293
+ }
294
+ },
295
+ {
296
+ "insert": " == 2\n"
297
+ }
298
+ ],
299
+ "version": 1734400834533,
300
+ "withData": [
260
301
 
302
+ ]
303
+ }}
304
+ />
305
+ <Field.Select label="绑定表单"
306
+ option_label={"formTitle"}
307
+ __id="menuFormTemplateId"
308
+ withIds={["routeType"]}
309
+ withVisibleFunc={(fieldsValue) => {
310
+ const result = fieldsValue?.routeType == 2 ? true : false
311
+ // console.log("withVisibleFunc menuFormTemplateId", fieldsValue)
312
+ // console.log("withVisibleFunc menuFormTemplateId result", result)
313
+ return result
314
+ }} />
315
+
316
+
317
+ <Field.Input label="隐藏字段" __id="hidden1"
318
+ calcHidden={true}
319
+ />
320
+
321
+ <Field.Input label="菜单URL" __id="route"
322
+ withIds={["routeType"]}
323
+ withVisibleFunc={(fieldsValue) => {
324
+ const result = fieldsValue?.routeType == 1 ? true : false
325
+ // console.log("withVisibleFunc route", fieldsValue)
326
+ // console.log("withVisibleFunc route result", result)
327
+ return result
328
+ }} />
329
+ <Field.TextArea label="备注" __id="remark"
330
+ withIds={["routeType"]}
331
+ withVisibleFunc={(fieldsValue) => {
332
+ return fieldsValue?.routeType != 999 ? true : false
333
+ }}
334
+ />
335
+
336
+ <Field.WithSingleSelect
337
+ ref={testRef}
338
+ request={async (params) => {
339
+ console.log("request params", params)
340
+ return {
341
+ code: 0, data: {
342
+ list:
343
+ [
344
+ { label: '选项1', value: '1', table_fill: [{ fill_tianchong1: { label: '选项1', value: '1' }, fill_tianchong2: { label: '选项2', value: '2' } }] },
345
+ { label: '选项2', value: '2' },
346
+ { label: '选项3', value: '3' }
347
+ ]
348
+ }
349
+ }
350
+ }}
351
+ option_label="label"
352
+ option_value="value"
353
+ fillRules={[
354
+ {
355
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
356
+ "type": 1,
357
+ "source": "table_fill",
358
+ "target": "table_fill",
359
+ "subRules": [
360
+ {
361
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
362
+ "type": 0,
363
+ "source": "fill_tianchong1",
364
+ "target": "fill_tianchong1",
365
+ },
366
+ ]
367
+ },
368
+
369
+ ]} label="子表填充数据源" __id="fill_datasource1" />
370
+ <Layout.FormRow layout={'1'}>
261
371
  <Field.Table label="测试主子表填充" __id="table_fill" isAllowAdd={true} isAllowCopy={false} >
262
372
 
263
373
  <Field.WithSingleSelect
264
374
  ref={testRef}
265
375
  request={async (params) => {
266
376
  console.log("request params", params)
267
- return { code: 0, data: { list: [{ label: '选项1', value: '1', fill_tianchong1_test: "sdfsdf", fill_tianchong2: { label: '选项2', value: '2' }, fill_tcinput1: "1111", }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }] } }
268
- }}
269
-
270
- withIds={["routeType"]}
271
- withVisible={{
272
- "value": [
273
- {
274
- "insert": {
275
- "span": true
276
- },
277
- "attributes": {
278
- "id": "routeType",
279
- "color": "blue",
280
- "tagKey": "fieldsValue",
281
- "content": "当前表单.开关"
282
- }
283
- },
284
- {
285
- "insert": "== 1"
286
- },
287
- ]
377
+ return { code: 0, data: { list: [{ label: '选项1', value: '1', fill_tianchong2: { label: '选项2', value: '2' }, fill_tcinput1: "1111", }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }] } }
288
378
  }}
289
379
  option_label="label"
290
380
  option_value="value"
291
381
  fillRules={[
292
- {
293
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b21",
294
- "type": 0,
295
- "source": "fill_tianchong1_test",
296
- "target": "fill_tianchong1_test",
297
- "subRules": [
298
- ]
299
- },
300
382
  {
301
383
  "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
302
384
  "type": 0,
@@ -317,21 +399,250 @@ function App() {
317
399
  ]} label="测试填充1" __id="fill_tianchong1" />
318
400
  <Field.WithSingleSelect
319
401
  ref={testRef}
320
- request={async (params,form) => {
321
- let fill_tianchong1_test = form?.getFieldValue("fill_tianchong1_test")
322
- console.log("fill_tianchong1_test",fill_tianchong1_test)
323
- if (!fill_tianchong1_test) return { code: 0, data: { list: [] } }
324
- await new Promise(resolve => setTimeout(resolve, 40))
402
+ request={async (params) => {
403
+ if (!params?.value) return { code: 0, data: { list: [{ label: '选项1', value: '1', }] } }
404
+ await new Promise(resolve => setTimeout(resolve, 200))
325
405
  return { code: 0, data: { list: [{ label: '选项1', value: '1', }, { label: '选项2', value: '2', fill_tcinput1: "8989", fill_tcinput2: "2222" }, { label: '选项3', value: '3' }] } }
326
406
  }}
327
407
  option_label="label"
328
408
  option_value="value"
329
409
  option_search="label"
410
+ fillRules={[
411
+ {
412
+ "id": "636d3924-0298-4e9b-809a-16d4a10d7b29",
413
+ "type": 0,
414
+ "source": "fill_tcinput1",
415
+ "target": "fill_tcinput1",
416
+ "subRules": [
417
+ ]
418
+ },
419
+ {
420
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b29",
421
+ "type": 0,
422
+ "source": "fill_tcinput2",
423
+ "target": "fill_tcinput2",
424
+ "subRules": [
425
+ ]
426
+ },
427
+
428
+ ]} label="测试填充2" __id="fill_tianchong2" />
429
+ <Field.Input label="测试被填充1" __id="fill_tcinput1" />
430
+ <Field.Input label="测试被填充2" __id="fill_tcinput2" />
431
+ <Field.Input label="测试被填充计算" __id="fill_tcinput3"
432
+ withIds={["table_fill.fill_tcinput2"]}
433
+ withFill={{
434
+ "value": [
435
+ {
436
+ "insert": {
437
+ "span": true
438
+ },
439
+ "attributes": {
440
+ "id": "table_fill.fill_tcinput2",
441
+ "color": "blue",
442
+ "tagKey": "fieldsValue",
443
+ "content": "当前表单.测试被填充2"
444
+ }
445
+ },
446
+ {
447
+ "insert": "* 0.5"
448
+ },
449
+ {
450
+ "insert": "\n\n"
451
+ }
452
+ ],
453
+ "version": 1719296886283,
454
+ "withData": [
455
+
456
+ ]
457
+ }}
458
+ />
459
+
460
+ </Field.Table>
461
+ </Layout.FormRow>
462
+ <Field.MultipleSelect mode="multiple" option_label={"label"} option_value={"value"} label="测试过滤条件" __id="selecta1" request={async (params) => {
463
+ return { code: 0, data: { list: [{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }] } }
464
+ }}></Field.MultipleSelect>
465
+ <Layout.FormRow layout={'1'}>
466
+
467
+ <Show.WithTable label="测试关联子表" __id="withtable1"
468
+ filterRules={[
469
+ {
470
+ "value": {
471
+ "parent": "",
472
+ "field_key": "aa2",
473
+ "group_key": "fieldsValue",
474
+ "field_name": "当前表单.测试"
475
+ },
476
+ "valueType": "variable",
477
+ "column": {
478
+ "label": "库存表.所在仓库",
479
+ "value": "node_ocm009lpxt2",
480
+ "column_name": "node_ocm009lpxt2",
481
+ "column_type": ""
482
+ }
483
+ }
484
+ ]} />
485
+ </Layout.FormRow>
486
+ <Field.Number label="测试" __id="aa2" isRequired={true} />
487
+ <Field.Number label="测试" __id="aa3" readonly={readonly} />
488
+ <Field.Number label="测试" __id="aa1" calcHidden={true} readonly={readonly} />
489
+ <Field.Number label="测试" __id="aa4" readonly={readonly} />
490
+ <Field.UserSelect label="选择用户" __id="userselect" defaultValue={[{ id: 1, username: "十天" }]} readonly={readonly} />
491
+ <Layout.FormGroupTitle title={"基本信息"} />
492
+ <Field.WithSingleSelect
493
+ rightIconRender={({ form, fieldName }) => {
494
+ // console.log("rightIconRender form", form,)
495
+ // console.log("rightIconRender fieldName", fieldName)
496
+ return <><PrinterOutlined /></>
497
+ }}
498
+ ref={testRef} fillRules={[
499
+ {
500
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
501
+ "type": 0,
502
+ "source": "shuilv",
503
+ "target": "shuilv",
504
+ "subRules": [
505
+ ]
506
+ },
507
+
508
+ ]} label="发票类型" options={[{ label: '选项1', value: '1', shuilv: 15, }, { label: '选项2', value: '2', shuilv: 50 }, { label: '选项3', value: '3', shuilv: 2 }]} __id="fapiaoleixing" />
509
+
510
+ <Field.Number label="税率(%)" __id="shuilv" />
511
+
512
+ <Field.WithSingleSelect ref={testRef} fillRules={[
513
+ {
514
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
515
+ "type": 0,
516
+ "source": "name",
517
+ "target": "name",
518
+ "subRules": [
519
+
520
+ ]
521
+ },
522
+ {
523
+ "id": "93401e38-60a4-4acf-84a6-8958785a4a30",
524
+ "type": 1,
525
+ "source": "table",
526
+ "target": "table",
527
+ "subRules": [
528
+ {
529
+ "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
530
+ "type": 0,
531
+ "source": "price",
532
+ "target": "product_price1"
533
+ },
534
+
535
+ {
536
+ "id": "c4a65ae5-58ff-4d7f-8738-a04de1acab61",
537
+ "type": 0,
538
+ "source": "num",
539
+ "target": "product_num1"
540
+ },
541
+ ]
542
+ }
543
+ ]} 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" />
544
+ <Layout.FormRow layout={'1'}>
545
+ <Field.Number label="测试规则" __id="ceshi_rule1" />
546
+ </Layout.FormRow>
547
+ <Layout.FormRow layout={'1'}>
548
+ <Field.Table label="子表格" __id="table2" isAllowCopy={true} >
549
+ <Field.Number label="测试规则2" __id="ceshi_rule2" />
550
+ </Field.Table>
551
+ </Layout.FormRow>
552
+
553
+ <Field.WithSingleSelect
554
+ ref={testRef}
555
+ request={async (params) => {
556
+ console.log("request params", params);
557
+ const { page = 1, pageSize = 10 } = params; // 获取当前页码,默认为1
558
+
559
+
560
+ // 模拟数据集
561
+ const allData = [
562
+ { label: '选项1', value: '1' },
563
+ { label: '选项2', value: '2' },
564
+ { label: '选项3', value: '3' },
565
+ { label: '选项4', value: '4' },
566
+ { label: '选项5', value: '5' },
567
+ { label: '选项6', value: '6' },
568
+ { label: '选项7', value: '7' },
569
+ { label: '选项8', value: '8' },
570
+ { label: '选项9', value: '9' },
571
+ { label: '选项10', value: '10' },
572
+ { label: '选项11', value: '11' },
573
+ { label: '选项12', value: '12' },
574
+ { label: '选项13', value: '13' },
575
+ { label: '选项14', value: '14' },
576
+ { label: '选项15', value: '15' },
577
+ { label: '选项16', value: '16' },
578
+ { label: '选项17', value: '17' },
579
+ { label: '选项18', value: '18' },
580
+ { label: '选项19', value: '19' },
581
+ { label: '选项20', value: '20' },
582
+ { label: '选项21', value: '21' },
583
+ { label: '选项22', value: '22' },
584
+ { label: '选项23', value: '23' },
585
+ { label: '选项24', value: '24' }
586
+ ];
587
+
588
+ // 根据页码和每页数据量计算当前页的数据
589
+ const startIndex = (page - 1) * pageSize;
590
+ const endIndex = startIndex + pageSize;
591
+ let pageData = []
592
+ if (startIndex < allData.length) {
593
+ pageData = allData.slice(startIndex, endIndex);
594
+ }
595
+
596
+ let result = { code: 0, data: { list: pageData } };
597
+ console.log("request result", result)
598
+ await new Promise(resolve => setTimeout(resolve, 200))
599
+ return result
600
+ }}
601
+ option_label="label"
602
+ option_value="value"
603
+ label="测试请求" __id="ceshirequest" />
604
+
605
+ <Layout.FormRow layout={'1'}>
606
+ <Field.Table label="子表格" __id="table" isAllowAdd={true} isAllowCopy={false} >
607
+
608
+ <Field.Number label="税率(%)" __id="shuilv_table" withIds={[
609
+ "shuilv"
610
+ ]}
611
+ withFill={{
612
+ "value": [
613
+ {
614
+ "insert": {
615
+ "span": true
616
+ },
617
+ "attributes": {
618
+ "id": "shuilv",
619
+ "color": "blue",
620
+ "tagKey": "fieldsValue",
621
+ "content": "当前表单.税率(%)"
622
+ }
623
+ },
624
+
625
+ ],
626
+ "version": 1723016911807,
627
+ "withData": [
628
+
629
+ ]
630
+ }} />
631
+ <Field.DatePicker defaultNow={true} label="日期时间" prompt="" datetype="date" __id="datetime2" />
632
+
633
+ <Field.WithSingleSelect ref={testRef}
634
+ request={async (params) => {
635
+ if (params?.ruleParams?.node_ocm009lpxt2 == 111)
636
+ return { code: 0, data: { list: [{ label: '选项1', value: '1', product_price11: "1111", product_price12: "2222", product_price1: 111 }, { label: '选项2', value: '2' }, { label: '选项3', value: '3' }] } }
637
+ else return { code: 0, data: { list: [{ label: '选项1', value: '1', product_price11: "1111", product_price12: "2222", product_price1: 111 }, { label: '选项2', value: '2' },] } }
638
+ }}
639
+ option_label="label"
640
+ option_value="value"
330
641
  filterRules={[
331
642
  {
332
643
  "value": {
333
644
  "parent": "",
334
- "field_key": "fill_tianchong1_test",
645
+ "field_key": "shuilv",
335
646
  "group_key": "fieldsValue",
336
647
  "field_name": "当前表单.税率"
337
648
  },
@@ -347,59 +658,282 @@ function App() {
347
658
 
348
659
  fillRules={[
349
660
  {
350
- "id": "636d3924-0298-4e9b-809a-16d4a10d7b29",
661
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
351
662
  "type": 0,
352
- "source": "fill_tcinput1",
353
- "target": "fill_tcinput1",
663
+ "source": "product_price11",
664
+ "target": "product_price11",
354
665
  "subRules": [
666
+
355
667
  ]
356
668
  },
357
669
  {
358
- "id": "636d3924-0298-4e9b-809a-26d4a10d7b29",
670
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b89",
359
671
  "type": 0,
360
- "source": "fill_tcinput2",
361
- "target": "fill_tcinput2",
672
+ "source": "product_price1",
673
+ "target": "product_price1",
362
674
  "subRules": [
675
+
363
676
  ]
364
677
  },
365
678
 
366
- ]} label="测试填充2" __id="fill_tianchong2" />
367
- <Field.Input label="测试被填充1" __id="fill_tcinput1" />
368
- <Field.Input label="测试被填充2" __id="fill_tcinput2" />
369
- <Field.Input label="测试被填充计算" __id="fill_tcinput3"
370
- withIds={["table_fill.fill_tcinput2"]}
679
+ ]} label="测试关联单选" __id="remark11" />
680
+
681
+ <Field.Switch label="开关" __id="switch_table"></Field.Switch>
682
+ <Field.Input defaultValue={3} label="含税单价" __id="product_price11" />
683
+ <Field.Input label="未税单价" __id="product_price12"
684
+ withIds={[
685
+ "table.product_price11",
686
+ "shuilv"
687
+ ]}
371
688
  withFill={{
372
689
  "value": [
690
+ {
691
+ "insert": "("
692
+ },
373
693
  {
374
694
  "insert": {
375
695
  "span": true
376
696
  },
377
697
  "attributes": {
378
- "id": "table_fill.fill_tcinput2",
698
+ "id": "table.product_price11",
379
699
  "color": "blue",
380
700
  "tagKey": "fieldsValue",
381
- "content": "当前表单.测试被填充2"
701
+ "content": "当前表单.产品列表.含税单价"
382
702
  }
383
703
  },
384
704
  {
385
- "insert": "* 0.5"
705
+ "insert": "/(1+"
386
706
  },
387
707
  {
388
- "insert": "\n\n"
708
+ "insert": {
709
+ "span": true
710
+ },
711
+ "attributes": {
712
+ "id": "shuilv",
713
+ "color": "blue",
714
+ "tagKey": "fieldsValue",
715
+ "content": "当前表单.税率(%)"
716
+ }
717
+ },
718
+ {
719
+ "insert": "/ 100)).toFixed(2)\n\n\n"
389
720
  }
390
721
  ],
391
- "version": 1719296886283,
722
+ "version": 1723016911807,
392
723
  "withData": [
393
724
 
394
725
  ]
395
726
  }}
396
727
  />
728
+ <Field.Input defaultValue={1} label="商品价格" __id="product_price13" />
729
+ <Field.Input defaultValue={2} label="商品价格" __id="product_price14" />
730
+ <Field.Input label="商品价格" __id="product_price1" />
731
+ <Field.Input label="商品个数" __id="product_num1" />
732
+ <Field.Input disabled={true} label="商品总价" __id="product_sum1"
733
+ withIds={["table.product_price1", "table.product_num1"]}
734
+ withFill={{
735
+ "value": [
736
+ {
737
+ "insert": {
738
+ "span": true
739
+ },
740
+ "attributes": {
741
+ "id": "table.product_price1",
742
+ "color": "blue",
743
+ "tagKey": "fieldsValue",
744
+ "content": "当前表单.商品价格"
745
+ }
746
+ },
747
+ {
748
+ "insert": "*"
749
+ },
750
+ {
751
+ "insert": {
752
+ "span": true
753
+ },
754
+ "attributes": {
755
+ "id": "table.product_num1",
756
+ "color": "blue",
757
+ "tagKey": "fieldsValue",
758
+ "content": "当前表单.商品个数"
759
+ }
760
+ },
761
+ {
762
+ "insert": "\n\n"
763
+ }
764
+ ],
765
+ "version": 1719296886283,
766
+ "withData": [
767
+
768
+ ]
769
+ }} />
770
+ <Field.Input label="分组名" __id="node_oclxmzswzti" />
771
+ <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
397
772
 
398
773
  </Field.Table>
399
774
  </Layout.FormRow>
775
+ <Field.Input label="总价" disabled={true} __id="product_total_price" withIds={[
776
+ "table.product_sum1"
777
+ ]}
778
+ withFill={{
779
+ "value": [
780
+ {
781
+ "insert": {
782
+ "span": true
783
+ },
784
+ "attributes": {
785
+ "id": "table.product_sum1",
786
+ "color": "blue",
787
+ "tagKey": "fieldsValue",
788
+ "content": "当前表单.标签.小计"
789
+ }
790
+ },
791
+ {
792
+ "insert": ".reduce((acc, curr) => parseFloat(acc||0) + parseFloat(curr||0), 0).toFixed(2)"
793
+ },
794
+ {
795
+ "insert": "\n"
796
+ }
797
+ ],
798
+ "version": 1719383786677,
799
+ "withData": [
400
800
 
401
- </FormContainerWrapper>
801
+ ]
802
+ }}
803
+ />
804
+ <Field.UserSelect label="选择用户" __id="userselect" customComponent={Input} />
805
+ <Field.DeptSelect label="DeptSelect" __id="DeptSelect" treeData={[{
806
+ value: 'parent 1-1',
807
+ title: 'parent 1-1',
808
+ children: [
809
+ {
810
+ value: 'leaf11',
811
+ title: <b style={{ color: '#08c' }}>leaf11</b>,
812
+ },
813
+ ],
814
+ },]}></Field.DeptSelect>
815
+ <Field.PostSelect multiple={true} label="PostSelect" __id="PostSelect" treeData={[{
816
+ value: 'parent 1-1',
817
+ title: 'parent 1-1',
818
+ children: [
819
+ {
820
+ value: 'leaf11',
821
+ title: <b style={{ color: '#08c' }}>leaf11</b>,
822
+ },
823
+ ],
824
+ },]}></Field.PostSelect>
825
+ <Field.SearchSelect mode='multiple' label="搜组件" __id="searchuser" request={searchSelectRequest} option_search={"name"} option_label="name" option_value="id"></Field.SearchSelect>
826
+ <Field.Input label="商品价格" __id="product_price" defaultValue={"12"} disabled={true} />
827
+ <Field.Input label="商品数量" __id="product_num" rules={"^(1[3-9]\\d{9})$"} />
828
+ <Field.NumberRange label="数量范围" __id="product_num_range" />
829
+ <Field.Input rules={["^(1[3-9]\\d{9})$", "^\\d+$"]} label="商品总价" __id="product_sum"
830
+ withIds={["product_price", "product_num"]}
831
+ withFill={{
832
+ "value": [
833
+ {
834
+ "insert": {
835
+ "span": true
836
+ },
837
+ "attributes": {
838
+ "id": "product_price",
839
+ "color": "blue",
840
+ "tagKey": "fieldsValue",
841
+ "content": "当前表单.商品价格"
842
+ }
843
+ },
844
+ {
845
+ "insert": "* "
846
+ },
847
+ {
848
+ "insert": {
849
+ "span": true
850
+ },
851
+ "attributes": {
852
+ "id": "product_num",
853
+ "color": "blue",
854
+ "tagKey": "fieldsValue",
855
+ "content": "当前表单.商品个数"
856
+ }
857
+ },
858
+ {
859
+ "insert": "\n\n"
860
+ }
861
+ ],
862
+ "version": 1719296886283,
863
+ "withData": [
864
+
865
+ ]
866
+ }} />
867
+
868
+ <Field.SingleSelect mode="single" option_value={"id"} label="测试单选" __id="select1" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.SingleSelect>
869
+ <Field.MultipleSelect mode="multiple" label="测多选" __id="select2" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]}></Field.MultipleSelect>
870
+ <Field.MultipleSelect mode="multiple" option_label={"label"} option_value={"value"} label="测多选2" __id="select2222" request={async (params) => {
871
+ return { code: 0, data: { list: [{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }] } }
872
+ }}></Field.MultipleSelect>
873
+ <Field.TreeSelect label="分组名" __id="title11"></Field.TreeSelect>
874
+ <Field.Switch label="开关" __id="switch"></Field.Switch>
875
+ <Layout.FormGroupTitle title={"嘟嘟嘟嘟嘟"} />
876
+ <Field.CodeMachine label="角色编号" prompt="" __id="code"
877
+ withIds={["switch"]}
878
+ withVisibleFunc={(fieldsValue) => {
879
+ return fieldsValue?.switch ? true : false
880
+ }}
881
+ />
882
+
883
+ <div className=' fh-10 fw-full fbg-green-300' __id="div1111"
884
+ _componentName="Field.div"
885
+ withIds={["switch"]}
886
+ withVisibleFunc={(fieldsValue) => {
887
+ return fieldsValue?.switch ? true : false
888
+ }}>1111</div>
889
+ <Field.DatePicker defaultNow={true} label="datetime" prompt="" datetype="month" value='2022-10-22' __id="datetime" />
890
+ <Field.DatePicker label="datetime2" prompt="" datetype="date" __id="datetime2" />
891
+ <Field.DatePicker disabled={true} defaultNow={true} label="datetime3" prompt="" datetype="datetime" value={'2022-10-22'} __id="datetime3" />
892
+ <Field.DatePicker defaultNow={true} label="datetime4" prompt="" datetype="year" value={'2022-10-22'} __id="datetime4" />
893
+ <Field.Input label="角色名称" __id="name" />
894
+ <Layout.FormRow layout={'1,1'}>
895
+ <Field.Input label="角色名称布局" __id="name1" />
896
+ <Field.Input label="角色名称布局2" __id="name2" />
897
+ </Layout.FormRow>
898
+ <Field.CheckboxTree label="角色权限" __id="permissions" addRoot={false} treeData={treeData} />
899
+ <Layout.FormGroupTitle title={"关联信息"} />
900
+ <Field.WithMultipleSelect disabled={true} label="测试关联多选" options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} __id="remark12" />
901
+ <Layout.FormRow > <Field.TextArea label="备注" __id="remark" /></Layout.FormRow>
402
902
 
903
+ <Layout.FormRow layout={'1'}>
904
+ <Field.RadioGroup withIds={["remark11"]}
905
+ withFill={{
906
+ "value": [
907
+ {
908
+ "insert": {
909
+ "span": true
910
+ },
911
+ "attributes": {
912
+ "id": "remark11",
913
+ "color": "blue",
914
+ "tagKey": "fieldsValue",
915
+ "content": "测试关联单选"
916
+ }
917
+ },
918
+ ],
919
+ "version": 1719296886283,
920
+ "withData": [
921
+
922
+ ]
923
+ }} options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="单选框" __id="radio" ></Field.RadioGroup>
924
+ </Layout.FormRow>
925
+ <Layout.FormRow layout={'1'}>
926
+ <Field.CheckboxGroup options={[{ label: '选项1', value: '1' }, { label: '选项2', value: '2' }]} label="多选框" __id="CheckboxGroup" ></Field.CheckboxGroup>
927
+ </Layout.FormRow>
928
+ <Field.UploadFile label="上传文件" __id="UploadFile" ></Field.UploadFile>
929
+ <Field.UploadImage label="上传图片" __id="UploadImage" ></Field.UploadImage>
930
+
931
+ </FormContainerWrapper>
932
+ <div className="fgroup">11111
933
+ <div className="fbg-red-500 group-hover:fbg-blue-500">
934
+ Hover over me or my parent!
935
+ </div>
936
+ </div>
403
937
 
404
938
  </div>
405
939