cnhis-design-vue 2.1.34 → 2.1.36

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 (129) hide show
  1. package/CHANGELOG.md +43 -9
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +133 -117
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/carousel/index.js +8 -8
  19. package/es/cascader/index.js +8 -8
  20. package/es/checkbox/index.js +9 -9
  21. package/es/col/index.js +8 -8
  22. package/es/collapse/index.js +8 -8
  23. package/es/color-picker/index.js +1 -1
  24. package/es/comment/index.js +8 -8
  25. package/es/config-provider/index.js +8 -8
  26. package/es/date-picker/index.js +8 -8
  27. package/es/descriptions/index.js +8 -8
  28. package/es/divider/index.js +8 -8
  29. package/es/drag-layout/index.js +3 -3
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +1 -1
  33. package/es/empty/index.js +8 -8
  34. package/es/fabric-chart/index.js +646 -2463
  35. package/es/fabric-chart/style.css +1 -1
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/form-table/index.js +62 -62
  39. package/es/index/index.js +1801 -3244
  40. package/es/index/style.css +1 -1
  41. package/es/input/index.js +9 -9
  42. package/es/input-number/index.js +8 -8
  43. package/es/layout/index.js +8 -8
  44. package/es/list/index.js +8 -8
  45. package/es/locale-provider/index.js +8 -8
  46. package/es/map/index.js +9 -9
  47. package/es/mentions/index.js +8 -8
  48. package/es/menu/index.js +8 -8
  49. package/es/message/index.js +8 -8
  50. package/es/multi-chat/index.js +726 -379
  51. package/es/multi-chat/style.css +1 -1
  52. package/es/multi-chat-client/index.js +653 -325
  53. package/es/multi-chat-client/style.css +1 -1
  54. package/es/multi-chat-history/index.js +4 -4
  55. package/es/multi-chat-record/index.js +120 -40
  56. package/es/multi-chat-setting/index.js +154 -49
  57. package/es/multi-chat-sip/index.js +1 -1
  58. package/es/notification/index.js +8 -8
  59. package/es/page-header/index.js +8 -8
  60. package/es/pagination/index.js +8 -8
  61. package/es/popconfirm/index.js +8 -8
  62. package/es/popover/index.js +8 -8
  63. package/es/progress/index.js +8 -8
  64. package/es/radio/index.js +9 -9
  65. package/es/rate/index.js +8 -8
  66. package/es/result/index.js +8 -8
  67. package/es/row/index.js +8 -8
  68. package/es/scale-view/index.js +33 -33
  69. package/es/select/index.js +11 -11
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +2 -2
  72. package/es/shortcut-setter/index.js +10 -10
  73. package/es/skeleton/index.js +8 -8
  74. package/es/slider/index.js +8 -8
  75. package/es/space/index.js +8 -8
  76. package/es/spin/index.js +8 -8
  77. package/es/statistic/index.js +8 -8
  78. package/es/steps/index.js +8 -8
  79. package/es/switch/index.js +8 -8
  80. package/es/table-filter/index.js +84 -73
  81. package/es/table-filter/style.css +1 -1
  82. package/es/tabs/index.js +8 -8
  83. package/es/tag/index.js +9 -9
  84. package/es/time-picker/index.js +8 -8
  85. package/es/timeline/index.js +8 -8
  86. package/es/tooltip/index.js +8 -8
  87. package/es/transfer/index.js +8 -8
  88. package/es/tree/index.js +8 -8
  89. package/es/tree-select/index.js +8 -8
  90. package/es/upload/index.js +8 -8
  91. package/es/utils/UniRTCv2.js +50 -15
  92. package/es/verification-code/index.js +2 -2
  93. package/lib/cui.common.js +1940 -3417
  94. package/lib/cui.umd.js +1940 -3417
  95. package/lib/cui.umd.min.js +48 -48
  96. package/package.json +2 -1
  97. package/packages/big-table/src/BigTable.vue +10 -8
  98. package/packages/big-table/src/components/AutoLayoutButton.vue +3 -3
  99. package/packages/fabric-chart/src/FabricChart.vue +8 -36
  100. package/packages/fabric-chart/src/FabricGrid.vue +3 -10
  101. package/packages/fabric-chart/src/components/TimeScaleValue.vue +10 -8
  102. package/packages/fabric-chart/src/const/defaultVaule.js +59 -59
  103. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +3 -3
  104. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +3 -23
  105. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +49 -41
  106. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +5 -6
  107. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +50 -42
  108. package/packages/fabric-chart/src/mixins/draw.js +25 -5
  109. package/packages/fabric-chart/src/mixins/fabricCommon.js +14 -4
  110. package/packages/multi-chat/chat/audio.vue +82 -14
  111. package/packages/multi-chat/chat/chatFooter.vue +3 -1
  112. package/packages/multi-chat/chat/chatMain.vue +17 -2
  113. package/packages/multi-chat/chat/index.vue +23 -3
  114. package/packages/multi-chat/chat/multiVideo.vue +4 -3
  115. package/packages/multi-chat/chat/video.vue +2 -1
  116. package/packages/multi-chat/store/getters.js +12 -0
  117. package/packages/multi-chat/store/mutation.js +12 -0
  118. package/packages/multi-chat/store/state.js +5 -1
  119. package/packages/multi-chat/utils/index.js +53 -0
  120. package/packages/multi-chat/utils/rtc-client.js +50 -3
  121. package/packages/scale-view/scaleView.vue +2010 -2010
  122. package/packages/table-filter/src/base-search-com/BaseSearch.vue +9 -0
  123. package/src/utils/UniRTCv2.js +40 -12
  124. package/packages/fabric-chart/src/fabric-chart2/FabricBottom.vue +0 -108
  125. package/packages/fabric-chart/src/fabric-chart2/FabricCanvas.vue +0 -181
  126. package/packages/fabric-chart/src/fabric-chart2/FabricCenter.vue +0 -612
  127. package/packages/fabric-chart/src/fabric-chart2/FabricLeft.vue +0 -104
  128. package/packages/fabric-chart/src/fabric-chart2/FabricRight.vue +0 -112
  129. package/packages/fabric-chart/src/fabric-chart2/FabricTop.vue +0 -172
