@cniot/android-pda-components 0.2.20 → 0.2.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.
Files changed (113) hide show
  1. package/README.md +4 -21
  2. package/build/assets/index.51a8714a.css +1 -0
  3. package/build/assets/{index.66cd7994.js → index.b428d9a3.js} +16 -16
  4. package/build/assets/vendor.999402d8.js +40 -0
  5. package/build/index.html +3 -3
  6. package/package.json +1 -1
  7. package/packages/AppList/doc.jsx +138 -0
  8. package/packages/AppList/index.jsx +33 -0
  9. package/packages/AppList/index.less +52 -0
  10. package/packages/BaseLayout/BarcodeScan.jsx +88 -0
  11. package/packages/BaseLayout/BaseLayoutContainer.jsx +208 -0
  12. package/packages/BaseLayout/RfidOnce.jsx +106 -0
  13. package/packages/BaseLayout/RfidScan.jsx +118 -0
  14. package/packages/BaseLayout/doc.jsx +177 -0
  15. package/packages/BaseLayout/index.jsx +52 -0
  16. package/packages/BaseLayout/index.less +47 -0
  17. package/packages/Button/doc.jsx +62 -0
  18. package/packages/Button/index.jsx +27 -0
  19. package/packages/Button/index.less +62 -0
  20. package/packages/Confirm/doc.jsx +147 -0
  21. package/packages/Confirm/index.jsx +71 -0
  22. package/packages/Confirm/index.less +55 -0
  23. package/packages/Header/doc.jsx +171 -0
  24. package/packages/Header/index.jsx +191 -0
  25. package/packages/Header/index.less +71 -0
  26. package/packages/InfoCard/doc.jsx +244 -0
  27. package/packages/InfoCard/index.jsx +67 -0
  28. package/packages/InfoCard/index.less +111 -0
  29. package/packages/List/doc.jsx +89 -0
  30. package/packages/List/index.jsx +54 -0
  31. package/packages/List/index.less +43 -0
  32. package/packages/Overlay/doc.jsx +103 -0
  33. package/packages/Overlay/index.jsx +42 -0
  34. package/packages/Overlay/index.less +28 -0
  35. package/packages/PdaActionSheet/doc.jsx +193 -0
  36. package/packages/PdaActionSheet/index.jsx +44 -0
  37. package/packages/PdaActionSheet/index.less +65 -0
  38. package/packages/PdaDistanceCard/doc.jsx +62 -0
  39. package/packages/PdaDistanceCard/index.jsx +35 -0
  40. package/packages/PdaDistanceCard/index.less +42 -0
  41. package/packages/PdaFinishCard/doc.jsx +111 -0
  42. package/packages/PdaFinishCard/index.jsx +62 -0
  43. package/packages/PdaFinishCard/index.less +62 -0
  44. package/packages/PdaInfiniteScroll/doc.jsx +121 -0
  45. package/packages/PdaInfiniteScroll/index.jsx +114 -0
  46. package/packages/PdaInfiniteScroll/index.less +12 -0
  47. package/packages/PdaInfiniteScroll/utils.jsx +25 -0
  48. package/packages/PdaSteps/PdaStep/index.jsx +38 -0
  49. package/packages/PdaSteps/PdaStep/index.less +70 -0
  50. package/packages/PdaSteps/PdaSteps/index.jsx +33 -0
  51. package/packages/PdaSteps/PdaSteps/index.less +0 -0
  52. package/packages/PdaSteps/doc.jsx +131 -0
  53. package/packages/PdaSteps/index.jsx +5 -0
  54. package/packages/PdaTitle/doc.jsx +102 -0
  55. package/packages/PdaTitle/index.jsx +51 -0
  56. package/packages/Presentation/doc.jsx +72 -0
  57. package/packages/Presentation/index.jsx +25 -0
  58. package/packages/Presentation/index.less +31 -0
  59. package/packages/SelectCard/doc.jsx +57 -0
  60. package/packages/SelectCard/index.jsx +13 -0
  61. package/packages/SelectCard/index.less +30 -0
  62. package/packages/SimpleCard/doc.jsx +59 -0
  63. package/packages/SimpleCard/index.jsx +13 -0
  64. package/packages/SimpleCard/index.less +38 -0
  65. package/packages/SimpleCardBlock/doc.jsx +77 -0
  66. package/packages/SimpleCardBlock/index.jsx +43 -0
  67. package/packages/SimpleCardBlock/index.less +26 -0
  68. package/packages/SubCard/doc.jsx +63 -0
  69. package/packages/SubCard/index.jsx +28 -0
  70. package/packages/SubCard/index.less +64 -0
  71. package/packages/Tag/doc.jsx +47 -0
  72. package/packages/Tag/index.jsx +12 -0
  73. package/packages/Tag/index.less +22 -0
  74. package/packages/TaskCard/doc.jsx +151 -0
  75. package/packages/TaskCard/index.jsx +65 -0
  76. package/packages/TaskCard/index.less +101 -0
  77. package/packages/Toast/doc.jsx +112 -0
  78. package/packages/Toast/index.jsx +7 -0
  79. package/packages/Toast/index.less +23 -0
  80. package/packages/Toast/methods.jsx +77 -0
  81. package/packages/Toast/toast.jsx +96 -0
  82. package/packages/WakeKeyborard/doc.jsx +170 -0
  83. package/packages/WakeKeyborard/index.jsx +61 -0
  84. package/packages/WakeKeyborard/index.less +55 -0
  85. package/packages/WakeKeyborard/keyborard.jsx +61 -0
  86. package/packages/doc.jsx +19 -0
  87. package/packages/global.less +7 -0
  88. package/packages/index.jsx +60 -0
  89. package/packages/index.less +3 -0
  90. package/packages/pageflow-system-pages/alert/doc.jsx +70 -0
  91. package/packages/pageflow-system-pages/alert/index.jsx +22 -0
  92. package/packages/pageflow-system-pages/confirm/doc.jsx +118 -0
  93. package/packages/pageflow-system-pages/confirm/index.jsx +31 -0
  94. package/packages/pageflow-system-pages/debug/index.jsx +27 -0
  95. package/packages/pageflow-system-pages/debug/index.less +5 -0
  96. package/packages/pageflow-system-pages/index.jsx +38 -0
  97. package/packages/pageflow-system-pages/loading/index.jsx +37 -0
  98. package/packages/pageflow-system-pages/not-found/index.jsx +12 -0
  99. package/packages/pageflow-system-pages/not-found/index.less +26 -0
  100. package/packages/pageflow-system-pages/prompt/doc.jsx +95 -0
  101. package/packages/pageflow-system-pages/prompt/index.jsx +43 -0
  102. package/packages/pageflow-system-pages/prompt/index.less +44 -0
  103. package/packages/pageflow-system-pages/start/index.jsx +28 -0
  104. package/packages/pageflow-system-pages/start/index.less +12 -0
  105. package/packages/pageflow-system-pages/toast/doc.jsx +76 -0
  106. package/packages/pageflow-system-pages/toast/index.jsx +42 -0
  107. package/packages/utils/index.js +56 -0
  108. package/packages/variable.less +4 -0
  109. package/build/assets/index.b8d6d64c.css +0 -1
  110. package/build/assets/vendor.5080796b.js +0 -40
  111. package/es/index.cjs.js +0 -7
  112. package/es/index.es.js +0 -2194
  113. package/es/style.css +0 -1
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import BaseLayoutContainer from './BaseLayoutContainer';
3
+ import RfidOnce from './RfidOnce';
4
+ import RfidScan from './RfidScan';
5
+ import BarcodeScan from './BarcodeScan';
6
+ import classNames from "classnames";
7
+
8
+ const blankFunc = () => { };
9
+
10
+ export default class BaseLayout extends React.Component {
11
+ constructor(props) {
12
+ super(props);
13
+ }
14
+
15
+ render() {
16
+ const props = this.props;
17
+ // onScanBarcode 一直监听
18
+ // onBarcodeScan 按下某些建才监听
19
+ const {onBarcodeScan, onScanBarcode, onRfidOnce, onRfidBoxOnce, onRfidPalletOnce, onRfidScan, onRfidBoxScan, onRfidPalletScan } = props;
20
+
21
+ if(onRfidOnce || onRfidBoxOnce || onRfidPalletOnce) {
22
+ return (
23
+ <RfidOnce
24
+ // onRfidOnce={onRfidOnce}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+ if(onRfidScan || onRfidBoxScan || onRfidPalletScan) {
30
+ return (
31
+ <RfidScan
32
+ // onRfidScan={onRfidScan}
33
+ {...props}
34
+ />
35
+ )
36
+ }
37
+ if(onBarcodeScan || onScanBarcode) {
38
+ return (
39
+ <BarcodeScan
40
+ // onBarcodeScan= {onBarcodeScan}
41
+ {...props}
42
+ />
43
+ )
44
+ }
45
+
46
+ return (
47
+ <BaseLayoutContainer
48
+ {...props}
49
+ />
50
+ )
51
+ }
52
+ }
@@ -0,0 +1,47 @@
1
+ .baselayout-wrapper {
2
+ height: 100%;
3
+ min-height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ position: absolute;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ background-color: black;
12
+
13
+ .baselayout-header {
14
+ // height: 84px;
15
+ }
16
+ .baselayout-container {
17
+ // height: calc(100% - 84px);
18
+ padding: 0 24px;
19
+ overflow-x: auto;
20
+ flex: 1;
21
+
22
+ &>* {
23
+ margin-top: 16px;
24
+ }
25
+ padding-bottom: 16px;
26
+ }
27
+ .baselayout-footer {
28
+ padding: 16px 0;
29
+ }
30
+ // .baselayout-paddingbottom {
31
+ // height: 24px;
32
+ // }
33
+
34
+ .loading {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ color: white;
41
+ background-color: rgba(0,0,0,0.4);
42
+ background-image: url(https://img.alicdn.com/imgextra/i2/O1CN01PRSptR1YO1wOlBHCr_!!6000000003048-1-tps-240-240.gif);
43
+ background-repeat: no-repeat;
44
+ background-position: center;
45
+ background-size: 120px 120px;
46
+ }
47
+ }
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import Button from "./index";
3
+
4
+ export default function () {
5
+ return (
6
+ <div>
7
+ <h1>Button</h1>
8
+ <p>扫码组件</p>
9
+ <h2>示例</h2>
10
+ {/* const { type="default", width, style = {}, onClick } = this.props; */}
11
+ <div className="light-block">
12
+ <Button dataClick='arms track'>按钮</Button>
13
+ <Button type='primary' onClick={e => console.log(e) } dataClick=''>确认</Button>
14
+ <Button type='dark'>深色</Button>
15
+ <Button.Group>
16
+ <Button type="cutout">镂空</Button>
17
+ <Button>按钮</Button>
18
+ </Button.Group>
19
+ </div>
20
+ <code className="code">{`
21
+ <Button dataClick='arms track'>按钮</Button>
22
+ <Button type='primary' onClick={e => console.log(e) }>确认</Button>
23
+ <Button type='dark'>深色</Button>
24
+ <Button.Group>
25
+ <Button type="cutout">镂空</Button>
26
+ <Button>按钮</Button>
27
+ </Button.Group>
28
+ `}</code>
29
+ <h2>参数</h2>
30
+ <table className="pure-table pure-table-bordered">
31
+ <thead>
32
+ <tr>
33
+ <th>属性</th>
34
+ <th>说明</th>
35
+ <th>类型</th>
36
+ <th>默认值</th>
37
+ </tr>
38
+ </thead>
39
+ <tbody>
40
+ <tr>
41
+ <td>type</td>
42
+ <td>类型</td>
43
+ <td>string: primary | dark | cutout</td>
44
+ <td>default</td>
45
+ </tr>
46
+ <tr>
47
+ <td>onClick</td>
48
+ <td>点击事件</td>
49
+ <td>function</td>
50
+ <td></td>
51
+ </tr>
52
+ <tr>
53
+ <td>dataClick</td>
54
+ <td>arms 监控使用</td>
55
+ <td>string</td>
56
+ <td></td>
57
+ </tr>
58
+ </tbody>
59
+ </table>
60
+ </div>
61
+ );
62
+ }
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ // import OPInput from "../OPInput";
3
+ import "./index.less";
4
+
5
+
6
+ export default function Button(props){
7
+ const { type="default", onClick, className="", tabIndex=1, dataClick=''} = props;
8
+ let opt = {};
9
+ if(dataClick) {
10
+ opt['data-click'] = dataClick;
11
+ }
12
+ return (
13
+ <button className={`pda-button pda-button-${type} ${className}`} onClick={onClick} tabIndex={tabIndex} {...opt}>
14
+ {props.children}
15
+ </button>
16
+ )
17
+ }
18
+
19
+ export function ButtonGroup(props){
20
+ return (
21
+ <div className="button-group" >
22
+ {props.children}
23
+ </div>
24
+ )
25
+ }
26
+
27
+ Button.Group = ButtonGroup;
@@ -0,0 +1,62 @@
1
+ .pda-button {
2
+ display: block;
3
+ box-sizing: border-box;
4
+ padding-right: 0;
5
+ text-align: center;
6
+ font-size: 40px;
7
+ height: 90px;
8
+ line-height: 40px;
9
+ // color: #000;
10
+ color: #fff;
11
+ background-color: #F3F4F8;
12
+ border-radius: 10px;
13
+ width: 100%;
14
+ border-width: 0;
15
+ word-break: keep-all;
16
+
17
+ &.pda-button-default {
18
+ color: #000;
19
+ }
20
+ &:active {
21
+ background-color: #979797;
22
+ }
23
+
24
+ &.pda-button-primary {
25
+ background-color: #0091EA;
26
+ // color: #fff;
27
+ &:active {
28
+ background-color: #0074BB;
29
+ }
30
+ }
31
+
32
+ &.pda-button-dark {
33
+ background-color: #282828;
34
+ // color: #fff;
35
+ &:active {
36
+ background-color: #979797;
37
+ }
38
+ }
39
+
40
+ &.pda-button-cutout {
41
+ // background-color: #282828;
42
+ // color: #fff;
43
+ color: #0091EA;
44
+ border-width: 4px;
45
+ border-color: #0091EA;
46
+ // &:active {
47
+ // background-color: #979797;
48
+ // }
49
+ }
50
+ }
51
+
52
+ .button-group {
53
+ display: flex;
54
+ flex-direction: row;
55
+ padding: 20px 24px;
56
+ width: 100%;
57
+ .pda-button {
58
+ &:not(:last-child){
59
+ margin-right: 16px;
60
+ }
61
+ }
62
+ }
@@ -0,0 +1,147 @@
1
+ import React from "react";
2
+ import Confirm from "./index";
3
+ export default function () {
4
+ return (
5
+ <div>
6
+ <h1>Confirm</h1>
7
+ <p>确认组件, 如果要悬浮在页面上,请配合 Overlay 使用</p>
8
+ <h2>示例</h2>
9
+ <div className="light-block">
10
+ <Confirm
11
+ title="111111"
12
+ message="22222"
13
+ okText="确认"
14
+ cancelText="取消"
15
+ okDataClick='clickOk'
16
+ // type="warning"
17
+ subMessage={
18
+ [{ label: '箱码', content: 'abcdefghijklmnopqrstuvwxyz' }]
19
+ }
20
+ onClick={(isConfirm) => {
21
+ console.log("isConfirm", isConfirm);
22
+ }}
23
+ ></Confirm>
24
+ <br />
25
+ <Confirm
26
+ title="111111"
27
+ message="22222"
28
+ okText="确认"
29
+ cancelText="取消"
30
+ type="warning"
31
+ subMessage={
32
+ [{ label: '箱码', content: 'abcdefghijklmnopqrstuvwxyz' }]
33
+ }
34
+ onClick={(isConfirm) => {
35
+ console.log("isConfirm", isConfirm);
36
+ }}
37
+ insertButtons={
38
+ [
39
+ { label: '查看详情111', value: 'hello', dataClick: '查看详情1234' }
40
+ ]
41
+ }
42
+ appendButtons={
43
+ [
44
+ { label: '查看详情', value: { name: 'id111' } }
45
+ ]
46
+ }
47
+ ></Confirm>
48
+ </div>
49
+ <code className="code">{`
50
+ <Confirm
51
+ // type="warning"
52
+ title="111111"
53
+ message="22222"
54
+ okText="确认"
55
+ cancelText="取消"
56
+ onClick={(isConfirm)=>{
57
+ console.log("isConfirm", isConfirm);
58
+ }}
59
+ ></Confirm>
60
+ `}</code>
61
+ <h2>参数</h2>
62
+ <table className="pure-table pure-table-bordered">
63
+ <thead>
64
+ <tr>
65
+ <th>属性</th>
66
+ <th>说明</th>
67
+ <th>类型</th>
68
+ <th>默认值</th>
69
+ </tr>
70
+ </thead>
71
+ <tbody>
72
+ <tr>
73
+ <td>title</td>
74
+ <td>标题</td>
75
+ <td>string</td>
76
+ <td>标题文案</td>
77
+ </tr>
78
+ <tr>
79
+ <td>message</td>
80
+ <td>消息内容</td>
81
+ <td>string</td>
82
+ <td>消息内容</td>
83
+ </tr>
84
+ <tr>
85
+ <td>okText</td>
86
+ <td>确认按钮文本</td>
87
+ <td>string</td>
88
+ <td></td>
89
+ </tr>
90
+ <tr>
91
+ <td>cancelText</td>
92
+ <td>取消按钮文本</td>
93
+ <td>string</td>
94
+ <td></td>
95
+ </tr>
96
+ <tr>
97
+ <td>onClick</td>
98
+ <td>按钮点击回调</td>
99
+ <td>(isConfirm)=></td>
100
+ <td></td>
101
+ </tr>
102
+ <tr>
103
+ <td>type</td>
104
+ <td>类型</td>
105
+ <td>string: primary | warning</td>
106
+ <td>primary</td>
107
+ </tr>
108
+ <tr>
109
+ <td>subMessage</td>
110
+ <td>描述</td>
111
+ <td>{JSON.stringify([{ label: '箱码' }, { content: 'abcdefghijklmnopqrstuvwxyz' }])}</td>
112
+ <td></td>
113
+ </tr>
114
+ <tr>
115
+ <td>okDataClick</td>
116
+ <td>ok 按钮 arms 监控</td>
117
+ <td>string</td>
118
+ <td></td>
119
+ </tr>
120
+ <tr>
121
+ <td>cancelDataClick</td>
122
+ <td>cancel 按钮 arms 监控</td>
123
+ <td>string</td>
124
+ <td></td>
125
+ </tr>
126
+ <tr>
127
+ <td>insertButtons</td>
128
+ <td>插入在默认按钮上面</td>
129
+ <td>{JSON.stringify([
130
+ { label: '查看详情111', value: 'hello', dataClick: '查看详情1234' }
131
+ ])}</td>
132
+ <td></td>
133
+ </tr>
134
+ <tr>
135
+ <td>appendButtons</td>
136
+ <td>追加到默认按钮下面</td>
137
+ <td>{JSON.stringify([
138
+ { label: '查看详情222', value: 'hello', dataClick: '查看详情1234' }
139
+ ])}</td>
140
+ <td></td>
141
+ </tr>
142
+
143
+ </tbody>
144
+ </table>
145
+ </div>
146
+ );
147
+ }
@@ -0,0 +1,71 @@
1
+ import React from "react";
2
+ import classNames from "classnames";
3
+ import Button from "../Button";
4
+ import './index.less';
5
+
6
+ function empty(){}
7
+
8
+ export default function Confirm(props){
9
+ const { title = "title", message = null, subMessage = [], okText="okText", cancelText=null, okDataClick=null, cancelDataClick=null, onClick = empty, type="primary", insertButtons = [], appendButtons = []} = props;
10
+
11
+ const innerHTML = {__html: message};
12
+
13
+ return <div className={classNames({"confirm-wrap": true, ["confirm-"+type]: true})}>
14
+ <div className="confirm-content">
15
+ <div className="confirm-title">{title}</div>
16
+ {
17
+ message ? <div className="confirm-message">{message}</div> : null
18
+ }
19
+ {
20
+ subMessage.length ? (
21
+ <div className="confirm-sub-message">
22
+ {
23
+ subMessage.map((item, index) => {
24
+ const { label, content } = item;
25
+ return (
26
+ <div className="confirm-sub-block" key={label ? label : index}>
27
+ <p className="confirm-sub-label">
28
+ {/* <span>{item.label || ''}</span>:&nbsp; */}
29
+ {label ? label + ' : ' : ''}
30
+ </p>
31
+ <p className="confirm-sub-content">
32
+ {content || ''}
33
+ </p>
34
+ </div>
35
+ // <p key={index} className="pda-listitem-subinfo">
36
+ // <span>{item.label || ''}</span>:&nbsp;<span></span>
37
+ // </p>
38
+ )
39
+ })
40
+ }
41
+ </div>
42
+ ) : null
43
+ }
44
+ </div>
45
+
46
+ <div className="confirm-btns">
47
+ {
48
+ insertButtons.length > 0 ? (
49
+ <Button.Group>
50
+ {
51
+ insertButtons.map((item, index) => <Button key={index} onClick={()=> onClick(item.value)} dataClick={item.dataClick}>{item.label}</Button> )
52
+ }
53
+ </Button.Group>
54
+ ) : null
55
+ }
56
+ <Button.Group>
57
+ {cancelText ? <Button className="confirm-cancel-button" onClick={()=> onClick(false)} dataClick={cancelDataClick}>{cancelText}</Button> : null}
58
+ <Button type="primary" onClick={()=> onClick(true)} dataClick={okDataClick}>{okText}</Button>
59
+ </Button.Group>
60
+ {
61
+ appendButtons.length > 0 ? (
62
+ <Button.Group>
63
+ {
64
+ appendButtons.map((item, index) => <Button key={index} onClick={()=> onClick(item.value)} dataClick={item.dataClick}>{item.label}</Button> )
65
+ }
66
+ </Button.Group>
67
+ ) : null
68
+ }
69
+ </div>
70
+ </div>
71
+ }
@@ -0,0 +1,55 @@
1
+ @import '../variable.less';
2
+
3
+ .confirm-wrap{
4
+ background:#ffffff;
5
+ border-radius:6px 6px 0 0;
6
+ // padding:24px 20px;
7
+ padding-top: 24px;
8
+ width:100%;
9
+ .confirm-content {
10
+ padding: 0 24px;
11
+ }
12
+ .confirm-title{
13
+ font-size:24 * @change2rem;
14
+ font-weight:700;
15
+ }
16
+
17
+ .confirm-message{
18
+ font-size:22 * @change2rem;
19
+ margin-bottom:10 * @change2rem;
20
+ }
21
+ .confirm-sub-message {
22
+ font-size:22 * @change2rem;
23
+ margin-bottom:10 * @change2rem;
24
+ // word-wrap: break-word;
25
+ // word-break: break-all;
26
+ }
27
+ .confirm-sub-block {
28
+ display: flex;
29
+ flex-direction: row;
30
+ .confirm-sub-label {
31
+ white-space: nowrap;
32
+ }
33
+ .confirm-sub-content {
34
+ margin-left: 12px;
35
+ word-wrap:break-word;
36
+ word-break: break-all;
37
+ }
38
+ }
39
+
40
+ .confirm-btns{
41
+ &>*:not(:first-child) {
42
+ padding-top: 0;
43
+ }
44
+ }
45
+
46
+ &.confirm-warning {
47
+ background-color: red;
48
+ .pda-button {
49
+ background-color: transparent;
50
+ color: black;
51
+ border: 2px solid black;
52
+ border-radius: 40px;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,171 @@
1
+ import React from "react";
2
+ import Header from "./index";
3
+ export default function () {
4
+ return (
5
+ <div>
6
+ <h1>Header</h1>
7
+ <p>头部指引, 在 iData PDA 中 fn 的键值为 0,已做特殊处理,可以直接写fn。</p>
8
+ <br/>
9
+ <div>
10
+ 注意:通过以下代码禁用实体 back 键的默认动作后,Header 组件的 onBack 可以响应实体back键
11
+ <code className="code">
12
+ {
13
+ `
14
+ WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'keyboard', 'method': 'disableBackKey', 'params': {}}", function(e) {
15
+ console.log('disable back key succeed');
16
+ }, function(e) {
17
+ console.log('disable back key failed');
18
+ });
19
+ `
20
+ }
21
+ </code>
22
+ </div>
23
+ <h2>示例</h2>
24
+ <div className="dark-block">
25
+ {/* const { className, goBack = true, icon="scan", title="任务", more=false } = this.props; */}
26
+ <Header
27
+ title='hello world'
28
+ onBack={console.log}
29
+ backShortcutKey="a"
30
+ />
31
+ <Header
32
+ icon='read'
33
+ title='hello world'
34
+ configIconClick = {
35
+ e => {
36
+ console.log('config icon click');
37
+ }
38
+ }
39
+ ></Header>
40
+ <Header
41
+ icon='select'
42
+ title='hello world'
43
+ menus={[
44
+ {
45
+ label:"menus1"
46
+ },
47
+ {
48
+ label:"menus2"
49
+ },
50
+ {
51
+ label:"menus3"
52
+ }
53
+ ]}
54
+ onClickMenuItem={console.log}
55
+ cancelMenuText="取消"
56
+ menuShortcutKey="f1,f2,fn"
57
+ configIconClick = {
58
+ e => {
59
+ console.log('config icon click');
60
+ }
61
+ }
62
+ ></Header>
63
+ </div>
64
+ <code className="code">{`
65
+ // backShortcutKey 绑定了 a 键快捷触发 onBack
66
+ <Header
67
+ title='hello world'
68
+ onBack={console.log}
69
+ backShortcutKey="a"
70
+ />
71
+ <Header
72
+ icon='read'
73
+ title='hello world'
74
+ ></Header>
75
+ <Header
76
+ icon='select'
77
+ title='hello world'
78
+ menus={[
79
+ {
80
+ label:"menus1"
81
+ },
82
+ {
83
+ label:"menus2"
84
+ },
85
+ {
86
+ label:"menus3"
87
+ }
88
+ ]}
89
+ onClickMenuItem={console.log}
90
+ cancelMenuText="取消"
91
+ menuShortcutKey="f1,f2,fn"
92
+ ></Header>
93
+ `}</code>
94
+ <h2>参数</h2>
95
+ <table className="pure-table pure-table-bordered">
96
+ <thead>
97
+ <tr>
98
+ <th>属性</th>
99
+ <th>说明</th>
100
+ <th>类型</th>
101
+ <th>默认值</th>
102
+ </tr>
103
+ </thead>
104
+ <tbody>
105
+ <tr>
106
+ <td>onBack</td>
107
+ <td>返回按钮点击</td>
108
+ <td>Function("back")</td>
109
+ <td></td>
110
+ </tr>
111
+ <tr>
112
+ <td>onClickMenuItem</td>
113
+ <td>menu item 点击</td>
114
+ <td>function(item)</td>
115
+ <td></td>
116
+ </tr>
117
+
118
+ <tr>
119
+ <td>icon</td>
120
+ <td>title 图标</td>
121
+ <td>string: scan | select | read</td>
122
+ <td>scan</td>
123
+ </tr>
124
+ <tr>
125
+ <td>title</td>
126
+ <td>标题</td>
127
+ <td>string</td>
128
+ <td></td>
129
+ </tr>
130
+ <tr>
131
+ <td>onScanBarcode</td>
132
+ <td>{`(barcode)=> `}</td>
133
+ <td>Function</td>
134
+ <td>-</td>
135
+ </tr>
136
+
137
+ <tr>
138
+ <td>menus</td>
139
+ <td>弹出菜单列表,menus item 的所有参数会直接给 Button</td>
140
+ <td>Array-Object</td>
141
+ <td></td>
142
+ </tr>
143
+ <tr>
144
+ <td>cancelMenuText</td>
145
+ <td>取消弹出菜单的按钮文案,没有的话不显示取消弹出菜单</td>
146
+ <td>String</td>
147
+ <td></td>
148
+ </tr>
149
+ <tr>
150
+ <td>menuShortcutKey</td>
151
+ <td>自己定义绑定 menu 菜单的快捷键弹出,比如 `f1`, `f1,f2` (支持,号分割绑定多个键)</td>
152
+ <td>String</td>
153
+ <td></td>
154
+ </tr>
155
+ <tr>
156
+ <td>backShortcutKey</td>
157
+ <td>返回,绑定快捷键, 必须声明过 onBack 参数才有效</td>
158
+ <td>String</td>
159
+ <td></td>
160
+ </tr>
161
+ <tr>
162
+ <td>configIconClick</td>
163
+ <td>增加 Config 按钮</td>
164
+ <td>function</td>
165
+ <td></td>
166
+ </tr>
167
+ </tbody>
168
+ </table>
169
+ </div>
170
+ );
171
+ }