react_hsbc_teller 1.6.7 → 1.6.9

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.
@@ -4,6 +4,7 @@
4
4
  import React, { Component, useState } from 'react';
5
5
  import API from '../../api/api';
6
6
  import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
7
+ import { BoardOperate } from '../../common/index.esm.js';
7
8
  import './video.less'
8
9
  import Header from '../header/header.jsx'
9
10
  import Foot from '../foot/foot.jsx'
@@ -23,10 +24,11 @@ import Spin from "antd/lib/spin";
23
24
  import 'antd/lib/spin/style'
24
25
  import Select from "antd/lib/select";
25
26
  import 'antd/lib/select/style'
26
-
27
+ import styled from 'styled-components';
27
28
  import { Button } from '../../../node_modules/antd/lib/index';
28
29
  import SignMy from '../sign/signMy.jsx'
29
30
  import axios from 'axios';
31
+ import CryptoJS from "crypto-js";
30
32
  const { Option } = Select;
31
33
  const LEAVE_TYPE = {
32
34
  TELLER_EXIT: 1, // 坐席退出
@@ -42,6 +44,36 @@ let messageValue = ''
42
44
  let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
43
45
  let rateList = []
44
46
  let beautyDiv = {};
47
+ const CanvasHome = styled.div`
48
+ position: fixed;
49
+ width: 76vw;
50
+ height: 74vh;
51
+ top: 3vh;
52
+ left: 1.5vw;
53
+ z-index:999;
54
+
55
+ .canvas{
56
+ width:100%;
57
+ height:100%;
58
+ box-shadow: 0 0 5px 0 #06a;
59
+ display:none;
60
+ }
61
+ `;
62
+ const OpreateDiv = styled.div`
63
+ display: inline-block;
64
+ margin-left: 10vw;
65
+ padding: 0 6px;
66
+ height: 4vh;
67
+ line-height: 4vh;
68
+ border-radius: 5px;
69
+ background: #fff;
70
+ font-size: 16px;
71
+ border: #333 1px solid;
72
+ span{
73
+ margin-right:10px;
74
+ cursor:pointer;
75
+ }
76
+ `;
45
77
  function clearStreamRemain() {
46
78
  if (!(beautyDiv.beauty_canvas == null || beautyDiv.beauty_canvas == undefined)) {
47
79
  beautyDiv.beauty_canvas = null;
@@ -69,6 +101,7 @@ message.config({
69
101
  class Video extends Component {
70
102
  constructor(props) {
71
103
  super(props)
104
+ this.boardOperate = null;
72
105
  }
73
106
  cancel = axios.CancelToken.source()
74
107
  state = {
@@ -213,10 +246,15 @@ class Video extends Component {
213
246
  ],
214
247
  shareMaskState: false,
215
248
  idCardName: '',
216
- idCardNumber: ''
249
+ idCardNumber: '',
250
+ operateShow: false,
251
+ drawConfig: {
252
+ curryControl: 'pen', // 工具类型
253
+ }
217
254
  };
218
255
  // eslint-disable-next-line no-undef
219
256
  test_controller = '';
257
+
220
258
  /**
221
259
  * 创建房间成功后回调后台
222
260
  * @param {JSON} data 数据类型
@@ -297,6 +335,35 @@ class Video extends Component {
297
335
 
298
336
  }
299
337
  };
338
+ decrypt(data) {
339
+ let keyStr = "le&&If?()*^%$#hA"
340
+ let iv = CryptoJS.enc.Utf8.parse("jwe232DEE?^%$eq3")
341
+ let encryptedHexStr = CryptoJS.enc.Hex.parse(data);
342
+ let content = CryptoJS.enc.Base64.stringify(encryptedHexStr);
343
+ let key = CryptoJS.enc.Utf8.parse(keyStr);
344
+ let decrypt = CryptoJS.AES.decrypt(content, key, {
345
+ iv: iv,
346
+ mode: CryptoJS.mode.CBC,
347
+ padding: CryptoJS.pad.Pkcs7,
348
+ });
349
+ return CryptoJS.enc.Utf8.stringify(decrypt).toString();
350
+ }
351
+ encrypt(data) {
352
+ let keyStr = "le&&If?()*^%$#hA"
353
+ let iv = CryptoJS.enc.Utf8.parse("jwe232DEE?^%$eq3")
354
+ let dataString = data;
355
+ if (typeof data !== "string") {
356
+ dataString = JSON.stringify(data);
357
+ }
358
+ const key = CryptoJS.enc.Utf8.parse(keyStr);
359
+ let sc = CryptoJS.enc.Utf8.parse(dataString);
360
+ let encrypted = CryptoJS.AES.encrypt(sc, key, {
361
+ iv: iv,
362
+ mode: CryptoJS.mode.CBC,
363
+ padding: CryptoJS.pad.Pkcs7,
364
+ });
365
+ return encrypted.ciphertext.toString();
366
+ }
300
367
  /**
301
368
  * 初始化获取数据
302
369
  * @param {JSON} data 数据类型
@@ -304,18 +371,13 @@ class Video extends Component {
304
371
  mpaasSig = async data => {
305
372
  console.log(data);
306
373
  try {
307
- let result = await API.mpaasSig({ account: data.account, type: data.type });
308
- console.log(result);
374
+ // let result = JSON.parse(this.decrypt(await API.mpaasSig({ ciphertext: this.encrypt({account: data.account, type: data.type})})));
375
+ let result = await API.mpaasSig({account: data.account, type: data.type});
376
+ console.log('mpaasSig',result,result.mpsSig);
309
377
  window.sessionStorage.setItem('alimpassSig', result.mpsSig);
310
378
  this.state.workSpaceId = result.workspaceId,
311
379
  this.state.appId = result.appId,
312
380
  this.state.bizName = result.bizName
313
- // const data1={
314
- // hostname: 'im.uat.dsp.hsbcfts.com.cn',
315
- // webPort: '443',
316
- // account: 'web',
317
- // openfireToken: '123'
318
- // }
319
381
  window.sessionStorage.setItem('sigData', JSON.stringify(result));
320
382
  if (data.sigType == 1) {
321
383
  this.handleEdit()
@@ -2500,6 +2562,12 @@ class Video extends Component {
2500
2562
  this.test_controller.OnNewJoinerIn = (participant) => {
2501
2563
  console.log('新加⼊房间者', participant);
2502
2564
  this.state.isCustomer= true
2565
+ if(this.props.isOpenSound) {
2566
+ let src = autod
2567
+ let audio = new Audio(src)
2568
+ audio.play()
2569
+ }
2570
+
2503
2571
  // let src = autod
2504
2572
  // let audio = new Audio(src)
2505
2573
  // audio.play()
@@ -2887,9 +2955,13 @@ class Video extends Component {
2887
2955
  exitType
2888
2956
  ) => {
2889
2957
  console.log('退出房间者', participant, exitType)
2890
- // let src = leftMetting
2891
- // let audio = new Audio(src)
2892
- // audio.play()
2958
+ if(this.props.isOpenSound) {
2959
+ let src = leftMetting
2960
+ let audio = new Audio(src)
2961
+ audio.play()
2962
+ }
2963
+
2964
+
2893
2965
  this.appGetUsernameClick(participant).then((res)=>{
2894
2966
  console.log('退出房间者',res)
2895
2967
  let data = res? res.username ? res.username : '客户' : '客户'
@@ -3262,6 +3334,7 @@ userType:'1'
3262
3334
  let result = await API.videoRecordCallback({
3263
3335
  activityId: this.props.businessNumber,
3264
3336
  sessionId: this.state.sessionId,
3337
+ roomId: this.state.channelId,
3265
3338
  type: type,
3266
3339
  status: status
3267
3340
  });
@@ -4414,13 +4487,81 @@ userType:'1'
4414
4487
  // }
4415
4488
  }
4416
4489
  }
4417
-
4418
4490
  this.navigatorClick()
4491
+
4419
4492
  } else {
4420
4493
  this.messageClick('internal staff正在共享屏幕,请先关闭','error')
4421
4494
  }
4422
4495
  }
4423
4496
  }
4497
+ openCanvas(drawCanvas) {
4498
+ if (!this.boardOperate) {
4499
+ this.boardOperate = new BoardOperate(drawCanvas, {
4500
+ drawColor: "#000000",
4501
+ drawType: "pen",
4502
+ lineWidth: 5,
4503
+ fillStyle: '', // 初始背景色,若为空则透明背景
4504
+ });
4505
+ }
4506
+ }
4507
+ closeCanvas() {
4508
+ this.boardOperate.destroy();
4509
+ this.boardOperate = null;
4510
+ }
4511
+
4512
+ setTool(type) {
4513
+ const { drawConfig } = this.state;
4514
+ drawConfig.curryControl = type;
4515
+ this.boardOperate.changeWay({
4516
+ type
4517
+ });
4518
+
4519
+ this.setState({ drawConfig });
4520
+ }
4521
+
4522
+ setOpreate(type) {
4523
+ this.boardOperate[type]();
4524
+ }
4525
+ downCanvas() {
4526
+ const canvas = document.getElementById('canvas');
4527
+ const base64 = canvas.toDataURL();
4528
+
4529
+
4530
+ let img = document.createElement('img');
4531
+ img.style.position = 'fixed';
4532
+ img.style.width = '90vw';
4533
+ img.style.height = '95vh';
4534
+ img.style.top = '9vh';
4535
+ img.style.left = '5vw';
4536
+ img.src = base64;
4537
+ document.body.appendChild(img);
4538
+
4539
+ }
4540
+ graffiti=()=>{
4541
+ if(!this.state.operateShow) {
4542
+ this.change(true)
4543
+ }
4544
+
4545
+ }
4546
+ closeGraffiti=()=>{
4547
+ this.change(false)
4548
+ }
4549
+ change(val) {
4550
+ this.setState({ operateShow: val })
4551
+ const canvas = document.getElementById('canvas');
4552
+ if (val) {
4553
+ canvas.style.display = 'block';
4554
+ canvas.width = canvas.clientWidth;
4555
+ canvas.height = canvas.clientHeight;
4556
+ setTimeout(() => {
4557
+ this.openCanvas(canvas)
4558
+ }, 0);
4559
+ } else {
4560
+ // this.downCanvas()
4561
+ this.closeCanvas();
4562
+ canvas.style.display = 'none';
4563
+ }
4564
+ }
4424
4565
  switchSelect = (value) => {
4425
4566
  this.setState({
4426
4567
  isSelect: value,
@@ -4783,7 +4924,19 @@ userType:'1'
4783
4924
  {tabTitleList}
4784
4925
  {/* <img style={sectionStyle} src={require("../../assets/img/placeholder_bg.png").default} alt="" /> */}
4785
4926
  <div id="whiteboardDIV" style={{height: 'calc(100% - 33px)'}}>
4786
-
4927
+ <CanvasHome>
4928
+ {this.state.operateShow &&
4929
+ <OpreateDiv id="operate">
4930
+ <span onClick={() => this.setTool('pen')}>铅笔</span>
4931
+ <span onClick={() => this.setTool('eraser')}>橡皮</span>
4932
+ <span onClick={() => this.setOpreate('undo')}>撤销</span>
4933
+ <span onClick={() => this.setOpreate('redo')}>恢复</span>
4934
+ <span onClick={() => this.setOpreate('clear')}>清除</span>
4935
+ <span onClick={() => this.closeGraffiti()}>关闭</span>
4936
+ </OpreateDiv>
4937
+ }
4938
+ <canvas id="canvas" className="canvas"></canvas>
4939
+ </CanvasHome>
4787
4940
  <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMScreen' || this.state.isSelect == 'staffScreen') ? '' : 'none', }}>
4788
4941
  <div className="videoDiv">
4789
4942
  <video
@@ -5275,6 +5428,7 @@ userType:'1'
5275
5428
  switchExternal={this.switchExternal}
5276
5429
  inspection={this.inspection}
5277
5430
  beautyClick={this.beautyClick}
5431
+ graffiti={this.graffiti}
5278
5432
  ></Foot>
5279
5433
  <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
5280
5434
  onCancel={this.handleCancel}>
@@ -5439,7 +5593,7 @@ sessionId: "",
5439
5593
  microphoneSize: 25,
5440
5594
  fontSize: '14',
5441
5595
  fontFamily: 'auto',
5442
- menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY'],
5596
+ menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI'],
5443
5597
  customLeaveRoom: '客户离开房间',
5444
5598
  meetingInfo: {
5445
5599
  title: '--',
@@ -5449,6 +5603,7 @@ sessionId: "",
5449
5603
  },
5450
5604
  isTranscribing: false,
5451
5605
  shareMask: false,
5606
+ isOpenSound: false, // true开启进出音效 false不开启
5452
5607
  internalUrl: 'https://wp-staff-gateway.wealth-platform.uat.ali.cloud.cn.hsbc/meeting-ui/OHB/CN/HSBC?chnlID=OHB&locale=zh_CN&chnlCC=CN&chnlGMC=HSBC&targetFunc=supervisorMeeting&sourceFunc=rmMeeting'
5453
5608
  }
5454
5609
  export default Video