@cniot/android-pda-components 2.0.0-beta.2 → 2.0.0-beta.21

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.
@@ -23,120 +23,130 @@ import {
23
23
  TableV2,
24
24
  PageFlowSystemPagesV2,
25
25
  DatePickerV2,
26
- } from '../../packages';
26
+ InputFieldV2,
27
+ useFieldV2,
28
+ } from "../../packages";
27
29
  import { Button, List } from "antd-mobile";
28
- import './index.less'
29
-
30
+ import "./index.less";
30
31
 
31
32
  const typePropsMap = {
32
33
  normal: {
33
- header: < div > 标题内容</div>,
34
- headerExtra:
35
- {
34
+ header: <div> 标题内容</div>,
35
+ headerExtra: {
36
36
  tag: {
37
- text: '进行中',
37
+ text: "进行中",
38
38
  // type: 'normal'
39
39
  },
40
- desc: 'A1-098',
41
- showRightIcon: true
40
+ desc: "A1-098",
41
+ showRightIcon: true,
42
42
  },
43
43
  footer: [
44
44
  {
45
- type: 'primary',
46
- buttonText: 'primary',
45
+ type: "primary",
46
+ buttonText: "primary",
47
47
  // disabled:true,
48
48
  fullWidth: true,
49
49
  },
50
50
 
51
51
  {
52
- type: 'secondary',
53
- buttonText: 'secondary',
52
+ type: "secondary",
53
+ buttonText: "secondary",
54
54
  // disabled:true,
55
55
  },
56
56
  {
57
- type: 'normal',
58
- buttonText: 'normal',
57
+ type: "normal",
58
+ buttonText: "normal",
59
59
  // disabled:true,
60
60
  },
61
61
  {
62
- type: 'primary',
63
- buttonText: 'primary',
64
- text: true
62
+ type: "primary",
63
+ buttonText: "primary",
64
+ text: true,
65
65
  },
66
66
  {
67
- type: 'normal',
68
- buttonText: 'normal',
69
- text: true
67
+ type: "normal",
68
+ buttonText: "normal",
69
+ text: true,
70
70
  },
71
71
  {
72
- type: 'warning',
73
- buttonText: 'warning',
74
- text: true
72
+ type: "warning",
73
+ buttonText: "warning",
74
+ text: true,
75
75
  },
76
76
  {
77
- type: 'warning',
78
- buttonText: 'warning',
77
+ type: "warning",
78
+ buttonText: "warning",
79
79
  },
80
80
  {
81
- type: 'warning-secondary',
82
- buttonText: 'warning-secondary',
81
+ type: "warning-secondary",
82
+ buttonText: "warning-secondary",
83
83
  },
84
- ]
85
-
84
+ ],
86
85
  },
87
86
  goods: {
88
87
  header: {
89
- goodsImage: 'https://gw.alicdn.com/imgextra/i1/O1CN01PemlAa1msAsAIrq7j_!!6000000005009-0-tps-500-500.jpg',
90
- goodsName: '礼盒套装CXW-358-EMG',
91
- goodsCode: '10290010010',
88
+ goodsImage:
89
+ "https://gw.alicdn.com/imgextra/i1/O1CN01PemlAa1msAsAIrq7j_!!6000000005009-0-tps-500-500.jpg",
90
+ goodsName: "礼盒套装CXW-358-EMG",
91
+ goodsCode: "10290010010",
92
92
  // extra:'单位:件',
93
- attrs: ['单位:件', '常温 | 避光 | 贵品',],
93
+ attrs: ["单位:件", "常温 | 避光 | 贵品"],
94
94
  tags: [
95
95
  {
96
- text: '唯一码',
97
- type: 'warning',
98
- backgroundColor: '#FEF0D6'
99
- }, {
100
- text: '单元',
101
- type: 'success'
102
- }
96
+ text: "唯一码",
97
+ type: "warning",
98
+ backgroundColor: "#FEF0D6",
99
+ },
100
+ {
101
+ text: "单元",
102
+ type: "success",
103
+ },
103
104
  ],
104
105
  },
105
106
  footer: {
106
- label: '',
107
+ label: "",
107
108
  realNum: 8,
108
109
  planNum: 10,
109
- }
110
+ },
110
111
  },
111
112
  list: {
112
- footer: 'A-9-087'
113
+ footer: "A-9-087",
113
114
  },
114
115
  tip: {
115
116
  content: {
116
- label: '标题',
117
- value: 'A-01-0908',
117
+ label: "标题",
118
+ value: "A-01-0908",
118
119
  tag: {
119
- type: 'time',
120
- text: '01:24',
120
+ type: "time",
121
+ text: "01:24",
121
122
  // icon:''
122
- }
123
- }
124
- }
125
- }
123
+ },
124
+ },
125
+ },
126
+ };
126
127
 
