mdm-client 1.0.2 → 1.0.3

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.
@@ -441,18 +441,10 @@ export default {
441
441
  type: String,
442
442
  default: "launch",
443
443
  },
444
- isCustomizeMiniInvitations: {
445
- type: Boolean,
446
- default: false,
447
- },
448
444
  miniPagePath: {
449
445
  type: String,
450
446
  default: "",
451
447
  },
452
- defaultInviteWay: {
453
- type: String,
454
- default: "identity",
455
- },
456
448
  isInMeeting: {
457
449
  type: Boolean,
458
450
  default: false,
@@ -1120,16 +1112,16 @@ export default {
1120
1112
  if (this.inviteNum <= 0) {
1121
1113
  this.inviteList.push(userItem);
1122
1114
  } else {
1123
- if (this.judgePersonIsInvited(userItem.id) < 0) {
1115
+ if (this.judgePersonIsInvited(userItem.phone) < 0) {
1124
1116
  this.inviteList.push(userItem);
1125
1117
  }
1126
1118
  }
1127
1119
  },
1128
1120
  // 判断是否已经在邀请列表中
1129
- judgePersonIsInvited(id) {
1121
+ judgePersonIsInvited(phone) {
1130
1122
  if (this.inviteNum > 0) {
1131
1123
  let index = this.inviteList.findIndex((item) => {
1132
- return item.id === id;
1124
+ return item.phone === phone;
1133
1125
  });
1134
1126
  return index;
1135
1127
  } else {
@@ -1367,16 +1359,27 @@ export default {
1367
1359
  this.$emit("meetingStart");
1368
1360
  if (this.joinType == "launch") {
1369
1361
  // 发送邀请信息
1370
- this.sendInviteMessage([], this.defaultInviteWay == "mini" ? 3 : 0);
1362
+ this.sendInviteMessage([]);
1371
1363
  // 拉取监控设备
1372
- this.deviceNum > 0 &&
1373
- this.deviceList.forEach((item) => {
1374
- if (item.source == "监控") {
1375
- this.pullMonitorDevice(item.monitorID, item.label);
1376
- } else if (item.source == "设备") {
1377
- this.pullMonitorDevice(item.equipmentID, item.label);
1378
- }
1379
- });
1364
+ // 使用批量外呼替换逐条外呼
1365
+ if (this.deviceNum > 0 && this.deviceList) {
1366
+ const deviceCalls = this.deviceList
1367
+ .map(item => {
1368
+ const id = item?.source === '监控' ? item?.monitorID : item?.equipmentID;
1369
+ return id ? { dnis: id, name: item.label } : null;
1370
+ })
1371
+ .filter(Boolean);
1372
+
1373
+ if (deviceCalls.length > 0) {
1374
+ this.liveClient.makeBatchCall(deviceCalls, 1)
1375
+ .then(() => {
1376
+ this.showMessage.message('success', '监控设备批量外呼已发起');
1377
+ })
1378
+ .catch(err => {
1379
+ this.showMessage.message('error', `批量拉取监控设备失败: ${err?.message || err}`);
1380
+ });
1381
+ }
1382
+ }
1380
1383
  }
1381
1384
  // 启动获取未入会和邀请人员轮询
1382
1385
  this.startUnjoinParticipantPolling();
@@ -1476,6 +1479,18 @@ export default {
1476
1479
  }
1477
1480
  }
1478
1481
  });
1482
+ this.liveClient.on("resMeetingRefresh", this.handleResMeetingRefresh);
1483
+ },
1484
+ handleResMeetingRefresh: (e) => {
1485
+ console.log('resMeetingRefresh事件触发', e);
1486
+
1487
+ if(e.includes("queryAllInvite") || e.includes("queryUnjoined")) {
1488
+ console.log('this', this, this.getUnjoinParticipant);
1489
+
1490
+ this.getUnjoinParticipant();
1491
+ this.queryAllInviteParticipant();
1492
+ this.startUnjoinParticipantPolling();
1493
+ }
1479
1494
  },
1480
1495
  handleRoomDataReceived(e) {
1481
1496
  switch (e.topic) {
@@ -1765,73 +1780,199 @@ export default {
1765
1780
  clearInterval(this.unjoinParticipantInterval);
1766
1781
  this.unjoinParticipantInterval = null;
1767
1782
  }
1768
-
1769
- // 立即执行一次
1770
- this.getUnjoinParticipant();
1771
- this.queryAllInviteParticipant();
1772
1783
  // 设置5秒间隔的轮询
1773
1784
  this.unjoinParticipantInterval = setInterval(() => {
1774
1785
  this.getUnjoinParticipant();
1775
1786
  this.queryAllInviteParticipant();
1776
- }, 6000);
1787
+ }, 30000);
1777
1788
  },
1778
1789
  initLiveClient() {
1779
1790
  this.liveClient = window["liveClient"];
1780
1791
  this.initLiveClientEvent();
1781
1792
  },
1782
- sendInviteMessage(tempList = [], inviteWay = 0) {
1783
- if (tempList.length <= 0) {
1784
- if (this.tempInviteList.length > 0) {
1785
- this.liveClient
1786
- .inviteParticipant(
1787
- this.meetingNum,
1788
- this.tempInviteList.map((item) => {
1789
- return {
1790
- userName: item.label,
1791
- identity: item?.loginCode ? item.loginCode : item.phone,
1792
- phone: item.phone,
1793
- };
1794
- }),
1795
- false,
1796
- inviteWay
1797
- )
1798
- .then((res) => {
1799
- if (res.code == 200) {
1800
- this.showMessage.message("success", "成功发送邀请");
1801
- this.tempInviteList.forEach((item) => {
1802
- this.addToInviteList(item);
1803
- });
1804
- this.getUnjoinParticipant();
1805
- this.queryAllInviteParticipant();
1793
+ sendInviteMessage(tempList = []) {
1794
+ // 确定使用的邀请列表
1795
+ const inviteList = tempList.length <= 0 ? this.tempInviteList : tempList;
1796
+
1797
+ if (!inviteList || inviteList.length <= 0) {
1798
+ console.log('没有邀请人员');
1799
+ return;
1800
+ }
1801
+
1802
+ // 去重处理:按 phone 字段去重,按优先级保留
1803
+ const deduplicatedList = [];
1804
+ const phoneMap = new Map();
1805
+
1806
+ // 定义优先级:人员 > 组织架构/外部 > volte > 常用分组 > 未知
1807
+ const getPriority = (source) => {
1808
+ if (source === '人员') return 1;
1809
+ if (source === '组织架构' || source === '外部') return 2;
1810
+ if (source === 'volte') return 3;
1811
+ if (source === '常用分组') return 4;
1812
+ return 5; // 未知类型优先级最低
1813
+ };
1814
+
1815
+ // 第一轮:处理非常用分组的项目,建立 phoneMap
1816
+ inviteList.forEach((item, index) => {
1817
+ const phone = item.phone;
1818
+ if (!phone) {
1819
+ // 没有 phone 字段的直接加入
1820
+ deduplicatedList.push(item);
1821
+ return;
1822
+ }
1823
+
1824
+ // 如果是常用分组,先跳过,后续单独处理
1825
+ if (item.source === '常用分组') {
1826
+ return;
1827
+ }
1828
+
1829
+ const existing = phoneMap.get(phone);
1830
+ if (!existing) {
1831
+ // 第一次遇到这个 phone
1832
+ phoneMap.set(phone, { item, index });
1833
+ } else {
1834
+ // 已存在相同 phone,比较优先级
1835
+ const existingPriority = getPriority(existing.item.source);
1836
+ const currentPriority = getPriority(item.source);
1837
+
1838
+ if (currentPriority < existingPriority) {
1839
+ // 当前项优先级更高,替换
1840
+ phoneMap.set(phone, { item, index });
1841
+ } else if (currentPriority === existingPriority && index < existing.index) {
1842
+ // 优先级相同,保留顺序靠前的
1843
+ phoneMap.set(phone, { item, index });
1844
+ }
1845
+ // 否则保持原有的
1846
+ }
1847
+ });
1848
+
1849
+ // 第二轮:处理常用分组项目,根据 original 字段分类
1850
+ const commonGroupItems = inviteList.filter(item => item.source === '常用分组');
1851
+ commonGroupItems.forEach((item, index) => {
1852
+ const phone = item.phone;
1853
+ if (!phone) {
1854
+ // 没有 phone 字段的直接加入
1855
+ deduplicatedList.push(item);
1856
+ return;
1857
+ }
1858
+
1859
+ // 如果 phone 已经在 phoneMap 中,跳过(已有更高优先级的项)
1860
+ if (phoneMap.has(phone)) {
1861
+ return;
1862
+ }
1863
+
1864
+ // 根据 original 字段确定实际的 source
1865
+ let actualSource = item.original;
1866
+
1867
+ // 如果 original 字段无效,默认为组织架构
1868
+ if (!actualSource || !['人员', '组织架构', 'volte', '外部'].includes(actualSource)) {
1869
+ actualSource = '组织架构';
1870
+ }
1871
+
1872
+ // 创建新的项目,使用 original 作为实际 source
1873
+ const processedItem = {
1874
+ ...item,
1875
+ source: actualSource
1876
+ };
1877
+
1878
+ // 添加到 phoneMap
1879
+ phoneMap.set(phone, { item: processedItem, index: index + inviteList.length });
1880
+ });
1881
+
1882
+ // 将去重后的项添加到结果列表
1883
+ phoneMap.forEach(({ item }) => {
1884
+ if (!deduplicatedList.find(existing => existing.phone === item.phone)) {
1885
+ deduplicatedList.push(item);
1886
+ }
1887
+ });
1888
+
1889
+ // 按 source 分组处理
1890
+ const personList = [];
1891
+ const orgAndExternalList = [];
1892
+ const volteList = [];
1893
+
1894
+ deduplicatedList.forEach(item => {
1895
+ if (item.source === '人员') {
1896
+ personList.push(item);
1897
+ } else if (item.source === '组织架构' || item.source === '外部') {
1898
+ orgAndExternalList.push(item);
1899
+ } else if (item.source === 'volte') {
1900
+ volteList.push(item);
1901
+ }
1902
+ });
1903
+
1904
+ // 发送邀请
1905
+ const promises = [];
1906
+
1907
+ // 处理人员邀请(invitationMethod = 0)
1908
+ if (personList.length > 0) {
1909
+ const personInviteData = personList.map(item => ({
1910
+ userName: item.label,
1911
+ identity: item?.loginCode ? item.loginCode : item.phone,
1912
+ phone: item.phone
1913
+ }));
1914
+
1915
+ promises.push(
1916
+ this.liveClient.inviteParticipant(this.meetingNum, personInviteData, false, 0)
1917
+ .then(res => {
1918
+ if (res.code === 200) {
1919
+ personList.forEach(item => this.addToInviteList(item));
1806
1920
  } else {
1807
- this.showMessage.message("error", res?.msg);
1921
+ this.showMessage.message("error", `邀请人员失败: ${res?.msg}`);
1808
1922
  }
1809
- });
1810
- }
1811
- } else {
1812
- this.liveClient
1813
- .inviteParticipant(
1814
- this.meetingNum,
1815
- tempList.map((item) => {
1816
- return {
1817
- userName: item.label,
1818
- identity: item?.loginCode ? item.loginCode : item.phone,
1819
- phone: item.phone,
1820
- };
1821
- }),
1822
- false,
1823
- inviteWay
1824
- )
1825
- .then((res) => {
1826
- if (res.code == 200) {
1827
- this.showMessage.message("success", "成功发送邀请");
1828
- this.getUnjoinParticipant();
1829
- this.queryAllInviteParticipant();
1830
- } else {
1831
- this.showMessage.message("error", res?.msg);
1832
- }
1833
- });
1923
+ })
1924
+ .catch(err => {
1925
+ this.showMessage.message("error", `邀请人员失败: ${err.message}`);
1926
+ })
1927
+ );
1928
+ }
1929
+
1930
+ // 处理组织架构和外部邀请(invitationMethod = 3)
1931
+ if (orgAndExternalList.length > 0) {
1932
+ const orgInviteData = orgAndExternalList.map(item => ({
1933
+ userName: item.label,
1934
+ identity: item?.loginCode ? item.loginCode : item.phone,
1935
+ phone: item.phone
1936
+ }));
1937
+
1938
+ promises.push(
1939
+ this.liveClient.inviteParticipant(this.meetingNum, orgInviteData, false, 3)
1940
+ .then(res => {
1941
+ if (res.code === 200) {
1942
+ orgAndExternalList.forEach(item => this.addToInviteList(item));
1943
+ } else {
1944
+ this.showMessage.message("error", `邀请组织/外部人员失败: ${res?.msg}`);
1945
+ }
1946
+ })
1947
+ .catch(err => {
1948
+ this.showMessage.message("error", `邀请组织/外部人员失败: ${err.message}`);
1949
+ })
1950
+ );
1951
+ }
1952
+
1953
+ // 处理 volte 呼叫
1954
+ if (volteList.length > 0) {
1955
+ // 构建批量外呼数据
1956
+ const volteCalls = volteList.map(item => ({
1957
+ dnis: item.phone,
1958
+ name: item.label
1959
+ }));
1960
+
1961
+ promises.push(
1962
+ this.liveClient.makeBatchCall(volteCalls)
1963
+ .then(() => {
1964
+ volteList.forEach(item => this.addToInviteList(item));
1965
+ })
1966
+ .catch(err => {
1967
+ this.showMessage.message("error", `批量呼叫失败: ${err.message}`);
1968
+ })
1969
+ );
1834
1970
  }
1971
+
1972
+ // 等待所有邀请完成后更新列表
1973
+ Promise.allSettled(promises).then(() => {
1974
+ // 可以在这里添加统一的后续处理,如刷新邀请列表
1975
+ });
1835
1976
  },
1836
1977
  queryAllInviteParticipant() {
1837
1978
  this.liveClient.getAllInviteParticipant(this.meetingNum).then((res) => {
@@ -2897,7 +3038,7 @@ export default {
2897
3038
  this.liveClient.deleteUnjoinParticipant(this.meetingNum, item.identity).then((res) => {
2898
3039
  if (res.code == 200) {
2899
3040
  this.showMessage.message("success", "成功删除未入会人员");
2900
- this.getUnjoinParticipant();
3041
+ // this.getUnjoinParticipant();
2901
3042
  this.removeFromInviteList(item.identity);
2902
3043
  } else {
2903
3044
  this.showMessage.message("error", res?.msg);
@@ -3188,28 +3329,8 @@ export default {
3188
3329
  e.forEach((item) => {
3189
3330
  this.addToInviteList(item);
3190
3331
  });
3332
+ this.sendInviteMessage(e)
3191
3333
  }
3192
- let tempList = [];
3193
- let index = -1;
3194
- this.inviteList.forEach((item) => {
3195
- if (this.invitedNum > 0) {
3196
- index = this.tempInvitedList.findIndex((ele) => {
3197
- if (item?.loginCode) {
3198
- return ele.identity === item.loginCode;
3199
- } else {
3200
- return ele.identity === item.phone;
3201
- }
3202
- });
3203
- if (index < 0) {
3204
- // 当前人员尚未被邀请
3205
- tempList.push(item);
3206
- }
3207
- } else {
3208
- tempList.push(item);
3209
- }
3210
- });
3211
-
3212
- this.sendInviteMessage(tempList, this.defaultInviteWay == "mini" ? 3 : 0);
3213
3334
  },
3214
3335
  async appendInviteDevice(e) {
3215
3336
  console.log("通讯录邀请设备", e);
@@ -3309,17 +3430,17 @@ export default {
3309
3430
  },
3310
3431
  appendInvite(e, inviteWay) {
3311
3432
  let tempList = [];
3312
- let tempDeviceList = [];
3433
+ let tempDeviceList = []
3313
3434
  let index = -1;
3314
3435
  if (e && e.length > 0) {
3315
3436
  e.forEach((item) => {
3316
- if (item.source == "人员") {
3437
+ if(item.source == "人员") {
3317
3438
  if (this.invitedNum > 0) {
3318
3439
  index = this.tempInvitedList.findIndex((ele) => {
3319
- if (item?.loginCode) {
3320
- return ele.identity === item.loginCode;
3440
+ if(item?.loginCode) {
3441
+ return ele.identity === item.loginCode
3321
3442
  } else {
3322
- return ele.identity === item.phone;
3443
+ return ele.identity === item.phone
3323
3444
  }
3324
3445
  });
3325
3446
  if (index < 0) {
@@ -3331,21 +3452,87 @@ export default {
3331
3452
  }
3332
3453
  this.addToInviteList(item);
3333
3454
  } else {
3334
- tempDeviceList.push(item);
3455
+ tempDeviceList.push(item)
3335
3456
  }
3336
3457
  });
3337
3458
  console.log("本次追加邀请人员", tempList);
3338
3459
  console.log("本次追加邀请设备", tempDeviceList);
3339
- this.sendInviteMessage(tempList, inviteWay == "mini" ? 3 : 0);
3340
- if (tempDeviceList.length > 0) {
3341
- tempDeviceList.forEach((item) => {
3342
- if (item.source == "设备") {
3343
- this.pullMonitorDevice(item.equipmentID, item.label);
3344
- } else if (item.source == "监控") {
3345
- this.pullMonitorDevice(item.monitorID, item.label);
3346
- }
3460
+ // 追加邀请人员
3461
+ if(tempList.length > 0) {
3462
+ const promises = [];
3463
+ if(inviteWay == "identity") {
3464
+ const applicationInviteData = tempList.map(item => {
3465
+ return {
3466
+ userName: item?.label || item?.userName || '未知用户',
3467
+ identity: item?.loginCode || item.phone,
3468
+ phone: item.phone,
3469
+ }
3470
+ })
3471
+ promises.push(
3472
+ this.liveClient.inviteParticipant(this.meetingNum, applicationInviteData, false, 0)
3473
+ .then(res => {
3474
+ if (res.code === 200) {
3475
+ console.log("邀请用户成功", applicationInviteData);
3476
+ } else {
3477
+ this.showMessage.message("error", `邀请用户失败: ${res?.msg}`);
3478
+ }
3479
+ })
3480
+ .catch(err => {
3481
+ this.showMessage.message("error", `邀请用户失败: ${err.message}`);
3482
+ })
3483
+ );
3484
+ } else if(inviteWay == "volte") {
3485
+ const volteCalls = tempList.map(item => {
3486
+ return {
3487
+ dnis: item.phone,
3488
+ name: item?.label || item?.userName || '未知用户'
3489
+ }
3490
+ })
3491
+ promises.push(
3492
+ this.liveClient.makeBatchCall(volteCalls)
3493
+ .then(() => {
3494
+ console.log("批量呼叫成功", volteCalls);
3495
+ })
3496
+ .catch(err => {
3497
+ this.showMessage.message("error", `批量呼叫失败: ${err.message}`);
3498
+ })
3499
+ );
3500
+ } else if(inviteWay == "mini") {
3501
+ const miniInviteData = tempList.map(item => {
3502
+ return {
3503
+ userName: item?.label || item?.userName || '未知用户',
3504
+ phone: item.phone,
3505
+ identity: item?.loginCode || item.phone,
3506
+ }
3507
+ })
3508
+ promises.push(
3509
+ this.liveClient.inviteParticipant(this.meetingNum, miniInviteData, false, 3)
3510
+ .then(res => {
3511
+ if (res.code === 200) {
3512
+ console.log("邀请用户成功", miniInviteData);
3513
+ } else {
3514
+ this.showMessage.message("error", `邀请用户失败: ${res?.msg}`);
3515
+ }
3516
+ })
3517
+ .catch(err => {
3518
+ this.showMessage.message("error", `邀请用户失败: ${err.message}`);
3519
+ })
3520
+ )
3521
+ }
3522
+ Promise.allSettled(promises).then(() => {
3523
+ // 添加邀请成功后统一的后续处理
3347
3524
  });
3348
3525
  }
3526
+ // 追加邀请设备
3527
+ if(tempDeviceList.length > 0) {
3528
+ tempDeviceList.forEach(item => {
3529
+ if(item.source == "设备") {
3530
+ pullMonitorDevice(item.equipmentID, item.label)
3531
+ } else if(item.source == "监控") {
3532
+ pullMonitorDevice(item.monitorID, item.label)
3533
+ }
3534
+ })
3535
+ }
3349
3536
  }
3350
3537
  },
3351
3538
  pullMonitorDevice(monitorID, monitorName) {
@@ -3365,51 +3552,113 @@ export default {
3365
3552
 
3366
3553
  async sendAppendInviteMessage(uninviteList = []) {
3367
3554
  // 政协项目新增
3368
- if (this.isCustomizeMiniInvitations) {
3369
- this.$emit("inviteMessageSend", {
3370
- inviteUserList: uninviteList,
3371
- meetingName: this.meetingName,
3372
- meetingNum: this.meetingNum,
3373
- fromUser: this.userData.username,
3555
+ if (uninviteList.length > 0) {
3556
+ // 按 platformID 分组处理
3557
+ const platformGroup = {
3558
+ '1_2': [], // platformID 为 1 或 2
3559
+ '7': [], // platformID 为 7
3560
+ '4': [] // platformID 为 4
3561
+ };
3562
+
3563
+ uninviteList.forEach(item => {
3564
+ const { userName, identity, phone, platformID } = item;
3565
+
3566
+ if (platformID === 30) {
3567
+ platformGroup['1_2'].push({ userName, identity, phone });
3568
+ } else if (platformID === 7) {
3569
+ platformGroup['7'].push({ userName, identity, phone });
3570
+ } else if (platformID === 4) {
3571
+ platformGroup['4'].push({ userName, identity, phone });
3572
+ }
3374
3573
  });
3375
- } else {
3376
- if (uninviteList.length > 0) {
3377
- this.liveClient
3378
- .inviteParticipant(
3379
- this.meetingNum,
3380
- uninviteList.map((item) => {
3381
- return {
3382
- userName: item.userName,
3383
- identity: item.identity,
3384
- phone: item.phone,
3385
- };
3574
+
3575
+ const promises = [];
3576
+
3577
+ // 处理 platformID 为 1 或 2 的邀请(invitationMethod = 0)
3578
+ if (platformGroup['1_2'].length > 0) {
3579
+ promises.push(
3580
+ this.liveClient.inviteParticipant(this.meetingNum, platformGroup['1_2'], false, 0)
3581
+ .then(res => {
3582
+ if (res.code === 200) {
3583
+ platformGroup['1_2'].forEach(item => {
3584
+ const inviteItem = uninviteList.find(u => u.identity === item.identity);
3585
+ if (inviteItem) this.addToInviteList(inviteItem);
3586
+ });
3587
+ } else {
3588
+ this.showMessage.message("error", `邀请用户失败 (platformID 1/2): ${res?.msg}`);
3589
+ }
3386
3590
  })
3387
- )
3388
- .then((res) => {
3389
- if (res.code == 200) {
3390
- this.showMessage.message("success", "成功发送邀请");
3391
- this.getUnjoinParticipant();
3392
- } else {
3393
- this.showMessage.message("error", res?.msg);
3394
- }
3395
- });
3591
+ .catch(err => {
3592
+ this.showMessage.message("error", `邀请用户失败 (platformID 1/2): ${err.message}`);
3593
+ })
3594
+ );
3595
+ }
3596
+
3597
+ // 处理 platformID 为 7 的邀请(invitationMethod = 3)
3598
+ if (platformGroup['7'].length > 0) {
3599
+ promises.push(
3600
+ this.liveClient.inviteParticipant(this.meetingNum, platformGroup['7'], false, 3)
3601
+ .then(res => {
3602
+ if (res.code === 200) {
3603
+ platformGroup['7'].forEach(item => {
3604
+ const inviteItem = uninviteList.find(u => u.identity === item.identity);
3605
+ if (inviteItem) this.addToInviteList(inviteItem);
3606
+ });
3607
+ } else {
3608
+ this.showMessage.message("error", `邀请用户失败 (platformID 7): ${res?.msg}`);
3609
+ }
3610
+ })
3611
+ .catch(err => {
3612
+ this.showMessage.message("error", `邀请用户失败 (platformID 7): ${err.message}`);
3613
+ })
3614
+ );
3615
+ }
3616
+
3617
+ // 处理 platformID 为 4 的呼叫
3618
+ if (platformGroup['4'].length > 0) {
3619
+ // 构建批量外呼数据
3620
+ const volteCalls = platformGroup['4'].map(item => ({
3621
+ dnis: item.phone,
3622
+ name: item.userName
3623
+ }));
3624
+
3625
+ promises.push(
3626
+ this.liveClient.makeBatchCall(volteCalls)
3627
+ .then(() => {
3628
+ platformGroup['4'].forEach(item => {
3629
+ const inviteItem = uninviteList.find(u => u.identity === item.identity);
3630
+ if (inviteItem) this.addToInviteList(inviteItem);
3631
+ });
3632
+ })
3633
+ .catch(err => {
3634
+ this.showMessage.message("error", `批量呼叫失败 (platformID 4): ${err.message}`);
3635
+ })
3636
+ );
3396
3637
  }
3638
+
3639
+ // 等待所有邀请完成后更新列表
3640
+ Promise.allSettled(promises).then(() => {
3641
+ // 可以在这里添加统一的后续处理,如刷新邀请列表
3642
+ });
3397
3643
  }
3398
3644
  },
3399
3645
  phoneCall(num) {
3400
3646
  this.liveClient.makeCall(num, num);
3401
3647
  },
3402
3648
  async miniCall(num) {
3403
- if (this.isCustomizeMiniInvitations) {
3404
- this.$emit("miniInviteSend", {
3405
- inviteMobile: num,
3406
- fromUser: this.userData.username,
3407
- meetingName: this.meetingName,
3408
- meetingNum: this.meetingNum,
3409
- });
3410
- } else {
3411
- this.showMessage.message("info", "当前功能暂未实现");
3412
- }
3649
+ this.liveClient.inviteParticipant(this.meetingNum, [{
3650
+ userName: num,
3651
+ phone: num,
3652
+ identity: num,
3653
+ }], false, 3).then(res => {
3654
+ if (res.code === 200) {
3655
+ this.showMessage.message("success", "成功邀请小程序用户");
3656
+ } else {
3657
+ this.showMessage.message("error", `邀请小程序用户失败: ${res?.msg}`);
3658
+ }
3659
+ }).catch(err => {
3660
+ this.showMessage.message("error", `邀请小程序用户失败: ${err.message}`);
3661
+ });
3413
3662
  },
3414
3663
  sleep(waitTimeInMs) {
3415
3664
  return new Promise((resolve) => setTimeout(resolve, waitTimeInMs));
@@ -4113,10 +4362,11 @@ export default {
4113
4362
  this.liveClient.off(eventName);
4114
4363
  });
4115
4364
  }
4365
+ this.liveClient.off("resMeetingRefresh", this.handleResMeetingRefresh);
4116
4366
  }
4117
- },
4367
+ }
4118
4368
  },
4119
- };
4369
+ }
4120
4370
  </script>
4121
4371
 
4122
4372
  <style lang="scss" scoped>