@cniot/android-pda-components 2.0.0-beta.1 → 2.0.0-beta.10

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