react_hsbc_teller 2.0.54 → 2.0.56
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.
- package/.babelrc +39 -39
- package/README.en.md +36 -36
- package/README.md +329 -323
- package/config/webpack.config.js +119 -119
- package/config/webpack.dev.js +108 -108
- package/config/webpack.prod.js +104 -104
- package/lib/hsbc.js +1 -1
- package/lib/hsbc.js.LICENSE.txt +13 -16
- package/package.json +110 -110
- package/packages/api/api.js +818 -818
- package/packages/api/server.js +50 -50
- package/packages/common/index.esm.js +374 -374
- package/packages/demo/demo.js +306 -306
- package/packages/demo/index.js +3 -3
- package/packages/demo/pdf.js +94 -94
- package/packages/envconfig/envconfig.js +12 -12
- package/packages/index.js +2 -2
- package/packages/pages/components/step/step.jsx +32 -31
- package/packages/pages/foot/foot.jsx +235 -235
- package/packages/pages/foot/foot.less +85 -85
- package/packages/pages/header/header.jsx +15 -15
- package/packages/pages/header/header.less +51 -51
- package/packages/pages/index.jsx +52 -52
- package/packages/pages/multiModule/components/copy/agree.jsx +115 -115
- package/packages/pages/multiModule/components/copy/agree.less +105 -105
- package/packages/pages/multiModule/components/copy/copyTwo.jsx +682 -682
- package/packages/pages/multiModule/components/copy/copyTwo.less +180 -180
- package/packages/pages/multiModule/components/copy/copy_en.jsx +368 -368
- package/packages/pages/multiModule/components/copy/copy_en.less +145 -145
- package/packages/pages/multiModule/components/copy/copylist.jsx +291 -291
- package/packages/pages/multiModule/components/copy/copylist.less +83 -83
- package/packages/pages/multiModule/components/copy/risk.jsx +296 -296
- package/packages/pages/multiModule/components/copy/risk.less +123 -123
- package/packages/pages/multiModule/components/sign/signMy.jsx +308 -308
- package/packages/pages/multiModule/components/sign/signMy.less +127 -127
- package/packages/pages/multiModule/components/subscribe/subscribe.jsx +113 -113
- package/packages/pages/multiModule/components/subscribe/subscribe.less +82 -82
- package/packages/pages/multiModule/multiModule.jsx +26 -26
- package/packages/pages/multiModule/multiModule.less +19 -19
- package/packages/pages/sign/signMy.jsx +223 -223
- package/packages/pages/sign/signMy.less +129 -129
- package/packages/pages/video/video.jsx +7746 -7745
- package/packages/pages/video/video.less +715 -715
- package/packages/style/index.less +1 -1
- package/packages/style/reset.less +345 -345
- package/packages/utils/asrController.js +259 -259
- package/packages/utils/asyncComponent.jsx +26 -26
- package/packages/utils/mixin.js +27 -27
- package/packages/utils/setRem.js +10 -10
- package/packages/utils/utils.js +199 -199
- package/public/index.html +77 -77
- package/src/index.js +11 -11
- package/src/index.less +5 -5
- package/tsconfig.json +11 -11
|
@@ -1,291 +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;
|
|
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;
|