@@ -76,7 +76,7 @@ import fetch, { qs } from '@/utils/chatFetch';
76
76
  import RtcClient from '../utils/rtc-client-multi';
77
77
  import { getSipUserId } from '@/utils/sip-device';
78
78
  import uniRTCAPI from './mixins/uniRTCAPI';
79
- import { getClientDeviceToken } from '../utils/index';
79
+ import { getClientDeviceToken, startVideoCall, getUuid } from '../utils/index';
80
80
  export default {
81
81
  inject: ['store', 'i18nText'],
82
82
  mixins: [uniRTCAPI],
@@ -119,7 +119,10 @@ export default {
119
119
  'muteAudio',
120
120
  'curScrollItem',
121
121
  'outing',
122
- 'callerStatus'
122
+ 'callerStatus',
123
+ 'doctorInfo',
124
+ 'requestId',
125
+ 'callTimer'
123
126
  ]),
124
127
  mySipName() {
125
128
  const videoData = this.videoData;
@@ -202,12 +205,14 @@ export default {
202
205
  }
203
206
  },
204
207
  beforeDestroy() {
208
+ clearInterval(this.callTimer)
209
+ this.setCallTimer(null)
205
210
  clearInterval(this.timer);
206
211
  clearInterval(this.expireTimer);
207
212
  },
