cnhis-design-vue 2.1.35 → 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 (58) hide show
  1. package/CHANGELOG.md +25 -10
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +70 -54
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +2 -2
  6. package/es/captcha/index.js +3 -3
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/fabric-chart/index.js +161 -168
  12. package/es/fabric-chart/style.css +1 -1
  13. package/es/form-table/index.js +17 -17
  14. package/es/index/index.js +1005 -656
  15. package/es/index/style.css +1 -1
  16. package/es/input/index.js +1 -1
  17. package/es/map/index.js +1 -1
  18. package/es/multi-chat/index.js +678 -331
  19. package/es/multi-chat/style.css +1 -1
  20. package/es/multi-chat-client/index.js +605 -277
  21. package/es/multi-chat-client/style.css +1 -1
  22. package/es/multi-chat-history/index.js +4 -4
  23. package/es/multi-chat-record/index.js +110 -30
  24. package/es/multi-chat-setting/index.js +152 -47
  25. package/es/multi-chat-sip/index.js +1 -1
  26. package/es/radio/index.js +1 -1
  27. package/es/scale-view/index.js +24 -24
  28. package/es/select/index.js +3 -3
  29. package/es/select-label/index.js +3 -3
  30. package/es/select-person/index.js +2 -2
  31. package/es/shortcut-setter/index.js +2 -2
  32. package/es/table-filter/index.js +21 -21
  33. package/es/tag/index.js +1 -1
  34. package/es/utils/UniRTCv2.js +50 -15
  35. package/es/verification-code/index.js +2 -2
  36. package/lib/cui.common.js +1263 -884
  37. package/lib/cui.umd.js +1263 -884
  38. package/lib/cui.umd.min.js +37 -37
  39. package/package.json +1 -1
  40. package/packages/big-table/src/BigTable.vue +10 -8
  41. package/packages/fabric-chart/src/FabricChart.vue +8 -19
  42. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +3 -3
  43. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +1 -1
  44. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +10 -9
  45. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +29 -26
  46. package/packages/fabric-chart/src/mixins/draw.js +24 -5
  47. package/packages/multi-chat/chat/audio.vue +82 -14
  48. package/packages/multi-chat/chat/chatFooter.vue +3 -1
  49. package/packages/multi-chat/chat/chatMain.vue +17 -2
  50. package/packages/multi-chat/chat/index.vue +23 -3
  51. package/packages/multi-chat/chat/multiVideo.vue +4 -3
  52. package/packages/multi-chat/chat/video.vue +2 -1
  53. package/packages/multi-chat/store/getters.js +12 -0
  54. package/packages/multi-chat/store/mutation.js +12 -0
  55. package/packages/multi-chat/store/state.js +5 -1
  56. package/packages/multi-chat/utils/index.js +53 -0
  57. package/packages/multi-chat/utils/rtc-client.js +50 -3
  58. package/src/utils/UniRTCv2.js +40 -12
@@ -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();
@@ -1,5 +1,6 @@
1
1
  import io from 'socket.io-client';
2
2
  import fetch, { qs } from './chatFetch';
3
+ import vexutils from '../utils/vexutils';
3
4
 
4
5
  function UniRTCObject(appId, tokenProvider, vueSelf) {
5
6
 
@@ -120,6 +121,7 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
120
121
  obj.deviceToken = deviceTokens[i];
121
122
  msg.deviceArray.push(obj);
122
123
  }
124
+ console.log('设备参数', msg);
123
125
  _socket.emit('onlineStatusQuery', JSON.stringify(msg));
124
126
  console.log('检查设备状态[' + JSON.stringify(msg) + ']');
125
127
  }
@@ -171,11 +173,11 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
171
173
  // 呼出被接callback
172
174
  this.onCallAccepted = function(outing) {
173
175
  console.log('呼出被接callback', outing);
174
- let videoData = {
175
- ...outing.guestConfig.videoData,
176
- inviteResult: 1
177
- }
178
- this.vueSelf.subscribeAcceptedJST(videoData)
176
+ // let videoData = {
177
+ // ...outing.guestConfig.videoData,
178
+ // inviteResult: 1
179
+ // }
180
+ // this.vueSelf.subscribeAcceptedJST(videoData)
179
181
  };
180
182
 
181
183
  // 呼出被拒callback
@@ -191,10 +193,34 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
191
193
  // 设备状态检查