127
128
  export default function (props) {
128
- const { data, onNext = (message) => { console.log(`message:======`, message); } } = props;
129
+ const {
130
+ data,
131
+ onNext = (message) => {
132
+ console.log(`message:======`, message);
133
+ },
134
+ } = props;
135
+ const [val, setVal] = useState();
136
+ const [val1, setVal1] = useState();
129
137
  const [showConfirm, setShowConfirm] = useState(false);
130
138
  const [showToast, setShowToast] = useState(false);
131
139
  const [showAlert, setShowAlert] = useState(false);
132
140
  const [showPrompt, setShowPrompt] = useState(false);
133
141
  const [showPopup, setShowPopup] = useState(false);
134
142
  let type;
135
- type = 'normal'
143
+ type = "normal";
136
144
  // type = 'goods'
137
- type = 'list'
145
+ type = "list";
138
146
  // type = 'tip'
139
147
 
148
+ const field = useFieldV2();
149
+
140
150
  const showMap = {
141
151
  LayoutV2: true,
142
152
  FinishCardV2: true,
@@ -145,6 +155,7 @@ export default function (props) {
145
155
  ButtonV2Group: true,
146
156
  TagV2: true,
147
157
  NumberPickerV2: true,
158
+ InputFieldV2: true,
148
159
  InputV2: true,
149
160
  ProgressBarV2: true,
150
161
  CardV2: true,
@@ -161,10 +172,25 @@ export default function (props) {
161
172
  TableV2: true,
162
173
  PageFlowSystemPagesV2: true,
163
174
  DatePickerV2: true,
164
- }
175
+ };
165
176
  const ImageUploaderV2Component = () => {
166
177
  const [images, setImg] = React.useState([]);
167
- setTimeout(() => { setImg([{ id: 1, url: "https://images.unsplash.com/photo-1624993590528-4ee743c9896e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=200&h=1000&q=80", }, { id: 2, url: "https://images.unsplash.com/photo-1601128533718-374ffcca299b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=3128&q=80", }, { id: 3, url: "https://images.unsplash.com/photo-1567945716310-4745a6b7844b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=300&q=60", },]); }, 1000);
178
+ setTimeout(() => {
179
+ setImg([
180
+ {
181
+ id: 1,
182
+ url: "https://images.unsplash.com/photo-1624993590528-4ee743c9896e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=200&h=1000&q=80",
183
+ },
184
+ {
185
+ id: 2,
186
+ url: "https://images.unsplash.com/photo-1601128533718-374ffcca299b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=3128&q=80",
187
+ },
188
+ {
189
+ id: 3,
190
+ url: "https://images.unsplash.com/photo-1567945716310-4745a6b7844b?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=300&q=60",
191
+ },
192
+ ]);
193
+ }, 1000);
168
194
  return (
169
195
  <div>
170
196
  <p>ImageUploader 图片上传</p>
@@ -186,382 +212,737 @@ export default function (props) {
186
212
  />
187
213
  </div>
188
214
  );
189
- }
215
+ };
190
216
  const components = {
191
- LatticeMouthV2: <>投篮指引<LatticeMouthV2 row={3} col={3} dataSource={[{ value: "highlight", label: "2", color: "highlight" }, { value: "active", label: "2", color: "active" }, { value: "default", label: "2", color: "default" }, { value: "complete", label: "2", color: "complete" }, { value: "error", label: "2", color: "error" }, { value: "自定义", label: "2", style: { "--font-size": "18px", "--background-color": "#ffffff", "--color": "#f30f30", "--label-background-color": "rgba(0,0,0,0.3)" } }]} /></>,
192
- ImageUploaderV2: <ImageUploaderV2Component />,
193
- HeaderV2: <HeaderV2
194
- onBack={() => { }}
195
- actions={[
196
- {
197
- label: "功能1",
198
- value: "",
199
- onClick() {
200
- alert("功能1");
217
+ HeaderV2: (
218
+ <HeaderV2
219
+ onBack={() => {}}
220
+ actions={[
221
+ {
222
+ label: "功能1",
223
+ value: "",
224
+ onClick() {
225
+ alert("功能1");
226
+ },
201
227
  },
202
- },
203
- {
204
- label: "功能2",
205
- value: "",
206
- onClick() {
207
- alert("功能2");
228
+ {
229
+ label: "功能2",
230
+ value: "",
231
+ onClick() {
232
+ alert("功能2");
233
+ },
208
234
  },
209
- },
210
- ]}
211
- >
212
- 标准页面
213
- </HeaderV2>,
214
-
215
- ButtonV2FullWidth: <div style={{ backgroundColor: '#ffffff', height: 90, padding: 10, margin: '10px 0' }}>
216
- ButtonV2FullWidth
217
- <ButtonV2 type='primary' fullWidth onClick={() => { console.log(`primary button click===`); }}>提交</ButtonV2>
218
- </div>,
219
-
220
- ButtonV2Group: <div style={{ backgroundColor: '#ffffff', height: 90, padding: '10px 0', margin: '10px 0' }}>
221
- ButtonV2Group
222
- <ButtonV2.Group>
223
- <ButtonV2 type='primary' fullWidth onClick={() => { console.log(`primary button click===`); }}>提交</ButtonV2>
224
- <ButtonV2 fullWidth onClick={() => { console.log(`primary button click===`); }}>取消</ButtonV2>
225
- </ButtonV2.Group>
226
- </div>,
227
-
228
- TagV2: <div style={{ backgroundColor: '#ffffff', display: 'flex', flexWrap: 'wrap', gap: 4, padding: 10, margin: '10px 0' }}>
229
- TagV2
230
- <TagV2 type='data-change'>data-change</TagV2>
231
- <TagV2 type='normal'>normal'</TagV2>
232
- <TagV2 type='warning'>warning'</TagV2>
233
- <TagV2 type='almost-warning'>almost-warning</TagV2>
234
- <TagV2 type='warning-end'>warning-end</TagV2>
235
- </div>,
235
+ ]}
236
+ >
237
+ 标准页面
238
+ </HeaderV2>
239
+ ),
240
+ // ScanV2: (
241
+ // <ScanV2
242
+ // label="扫描"
243
+ // placeholder="请扫描"
244
+ // onScan={(value) => {
245
+ // console.log("scan value", value);
246
+ // }}
247
+ // ></ScanV2>
248
+ // ),
249
+ InputFieldV2: (
250
+ <div>
251
+ 独立输入框
252
+ {/* <input
253
+ value={val}
254
+ onChange={(val) => {
255
+ setVal(val?.target?.value);
256
+ }}
257
+ />
258
+ <button
259
+ onClick={() => {
260
+ setVal(null);
261
+ }}
262
+ >
263
+ dddd
264
+ </button> */}
265
+ <InputFieldV2
266
+ label="文本输入框"
267
+ // labelRowCharNum={4}
268
+ // component={() => {
269
+ // // return <input placeholder="独立输入框"></input>;
270
+ // // return <input>component 可能需要自己维护 校验逻辑等</input>;
271
+ // }}
272
+ type="input"
273
+ componentProps={{}}
274
+ validator={(val) => {
275
+ // return Number(val) > 9 ? "不能大于9" : null;
276
+ return Number(val) > 9
277
+ ? {
278
+ title: "输入错误",
279
+ level: "error",
280
+ message: "不能大于9",
281
+ duration: 5000,
282
+ }
283
+ : null;
284
+ }}
285
+ validateTriggerType="onBlur" // onChange
286
+ onChange={(val) => {
287
+ setVal(val);
288
+ }}
289
+ value={val}
290
+ clearWhenValidateError
291
+ />
292
+ <InputFieldV2
293
+ showIcon={false}
294
+ label="选择"
295
+ // labelRowCharNum={4}
296
+ // component={() => {
297
+ // // return <input placeholder="独立输入框"></input>;
298
+ // // return <input>component 可能需要自己维护 校验逻辑等</input>;
299
+ // }}
300
+ type="select"
301
+ componentProps={{
302
+ dataSource: [
303
+ { label: "1", value: "1" },
304
+ { label: "2", value: "2" },
305
+ ],
306
+ }}
307
+ validator={(val) => {
308
+ // return Number(val) <= 0 ? "必须大于0" : null;
309
+ return val === "1"
310
+ ? {
311
+ title: "输入错误",
312
+ level: "error",
313
+ message: "必须大于0",
314
+ duration: 5000,
315
+ }
316
+ : null;
317
+ }}
318
+ validateTriggerType="onChange" // onChange
319
+ clearWhenValidateError
320
+ onChange={(val) => {
321
+ console.log(`val:======`, val);
322
+ setVal1(val);
323
+ }}
324
+ value={val1}
325
+ />
326
+ <InputFieldV2
327
+ label="数字输入"
328
+ // labelRowCharNum={6}
329
+ // component={() => {
330
+ // // return <input placeholder="独立输入框"></input>;
331
+ // // return <input>component 可能需要自己维护 校验逻辑等</input>;
332
+ // }}
333
+ // componentProps={{}}
334
+ type="number"
335
+ validator={(val) => {
336
+ console.log(`val:======`, val, typeof val);
337
+ return val > 100 ? "不能大于9" : null;
338
+ // return Number(val) > 9
339
+ // ? {
340
+ // title: "输入错误",
341
+ // level: "error",
342
+ // message: "不能大于9",
343
+ // duration: 5000,
344
+ // }
345
+ // : null;
346
+ }}
347
+ validateTriggerType="onChange" // onChange
348
+ onChange={(val) => {
349
+ setVal(val);
350
+ }}
351
+ value={val}
352
+ clearWhenValidateError
353
+ />
354
+ ;
355
+ </div>
356
+ ),
357
+ LatticeMouthV2: (
358
+ <>
359
+ 投篮指引
360
+ <LatticeMouthV2
361
+ row={3}
362
+ col={3}
363
+ dataSource={[
364
+ { value: "highlight", label: "2", color: "highlight" },
365
+ { value: "active", label: "2", color: "active" },
366
+ { value: "default", label: "2", color: "default" },
367
+ { value: "complete", label: "2", color: "complete" },
368
+ { value: "error", label: "2", color: "error" },
369
+ {
370
+ value: "自定义",
371
+ label: "2",
372
+ style: {
373
+ "--font-size": "18px",
374
+ "--background-color": "#ffffff",
375
+ "--color": "#f30f30",
376
+ "--label-background-color": "rgba(0,0,0,0.3)",
377
+ },
378
+ },
379
+ ]}
380
+ />
381
+ </>
382
+ ),
383
+ ImageUploaderV2: <ImageUploaderV2Component />,
384
+ ButtonV2FullWidth: (
385
+ <div
386
+ style={{
387
+ backgroundColor: "#ffffff",
388
+ height: 90,
389
+ padding: 10,
390
+ margin: "10px 0",
391
+ }}
392
+ >
393
+ ButtonV2FullWidth
394
+ <ButtonV2
395
+ type="primary"
396
+ fullWidth
397
+ onClick={() => {
398
+ console.log(`primary button click===`);
399
+ }}
400
+ >
401
+ 提交
402
+ </ButtonV2>
403
+ </div>
404
+ ),
236
405
 
237
- NumberPickerV2: <div style={{ backgroundColor: '#ffffff', padding: 10, margin: '10px 0' }}>
238
- NumberPickerV2
239
- <NumberPickerV2
240
- max={10}
241
- min={0}
242
- />
243
- </div>,
406
+ ButtonV2Group: (
407
+ <div
408
+ style={{
409
+ backgroundColor: "#ffffff",
410
+ height: 90,
411
+ padding: "10px 0",
412
+ margin: "10px 0",
413
+ }}
414
+ >
415
+ ButtonV2Group
416
+ <ButtonV2.Group>
417
+ <ButtonV2
418
+ type="primary"
419
+ fullWidth
420
+ onClick={() => {
421
+ console.log(`primary button click===`);
422
+ }}
423
+ >
424
+ 提交
425
+ </ButtonV2>
426
+ <ButtonV2
427
+ fullWidth
428
+ onClick={() => {
429
+ console.log(`primary button click===`);
430
+ }}
431
+ >
432
+ 取消
433
+ </ButtonV2>
434
+ </ButtonV2.Group>
435
+ </div>
436
+ ),
244
437
 
245
- InputV2: <>输入框<InputV2
246
- hasBorder
247
- // style={{ '--text-align': 'right' }}
248
- /></>,
438
+ TagV2: (
439
+ <div
440
+ style={{
441
+ backgroundColor: "#ffffff",
442
+ display: "flex",
443
+ flexWrap: "wrap",
444
+ gap: 4,
445
+ padding: 10,
446
+ margin: "10px 0",
447
+ }}
448
+ >
449
+ TagV2
450
+ <TagV2 type="data-change">data-change</TagV2>
451
+ <TagV2 type="normal">normal'</TagV2>
452
+ <TagV2 type="warning">warning'</TagV2>
453
+ <TagV2 type="almost-warning">almost-warning</TagV2>
454
+ <TagV2 type="warning-end">warning-end</TagV2>
455
+ </div>
456
+ ),
249
457
 
250
- DatePickerV2: <>时间选择器<DatePickerV2 className='aaaaaaa'
251
- placeholder='请选择时间'
252
- value={new Date('2024-08-26')}
253
- onChange={(val) => { console.log(`val:======时间`, val, typeof val); }}
254
- format='YY-MM-DD'
255
- // showFormat='YYYY-MM-DD'
256
- // defaultValue={new Date('2024-08-26')}
257
- /></>,
458
+ NumberPickerV2: (
459
+ <div
460
+ style={{ backgroundColor: "#ffffff", padding: 10, margin: "10px 0" }}
461
+ >
462
+ NumberPickerV2
463
+ <NumberPickerV2 max={10} min={0} />
464
+ </div>
465
+ ),
258
466
 
259
- ProgressBarV2: <div style={{ backgroundColor: '#ffffff', padding: 10, margin: '10px 0' }}>
260
- ProgressBarV2
261
- <ProgressBarV2 percent={40} />
262
- </div>,
467
+ InputV2: (
468
+ <>
469
+ 输入框
470
+ <InputV2
471
+ hasBorder
472
+ // style={{ '--text-align': 'right' }}
473
+ />
474
+ </>
475
+ ),
263
476
 
264
- SelectV2: <>下拉选择<SelectV2
265
- label="Select Reason"
266
- placeholder="Please select"
267
- dataSource={[
268
- { label: "Item code", value: "1" },
269
- { label: "DIS", value: "2" },
270
- { label: "Barcode", value: "3" },
271
- { label: "Category", value: "4" },
272
- { label: "Qty", value: "5" },
273
- { label: "Item Name", value: "6" },
274
- { label: "DIS", value: "7" },
275
- ]}
276
- /></>,
477
+ DatePickerV2: (
478
+ <>
479
+ 时间选择器
480
+ <DatePickerV2
481
+ className="aaaaaaa"
482
+ placeholder="请选择时间"
483
+ value={new Date("2024-08-26")}
484
+ onChange={(val) => {
485
+ console.log(`val:======时间`, val, typeof val);
486
+ }}
487
+ format="YY-MM-DD"
488
+ // showFormat='YYYY-MM-DD'
489
+ // defaultValue={new Date('2024-08-26')}
490
+ />
491
+ </>
492
+ ),
277
493
 
278
- CardV2: <CardV2
279
- type={type}
280
- {...typePropsMap[type]}
281
- // noPadding
494
+ ProgressBarV2: (
495
+ <div
496
+ style={{ backgroundColor: "#ffffff", padding: 10, margin: "10px 0" }}
497
+ >
498
+ ProgressBarV2
499
+ <ProgressBarV2 percent={40} />
500
+ </div>
501
+ ),
282
502
 
283
- dataSource={[
284
- { label: "", value: "value", className: "high", display: false },
285
- { label: "", value: "value", className: "highlight", display: false },
286
- { label: "输入", value: <NumberPickerV2 /> },
287
- { label: "输入", value: <InputV2 /> },
288
- { label: "最多六个字符", value: "2022-09-08 12:00:00" },
289
- { label: "最多六个字符123", value: "2022-09-08 12:00:00" },
290
- { label: "入库单号", value: "17836397", },
291
- { label: "渠道", value: "电商", },
292
- { label: "数量/总数", value: "12/98", type: 'error', tip: '实收数量少于应收数量,请仔细核对后再结束该入库订单' },
293
- // { label: "label", value: "value,valuevalue,valuevalue,value" },
294
- // { label: "入库单号", value: "17836397", className: "tag" },
295
- // { label: "渠道", value: "电商", className: "tag" },
296
- // { label: "数量/总数", value: "12/98", className: "tag" },
297
- // { label: "多次收货", value: "允许", className: "tag" },
503
+ SelectV2: (
504
+ <>
505
+ 下拉选择
506
+ <SelectV2
507
+ readOnly
508
+ disabled
509
+ value="1"
510
+ label="Select Reason"
511
+ placeholder="Please select"
512
+ dataSource={[
513
+ { label: "Item code", value: "1" },
514
+ { label: "DIS", value: "2" },
515
+ { label: "Barcode", value: "3" },
516
+ { label: "Category", value: "4" },
517
+ { label: "Qty", value: "5" },
518
+ { label: "Item Name", value: "6" },
519
+ { label: "DIS", value: "7" },
520
+ ]}
521
+ />
522
+ </>
523
+ ),
298
524
 
299
- ]}
300
- extend={
301
- <Button size="medium" color="primary" fill="outline">
302
- Start
303
- </Button>
304
- }
305
- ></CardV2>,
525
+ CardV2: (
526
+ <CardV2
527
+ type={type}
528
+ {...typePropsMap[type]}
529
+ // noPadding
306
530
 
307
- ScanV2: <ScanV2
308
- label="扫描"
309
- placeholder="请扫描"
310
- onScan={(value) => {
311
- console.log("scan value", value);
312
- }}
313
- ></ScanV2>,
531
+ dataSource={[
532
+ { label: "", value: "value", className: "high", display: false },
533
+ { label: "", value: "value", className: "highlight", display: false },
534
+ {
535
+ label: "输入",
536
+ value: (
537
+ <NumberPickerV2
538
+ {...field.getProps("number", { validator: "required" })}
539
+ />
540
+ ),
541
+ type: field.getValidateStatus("number") ? "error" : null,
542
+ tip: field.getValidateStatus("number"),
543
+ },
544
+ {
545
+ label: "输入 type test",
546
+ value: (
547
+ <InputV2
548
+ {...field.getProps("input", {
549
+ validator: "required",
550
+ onChange(val) {
551
+ console.log(`val:======`, val);
552
+ },
553
+ })}
554
+ />
555
+ ),
556
+ type: 'test',
557
+ // type: field.getValidateStatus("input") ? "error" : null,
558
+ // tip: field.getValidateStatus("input"),
559
+ },
560
+ { label: "最多六个字符", value: "2022-09-08 12:00:00" },
561
+ { label: "最多六个字符123", value: "2022-09-08 12:00:00" },
562
+ { label: "入库单号", value: "17836397" },
563
+ { label: "渠道", value: "电商" },
564
+ {
565
+ label: "数量/总数",
566
+ value: "12/98",
567
+ type: "error",
568
+ tip: "实收数量少于应收数量,请仔细核对后再结束该入库订单",
569
+ },
570
+ // { label: "label", value: "value,valuevalue,valuevalue,value" },
571
+ // { label: "入库单号", value: "17836397", className: "tag" },
572
+ // { label: "渠道", value: "电商", className: "tag" },
573
+ // { label: "数量/总数", value: "12/98", className: "tag" },
574
+ // { label: "多次收货", value: "允许", className: "tag" },
575
+ ]}
576
+ extend={
577
+ <Button size="medium" color="primary" fill="outline">
578
+ Start
579
+ </Button>
580
+ }
581
+ ></CardV2>
582
+ ),
314
583
 
315
- ScanV2Only: <ScanV2
316
- label="只输入"
317
- placeholder="Input code"
318
- scanAllowed={false}
319
- onScan={(value) => {
320
- console.log("scan value", value);
321
- }}
322
- onChange={(value) => {
323
- console.log("change", value);
324
- }}
325
- noEnter={true}
326
- ></ScanV2>,
584
+ ScanV2Only: (
585
+ <ScanV2
586
+ label="只输入"
587
+ placeholder="Input code"
588
+ scanAllowed={false}
589
+ onScan={(value) => {
590
+ console.log("scan value", value);
591
+ }}
592
+ onChange={(value) => {
593
+ console.log("change", value);
594
+ }}
595
+ noEnter={true}
596
+ ></ScanV2>
597
+ ),
327
598
 
328
- ListV2: <><ListV2 header="可点击列表" className="body-card" style={{ '--pda-card-margin-bottom': 0 }}>
329
- <ListV2.Item onClick={() => {
330
- setShowToast(false);
331
- onNext("toast success");
332
- setTimeout(() => {
333
- setShowToast({
334
- title: 'toast',
335
- message: 'message',
336
- // message: <div style={{ backgroundColor: 'red', }}>message</div>,
337
- level: 'success',
338
- duration: 3000,
339
- });
340
- }, 300);
341
- }}>成功 Toast</ListV2.Item>
342
- <ListV2.Item onClick={() => {
343
- setShowToast(false);
344
- onNext("toast success");
345
- setTimeout(() => {
346
- setShowToast({
347
- title: 'toast',
348
- message: 'message',
349
- // message: <div style={{ backgroundColor: 'red', }}>message</div>,
350
- level: 'warning',
351
- duration: 3000,
352
- });
353
- }, 300);
354
- }}>警告 Toast</ListV2.Item>
355
- <ListV2.Item onClick={() => {
356
- setShowToast(false);
357
- onNext("toast error");
358
- setTimeout(() => {
359
- setShowToast({
360
- title: '异常',
361
- // title: <div style={{ backgroundColor: '#ffffff', color: '#000000' }}>title</div>,
362
- message: <div style={{ backgroundColor: 'red', }}>message</div>,
363
- message: 'message',
364
- message: [{ label: '入库单号', value: '73683638' }, { label: '入库数量', value: '22' }],
365
- level: 'error',
366
- duration: 500000,
367
- });
368
- }, 300);
369
- }}>错误 Toast</ListV2.Item>
370
- <ListV2.Item onClick={() => {
371
- onNext("alert");
372
- setShowAlert({
373
- title: <div style={{ backgroundColor: '#ffffff', color: '#000000' }}>title</div>,
374
- message: <div >message</div>,
375
- message: [{ label: '入库单号', value: '73683638' }, { label: '入库数量', value: '22' }],
376
- // message: <div style={{ backgroundColor: 'red', }}>message</div>,
377
- okText: '点击确认',
378
- });
379
- }}>alert</ListV2.Item>
380
- <ListV2.Item onClick={() => {
381
- onNext("confirm");
382
- setShowConfirm({
383
- title: '确认移动?',
384
- message: 'message',
385
- message: [{ label: '入库单号', value: '73683638' }, { label: '入库数量', value: '22' }],
386
- // message: <div style={{ backgroundColor: 'red', }}>message</div>,
387
- okText: '确认',
388
- cancelText: '取消',
389
- okButtonType: 'error'
390
- });
391
- }}>confirm</ListV2.Item>
392
- <ListV2.Item onClick={() => {
393
- onNext("prompt");
394
- setShowPrompt({
395
- title: '输入下架数量',
396
- placeholder: '输入下架数量',
397
- inputTip: '这里是输入提示',
398
- defaultValue: 2,
399
- okText: '确认',
400
- cancelText: '取消',
401
- })
402
- }}>prompt</ListV2.Item>
403
- <ListV2.Item onClick={() => {
404
- onNext("popup table");
405
- setShowPopup({
406
- columns: [
407
- { title: '序号', dataIndex: 'a', },
408
- { title: 'SN', dataIndex: 'b', },
409
- { title: '状态', dataIndex: 'c', },
410
- ],
411
- dataSource: [
412
- { a: '1', b: '1234', c: '待扫' },
413
- { a: '2', b: '234', c: '待扫' },
414
- { a: '3', b: '444', c: '待扫' },
415
- { a: 'a2', b: '442', c: '待扫' },
416
- { a: 'a2', b: '2323', c: '待扫' },
417
- // { a: 'a2', b: 'b2' },
418
- // { a: 'a2', b: 'b2' },
419
- // { a: 'a2', b: 'b2' },
420
- // { a: 'a2', b: 'b2' },
421
- // { a: 'a2', b: 'b2' },
422
- // { a: 'a2', b: 'b2' },
423
- // { a: 'a2', b: 'b2' },
424
- // { a: 'a2', b: 'b2' },
425
- // { a: 'a2', b: 'b2' },
426
- // { a: 'a2', b: 'b2' },
427
- // { a: 'a2', b: 'b2' },
428
- // { a: 'a2', b: 'b2' },
429
- // { a: 'a2', b: 'b2' },
430
- // { a: 'a2', b: 'b2' },
431
- // { a: 'a2', b: 'b2' },
432
- { a: 'a2', b: 'b4' },
433
- ],
434
- })
435
- }}>Popup Table</ListV2.Item>
436
- {/* <ListV2.Item ><CardV2 type={'tip'} {...typePropsMap[type]} ></CardV2></ListV2.Item>
599
+ ListV2: (
600
+ <>
601
+ <ListV2
602
+ header="可点击列表"
603
+ className="body-card"
604
+ style={{ "--pda-card-margin-bottom": 0 }}
605
+ >
606
+ <ListV2.Item
607
+ onClick={() => {
608
+ setShowToast(false);
609
+ onNext("toast success");
610
+ setTimeout(() => {
611
+ setShowToast({
612
+ title: "toast",
613
+ message: "message",
614
+ // message: <div style={{ backgroundColor: 'red', }}>message</div>,
615
+ level: "success",
616
+ duration: 3000,
617
+ });
618
+ }, 300);
619
+ }}
620
+ >
621
+ 成功 Toast
622
+ </ListV2.Item>
623
+ <ListV2.Item
624
+ onClick={() => {
625
+ setShowToast(false);
626
+ onNext("toast success");
627
+ setTimeout(() => {
628
+ setShowToast({
629
+ title: "toast",
630
+ message: "message",
631
+ // message: <div style={{ backgroundColor: 'red', }}>message</div>,
632
+ level: "warning",
633
+ duration: 3000,
634
+ });
635
+ }, 300);
636
+ }}
637
+ >
638
+ 警告 Toast
639
+ </ListV2.Item>
640
+ <ListV2.Item
641
+ onClick={() => {
642
+ setShowToast(false);
643
+ onNext("toast error");
644
+ setTimeout(() => {
645
+ setShowToast({
646
+ title: "异常",
647
+ // title: <div style={{ backgroundColor: '#ffffff', color: '#000000' }}>title</div>,
648
+ message: (
649
+ <div style={{ backgroundColor: "red" }}>message</div>
650
+ ),
651
+ message: "message",
652
+ message: [
653
+ { label: "入库单号", value: "73683638" },
654
+ { label: "入库数量", value: "22" },
655
+ ],
656
+ level: "error",
657
+ duration: 500000,
658
+ });
659
+ }, 300);
660
+ }}
661
+ >
662
+ 错误 Toast
663
+ </ListV2.Item>
664
+ <ListV2.Item
665
+ onClick={() => {
666
+ onNext("alert");
667
+ setShowAlert({
668
+ title: (
669
+ <div style={{ backgroundColor: "#ffffff", color: "#000000" }}>
670
+ title
671
+ </div>
672
+ ),
673
+ message: <div>message</div>,
674
+ message: [
675
+ { label: "入库单号", value: "73683638" },
676
+ { label: "入库数量", value: "22" },
677
+ ],
678
+ // message: <div style={{ backgroundColor: 'red', }}>message</div>,
679
+ okText: "点击确认",
680
+ });
681
+ }}
682
+ >
683
+ alert
684
+ </ListV2.Item>
685
+ <ListV2.Item
686
+ onClick={() => {
687
+ onNext("confirm");
688
+ setShowConfirm({
689
+ title: "确认移动?",
690
+ message: "message",
691
+ message: [
692
+ { label: "入库单号", value: "73683638" },
693
+ { label: "入库数量", value: "22" },
694
+ ],
695
+ // message: <div style={{ backgroundColor: 'red', }}>message</div>,
696
+ okText: "确认",
697
+ cancelText: "取消",
698
+ okButtonType: "error",
699
+ });
700
+ }}
701
+ >
702
+ confirm
703
+ </ListV2.Item>
704
+ <ListV2.Item
705
+ onClick={() => {
706
+ onNext("prompt");
707
+ setShowPrompt({
708
+ title: "输入下架数量",
709
+ placeholder: "输入下架数量",
710
+ inputTip: "这里是输入提示",
711
+ defaultValue: 2,
712
+ okText: "确认",
713
+ cancelText: "取消",
714
+ });
715
+ }}
716
+ >
717
+ prompt
718
+ </ListV2.Item>
719
+ <ListV2.Item
720
+ onClick={() => {
721
+ onNext("popup table");
722
+ setShowPopup({
723
+ columns: [
724
+ { title: "序号", dataIndex: "a" },
725
+ { title: "SN", dataIndex: "b" },
726
+ { title: "状态", dataIndex: "c" },
727
+ ],
728
+ dataSource: [
729
+ { a: "1", b: "1234", c: "待扫" },
730
+ { a: "2", b: "234", c: "待扫" },
731
+ { a: "3", b: "444", c: "待扫" },
732
+ { a: "a2", b: "442", c: "待扫" },
733
+ { a: "a2", b: "2323", c: "待扫" },
734
+ // { a: 'a2', b: 'b2' },
735
+ // { a: 'a2', b: 'b2' },
736
+ // { a: 'a2', b: 'b2' },
737
+ // { a: 'a2', b: 'b2' },
738
+ // { a: 'a2', b: 'b2' },
739
+ // { a: 'a2', b: 'b2' },
740
+ // { a: 'a2', b: 'b2' },
741
+ // { a: 'a2', b: 'b2' },
742
+ // { a: 'a2', b: 'b2' },
743
+ // { a: 'a2', b: 'b2' },
744
+ // { a: 'a2', b: 'b2' },
745
+ // { a: 'a2', b: 'b2' },
746
+ // { a: 'a2', b: 'b2' },
747
+ // { a: 'a2', b: 'b2' },
748
+ // { a: 'a2', b: 'b2' },
749
+ { a: "a2", b: "b4" },
750
+ ],
751
+ });
752
+ }}
753
+ >
754
+ Popup Table
755
+ </ListV2.Item>
756
+ {/* <ListV2.Item ><CardV2 type={'tip'} {...typePropsMap[type]} ></CardV2></ListV2.Item>
437
757
  <ListV2.Item><CardV2 type={'tip'} {...typePropsMap[type]} ></CardV2></ListV2.Item>
438
758
  <ListV2.Item><CardV2 type={'tip'} {...typePropsMap[type]} ></CardV2></ListV2.Item> */}
439
- </ListV2>
440
- <CardV2 type={'tip'} {...typePropsMap.tip} ></CardV2>
441
- <CardV2 type={'tip'} {...typePropsMap.tip} ></CardV2>
442
- <CardV2 type={'tip'} {...typePropsMap.tip} ></CardV2>
443
- </>
444
- ,
445
-
759
+ </ListV2>
760
+ <CardV2 type={"tip"} {...typePropsMap.tip}></CardV2>
761
+ <CardV2 type={"tip"} {...typePropsMap.tip}></CardV2>
762
+ <CardV2 type={"tip"} {...typePropsMap.tip}></CardV2>
763
+ </>
764
+ ),
446
765
  IllustrationV2: <IllustrationV2 />,
447
766
 
448
- TaskCardV2: <TaskCardV2
449
- data={{
450
- title: "Trip ID.",
451
- content: "TK2021012700002",
452
- tags: [
453
- { label: "SKU", value: "6" },
454
- // { label: "QTY", value: "2" },
455
- // { label: "QTY1", value: "2" },
456
- // { label: "SKU", value: "6/7" },
457
- // { label: "QTY", value: "2/2" },
458
- ],
459
- progress: {
460
- desc: "MLP progress",
461
- current: "1",
462
- total: 10,
463
- },
464
- }}
465
- ></TaskCardV2>,
767
+ TaskCardV2: (
768
+ <TaskCardV2
769
+ data={{
770
+ title: "Trip ID.",
771
+ content: "TK2021012700002",
772
+ tags: [
773
+ { label: "SKU", value: "6" },
774
+ // { label: "QTY", value: "2" },
775
+ // { label: "QTY1", value: "2" },
776
+ // { label: "SKU", value: "6/7" },
777
+ // { label: "QTY", value: "2/2" },
778
+ ],
779
+ progress: {
780
+ desc: "MLP progress",
781
+ current: "1",
782
+ total: 10,
783
+ },
784
+ }}
785
+ ></TaskCardV2>
786
+ ),
466
787
 
467
- TaskInputV2: <TaskInputV2
468
- label="只输入"
469
- placeholder="Input code"
470
- scanAllowd={false}
471
- onChange={(value) => {
472
- console.log("scan value", value);
473
- }}
474
- decimal={3}
475
- // unit={'EA'}
476
- // max={5}
477
- // min={1}
478
- ></TaskInputV2>,
788
+ TaskInputV2: (
789
+ <TaskInputV2
790
+ label="只输入"
791
+ placeholder="Input code"
792
+ scanAllowd={false}
793
+ onChange={(value) => {
794
+ console.log("scan value", value);
795
+ }}
796
+ decimal={3}
797
+ // unit={'EA'}
798
+ // max={5}
799
+ // min={1}
800
+ ></TaskInputV2>
801
+ ),
479
802
 
480
- MenuListV2: <MenuListV2
481
- dataSource={[
482
- {
483
- label: "Assigned packing tasks",
484
- value: 10,
485
- key: "assigned",
486
- backgroundColor: "#5dc8a6",
487
- img: "https://img.alicdn.com/imgextra/i3/O1CN01UiB43o1HEYTkJDkGW_!!6000000000726-2-tps-124-128.png",
488
- },
489
- {
490
- label: "Available Packing Tasks",
491
- value: 20,
492
- key: "available",
493
- backgroundColor: "#4c80f8",
494
- img: "https://img.alicdn.com/imgextra/i2/O1CN013UzJVm262gcLeDKjQ_!!6000000007604-2-tps-118-128.png",
495
- },
496
- ]}
497
- onSelect={console.log}
498
- ></MenuListV2>,
803
+ MenuListV2: (
804
+ <MenuListV2
805
+ dataSource={[
806
+ {
807
+ label: "Assigned packing tasks",
808
+ value: 10,
809
+ key: "assigned",
810
+ backgroundColor: "#5dc8a6",
811
+ img: "https://img.alicdn.com/imgextra/i3/O1CN01UiB43o1HEYTkJDkGW_!!6000000000726-2-tps-124-128.png",
812
+ },
813
+ {
814
+ label: "Available Packing Tasks",
815
+ value: 20,
816
+ key: "available",
817
+ backgroundColor: "#4c80f8",
818
+ img: "https://img.alicdn.com/imgextra/i2/O1CN013UzJVm262gcLeDKjQ_!!6000000007604-2-tps-118-128.png",
819
+ },
820
+ ]}
821
+ onSelect={console.log}
822
+ ></MenuListV2>
823
+ ),
499
824
 
500
- FooterV2: <FooterV2>
501
- <ButtonV2.Group>
502
- <ButtonV2 type='primary' text fullWidth onClick={() => { console.log(`primary button click===`); }}>提交</ButtonV2>
503
- <ButtonV2 fullWidth onClick={() => { console.log(`primary button click===`); }}>取消</ButtonV2>
504
- <ButtonV2 type='warning' fullWidth onClick={() => { console.log(`warning button click===`); }}>warning</ButtonV2>
505
- <ButtonV2 type='secondary' fullWidth onClick={() => { console.log(`secondary button click===`); }}>secondary</ButtonV2>
506
- </ButtonV2.Group>
507
- </FooterV2>,
508
- }
825
+ FooterV2: (
826
+ <FooterV2>
827
+ <ButtonV2.Group>
828
+ <ButtonV2
829
+ type="primary"
830
+ text
831
+ fullWidth
832
+ onClick={() => {
833
+ console.log(`primary button click===`);
834
+ field.validate().then(res=>console.log(`field.getValues:======`,field.getValues())).finally(() => {
835
+ console.log(`validate end===`);
836
+ });
837
+ }}
838
+ hotkey="Enter"
839
+ // hotkeyHandler={() => {
840
+ // console.log(`primary button hotkeyHandler===`);
841
+ // }}
842
+ >
843
+ 提交 Enter
844
+ </ButtonV2>
845
+ <ButtonV2
846
+ fullWidth
847
+ onClick={() => {
848
+ console.log(`primary button click===`);
849
+ }}
850
+ >
851
+ 取消
852
+ </ButtonV2>
853
+ <ButtonV2
854
+ type="warning"
855
+ fullWidth
856
+ onClick={() => {
857
+ console.log(`warning button click===`);
858
+ }}
859
+ >
860
+ warning
861
+ </ButtonV2>
862
+ <ButtonV2
863
+ type="secondary"
864
+ fullWidth
865
+ onClick={() => {
866
+ console.log(`secondary button click===`);
867
+ console.log(`val:======`, val);
868
+ }}
869
+ >
870
+ secondary
871
+ </ButtonV2>
872
+ </ButtonV2.Group>
873
+ </FooterV2>
874
+ ),
875
+ };
509
876
 
510
877
  return (
511
878
  <div className="debug-father-container">
512
- <LayoutV2 style={{ display: showMap['LayoutV2'] ? undefined : 'none' }}>
513
- {
514
- Object.entries(components).map(([key, value]) => {
515
- return showMap[key] ? value : null;
516
- })
517
- }
518
- </LayoutV2 >
519
- <div style={{ display: showMap['FinishCardV2'] ? undefined : 'none' }}>
879
+ <LayoutV2 style={{ display: showMap["LayoutV2"] ? undefined : "none" }}>
880
+ {Object.entries(components).map(([key, value]) => {
881
+ return showMap[key] ? value : null;
882
+ })}
883
+ </LayoutV2>
884
+ <div style={{ display: showMap["FinishCardV2"] ? undefined : "none" }}>
520
885
  <FinishCardV2
521
- title={'收货完成!'}
522
- okText={'返回'}
523
- cancelText={'取消'}
524
- infoTitle={'入库单号:12838383'}
886
+ title={"收货完成!"}
887
+ okText={"返回"}
888
+ cancelText={"取消"}
889
+ infoTitle={"入库单号:12838383"}
525
890
  infoList={[
526
891
  {
527
- label: '入库单号',
528
- value: '7788038939',
892
+ label: "入库单号",
893
+ value: "7788038939",
529
894
  },
530
895
  {
531
- label: 'SKU',
896
+ label: "SKU",
532
897
  value: 30,
533
898
  },
534
899
  {
535
- label: '数量',
536
- value: '200 件',
900
+ label: "数量",
901
+ value: "200 件",
537
902
  },
538
903
  ]}
539
904
  />
540
905
  </div>
541
- {
542
- showToast && <PageFlowSystemPagesV2.Toast data={showToast}
543
- onNext={() => { onNext(); }}
906
+ {showToast && (
907
+ <PageFlowSystemPagesV2.Toast
908
+ data={showToast}
909
+ onNext={() => {
910
+ onNext();
911
+ }}
544
912
  />
545
- }
546
- {
547
- showAlert && <PageFlowSystemPagesV2.Alert data={showAlert}
548
- onNext={() => { onNext(); setShowAlert(false) }}
913
+ )}
914
+ {showAlert && (
915
+ <PageFlowSystemPagesV2.Alert
916
+ data={showAlert}
917
+ onNext={() => {
918
+ onNext();
919
+ setShowAlert(false);
920
+ }}
549
921
  />
550
- }
551
- {
552
- showConfirm && <PageFlowSystemPagesV2.Confirm data={showConfirm}
553
- onNext={() => { onNext(); setShowConfirm(false) }} />
554
- }
555
- {
556
- showPrompt && <PageFlowSystemPagesV2.Prompt data={showPrompt}
557
- onNext={() => { onNext(); setShowPrompt(false) }}
922
+ )}
923
+ {showConfirm && (
924
+ <PageFlowSystemPagesV2.Confirm
925
+ data={showConfirm}
926
+ onNext={() => {
927
+ onNext();
928
+ setShowConfirm(false);
929
+ }}
558
930
  />
559
- }
560
- {
561
- showPopup && <PopupV2>
931
+ )}
932
+ {showPrompt && (
933
+ <PageFlowSystemPagesV2.Prompt
934
+ data={showPrompt}
935
+ onNext={() => {
936
+ onNext();
937
+ setShowPrompt(false);
938
+ }}
939
+ />
940
+ )}
941
+ {showPopup && (
942
+ <PopupV2>
562
943
  <TableV2 {...(showPopup || {})} />
563
944
  </PopupV2>
564
- }
565
- </div >
945
+ )}
946
+ </div>
566
947
  );
567
- }
948
+ }