react_hsbc_teller 2.0.24 → 2.0.25

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 (26) hide show
  1. package/lib/hsbc.js +1 -1
  2. package/package.json +1 -1
  3. package/packages/api/api.js +91 -0
  4. package/packages/assets/mp3/ipad_leave_error.mp3 +0 -0
  5. package/packages/assets/mp3/ipad_low_power.mp3 +0 -0
  6. package/packages/demo/demo.js +2 -0
  7. package/packages/pages/foot/foot.jsx +2 -2
  8. package/packages/pages/multiModule/components/copy/agree.jsx +115 -0
  9. package/packages/pages/multiModule/components/copy/agree.less +105 -0
  10. package/packages/pages/multiModule/components/copy/copyTwo.jsx +663 -0
  11. package/packages/pages/multiModule/components/copy/copyTwo.less +180 -0
  12. package/packages/pages/multiModule/components/copy/copy_en.jsx +365 -0
  13. package/packages/pages/multiModule/components/copy/copy_en.less +145 -0
  14. package/packages/pages/multiModule/components/copy/copylist.jsx +291 -0
  15. package/packages/pages/multiModule/components/copy/copylist.less +83 -0
  16. package/packages/pages/multiModule/components/copy/risk.jsx +294 -0
  17. package/packages/pages/multiModule/components/copy/risk.less +123 -0
  18. package/packages/pages/multiModule/components/sign/signMy.jsx +306 -0
  19. package/packages/pages/multiModule/components/sign/signMy.less +128 -0
  20. package/packages/pages/multiModule/components/subscribe/subscribe.jsx +113 -0
  21. package/packages/pages/multiModule/components/subscribe/subscribe.less +82 -0
  22. package/packages/pages/multiModule/multiModule.jsx +26 -0
  23. package/packages/pages/multiModule/multiModule.less +20 -0
  24. package/packages/pages/video/video.jsx +388 -148
  25. package/packages/utils/asrController.js +242 -0
  26. package/packages/utils/recorder.js +289 -0