192
194
  this.onStatusChecked = function(stat) {
193
195
  console.log('设备状态检查', stat);
194
- if (stat[0].status == '0') {
196
+ let index = stat.findIndex(item => item.status == '0')
197
+ let outtings =[]
198
+ outtings.push(...stat)
199
+ let targetInfo = _this.vueSelf.targetInfo
200
+ if (index != -1) {
201
+ if (_this.vueSelf.callTimer) {
202
+ clearInterval(_this.vueSelf.callTimer)
203
+ _this.vueSelf.setCallTimer(null)
204
+ }
195
205
  _this.vueSelf.setCallerStatus('在线')
206
+ _this.startCall(stat[index].deviceToken, '腾讯视频', 'tencent', {
207
+ sdkAppId: Number(_this.vueSelf.sdkInfo.sdkAppId),
208
+ userId: _this.vueSelf.isServer ? _this.vueSelf.serviceId : _this.vueSelf.clientId,
209
+ userSig: _this.vueSelf.videoData.token,
210
+ roomId: Number(_this.vueSelf.roomId),
211
+ videoData: _this.vueSelf.videoData
212
+ }, {
213
+ sdkAppId: Number(_this.vueSelf.sdkInfo.sdkAppId),
214
+ userId: targetInfo.username,
215
+ userSig: targetInfo.token,
216
+ roomId: Number(_this.vueSelf.videoData.roomId),
217
+ videoData: _this.vueSelf.videoData
218
+ // privateMapKey
219
+ })
220
+ _this.vueSelf.setOuting( outtings)
196
221
  } else {
197
222
  _this.vueSelf.setCallerStatus('离线')
223
+ _this.vueSelf.sendVideoCall()
198
224
  }
199
225
  }
200
226
 
@@ -226,7 +252,6 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
226
252
  _socket = io.connect('https://t.jsehealth.com:9997'); // 测试环境
227
253
  // _socket = io.connect('http://127.0.0.1:9090');
228
254
  // _socket = io.connect("https://dli.xikang.com:9999");
229
-
230
255
  // 注册事件处理函数
231
256
  _socket.on('connect', function() {
232
257
  _onDeviceConnected();
@@ -316,8 +341,9 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
316
341
  // alert('设备登录失败\n' + msg);
317
342
  }
318
343
  }
319
- // 对方拒绝接听回调
320
- function customerRefuse(vuePage) {
344
+ const customerConfirmDebounce = vexutils.debounce(customerConfirm, 2000);
345
+ // 对方接听/拒绝接听回调
346
+ function customerConfirm(vuePage, accept) {
321
347
  let curScrollParam = vuePage.getRefuseParam();
322
348
  const videoData = vuePage.videoData;
323
349
  const params = {
@@ -326,12 +352,12 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
326
352
  userId: curScrollParam.userId,
327
353
  sessionId: videoData.sessionId,
328
354
  recordId: videoData.recordId,
329
- inviteResult: 0,
355
+ inviteResult: accept ? 1 : 0,
330
356
  isExpire: ''
331
357
  };
332
358
  fetch.post('/chat/access/videoInviteEnter', qs.stringify(params)).then(({ data }) => {
333
359
  if (data.result === 'SUCCESS') {
334
- vuePage.$message.info('对方拒绝接听');
360
+ vuePage.$message.info(accept ? '接入成功' : '对方拒绝接听');
335
361
  }
336
362
  });
337
363
  }
@@ -343,6 +369,8 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
343
369
 
344
370
  // 如果对方接听,就向对方发送视频配置
345
371
  if (data.code == '0') {
372
+ // 接听调用接口
373
+ customerConfirmDebounce(_this.vueSelf, true)
346
374
  target = data.deviceToken;
347
375
  outing = _outing.get(target);
348
376
  if (outing == null) {
@@ -363,7 +391,7 @@ function UniRTCObject(appId, tokenProvider, vueSelf) {
363
391
  // alert(data.msg);
364
392
  } else if (data.code === '3001') {
365
393
  console.log('错误号:'+data.code+'====>错误编码:'+data.msg);
366
- customerRefuse(_this.vueSelf);
394
+ customerConfirmDebounce(_this.vueSelf, false);
367
395
  target = data.deviceToken;
368
396
  outing = _outing.get(target);
369
397
  _this.stopCall(outing);