208
213
  methods: {
209
214
  ...mapActions(['sendMessage']),
210
- ...mapMutations(['setShowAudio', 'setVideoData', 'setRecordId', 'setShowVideo', 'setVideoMembers', 'setMuteAudio']),
215
+ ...mapMutations(['setShowAudio', 'setVideoData', 'setRecordId', 'setShowVideo', 'setVideoMembers', 'setMuteAudio', 'setTargetInfo', 'setRequestId', 'setCallTimer']),
211
216
  playStream(stream, id, isUserId = true) {
212
217
  const el = this.$el.querySelector(`#${isUserId ? 'uid_' : ''}${id}`);
213
218
  el && stream.play(el);
@@ -242,6 +247,23 @@ export default {
242
247
  document.onmouseup = null;
243
248
  };
244
249
  },
250
+ sendVideoCall(flag) {
251
+ const curScrollItemParams = JSON.parse(this.curScrollItem?.params)
252
+ const startVideoParam = {
253
+ customerId: curScrollItemParams.customerId,
254
+ doctorIdNo: this.doctorInfo.idCard,
255
+ doctorId: this.doctorInfo.userId,
256
+ sendStatus: flag,
257
+ requestId: this.requestId
258
+ }
259
+ return startVideoCall(startVideoParam).then(videoRes => {
260
+ if (!videoRes) {
261
+ return false
262
+ }
263
+ console.log('推送公众号成功');
264
+ return videoRes
265
+ })
266
+ },
245
267
  /* 发起邀请 */
246
268
  lanchInvite() {
247
269
  let memberIds = this.videoMembers.map(item => item.userId).join(',');
@@ -258,25 +280,62 @@ export default {
258
280
  params.sipKey = callerSipKey;
259
281
  params.sipName = callerSipName;
260
282
  }
261
- fetch.post('/chat/access/videoInvite', qs.stringify(params)).then(({ data }) => {
283
+ fetch.post('/chat/access/videoInvite', qs.stringify(params)).then(async ({ data }) => {
262
284
  if (data.result === 'SUCCESS') {
285
+ this.setRequestId(getUuid())
263
286
  this.$message.success(this.i18nText('1.9.386'));
264
287
  // this.appendVideoMessage();
265
288
  this.setVideoData(data.map);
289
+ this.setTargetInfo({username: data.map?.targetList[0].username, token: data.map?.targetList[0].token})
266
290
  // 江苏省
267
291
  if (this.uniRTC || data.map?.vendor == 3) {
268
292
  console.log('this.curScrollItem', this.curScrollItem);
269
293
  const curScrollItemParams = JSON.parse(this.curScrollItem?.params)
270
- getClientDeviceToken(curScrollItemParams.customerId).then(tokenRes => {
271
- if (!tokenRes) {
272
- return
273
- }
274
- const targetInfo = data.map?.targetList || [];
275
- // const targetList = data.map?.targetList || [];
276
- const targetList = [{deviceToken: tokenRes.deviceToken, username: targetInfo[0].username, token: targetInfo[0].token}]
294
+ const videoCallInfo = await this.sendVideoCall(false)
295
+ if (Array.isArray(videoCallInfo) && videoCallInfo.length) {
296
+ let targetList = videoCallInfo.map(item => {
297
+ return {
298
+ deviceToken: item.token
299
+ }
300
+ })
277
301
  this.checkStatus(targetList);
278
- this.startCall(targetList);
279
- })
302
+ } else {
303
+ getClientDeviceToken(curScrollItemParams.customerId).then(tokenRes => {
304
+ if (!tokenRes || tokenRes.code != 200) {
305
+ return
306
+ }
307
+ const targetInfo = data.map?.targetList || [];
308
+ // const targetList = data.map?.targetList || [];
309
+ const targetList = [{deviceToken: tokenRes.deviceToken, username: targetInfo[0].username, token: targetInfo[0].token}]
310
+ this.checkStatus(targetList);
311
+ // this.startCall(targetList);
312
+ })
313
+ }
314
+ const timerId = setInterval(async () => {
315
+ console.log('定时调用查询状态');
316
+ const curScrollItemParams1 = JSON.parse(this.curScrollItem?.params)
317
+ const videoCallInfo1 = await this.sendVideoCall(false)
318
+ if (Array.isArray(videoCallInfo1) && videoCallInfo1.length) {
319
+ let targetList = videoCallInfo1.map(item => {
320
+ return {
321
+ deviceToken: item.token
322
+ }
323
+ })
324
+ this.checkStatus(targetList);
325
+ } else {
326
+ getClientDeviceToken(curScrollItemParams1.customerId).then(tokenRes => {
327
+ if (!tokenRes || tokenRes.code != 200) {
328
+ return
329
+ }
330
+ const targetInfo = data.map?.targetList || [];
331
+ // const targetList = data.map?.targetList || [];
332
+ const targetList = [{deviceToken: tokenRes.deviceToken, username: targetInfo[0].username, token: targetInfo[0].token}]
333
+ this.checkStatus(targetList);
334
+ // this.startCall(targetList);
335
+ })
336
+ }
337
+ }, 7000)
338
+ this.setCallTimer(timerId)
280
339
  }
281
340
  } else {
282
341
  this.$message.warning(data.resultMsg);
@@ -286,6 +345,8 @@ export default {
286
345
  },
287
346
  /* 挂断视频 */
288
347
  handleReject(accept, isTimeOut = false) {
348
+ clearInterval(this.callTimer)
349
+ this.setCallTimer(null)
289
350
  if (!this.videoData?.inviteResult) {
290
351
  if (this.validTalkingEnv && accept == '1') {
291
352
  this.validTalkingEnv().then(res => {
@@ -335,6 +396,8 @@ export default {
335
396
  if (accept == '0') {
336
397
  this.$message.success(`${this.i18nText('1.9.387')}!`);
337
398
  this.setShowAudio(false);
399
+ clearInterval(this.callTimer)
400
+ this.setCallTimer(null)
338
401
  this.setMuteAudio(false);
339
402
  this.setVideoMembers([]);
340
403
  this.setVideoData({});
@@ -352,6 +415,8 @@ export default {
352
415
  if (data.map.type == 1 && data.map.mode == 2) {
353
416
  this.setShowVideo(true);
354
417
  this.setShowAudio(false);
418
+ clearInterval(this.callTimer)
419
+ this.setCallTimer(null)
355
420
  }
356
421
  this.setVideoData(data.map);
357
422
  this.$nextTick(() => {
@@ -409,7 +474,8 @@ export default {
409
474
  wsUrl: this.sdkInfo?.wsUrl,
410
475
  turnUrl: this.sdkInfo?.turnUrl,
411
476
  turnUsername: this.sdkInfo?.turnUsername,
412
- turnCredential: this.sdkInfo?.turnCredential
477
+ turnCredential: this.sdkInfo?.turnCredential,
478
+ videoData: this.videoData
413
479
  });
414
480
  this.timer = setInterval(() => {
415
481
  this.meetingTime = this.meetingTime + 1;
@@ -429,6 +495,8 @@ export default {
429
495
  this.rtc.leave();
430
496
  this.rtc = null;
431
497
  }
498
+ clearInterval(this.callTimer)
499
+ this.setCallTimer(null)
432
500
  }
433
501
  },
434
502
  watch: {
@@ -402,7 +402,8 @@ export default {
402
402
  'setLastCurrentTab',
403
403
  'setIsRecorderVoice',
404
404
  'setVideoData',
405
- 'setSessionType'
405
+ 'setSessionType',
406
+ 'setCallerStatus'
406
407
  ]),
407
408
  ...mapMutations({
408
409
  clearMsgList: 'setMsgList'
@@ -722,6 +723,7 @@ export default {
722
723
  });
723
724
  },
724
725
  handleVideoClick(type) {
726
+ this.setCallerStatus('')
725
727
  // this.curScrollItem.type 2多人 1单人
726
728
  if (this.sessionType === 2) {
727
729
  this.$emit('update:addvisible', true);
@@ -299,7 +299,9 @@ export default {
299
299
  'enable',
300
300
  'appendList',
301
301
  'queueItem',
302
- 'isRecorderVoice'
302
+ 'isRecorderVoice',
303
+ 'callTimer',
304
+ 'requestId'
303
305
  ]),
304
306
  orgId() {
305
307
  const getters = this.store.getters;
@@ -396,6 +398,7 @@ export default {
396
398
  },
397
399
  created() {
398
400
  this.attachEvent();
401
+ this.getUserInformation();
399
402
  },
400
403
  methods: {
401
404
  ...mapMutations([
@@ -411,13 +414,25 @@ export default {
411
414
  'setShowAudio',
412
415
  'setVideoMode',
413
416
  'setVideoMembers',
414
- 'setIsRecorderVoice'
417
+ 'setIsRecorderVoice',
418
+ 'setDoctorInfo',
419
+ 'setCallTimer'
415
420
  ]),
416
421
  ...mapActions({
417
422
  getEarlierMsg: 'setMsgList',
418
423
  handleBotChat: 'handleBotChat',
419
424
  sendMessage: 'sendMessage'
420
425
  }),
426
+ // 获取医生信息
427
+ getUserInformation() {
428
+ const url = '/user/getUserInformation';
429
+ fetch.get(url).then(({ data }) => {
430
+ if (data.result === 'SUCCESS') {
431
+ this.setDoctorInfo(data?.map?.sysUserInformation)
432
+ console.log('data?.map?.sysUserInformation', data?.map?.sysUserInformation);
433
+ }
434
+ });
435
+ },
421
436
  getMessageItemClass(item) {
422
437
  // content.source === 1, 代表为系统消息, 系统统一左侧展示
423
438
  if (item.content?.source === 1) {
@@ -336,7 +336,7 @@ import addConference from './addConference';
336
336
  import ClassifyTabs from '../components/classify-tabs';
337
337
  import ChatTabsHeader from '../components/chat-tabs-header';
338
338
  import UserStatus from '../components/user-status';
339
- import { checkTalkingEnv } from '../utils/index';
339
+ import { checkTalkingEnv, startVideoCall } from '../utils/index';
340
340
  import uniRTCAPI from './mixins/uniRTCAPI';
341
341
 
342
342
  export default {
@@ -475,7 +475,10 @@ export default {
475
475
  'curScrollItem',
476
476
  'disableOperate',
477
477
  'sdkInfo',
478
- 'closedSession'
478
+ 'closedSession',
479
+ 'doctorInfo',
480
+ 'targetInfo',
481
+ 'requestId'
479
482
  ]),
480
483
  isNormalStyle() {
481
484
  return this.styleFold !== 'Y';
@@ -646,7 +649,8 @@ export default {
646
649
  'setQueueItem',
647
650
  'setCurScrollItem',
648
651
  'setSessionType',
649
- 'setCallerStatus'
652
+ 'setCallerStatus',
653
+ 'setOuting'
650
654
  ]),
651
655
  ...mapActions(['setChatTimer', 'getVideoHistoryList', 'initUniRTC']),
652
656
  ...mapActions({
@@ -1309,6 +1313,22 @@ export default {
1309
1313
  assemblyId: this.assemblyId
1310
1314
  }
1311
1315
  },
1316
+ sendVideoCall() {
1317
+ const curScrollItemParams = JSON.parse(this.curScrollItem?.params)
1318
+ const startVideoParam = {
1319
+ customerId: curScrollItemParams.customerId,
1320
+ doctorIdNo: this.doctorInfo.idCard,
1321
+ doctorId: this.doctorInfo.userId,
1322
+ sendStatus: true,
1323
+ requestId: this.requestId
1324
+ }
1325
+ startVideoCall(startVideoParam).then(videoRes => {
1326
+ if (!videoRes) {
1327
+ return
1328
+ }
1329
+ console.log('推送公众号成功');
1330
+ })
1331
+ },
1312
1332
  // 获取视频sdk
1313
1333
  getSdkAppId() {
1314
1334
  fetch
@@ -480,12 +480,12 @@ export default {
480
480
  const curScrollItemParams = JSON.parse(this.curScrollItem?.params)
481
481
  getClientDeviceToken(curScrollItemParams.customerId).then(tokenRes => {
482
482
  const targetInfo = data.map?.targetList || [];
483
- if (!tokenRes) {
483
+ if (!tokenRes || tokenRes.code != 200) {
484
484
  return
485
485
  }
486
486
  const targetList = [{deviceToken: tokenRes.deviceToken, username: targetInfo[0].username, token: targetInfo[0].token}]
487
487
  this.checkStatus(targetList);
488
- this.startCall(targetList);
488
+ // this.startCall(targetList);
489
489
  })
490
490
  }
491
491
  } else {
@@ -544,7 +544,8 @@ export default {
544
544
  wsUrl: this.sdkInfo?.wsUrl,
545
545
  turnUrl: this.sdkInfo?.turnUrl,
546
546
  turnUsername: this.sdkInfo?.turnUsername,
547
- turnCredential: this.sdkInfo?.turnCredential
547
+ turnCredential: this.sdkInfo?.turnCredential,
548
+ videoData: this.videoData
548
549
  });
549
550
  },
550
551
  toggleScreen(flag, options) {
@@ -282,7 +282,8 @@ export default {
282
282
  wsUrl: this.sdkInfo?.wsUrl,
283
283
  turnUrl: this.sdkInfo?.turnUrl,
284
284
  turnUsername: this.sdkInfo?.turnUsername,
285
- turnCredential: this.sdkInfo?.turnCredential
285
+ turnCredential: this.sdkInfo?.turnCredential,
286
+ videoData: this.videoData
286
287
  });
287
288
  this.setVideoMembers([]);
288
289
  },
@@ -355,5 +355,17 @@ export default {
355
355
  },
356
356
  callerStatus(state) {
357
357
  return state.callerStatus;
358
+ },
359
+ doctorInfo(state) {
360
+ return state.doctorInfo;
361
+ },
362
+ targetInfo(state) {
363
+ return state.targetInfo;
364
+ },
365
+ callTimer(state) {
366
+ return state.callTimer;
367
+ },
368
+ requestId(state) {
369
+ return state.requestId;
358
370
  }
359
371
  };
@@ -280,5 +280,17 @@ export default {
280
280
  },
281
281
  setCallerStatus(state, callerStatus) {
282
282
  state.callerStatus = callerStatus;
283
+ },
284
+ setDoctorInfo(state, doctorInfo) {
285
+ state.doctorInfo = doctorInfo;
286
+ },
287
+ setTargetInfo(state, targetInfo) {
288
+ state.targetInfo = targetInfo;
289
+ },
290
+ setCallTimer(state, callTimer) {
291
+ state.callTimer = callTimer;
292
+ },
293
+ setRequestId(state, requestId) {
294
+ state.requestId = requestId;
283
295
  }
284
296
  };
@@ -108,6 +108,10 @@ export default () => {
108
108
  uniRTC: null,
109
109
  incoming: null,
110
110
  outing: [],
111
- callerStatus: '' // 呼叫人在线离线状态(江苏通)
111
+ callerStatus: '', // 呼叫人在线离线状态(江苏通)
112
+ doctorInfo: null, // 登录人信息(江苏通)
113
+ targetInfo: null, // 呼叫targetInfo()
114
+ requestId: null, // 随机数
115
+ callTimer: null // 定时器
112
116
  };
113
117
  };
@@ -2,6 +2,7 @@ import { message } from 'ant-design-vue';
2
2
  import { getCacheSIP, setCacheSip, openSipDialog } from '@/utils/sip-device';
3
3
  import fetch from '@/utils/chatFetch';
4
4
  import axios from 'axios'
5
+ import vexutils from '@/utils/vexutils';
5
6
  let chatUid = 0;
6
7
  let chatUids = [];
7
8
  const chatUidUp = () => {
@@ -9,6 +10,58 @@ const chatUidUp = () => {
9
10
  chatUid++;
10
11
  };
11
12
 
13
+ export function getUuid() {
14
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
15
+ var r = (Math.random() * 16) | 0,
16
+ v = c == 'x' ? r : (r & 0x3) | 0x8;
17
+ return v.toString(16);
18
+ });
19
+ }
20
+
21
+ export function getRandomNum(num) {
22
+ return Math.floor((Math.random()+Math.floor(Math.random()*9+1))*Math.pow(10,num-1));
23
+ }
24
+
25
+ /**
26
+ *
27
+ * @param {*} params customerIdNo患者customerId,医生身份证
28
+ * @returns 开启呼叫视频
29
+ */
30
+ export const startVideoCall = (params) => {
31
+ return axios({
32
+ method: "get",
33
+ baseURL: "",
34
+ url: "/ihcrm/rest/callEsb/util/get",
35
+ params: {
36
+ customerId: params.customerId,
37
+ doctorIdNo: params.doctorIdNo,
38
+ doctorId: params.doctorId,
39
+ sendStatus:params.sendStatus,
40
+ requestId: params.requestId,
41
+ interface: 'startVideoCall'
42
+ }
43
+ })
44
+ .then(({ data }) => {
45
+ if (data.status === "success" || data.code === "00000") {
46
+ const result = data.result;
47
+ if (result.code === '00000' || result.success) {
48
+ if (result.data && vexutils.isJSON(result.data)) {
49
+ return JSON.parse(result.data)
50
+ } else {
51
+ return []
52
+ }
53
+ } else {
54
+ return false
55
+ }
56
+ } else {
57
+ return false
58
+ }
59
+ })
60
+ .catch((error) => {
61
+ console.error(error)
62
+ });
63
+ };
64
+
12
65
  export const getClientDeviceToken = (params) => {
13
66
  return axios({
14
67
  method: "get",
@@ -16,6 +16,7 @@ export default class RtcClient {
16
16
  // 是否开启视频
17
17
  this.openVideo = screen ? false : options.openVideo;
18
18
  this.screen = screen;
19
+ this.videoData = options.videoData
19
20
  // 远端关闭时,关闭窗口
20
21
  this.videoWindow = options.videoWindow;
21
22
 
@@ -63,9 +64,10 @@ export default class RtcClient {
63
64
  roomId: this.roomId_,
64
65
  sdkAppId: this.sdkAppId_,
65
66
  userId: this.userId_,
66
- userSig: this.userSig_
67
+ userSig: this.userSig_,
68
+ userDefineRecordId: new Date().getTime() + '_' + this.roomId_ + '_' + this.userId_
67
69
  });
68
-
70
+
69
71
  // 添加代理服务地址
70
72
  this.setServer();
71
73
 
@@ -77,6 +79,47 @@ export default class RtcClient {
77
79
  await this.client_.join({ roomId: this.roomId_ });
78
80
  console.log('join room success');
79
81
  this.isJoined_ = true;
82
+ if (this.options.vendor == 3) {
83
+ try {
84
+ // 预排版模式,自 v4.9.0 版本开始支持
85
+ const config = {
86
+ mode: 'preset-layout',
87
+ videoWidth: 1280,
88
+ videoHeight: 720,
89
+ videoBitrate: 1500,
90
+ videoFramerate: 20,
91
+ videoGOP: 2,
92
+ audioSampleRate: 48000,
93
+ audioBitrate: 64,
94
+ audioChannels: 1,
95
+ // 预设一路本地摄像头、一路本地屏幕分享、两路远端流的排版位置
96
+ mixUsers: [
97
+ {
98
+ width: 1280,
99
+ height: 720,
100
+ locationX: 0,
101
+ locationY: 0,
102
+ pureAudio: false,
103
+ userId: this.userId_, // 本地摄像头占位,传入推摄像头的 client userId
104
+ zOrder: 1
105
+ },
106
+ {
107
+ width: 250,
108
+ height: 400,
109
+ locationX: 980,
110
+ locationY: 30,
111
+ pureAudio: false,
112
+ userId: this.videoData.callee, // 远端流占位
113
+ zOrder: 2
114
+ }
115
+ ]
116
+ }
117
+ console.log('混流设置', config);
118
+ await this.client_.startMixTranscode(config);
119
+ } catch (error) {
120
+ console.error('startMixTranscode failed ', error);
121
+ }
122
+ }
80
123
  } catch (error) {
81
124
  console.error('failed to join room because: ' + error);
82
125
  if (this.options.vendor == 2) {
@@ -153,12 +196,16 @@ export default class RtcClient {
153
196
  }
154
197
 
155
198
  try {
199
+ // if (this.options.vendor == 3) {
200
+ // console.log('关闭混流');
201
+ // await this.client_.stopMixTranscode();
202
+ // }
156
203
  // leave the room
157
204
  await this.client_.leave();
158
205
  this.isJoined_ = false;
159
206
  } catch (error) {
160
207
  console.error('failed to leave the room because ' + error);
161
- location.reload();
208
+ // location.reload();
162
209
  } finally {
163
210
  // 停止本地流,关闭本地流内部的音视频播放器
164
211
  this.localStream_.stop();