lu-lowcode-package-form 0.11.80 → 0.11.81

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.
@@ -0,0 +1,1027 @@
1
+ import { FormContainer, Field, FormContainerWrapper, Layout, Setter, EditorQuill, EditorWang, EditorWang2, EditorWang3, WangEditor, WangEditorNext, Show } from './components';
2
+ import './App.css';
3
+ import { Button, Input, Select } from 'antd';
4
+ import React, { useCallback, useEffect, useState } from 'react';
5
+ import Draggable from 'react-draggable';
6
+ import { throttle, debounce } from 'lodash';
7
+ import { SortList } from "./components"
8
+ import { TinyMCEEditor } from './components'
9
+ import { PrinterOutlined } from '@ant-design/icons';
10
+ const searchSelectOptions = [
11
+ { id: 1, name: "1111" },
12
+ { id: 2, name: "2222" },
13
+ { id: 3, name: "3333" },
14
+ { id: 4, name: "4444" },
15
+ { id: 5, name: "5555" },
16
+ { id: 6, name: "6666" },
17
+ { id: 7, name: "7777" },
18
+ { id: 8, name: "8888" },
19
+ { id: 9, name: "9999" },
20
+ ]
21
+ const searchSelectRequest = async (params) => {
22
+ // console.log("params", params)
23
+ return await new Promise((resolve) => {
24
+ setTimeout(() => {
25
+ if (params && params?.name) {
26
+ resolve({ code: 0, data: searchSelectOptions.filter(item => item.name.includes(params.name)) })
27
+ }
28
+ resolve({ code: 0, data: searchSelectOptions })
29
+ }, 20);
30
+ })
31
+ }
32
+ const DraggableBtn = () => {
33
+ const [dragging, setDragging] = useState(false);
34
+
35
+ const handleStart = (e) => {
36
+ e.preventDefault();
37
+ setDragging(false);
38
+ };
39
+
40
+ const handleDrag = () => {
41
+ setDragging(true);
42
+ };
43
+
44
+ const handleStop = (e) => {
45
+ e.preventDefault();
46
+ if (!dragging) {
47
+ alert('Button clicked!');
48
+ }
49
+ };
50
+
51
+ return (
52
+ <Draggable
53
+ onStart={handleStart}
54
+ onDrag={handleDrag}
55
+ onStop={handleStop}
56
+ >
57
+ <button className="floating-button">Drag me!</button>
58
+ </Draggable>
59
+ );
60
+ }
61
+
62
+ const treeData = [
63
+ {
64
+ title: '0-1',
65
+ key: '0-1',
66
+ children: [
67
+ { title: '0-1-0-0', key: '0-1-0-0' },
68
+ { title: '0-1-0-1', key: '0-1-0-1' },
69
+ { title: '0-1-0-2', key: '0-1-0-2' },
70
+ ],
71
+ },
72
+ {
73
+ title: '0-2',
74
+ key: '0-2',
75
+ },
76
+ ];
77
+
78
+ function App() {
79
+ const formRef = React.createRef();
80
+ const testRef = React.useRef()
81
+ const [testCalcHidden, setTestCalcHidden] = useState(false);
82
+ const [readonly, setReadonly] = useState(true);
83
+
84
+ const testdebounce = useCallback(debounce((param1, param2) => {
85
+ console.log("testdebounce param1", param1)
86
+ console.log("testdebounce param2", param2)
87
+ }, 200))
88
+
89
+
90
+
91
+ const [cols, setCols] = React.useState(3);
92
+
93
+ const getFormFields = () => {
94
+ console.log("formRef?.current", formRef)
95
+ const formData = formRef?.current?.formRef?.getFieldsValue();
96
+ console.log("formData", JSON.stringify(formData));
97
+ }
98
+ // 验证
99
+ const validateFields = async () => {
100
+ try {
101
+ var values = await formRef?.current?.formRef?.validateFields({
102
+ validateOnly: false,
103
+ })
104
+ console.log("values", values)
105
+
106
+ } catch (error) {
107
+ console.log("error", error)
108
+ console.log(error.errorFields[0].errors[0])
109
+ }
110
+ }
111
+ const setFormFields = () => {
112
+ formRef?.current?.setFieldsValue({ "__id": 1, "userselect": "1213131", "remark11": { "label": "选项1", "value": "1", "name": "1111", "table": "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2},{\"price\":3,\"num\":3},{\"price\":3,\"num\":3}]" }, "table2": [{}], "table": [{ "product_num1": "123", "product_sum1": "", "node_oclxmzswzti": "", "select2": "", "switch_table": false, "remark11": { "label": "选项2", "value": "2" }, "product_price12": "", "tianchong1": { "label": "选项1", "value": "1", "tianchong2": { "label": "选项2", "value": "2" }, "tcinput1": "1111" }, "tianchong2": { "label": "选项2", "value": "2", "tcinput1": "8989", "tcinput2": "2222" }, "tcinput1": "8989", "tcinput2": "2222", "tcinput3": "2222" }, { "product_num1": "213", "product_sum1": "", "node_oclxmzswzti": "", "select2": "", "switch_table": false, "datetime2": "2024-08-22 11:09:07", "product_price13": 1, "product_price14": 2, "product_price12": "", "remark11": { "label": "选项3", "value": "3" }, "product_price11": 3 }], "product_total_price": "0.00", "DeptSelect": ["leaf11"], "PostSelect": ["parent 1-1", "leaf11"], "searchuser": [{ "id": 2, "name": "2222", "label": "2222", "value": 2 }, { "id": 4, "name": "4444", "label": "4444", "value": 4 }], "product_price": "213", "product_num": "21", "product_num_range": [1, 22], "product_sum": "4473", "switch": false, "datetime": "2024-08-25", "datetime2": "2024-08-25", "datetime3": "", "datetime4": "2024-08-22 11:09:04", "remark12": JSON.stringify([{ "label": "选项1", "value": "1" }, { "label": "选项2", "value": "2" }]) })
113
+ // formRef?.current?.setFieldsValue({"tianchong1":{"label":"选项1","value":"1"}, })
114
+ }
115
+ const handleCols = () => {
116
+
117
+ setCols(cols == 1 ? 3 : cols - 1)
118
+ }
119
+
120
+ const [items, setItems] = useState(['Item 1', 'Item 2', 'Item 3', 'Item 4']);
121
+
122
+ const handleUpdateReadonly = () => {
123
+ setReadonly(!readonly)
124
+ }
125
+
126
+ const [sortItems, setSortItems] = useState([{ id: 1, content: "sdfsfd" }, { id: 2, content: "sdfsfd2" }, { id: 3, content: "sdfsfd3" }]);
127
+ return (
128
+ <div className='fflex fflex-col fitems-center fh-screen '>
129
+ <div className='fflex fgap-2 fitems-center fjustify-center fw-full'>
130
+ <Button type="primary" onClick={() => {
131
+ setTestCalcHidden(!testCalcHidden)
132
+ }}>testCalcHidden</Button>
133
+ <Button type="primary" onClick={validateFields}>validateFields</Button>
134
+ <Button type="primary" onClick={getFormFields}>GetValues</Button>
135
+ <Button type="primary" onClick={setFormFields}>SetValues</Button>
136
+ <Button type="primary" onClick={() => {
137
+ console.log("testRef.current", testRef.current)
138
+ testRef.current?.handleChange({ label: '选项1', value: '1', name: "1111", table: "[{\"price\":1,\"num\":2},{\"price\":2,\"num\":2}]" })
139
+ }}>testwithref</Button>
140
+ <Button type="primary" onClick={handleCols}>UpdateCol</Button>
141
+ <Button type="primary" onClick={handleUpdateReadonly}>UpdateReadonly</Button>
142
+ </div>
143
+
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> */}
189
+ <div className='fw-[960px] frounded fbg-slate-50 fflex fflex-col fitems-center fpb-10'>
190
+
191
+
192
+ <FormContainerWrapper cols={cols} key={"formc"} className="" ref={formRef} >
193
+
194
+ <Field.Number label="税率" __id="fill_shuilv"
195
+ />
196
+ <Field.Input label="含税单价代理中转" __id="fill_xianghu4"
197
+ withIds={["fill_xianghu2","fill_shuilv"]}
198
+ withFill={{
199
+ "value": [
200
+ {
201
+ "insert": {
202
+ "span": true
203
+ },
204
+ "attributes": {
205
+ "id": "fill_xianghu2",
206
+ "color": "blue",
207
+ "tagKey": "fieldsValue",
208
+ "content": "当前表单.测试相互依赖"
209
+ }
210
+ },
211
+ {
212
+ "insert": "* (1+"
213
+ },
214
+ {
215
+ "insert": {
216
+ "span": true
217
+ },
218
+ "attributes": {
219
+ "id": "fill_shuilv",
220
+ "color": "blue",
221
+ "tagKey": "fieldsValue",
222
+ "content": "当前表单.测试相互依赖"
223
+ }
224
+ },
225
+ {
226
+ "insert": ")"
227
+ },
228
+ {
229
+ "insert": "\n\n"
230
+ }
231
+ ],
232
+ "version": 1719296886283,
233
+ "withData": [
234
+
235
+ ]
236
+ }}
237
+ />
238
+ <Field.Input label="含税单价" __id="fill_xianghu1"
239
+ withIds={["fill_xianghu6"]}
240
+ withFill={{
241
+ "value": [
242
+ {
243
+ "insert": {
244
+ "span": true
245
+ },
246
+ "attributes": {
247
+ "id": "fill_xianghu6",
248
+ "color": "blue",
249
+ "tagKey": "fieldsValue",
250
+ "content": "当前表单.测试相互依赖"
251
+ }
252
+ },
253
+ {
254
+ "insert": "* 0.5"
255
+ },
256
+ {
257
+ "insert": "\n\n"
258
+ }
259
+ ],
260
+ "version": 1719296886283,
261
+ "withData": [
262
+
263
+ ]
264
+ }}
265
+ />
266
+
267
+ <Field.Input label="未税单价" __id="fill_xianghu2"
268
+ withIds={["fill_xianghu1","fill_shuilv"]}
269
+ withFill={{
270
+ "value": [
271
+ {
272
+ "insert": {
273
+ "span": true
274
+ },
275
+ "attributes": {
276
+ "id": "fill_xianghu1",
277
+ "color": "blue",
278
+ "tagKey": "fieldsValue",
279
+ "content": "当前表单.测试相互依赖"
280
+ }
281
+ },
282
+ {
283
+ "insert": "/ (1+"
284
+ },
285
+ {
286
+ "insert": {
287
+ "span": true
288
+ },
289
+ "attributes": {
290
+ "id": "fill_shuilv",
291
+ "color": "blue",
292
+ "tagKey": "fieldsValue",
293
+ "content": "当前表单.测试相互依赖"
294
+ }
295
+ },
296
+ {
297
+ "insert": ")"
298
+ },
299
+ {
300
+ "insert": "\n\n"
301
+ }
302
+ ],
303
+ "version": 1719296886283,
304
+ "withData": [
305
+
306
+ ]
307
+ }}
308
+ />
309
+
310
+ <Field.Input label="客户单价" __id="fill_xianghu3"
311
+ withIds={["fill_xianghu4"]}
312
+ withFill={{
313
+ "value": [
314
+ {
315
+ "insert": {
316
+ "span": true
317
+ },
318
+ "attributes": {
319
+ "id": "fill_xianghu4",
320
+ "color": "blue",
321
+ "tagKey": "fieldsValue",
322
+ "content": "当前表单.测试相互依赖"
323
+ }
324
+ },
325
+ {
326
+ "insert": "/ 0.5"
327
+ },
328
+ {
329
+ "insert": "\n\n"
330
+ }
331
+ ],
332
+ "version": 1719296886283,
333
+ "withData": [
334
+
335
+ ]
336
+ }}
337
+ />
338
+
339
+ <Field.Input label="客户单价中转" __id="fill_xianghu6"
340
+ withIds={["fill_xianghu5","fill_shuilv"]}
341
+ withFill={{
342
+ "value": [
343
+ {
344
+ "insert": {
345
+ "span": true
346
+ },
347
+ "attributes": {
348
+ "id": "fill_xianghu5",
349
+ "color": "blue",
350
+ "tagKey": "fieldsValue",
351
+ "content": "当前表单.测试相互依赖"
352
+ }
353
+ },
354
+ {
355
+ "insert": "* (1+"
356
+ },
357
+
358
+ {
359
+ "insert": {
360
+ "span": true
361
+ },
362
+ "attributes": {
363
+ "id": "fill_shuilv",
364
+ "color": "blue",
365
+ "tagKey": "fieldsValue",
366
+ "content": "当前表单.测试相互依赖"
367
+ }
368
+ },
369
+ {
370
+ "insert": ")"
371
+ },
372
+ {
373
+ "insert": "\n\n"
374
+ }
375
+ ],
376
+ "version": 1719296886283,
377
+ "withData": [
378
+
379
+ ]
380
+ }}
381
+ />
382
+
383
+
384
+ <Field.Input label="客户未税单价" __id="fill_xianghu5"
385
+ withIds={["fill_xianghu3","fill_shuilv"]}
386
+ withFill={{
387
+ "value": [
388
+ {
389
+ "insert": {
390
+ "span": true
391
+ },
392
+ "attributes": {
393
+ "id": "fill_xianghu3",
394
+ "color": "blue",
395
+ "tagKey": "fieldsValue",
396
+ "content": "当前表单.测试相互依赖"
397
+ }
398
+ },
399
+ {
400
+ "insert": "/ (1+"
401
+ },
402
+
403
+ {
404
+ "insert": {
405
+ "span": true
406
+ },
407
+ "attributes": {
408
+ "id": "fill_shuilv",
409
+ "color": "blue",
410
+ "tagKey": "fieldsValue",
411
+ "content": "当前表单.测试相互依赖"
412
+ }
413
+ },
414
+ {
415
+ "insert": ")"
416
+ },
417
+ {
418
+ "insert": "\n\n"
419
+ }
420
+ ],
421
+ "version": 1719296886283,
422
+ "withData": [
423
+
424
+ ]
425
+ }}
426
+ />
427
+
428
+ <Field.WithSingleSelect
429
+ ref={testRef}
430
+ request={async (params) => {
431
+ return {
432
+ code: 0, data: {
433
+ list:
434
+ [
435
+ { label: '选项1', value: '1', routeType: 1 },
436
+ { label: '选项2', value: '2', routeType: 2 },
437
+ { label: '选项3', value: '3' }
438
+ ]
439
+ }
440
+ }
441
+ }}
442
+ option_label="label"
443
+ option_value="value"
444
+ fillRules={[
445
+ {
446
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
447
+ "type": 0,
448
+ "source": "routeType",
449
+ "target": "routeType",
450
+ },
451
+
452
+ ]} label="类型填充" __id="fill_routeType" />
453
+ <Field.RadioGroup
454
+ buttonStyle="solid"
455
+ label="菜单类型"
456
+ __id="routeType"
457
+ defaultValue={2}
458
+ options={[{ label: "菜单分组", value: 999 }, { label: "URL", value: 1 }, { label: "绑定表单", value: 2 }]} />
459
+
460
+
461
+ <Field.Input label="测试 withVisible" __id="withVisible"
462
+ isRequired={true}
463
+ withIds={["routeType"]}
464
+ withVisible={{
465
+ "value": [
466
+ {
467
+ "insert": {
468
+ "span": true
469
+ },
470
+ "attributes": {
471
+ "id": "routeType",
472
+ "color": "blue",
473
+ "tagKey": "fieldsValue",
474
+ "content": "当前表单.开关"
475
+ }
476
+ },
477
+ {
478
+ "insert": " == 1\n"
479
+ }
480
+ ],
481
+ "version": 1734400834533,
482
+ "withData": [
483
+
484
+ ]
485
+ }}
486
+ />
487
+ <Field.Input label="测试 withVisible2" __id="withVisible2"
488
+ isRequired={true}
489
+ withIds={["routeType"]}
490
+ withVisible={{
491
+ "value": [
492
+ {
493
+ "insert": {
494
+ "span": true
495
+ },
496
+ "attributes": {
497
+ "id": "routeType",
498
+ "color": "blue",
499
+ "tagKey": "fieldsValue",
500
+ "content": "当前表单.开关2"
501
+ }
502
+ },
503
+ {
504
+ "insert": " == 2\n"
505
+ }
506
+ ],
507
+ "version": 1734400834533,
508
+ "withData": [
509
+
510
+ ]
511
+ }}
512
+ />
513
+ <Field.Input label="测试 withVisible21" __id="withVisible21"
514
+ isRequired={true}
515
+ withIds={["routeType"]}
516
+ withVisible={{
517
+ "value": [
518
+ {
519
+ "insert": {
520
+ "span": true
521
+ },
522
+ "attributes": {
523
+ "id": "routeType",
524
+ "color": "blue",
525
+ "tagKey": "fieldsValue",
526
+ "content": "当前表单.开关2"
527
+ }
528
+ },
529
+ {
530
+ "insert": " == 2\n"
531
+ }
532
+ ],
533
+ "version": 1734400834533,
534
+ "withData": [
535
+
536
+ ]
537
+ }}
538
+ />
539
+ <Field.Select label="绑定表单"
540
+ option_label={"formTitle"}
541
+ __id="menuFormTemplateId"
542
+ withIds={["routeType"]}
543
+ withVisibleFunc={(fieldsValue) => {
544
+ const result = fieldsValue?.routeType == 2 ? true : false
545
+ // console.log("withVisibleFunc menuFormTemplateId", fieldsValue)
546
+ // console.log("withVisibleFunc menuFormTemplateId result", result)
547
+ return result
548
+ }} />
549
+
550
+
551
+ <Field.Input label="隐藏字段" __id="hidden1"
552
+ calcHidden={true}
553
+ />
554
+
555
+ <Field.Input label="菜单URL" __id="route"
556
+ withIds={["routeType"]}
557
+ withVisibleFunc={(fieldsValue) => {
558
+ const result = fieldsValue?.routeType == 1 ? true : false
559
+ // console.log("withVisibleFunc route", fieldsValue)
560
+ // console.log("withVisibleFunc route result", result)
561
+ return result
562
+ }} />
563
+ <Field.TextArea label="备注" __id="remark"
564
+ withIds={["routeType"]}
565
+ withVisibleFunc={(fieldsValue) => {
566
+ return fieldsValue?.routeType != 999 ? true : false
567
+ }}
568
+ />
569
+
570
+ <Field.WithSingleSelect
571
+ ref={testRef}
572
+ request={async (params) => {
573
+ console.log("request params", params)
574
+ return {
575
+ code: 0, data: {
576
+ list:
577
+ [
578
+ { label: '选项1', value: '1', table_fill: [{ fill_shuilv:0.13, fill_tianchong1: { label: '选项1', value: '1' }, fill_tianchong2: { label: '选项2', value: '2' } },{ fill_shuilv:0.13, fill_tianchong1: { label: '选项1', value: '1' }, fill_tianchong2: { label: '选项2', value: '2' } }] },
579
+ { label: '选项2', value: '2' },
580
+ { label: '选项3', value: '3' }
581
+ ]
582
+ }
583
+ }
584
+ }}
585
+ option_label="label"
586
+ option_value="value"
587
+ fillRules={[
588
+ {
589
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
590
+ "type": 1,
591
+ "source": "table_fill",
592
+ "target": "table_fill",
593
+ "subRules": [
594
+ {
595
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
596
+ "type": 0,
597
+ "source": "fill_tianchong1",
598
+ "target": "fill_tianchong1",
599
+ },
600
+ {
601
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
602
+ "type": 0,
603
+ "source": "fill_shuilv",
604
+ "target": "fill_shuilv",
605
+ },
606
+ ]
607
+ },
608
+
609
+ ]} label="子表填充数据源" __id="fill_datasource1" />
610
+ <Layout.FormRow layout={'1'}>
611
+ <Field.Table label="测试主子表填充" __id="table_fill" isAllowAdd={true} isAllowCopy={true} hideEditMode={true} columnsWidth={[100,200,300,400,500,600,700,800,900,1000]}>
612
+ <Field.Number label="税率" __id="fill_shuilv"
613
+ />
614
+ <Field.Input label="含税单价代理中转" __id="fill_xianghu4"
615
+ withIds={["table_fill.fill_xianghu2","table_fill.fill_shuilv"]}
616
+ withFill={{
617
+ "value": [
618
+ {
619
+ "insert": {
620
+ "span": true
621
+ },
622
+ "attributes": {
623
+ "id": "table_fill.fill_xianghu2",
624
+ "color": "blue",
625
+ "tagKey": "fieldsValue",
626
+ "content": "当前表单.测试相互依赖"
627
+ }
628
+ },
629
+ {
630
+ "insert": "* (1+"
631
+ },
632
+ {
633
+ "insert": {
634
+ "span": true
635
+ },
636
+ "attributes": {
637
+ "id": "table_fill.fill_shuilv",
638
+ "color": "blue",
639
+ "tagKey": "fieldsValue",
640
+ "content": "当前表单.测试相互依赖"
641
+ }
642
+ },
643
+ {
644
+ "insert": ")"
645
+ },
646
+ {
647
+ "insert": "\n\n"
648
+ }
649
+ ],
650
+ "version": 1719296886283,
651
+ "withData": [
652
+
653
+ ]
654
+ }}
655
+ />
656
+ <Field.Input label="含税单价" __id="fill_xianghu1"
657
+ withIds={["table_fill.fill_xianghu6"]}
658
+ withFill={{
659
+ "value": [
660
+ {
661
+ "insert": {
662
+ "span": true
663
+ },
664
+ "attributes": {
665
+ "id": "table_fill.fill_xianghu6",
666
+ "color": "blue",
667
+ "tagKey": "fieldsValue",
668
+ "content": "当前表单.测试相互依赖"
669
+ }
670
+ },
671
+ {
672
+ "insert": "* 0.5"
673
+ },
674
+ {
675
+ "insert": "\n\n"
676
+ }
677
+ ],
678
+ "version": 1719296886283,
679
+ "withData": [
680
+
681
+ ]
682
+ }}
683
+ />
684
+
685
+ <Field.Input label="未税单价" __id="fill_xianghu2"
686
+ withIds={["table_fill.fill_xianghu1","table_fill.fill_shuilv"]}
687
+ withFill={{
688
+ "value": [
689
+ {
690
+ "insert": {
691
+ "span": true
692
+ },
693
+ "attributes": {
694
+ "id": "table_fill.fill_xianghu1",
695
+ "color": "blue",
696
+ "tagKey": "fieldsValue",
697
+ "content": "当前表单.测试相互依赖"
698
+ }
699
+ },
700
+ {
701
+ "insert": "/ (1+"
702
+ },
703
+ {
704
+ "insert": {
705
+ "span": true
706
+ },
707
+ "attributes": {
708
+ "id": "table_fill.fill_shuilv",
709
+ "color": "blue",
710
+ "tagKey": "fieldsValue",
711
+ "content": "当前表单.测试相互依赖"
712
+ }
713
+ },
714
+ {
715
+ "insert": ")"
716
+ },
717
+ {
718
+ "insert": "\n\n"
719
+ }
720
+ ],
721
+ "version": 1719296886283,
722
+ "withData": [
723
+
724
+ ]
725
+ }}
726
+ />
727
+
728
+ <Field.Input label="客户单价" __id="fill_xianghu3"
729
+ withIds={["table_fill.fill_xianghu4"]}
730
+ withFill={{
731
+ "value": [
732
+ {
733
+ "insert": {
734
+ "span": true
735
+ },
736
+ "attributes": {
737
+ "id": "table_fill.fill_xianghu4",
738
+ "color": "blue",
739
+ "tagKey": "fieldsValue",
740
+ "content": "当前表单.测试相互依赖"
741
+ }
742
+ },
743
+ {
744
+ "insert": "/ 0.5"
745
+ },
746
+ {
747
+ "insert": "\n\n"
748
+ }
749
+ ],
750
+ "version": 1719296886283,
751
+ "withData": [
752
+
753
+ ]
754
+ }}
755
+ />
756
+
757
+ <Field.Input label="客户单价中转" __id="fill_xianghu6"
758
+ withIds={["table_fill.fill_xianghu5","table_fill.fill_shuilv"]}
759
+ withFill={{
760
+ "value": [
761
+ {
762
+ "insert": {
763
+ "span": true
764
+ },
765
+ "attributes": {
766
+ "id": "table_fill.fill_xianghu5",
767
+ "color": "blue",
768
+ "tagKey": "fieldsValue",
769
+ "content": "当前表单.测试相互依赖"
770
+ }
771
+ },
772
+ {
773
+ "insert": "* (1+"
774
+ },
775
+
776
+ {
777
+ "insert": {
778
+ "span": true
779
+ },
780
+ "attributes": {
781
+ "id": "table_fill.fill_shuilv",
782
+ "color": "blue",
783
+ "tagKey": "fieldsValue",
784
+ "content": "当前表单.测试相互依赖"
785
+ }
786
+ },
787
+ {
788
+ "insert": ")"
789
+ },
790
+ {
791
+ "insert": "\n\n"
792
+ }
793
+ ],
794
+ "version": 1719296886283,
795
+ "withData": [
796
+
797
+ ]
798
+ }}
799
+ />
800
+
801
+
802
+ <Field.Input label="客户未税单价" __id="fill_xianghu5"
803
+ withIds={["table_fill.fill_xianghu3","table_fill.fill_shuilv"]}
804
+ withFill={{
805
+ "value": [
806
+ {
807
+ "insert": {
808
+ "span": true
809
+ },
810
+ "attributes": {
811
+ "id": "table_fill.fill_xianghu3",
812
+ "color": "blue",
813
+ "tagKey": "fieldsValue",
814
+ "content": "当前表单.测试相互依赖"
815
+ }
816
+ },
817
+ {
818
+ "insert": "/ (1+"
819
+ },
820
+
821
+ {
822
+ "insert": {
823
+ "span": true
824
+ },
825
+ "attributes": {
826
+ "id": "table_fill.fill_shuilv",
827
+ "color": "blue",
828
+ "tagKey": "fieldsValue",
829
+ "content": "当前表单.测试相互依赖"
830
+ }
831
+ },
832
+ {
833
+ "insert": ")"
834
+ },
835
+ {
836
+ "insert": "\n\n"
837
+ }
838
+ ],
839
+ "version": 1719296886283,
840
+ "withData": [
841
+
842
+ ]
843
+ }}
844
+ />
845
+
846
+
847
+ <Field.Number label="数量" __id="fill_shuliang"/>
848
+ <Field.Input label="未税金额" __id="fill_weishu5"
849
+ withIds={["table_fill.fill_xianghu3","table_fill.fill_shuliang","table_fill.fill_shuilv"]}
850
+ withFill={{
851
+ "value": [
852
+ {
853
+ "insert": {
854
+ "span": true
855
+ },
856
+ "attributes": {
857
+ "id": "table_fill.fill_xianghu3",
858
+ "color": "blue",
859
+ "tagKey": "fieldsValue",
860
+ "content": "当前表单.测试相互依赖"
861
+ }
862
+ },
863
+ {
864
+ "insert": "/ (1+"
865
+ },
866
+
867
+ {
868
+ "insert": {
869
+ "span": true
870
+ },
871
+ "attributes": {
872
+ "id": "table_fill.fill_shuilv",
873
+ "color": "blue",
874
+ "tagKey": "fieldsValue",
875
+ "content": "当前表单.测试相互依赖"
876
+ }
877
+ },
878
+ {
879
+ "insert": ") * "
880
+ },
881
+
882
+ {
883
+ "insert": {
884
+ "span": true
885
+ },
886
+ "attributes": {
887
+ "id": "table_fill.fill_shuliang",
888
+ "color": "blue",
889
+ "tagKey": "fieldsValue",
890
+ "content": "当前表单.测试相互依赖"
891
+ }
892
+ },
893
+ {
894
+ "insert": "\n\n"
895
+ }
896
+ ],
897
+ "version": 1719296886283,
898
+ "withData": [
899
+
900
+ ]
901
+ }}
902
+ />
903
+ <Field.WithSingleSelect
904
+ ref={testRef}
905
+ request={async (params) => {
906
+ console.log("request params", params)
907
+ 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' }] } }
908
+ }}
909
+ option_label="label"
910
+ option_value="value"
911
+ fillRules={[
912
+ {
913
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b19",
914
+ "type": 0,
915
+ "source": "fill_tianchong2",
916
+ "target": "fill_tianchong2",
917
+ "subRules": [
918
+ ]
919
+ },
920
+ {
921
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b11",
922
+ "type": 0,
923
+ "source": "fill_tcinput1",
924
+ "target": "fill_tcinput1",
925
+ "subRules": [
926
+ ]
927
+ },
928
+
929
+ ]} label="测试填充1" __id="fill_tianchong1" />
930
+ <Field.WithSingleSelect
931
+ ref={testRef}
932
+ request={async (params) => {
933
+ console.log("测试填充2 reqeust", params)
934
+ if (!params?.value) return { code: 0, data: { list: [{ label: '选项1', value: '1', }] } }
935
+ await new Promise(resolve => setTimeout(resolve, 200))
936
+ return { code: 0, data: { list: [{ label: '选项1', value: '1', }, { label: '选项2', value: '2', fill_tcinput1: "8989", fill_tcinput2: "2222" }, { label: '选项3', value: '3' }] } }
937
+ }}
938
+ option_label="label"
939
+ option_value="value"
940
+ option_search="label"
941
+ fillRules={[
942
+ {
943
+ "id": "636d3924-0298-4e9b-809a-16d4a10d7b29",
944
+ "type": 0,
945
+ "source": "fill_tcinput1",
946
+ "target": "fill_tcinput1",
947
+ "subRules": [
948
+ ]
949
+ },
950
+ {
951
+ "id": "636d3924-0298-4e9b-809a-26d4a10d7b29",
952
+ "type": 0,
953
+ "source": "fill_tcinput2",
954
+ "target": "fill_tcinput2",
955
+ "subRules": [
956
+ ]
957
+ },
958
+
959
+ ]} label="测试填充2" __id="fill_tianchong2" />
960
+ <Field.Input label="测试被填充1" __id="fill_tcinput1" />
961
+ <Field.Input label="测试被填充2" __id="fill_tcinput2" />
962
+ <Field.Input label="测试被填充计算" __id="fill_tcinput3"
963
+ withIds={["table_fill.fill_tcinput2"]}
964
+ withFill={{
965
+ "value": [
966
+ {
967
+ "insert": {
968
+ "span": true
969
+ },
970
+ "attributes": {
971
+ "id": "table_fill.fill_tcinput2",
972
+ "color": "blue",
973
+ "tagKey": "fieldsValue",
974
+ "content": "当前表单.测试被填充2"
975
+ }
976
+ },
977
+ {
978
+ "insert": "* 0.5"
979
+ },
980
+ {
981
+ "insert": "\n\n"
982
+ }
983
+ ],
984
+ "version": 1719296886283,
985
+ "withData": [
986
+
987
+ ]
988
+ }}
989
+ />
990
+
991
+ </Field.Table>
992
+ </Layout.FormRow>
993
+ <Field.Input label="测试计算汇总" __id="huizong1"
994
+ withIds={["table_fill.fill_tcinput3"]}
995
+ withFill={{
996
+ "value": [
997
+ {
998
+ "insert": {
999
+ "span": true
1000
+ },
1001
+ "attributes": {
1002
+ "id": "table_fill.fill_tcinput3",
1003
+ "color": "blue",
1004
+ "tagKey": "fieldsValue",
1005
+ "content": "当前表单.测试被填充计算"
1006
+ }
1007
+ },
1008
+ ]
1009
+ }}
1010
+ />
1011
+ </FormContainerWrapper>
1012
+ <div className="fgroup">11111
1013
+ <div className="fbg-red-500 group-hover:fbg-blue-500">
1014
+ Hover over me or my parent!
1015
+ </div>
1016
+ </div>
1017
+
1018
+ </div>
1019
+
1020
+ </div>
1021
+ </div>
1022
+ );
1023
+ }
1024
+
1025
+ export default App;
1026
+
1027
+ export { FormContainer, Field, FormContainerWrapper } from './components'