@@ -0,0 +1,291 @@
1
+ import React, { Component } from 'react';
2
+ import { message } from 'antd';
3
+ import CopyTwo from './copyTwo'
4
+ import CopyEn from './copy_en'
5
+ import Risk from './risk'
6
+ import Agree from './agree'
7
+ import './copylist.less'
8
+ import API from '@/api/api';
9
+ import { FormattedMessage, injectIntl } from 'react-intl';
10
+ import Modal from "antd/lib/modal";
11
+ import 'antd/lib/modal/style'
12
+ import { Button } from '../../../../../node_modules/antd/lib/index';
13
+ @injectIntl
14
+ class Copylist extends Component {
15
+ state = {
16
+ data: {
17
+ "sessionId":"SXbUX8GaE",
18
+ "callbackUrl":"http://47.102.126.132:8720/hsbc/callback",
19
+ "title":"抄录标题",
20
+ "copyNumber":"抄录批次号",
21
+ "username":"姓名",
22
+ length: "337",
23
+ height: "177",
24
+ "list":[
25
+ {
26
+ "transactionNumber":"2021061762130001326",
27
+ "productName":[
28
+ "富达基金",
29
+ "汇丰代境外理财计划"
30
+ ],
31
+ "file":[
32
+ {
33
+ "docId":"xxxxxxxxxx",
34
+ "docText":"ODII_ 汇丰代境外理财计划-开放式海外基金型产品认购书(含客户权益须知)"
35
+ },
36
+ {
37
+ "docId":"xxxxxxxxxx",
38
+ "docText":"海外基金型产品认购书"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "transactionNumber":"202106176213078758",
44
+ "productName":[
45
+ "产品名称3",
46
+ "汇丰代境外理财计划"
47
+ ],
48
+ "file":[
49
+ {
50
+ "docId":"xxxxxxxxxx",
51
+ "docText":"ODII_ 汇丰代境外理财计划-开放式海外基金型产品认购书(含客户权益须知)"
52
+ },
53
+ ]
54
+ }
55
+ ],
56
+ "content":[
57
+ {
58
+ "type":"1",
59
+ "sequence":"2",
60
+ "subContent":[
61
+ {
62
+ "desc":"描述1",
63
+ "option":false
64
+ },
65
+ {
66
+ "desc":"描述2",
67
+ "option":false
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "type":"2",
73
+ "sequence":"1",
74
+ "locale":"zh_CN", // en_US
75
+ "subContent": "汇丰代境外理财计划",
76
+ "row": 2,
77
+ "cell": 12
78
+ },
79
+ {
80
+ "type":"2",
81
+ "sequence":"1",
82
+ "locale":"en_US", // en_US
83
+ "subContent":"To see a world in a grain of sand. And a heaven in a wild flower.",
84
+ "row": 2,
85
+ "cell": 5
86
+ },
87
+ {
88
+ "type":"3",
89
+ "sequence":"3",
90
+ "subContent":"风险等级"
91
+ }
92
+ ]
93
+ },
94
+ isStartCopy: false,
95
+ curIndex: 0,
96
+ resultContent: [],
97
+ isModalVisibleSubmitError: false
98
+ };
99
+ // 开始抄录
100
+ startCopy = () => {
101
+ this.setState({
102
+ isStartCopy: true,
103
+ curIndex: 0
104
+ })
105
+ }
106
+ base64toFile(data, fileName) {
107
+ const dataArr = data.split(",");
108
+ const byteString = atob(dataArr[1]);
109
+ const options = {
110
+ type: "image/jpeg",
111
+ endings: "native"
112
+ };
113
+ const u8Arr = new Uint8Array(byteString.length);
114
+ for (let i = 0; i < byteString.length; i++) {
115
+ u8Arr[i] = byteString.charCodeAt(i);
116
+ }
117
+ return new File([u8Arr], fileName + ".jpg", options);//返回文件流
118
+ }
119
+ nextCopy = async (resultData) => {
120
+ this.state.resultContent.push(resultData) // 将结果保存
121
+ if (resultData.type=='2' || resultData.type=='3') {
122
+ console.log(resultData)
123
+ const formData = new FormData();
124
+ formData.append('file', this.base64toFile(resultData.file, 'image'));
125
+ formData.append('sessionId', window.imRoom.sessionId);
126
+ formData.append('sequence', resultData.sequence);
127
+ formData.append('type', resultData.type);
128
+ formData.append('from', window.imRoom.userId);
129
+ formData.append('to', window.imRoom.userId);
130
+ let result = await API.uploadOss(formData);
131
+ console.log(result)
132
+ if(result.code == 500) {
133
+ this.setState({
134
+ isModalVisibleSubmitError: true
135
+ })
136
+ } else {
137
+ this.endFinish()
138
+ }
139
+ // console.log(result);
140
+ // callNimIM('sendCustomCmdMsg', {
141
+ // customId: window.imRoom.imRoomId,
142
+ // content: JSON.stringify({
143
+ // 'typeId': 1220,
144
+ // 'data': resultData,
145
+ // 'sessionId': window.imRoom.sessionId,
146
+ // 'userId': window.imRoom.userId
147
+ // })
148
+ // }, function (code, message, data) {
149
+ // });
150
+ }else if (resultData.type=='1'){
151
+ console.log(this.state.resultContent)
152
+ let result = await API.previewCopyCallback({
153
+ ...this.props.data,
154
+ content: this.state.resultContent
155
+ });
156
+ if(result.code == 500) {
157
+ this.setState({
158
+ isModalVisibleSubmitError: true
159
+ })
160
+ } else {
161
+ this.props.handleReceiveMsg({
162
+ 'typeId': 1220,
163
+ 'data': {
164
+ ...resultData,
165
+ file: ''
166
+ },
167
+ 'sessionId': window.imRoom.sessionId,
168
+ 'userId': window.imRoom.userId
169
+ })
170
+ this.endFinish()
171
+ }
172
+ }
173
+ // if (this.state.curIndex+1<this.state.data.content.length){
174
+ // this.setState({
175
+ // isStartCopy: true,
176
+ // curIndex: this.state.curIndex + 1
177
+ // })
178
+ // } else {
179
+ // // 结束抄录
180
+ // this.setState({
181
+ // isStartCopy: false,
182
+ // curIndex: 0
183
+ // })
184
+ // message.success(this.props.intl.formatMessage({id: 'copySuccess'}));
185
+ // this.props.finish()
186
+ // }
187
+ }
188
+ endFinish=()=>{
189
+ // 结束抄录
190
+ this.setState({
191
+ isStartCopy: false,
192
+ curIndex: 0
193
+ })
194
+ message.success(this.props.intl.formatMessage({id: 'copySuccess'}));
195
+ this.props.finish()
196
+ }
197
+ handleSubmit=()=>{
198
+ this.setState({
199
+ isModalVisibleSubmitError: false
200
+ })
201
+ }
202
+ componentWillMount() {
203
+ // 初始化排序
204
+ let data = this.props.data || this.state.data
205
+ data.content.sort(function (obj1, obj2) {
206
+ var val1 = Number(obj1.sequence);
207
+ var val2 = Number(obj2.sequence);
208
+ if (val1 < val2) {
209
+ return -1;
210
+ } else if (val1 > val2) {
211
+ return 1;
212
+ } else {
213
+ return 0;
214
+ }
215
+ } )
216
+ this.setState({
217
+ data: data
218
+ })
219
+ this.startCopy()
220
+ }
221
+ exit = () => {
222
+ this.props.handleReceiveMsg({
223
+ 'typeId': 121405,
224
+ 'sessionId': window.imRoom.sessionId,
225
+ })
226
+ this.props.finish();
227
+ };
228
+ render() {
229
+ let curItem = this.state.data.list[this.state.curIndex]
230
+ let curSubItem = this.state.data.content[this.state.curIndex]
231
+ console.log('curSubItem',curSubItem)
232
+ // const lang = window.localStorage.getItem("a_lang")
233
+ return (
234
+ <div style={{height:'100%'}}>
235
+ {this.state.isStartCopy && curSubItem.type==3 ? <Risk title={this.state.data.title} length={this.state.data.length} height={this.state.data.height} item={curSubItem} next={this.nextCopy} exit={this.exit}/> : null }
236
+ {/* {this.state.isStartCopy && curSubItem.type==2 ? <Copy item={curSubItem} next={this.nextCopy}/> : null } */}
237
+ {this.state.isStartCopy && curSubItem.type==2 && curSubItem.subContent[0].local.includes('en')? <CopyEn title={this.state.data.title} rate={this.state.data.length/this.state.data.height} item={curSubItem} next={this.nextCopy} exit={this.exit}/> : null }
238
+ {this.state.isStartCopy && curSubItem.type==2 && !curSubItem.subContent[0].local.includes('en')? <CopyTwo title={this.state.data.title} length={this.state.data.length} height={this.state.data.height} rate={this.state.data.length/this.state.data.height} item={curSubItem} next={this.nextCopy} exit={this.exit}/> : null }
239
+ {this.state.isStartCopy && curSubItem.type==1 ? <Agree title={this.state.data.title} item={curSubItem} next={this.nextCopy} exit={this.exit}/> : null }
240
+ {/* {this.state.isStartCopy? null :
241
+ <div className="copylist">
242
+ <div className="thehead">
243
+ <div className="title">
244
+ <div className="title-color"></div>
245
+ <div className="title-text"><FormattedMessage id="copylist" /></div>
246
+ </div>
247
+ <div className="qianshu" onClick={this.startCopy}><FormattedMessage id="copy" /></div>
248
+ </div>
249
+ <div className="contents">
250
+ {
251
+ this.state.data.list.map((item,index) => {
252
+ return (
253
+ <div className="item-panel" key={index}>
254
+ <div className="item-header"> <FormattedMessage id="tradeNo" />: <strong>{item.transactionNumber}</strong></div>
255
+ <div className="item-info">
256
+ <div className="item-sub-title"><FormattedMessage id="productName" />:</div>
257
+ {
258
+ item.productName.map((name,index1)=> <div key={index1} className="content-text">{name}</div>)
259
+ }
260
+ <div className="item-sub-title"><FormattedMessage id="mergedCopyFiles" />:</div>
261
+ {
262
+ item.file.map((file,index2)=> <div key={index2} className="content-text">{file.docText}</div>)
263
+ }
264
+ </div>
265
+ </div>
266
+ )
267
+ })
268
+ }
269
+
270
+ </div>
271
+ </div>} */}
272
+ <Modal transitionName="" getContainer={document.getElementById('multiModule')} maskTransitionName="" destroyOnClose={true} closable={false} centered={true} visible={this.state.isModalVisibleSubmitError} footer={[<div key='end'>
273
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleSubmit}><FormattedMessage id="ok" /></Button>
274
+ </div>
275
+ ]}>
276
+ <div className='endModal'>
277
+ <div className='modalEndTitle'>
278
+ <FormattedMessage id="message" />
279
+ </div>
280
+ <div className='modalEnd'>
281
+ <FormattedMessage id="submission" />
282
+ </div>
283
+ </div>
284
+ </Modal>
285
+ </div>
286
+ );
287
+ }
288
+
289
+ }
290
+
291
+ export default Copylist;
@@ -0,0 +1,83 @@
1
+ .copylist{
2
+ // height: 750px;
3
+ min-height: 100%;
4
+ background: #fff;
5
+ .thehead{
6
+ display: flex;
7
+ justify-content: space-between;
8
+ padding: 14px 24px;
9
+ .title{
10
+ display: flex;
11
+ .title-color{
12
+ width: 2px;
13
+ height: 1.5rem;
14
+ background: #00847F;
15
+ margin-top: 3px;
16
+ }
17
+ .title-text{
18
+ font-size: 1.5rem;
19
+ color: #323232;
20
+ margin-left: 8px;
21
+ }
22
+
23
+ }
24
+ .qianshu{
25
+ width: 96px;
26
+ height: 32px;
27
+ background: #F9F2F3;
28
+ border-radius: 2px;
29
+ border: 1px solid #E5B2B5;
30
+ font-size: 14px;
31
+ color: #DB0011;
32
+ line-height: 32px;
33
+ text-align: center;
34
+ }
35
+ }
36
+ .contents{
37
+ display: flex;
38
+ flex-direction: column;
39
+ flex-wrap: wrap;
40
+ padding: 10px 24px;
41
+ .item-panel{
42
+ width: 100%;
43
+ min-height: 205px;
44
+ background: #FFFFFF;
45
+ border-radius: 4px;
46
+ border: 1px solid #E8E8E8;
47
+ overflow: hidden;
48
+ margin-top: 10px;
49
+ .item-header{
50
+ width: 100%;
51
+ height: 48px;
52
+ background: #FAFBFC;
53
+ border-radius: 4px 4px 0px 0px;
54
+ line-height: 48px;
55
+ font-size: 16px;
56
+ padding-left: 20px;
57
+ }
58
+ .item-info{
59
+ padding: 15px 22px;
60
+ .item-sub-title{
61
+ font-size: 12px;
62
+ font-weight: 400;
63
+ color: #969696;
64
+ &:not(:first-child){
65
+ margin-top: 20px;
66
+ }
67
+ }
68
+ .content-text{
69
+ font-size: 16px;
70
+ font-family: PingFangSC-Regular, PingFang SC;
71
+ font-weight: 400;
72
+ color: #666666;
73
+ line-height: 30px;
74
+ }
75
+ }
76
+
77
+ }
78
+
79
+ }
80
+
81
+
82
+
83
+ }
@@ -0,0 +1,294 @@
1
+ import React, { Component } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import './risk.less'
4
+ import Modal from "antd/lib/modal";
5
+ import 'antd/lib/modal/style'
6
+ import { Button } from '../../../../../node_modules/antd/lib/index';
7
+ class Risk extends Component {
8
+ signCanvas = React.createRef();
9
+ state = {
10
+ canvasCtx: null,
11
+ isModalVisibleEnd: false,
12
+ isModalVisibleSubmit: false,
13
+ isSignOk: false
14
+ };
15
+ componentDidMount() {
16
+ setTimeout(() => {
17
+ // console.log(document.getElementById('multiModule').offsetWidth)
18
+ let canvasWidth = document.getElementById('multiModule').offsetWidth - 40
19
+ let canvasHeight = canvasWidth * (Number(this.props.height)) / (Number(this.props.length))
20
+
21
+ // 适应竖长图
22
+ if(canvasHeight > document.getElementById('multiModule').offsetHeight - 160){
23
+ canvasHeight = document.getElementById('multiModule').offsetHeight - 160
24
+ canvasWidth = canvasHeight * (Number(this.props.length)) / (Number(this.props.height))
25
+ }
26
+
27
+ const canvas = this.refs.canvasF;
28
+ canvas.height =canvasHeight || this.refs.canvasHW.offsetHeight;
29
+ canvas.width = canvasWidth || this.refs.canvasHW.offsetWidth;
30
+
31
+
32
+ this.state.canvasCtx = canvas.getContext('2d');
33
+ this.state.stageInfo = canvas.getBoundingClientRect();
34
+ this.state.canvasCtx.lineWidth = 7;
35
+ this.state.canvasCtx.lineCap = "round";
36
+ this.setState({
37
+ isSignOk: false
38
+ })
39
+ // this.state.isSignOk = false
40
+ canvas.addEventListener('touchstart', this.touchStart, { passive: false });
41
+ canvas.addEventListener('touchmove', this.touchMove, { passive: false });
42
+ canvas.addEventListener('touchend', this.touchEnd, { passive: false });
43
+ }, 10);
44
+ }
45
+ componentWillUnmount () {
46
+ const canvas = this.refs.canvasF;
47
+ canvas.removeEventListener('touchstart', this.touchStart);
48
+ canvas.removeEventListener('touchmove', this.touchMove);
49
+ canvas.removeEventListener('touchend', this.touchEnd);
50
+ }
51
+ // 清空画布
52
+ clearSign = async () => {
53
+ this.setState({
54
+ isSignOk: false
55
+ })
56
+ // this.state.isSignOk = false
57
+ const canvas = this.refs.canvasF;
58
+ // 清除画布
59
+ this.state.canvasCtx.clearRect(
60
+ 0,
61
+ 0,
62
+ canvas.width,
63
+ canvas.height,
64
+ );
65
+ };
66
+
67
+ touchStart=(ev)=> {
68
+ this.setState({
69
+ isSignOk: true
70
+ })
71
+ // this.state.isSignOk = true
72
+ ev = ev || event
73
+ ev.preventDefault()
74
+ if (ev.touches.length == 1) {
75
+ let obj = {
76
+ x: ev.targetTouches[0].clientX,
77
+ y: ev.targetTouches[0].clientY,
78
+ }
79
+ this.state.startX = obj.x
80
+ this.state.startY = obj.y
81
+ this.state.canvasCtx.beginPath()
82
+ const canvas = this.refs.canvasF;
83
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
84
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
85
+ this.state.canvasCtx.stroke()
86
+ this.state.canvasCtx.closePath()
87
+ // this.points.push(obj)
88
+
89
+ }
90
+ }
91
+ touchMove=(ev)=>{
92
+ ev = ev || event
93
+ ev.preventDefault()
94
+ if (ev.touches.length == 1) {
95
+ let obj = {
96
+ x: ev.targetTouches[0].clientX,
97
+ y: ev.targetTouches[0].clientY
98
+ }
99
+ this.state.moveY = obj.y
100
+ this.state.moveX = obj.x
101
+ this.state.canvasCtx.beginPath()
102
+ // strokeStyle = 'blue';
103
+ const canvas = this.refs.canvasF;
104
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
105
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
106
+ this.state.canvasCtx.stroke()
107
+ this.state.canvasCtx.closePath()
108
+ this.state.startY = obj.y
109
+ this.state.startX = obj.x
110
+ // this.points.push(obj)
111
+ }
112
+ }
113
+ touchEnd=(ev)=> {
114
+ ev = ev || event
115
+ ev.preventDefault()
116
+ if (ev.touches.length == 1) {
117
+ let obj = {
118
+ x: ev.targetTouches[0].clientX ,
119
+ y: ev.targetTouches[0].clientY
120
+ }
121
+ this.state.canvasCtx.beginPath()
122
+ const canvas = this.refs.canvasF;
123
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
124
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
125
+ this.state.canvasCtx.stroke()
126
+ this.state.canvasCtx.closePath()
127
+ // this.points.push(obj)
128
+ }
129
+ }
130
+ // pc
131
+ mouseDown=(ev) =>{
132
+ this.setState({
133
+ isSignOk: true
134
+ })
135
+ ev.preventDefault();
136
+ const obj = {
137
+ x: ev.pageX,
138
+ y: ev.pageY,
139
+ };
140
+ const canvas = this.refs.canvasF;
141
+ this.state.startX = obj.x;
142
+ this.state.startY = obj.y;
143
+ this.state.canvasCtx.beginPath();
144
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
145
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
146
+ this.state.canvasCtx.stroke();
147
+ this.state.canvasCtx.closePath();
148
+ this.state.isDown = true;
149
+
150
+ }
151
+ mouseMove=(ev)=> {
152
+ ev.preventDefault();
153
+ if (this.state.isDown) {
154
+ const obj = {
155
+ x: ev.pageX,
156
+ y: ev.pageY,
157
+ };
158
+ const canvas = this.refs.canvasF;
159
+ if(obj.x - canvas.getBoundingClientRect().left<0 || obj.x - canvas.getBoundingClientRect().left> canvas.width || obj.y - canvas.getBoundingClientRect().top< 0 || obj.y - canvas.getBoundingClientRect().top> canvas.height) {
160
+ this.state.isDown = false;
161
+ }
162
+ this.state.moveY = obj.y;
163
+ this.state.moveX = obj.x;
164
+ this.state.canvasCtx.beginPath();
165
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
166
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
167
+ this.state.canvasCtx.stroke();
168
+ this.state.canvasCtx.closePath();
169
+ this.state.startY = obj.y;
170
+ this.state.startX = obj.x;
171
+ }
172
+ }
173
+ mouseUp=(ev)=> {
174
+ ev.preventDefault();
175
+ const obj = {
176
+ x: ev.pageX,
177
+ y: ev.pageY,
178
+ };
179
+ const canvas = this.refs.canvasF;
180
+ this.state.canvasCtx.beginPath();
181
+ this.state.canvasCtx.moveTo(this.state.startX - canvas.getBoundingClientRect().left, this.state.startY - canvas.getBoundingClientRect().top);
182
+ this.state.canvasCtx.lineTo(obj.x - canvas.getBoundingClientRect().left, obj.y - canvas.getBoundingClientRect().top);
183
+ this.state.canvasCtx.stroke();
184
+ this.state.canvasCtx.closePath();
185
+ this.state.isDown = false;
186
+ }
187
+
188
+ commit = async () => {
189
+ if(this.state.isSignOk) {
190
+ const item = this.props.item;
191
+ this.props.next({
192
+ type: item.type,
193
+ file: this.refs.canvasF.toDataURL(), //.replace('data:image/png;base64,',''),
194
+ sequence: item.sequence
195
+ })
196
+ console.log(this.refs.canvasF.toDataURL())
197
+ } else {
198
+ this.setState({
199
+ isModalVisibleSubmit: true
200
+ })
201
+ }
202
+ }
203
+ exit = () => {
204
+ this.setState({
205
+ isModalVisibleEnd: true
206
+ })
207
+ }
208
+ handleCancelEnd = () => {
209
+ this.setState({
210
+ isModalVisibleEnd: false
211
+ })
212
+ }
213
+ handleOkEnd = () => {
214
+ this.setState({
215
+ isModalVisibleEnd: false
216
+ })
217
+ this.props.exit()
218
+ }
219
+ handleSubmit=()=>{
220
+ this.setState({
221
+ isModalVisibleSubmit: false
222
+ })
223
+ }
224
+ render() {
225
+ return (
226
+ <div className="risk">
227
+ <div className="thehead">
228
+ <div className="title">
229
+ <div className="title-color"></div>
230
+ <div className="title-text">{this.props.title}</div>
231
+ </div>
232
+ <div className='btns'>
233
+ <div className="reset" onClick={this.exit}><FormattedMessage id="exit" /></div>
234
+ </div>
235
+ </div>
236
+ <div className="content" ref="canvasHW">
237
+ <canvas
238
+ id="canvasF"
239
+ className='canvasF'
240
+ ref="canvasF"
241
+ onMouseDown={this.mouseDown}
242
+ onMouseMove={this.mouseMove}
243
+ onMouseUp={this.mouseUp}
244
+ ></canvas>
245
+ {
246
+ // !this.state.isSignOk && <div className="signHere"><FormattedMessage id="spaceAccording" /></div>
247
+ !this.state.isSignOk && <div className="signHere">{this.props.item.subContent[0].desc}</div>
248
+ }
249
+
250
+ </div>
251
+ <div className='footRisk'>
252
+ <div className='btns'>
253
+ <div className="reset" onClick={this.clearSign}><FormattedMessage id="clearScreen" /></div>
254
+ <div className="qianshu" onClick={this.commit}><FormattedMessage id="commit" /></div>
255
+
256
+ </div>
257
+ </div>
258
+ <Modal transitionName="" maskTransitionName="" getContainer={document.getElementById('multiModule')} destroyOnClose={true} closable={false} centered={true} visible={this.state.isModalVisibleEnd} footer={[<div key='end'>
259
+ <Button className="modelButtonCancel" onClick={this.handleCancelEnd}><FormattedMessage id="cancel" /></Button>
260
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkEnd}><FormattedMessage id="ok" /></Button>
261
+ </div>
262
+ ]}>
263
+ <div className='endModal'>
264
+ <div className='modalEndTitle'>
265
+ <FormattedMessage id="whether" />
266
+ </div>
267
+ <div className='modalEnd'>
268
+ <FormattedMessage id="progress" />
269
+
270
+
271
+ </div>
272
+ </div>
273
+ </Modal>
274
+ <Modal transitionName="" maskTransitionName="" getContainer={document.getElementById('multiModule')} destroyOnClose={true} closable={false} centered={true} visible={this.state.isModalVisibleSubmit} footer={[<div key='end'>
275
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleSubmit}><FormattedMessage id="ok" /></Button>
276
+ </div>
277
+ ]}>
278
+ <div className='endModal'>
279
+ <div className='modalEndTitle'>
280
+
281
+ <FormattedMessage id="message" />
282
+ </div>
283
+ <div className='modalEnd'>
284
+ <FormattedMessage id="signatureNot" />
285
+ </div>
286
+ </div>
287
+ </Modal>
288
+ </div>
289
+ );
290
+ }
291
+
292
+ }
293
+
294
+ export default Risk;