mdm-client 1.0.1 → 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.
- package/package.json +1 -1
- package/src/App.vue +15 -9
- package/src/assets/image/common/platform_app_icon.png +0 -0
- package/src/assets/image/common/platform_mini_icon.png +0 -0
- package/src/assets/image/common/platform_pc_icon.png +0 -0
- package/src/assets/image/common/platform_volte_icon.png +0 -0
- package/src/components/LiveMulti/LiveMulti.vue +0 -10
- package/src/components/LiveMultipleMeeting/LiveMultipleMeeting.vue +402 -151
- package/src/components/other/addressBook.vue +139 -19
- package/src/components/other/customGroupDialog.vue +2 -1
- package/src/components/other/editGroupDialog.vue +2 -0
- package/src/components/other/memberManage.vue +61 -4
- package/src/utils/api.js +9 -0
- package/src/utils/livekit/live-client-esm.js +1 -1
- package/src/utils/livekit/live-client-esm-old.js +0 -1
|
@@ -358,6 +358,7 @@
|
|
|
358
358
|
<script>
|
|
359
359
|
import LiveClient from "../../utils/livekit/live-client-esm";
|
|
360
360
|
import { ShowMessage, calculateTime, mittBus } from "../../utils";
|
|
361
|
+
import { MessageBox } from "element-ui";
|
|
361
362
|
import dayjs from "dayjs";
|
|
362
363
|
import ThemeDialog from "../other/themeDialog.vue";
|
|
363
364
|
import LayoutSwitch from "../other/layoutSwitch.vue";
|
|
@@ -440,18 +441,10 @@ export default {
|
|
|
440
441
|
type: String,
|
|
441
442
|
default: "launch",
|
|
442
443
|
},
|
|
443
|
-
isCustomizeMiniInvitations: {
|
|
444
|
-
type: Boolean,
|
|
445
|
-
default: false,
|
|
446
|
-
},
|
|
447
444
|
miniPagePath: {
|
|
448
445
|
type: String,
|
|
449
446
|
default: "",
|
|
450
447
|
},
|
|
451
|
-
defaultInviteWay: {
|
|
452
|
-
type: String,
|
|
453
|
-
default: "identity",
|
|
454
|
-
},
|
|
455
448
|
isInMeeting: {
|
|
456
449
|
type: Boolean,
|
|
457
450
|
default: false,
|
|
@@ -1119,16 +1112,16 @@ export default {
|
|
|
1119
1112
|
if (this.inviteNum <= 0) {
|
|
1120
1113
|
this.inviteList.push(userItem);
|
|
1121
1114
|
} else {
|
|
1122
|
-
if (this.judgePersonIsInvited(userItem.
|
|
1115
|
+
if (this.judgePersonIsInvited(userItem.phone) < 0) {
|
|
1123
1116
|
this.inviteList.push(userItem);
|
|
1124
1117
|
}
|
|
1125
1118
|
}
|
|
1126
1119
|
},
|
|
1127
1120
|
// 判断是否已经在邀请列表中
|
|
1128
|
-
judgePersonIsInvited(
|
|
1121
|
+
judgePersonIsInvited(phone) {
|
|
1129
1122
|
if (this.inviteNum > 0) {
|
|
1130
1123
|
let index = this.inviteList.findIndex((item) => {
|
|
1131
|
-
return item.
|
|
1124
|
+
return item.phone === phone;
|
|
1132
1125
|
});
|
|
1133
1126
|
return index;
|
|
1134
1127
|
} else {
|
|
@@ -1187,7 +1180,7 @@ export default {
|
|
|
1187
1180
|
this.isDeleteRoom = true;
|
|
1188
1181
|
this.leaveRoom();
|
|
1189
1182
|
} else {
|
|
1190
|
-
|
|
1183
|
+
MessageBox.confirm("点击结束会议后会议将被解散,您确定要这么做么?", "警告", {
|
|
1191
1184
|
confirmButtonText: "确定",
|
|
1192
1185
|
cancelButtonText: "取消",
|
|
1193
1186
|
type: "warning",
|
|
@@ -1216,7 +1209,7 @@ export default {
|
|
|
1216
1209
|
if (index !== -1) {
|
|
1217
1210
|
this.appointDialogShow = true;
|
|
1218
1211
|
} else {
|
|
1219
|
-
|
|
1212
|
+
MessageBox.confirm("当前会议没有pc端和app端与会者, 无法指派主持人, 将直接解散会议", "警告", {
|
|
1220
1213
|
confirmButtonText: "确定",
|
|
1221
1214
|
cancelButtonText: "取消",
|
|
1222
1215
|
type: "warning",
|
|
@@ -1366,16 +1359,27 @@ export default {
|
|
|
1366
1359
|
this.$emit("meetingStart");
|
|
1367
1360
|
if (this.joinType == "launch") {
|
|
1368
1361
|
// 发送邀请信息
|
|
1369
|
-
this.sendInviteMessage([]
|
|
1362
|
+
this.sendInviteMessage([]);
|
|
1370
1363
|
// 拉取监控设备
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
}
|
|
1378
|
-
|
|
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
|
+
}
|
|
1379
1383
|
}
|
|
1380
1384
|
// 启动获取未入会和邀请人员轮询
|
|
1381
1385
|
this.startUnjoinParticipantPolling();
|
|
@@ -1475,6 +1479,18 @@ export default {
|
|
|
1475
1479
|
}
|
|
1476
1480
|
}
|
|
1477
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
|
+
}
|
|
1478
1494
|
},
|
|
1479
1495
|
handleRoomDataReceived(e) {
|
|
1480
1496
|
switch (e.topic) {
|
|
@@ -1764,73 +1780,199 @@ export default {
|
|
|
1764
1780
|
clearInterval(this.unjoinParticipantInterval);
|
|
1765
1781
|
this.unjoinParticipantInterval = null;
|
|
1766
1782
|
}
|
|
1767
|
-
|
|
1768
|
-
// 立即执行一次
|
|
1769
|
-
this.getUnjoinParticipant();
|
|
1770
|
-
this.queryAllInviteParticipant();
|
|
1771
1783
|
// 设置5秒间隔的轮询
|
|
1772
1784
|
this.unjoinParticipantInterval = setInterval(() => {
|
|
1773
1785
|
this.getUnjoinParticipant();
|
|
1774
1786
|
this.queryAllInviteParticipant();
|
|
1775
|
-
},
|
|
1787
|
+
}, 30000);
|
|
1776
1788
|
},
|
|
1777
1789
|
initLiveClient() {
|
|
1778
1790
|
this.liveClient = window["liveClient"];
|
|
1779
1791
|
this.initLiveClientEvent();
|
|
1780
1792
|
},
|
|
1781
|
-
sendInviteMessage(tempList = []
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
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));
|
|
1805
1920
|
} else {
|
|
1806
|
-
this.showMessage.message("error", res?.msg);
|
|
1921
|
+
this.showMessage.message("error", `邀请人员失败: ${res?.msg}`);
|
|
1807
1922
|
}
|
|
1808
|
-
})
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
.
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1832
|
-
|
|
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
|
+
);
|
|
1833
1970
|
}
|
|
1971
|
+
|
|
1972
|
+
// 等待所有邀请完成后更新列表
|
|
1973
|
+
Promise.allSettled(promises).then(() => {
|
|
1974
|
+
// 可以在这里添加统一的后续处理,如刷新邀请列表
|
|
1975
|
+
});
|
|
1834
1976
|
},
|
|
1835
1977
|
queryAllInviteParticipant() {
|
|
1836
1978
|
this.liveClient.getAllInviteParticipant(this.meetingNum).then((res) => {
|
|
@@ -2896,7 +3038,7 @@ export default {
|
|
|
2896
3038
|
this.liveClient.deleteUnjoinParticipant(this.meetingNum, item.identity).then((res) => {
|
|
2897
3039
|
if (res.code == 200) {
|
|
2898
3040
|
this.showMessage.message("success", "成功删除未入会人员");
|
|
2899
|
-
this.getUnjoinParticipant();
|
|
3041
|
+
// this.getUnjoinParticipant();
|
|
2900
3042
|
this.removeFromInviteList(item.identity);
|
|
2901
3043
|
} else {
|
|
2902
3044
|
this.showMessage.message("error", res?.msg);
|
|
@@ -3187,28 +3329,8 @@ export default {
|
|
|
3187
3329
|
e.forEach((item) => {
|
|
3188
3330
|
this.addToInviteList(item);
|
|
3189
3331
|
});
|
|
3332
|
+
this.sendInviteMessage(e)
|
|
3190
3333
|
}
|
|
3191
|
-
let tempList = [];
|
|
3192
|
-
let index = -1;
|
|
3193
|
-
this.inviteList.forEach((item) => {
|
|
3194
|
-
if (this.invitedNum > 0) {
|
|
3195
|
-
index = this.tempInvitedList.findIndex((ele) => {
|
|
3196
|
-
if (item?.loginCode) {
|
|
3197
|
-
return ele.identity === item.loginCode;
|
|
3198
|
-
} else {
|
|
3199
|
-
return ele.identity === item.phone;
|
|
3200
|
-
}
|
|
3201
|
-
});
|
|
3202
|
-
if (index < 0) {
|
|
3203
|
-
// 当前人员尚未被邀请
|
|
3204
|
-
tempList.push(item);
|
|
3205
|
-
}
|
|
3206
|
-
} else {
|
|
3207
|
-
tempList.push(item);
|
|
3208
|
-
}
|
|
3209
|
-
});
|
|
3210
|
-
|
|
3211
|
-
this.sendInviteMessage(tempList, this.defaultInviteWay == "mini" ? 3 : 0);
|
|
3212
3334
|
},
|
|
3213
3335
|
async appendInviteDevice(e) {
|
|
3214
3336
|
console.log("通讯录邀请设备", e);
|
|
@@ -3308,17 +3430,17 @@ export default {
|
|
|
3308
3430
|
},
|
|
3309
3431
|
appendInvite(e, inviteWay) {
|
|
3310
3432
|
let tempList = [];
|
|
3311
|
-
let tempDeviceList = []
|
|
3433
|
+
let tempDeviceList = []
|
|
3312
3434
|
let index = -1;
|
|
3313
3435
|
if (e && e.length > 0) {
|
|
3314
3436
|
e.forEach((item) => {
|
|
3315
|
-
if
|
|
3437
|
+
if(item.source == "人员") {
|
|
3316
3438
|
if (this.invitedNum > 0) {
|
|
3317
3439
|
index = this.tempInvitedList.findIndex((ele) => {
|
|
3318
|
-
if
|
|
3319
|
-
return ele.identity === item.loginCode
|
|
3440
|
+
if(item?.loginCode) {
|
|
3441
|
+
return ele.identity === item.loginCode
|
|
3320
3442
|
} else {
|
|
3321
|
-
return ele.identity === item.phone
|
|
3443
|
+
return ele.identity === item.phone
|
|
3322
3444
|
}
|
|
3323
3445
|
});
|
|
3324
3446
|
if (index < 0) {
|
|
@@ -3330,21 +3452,87 @@ export default {
|
|
|
3330
3452
|
}
|
|
3331
3453
|
this.addToInviteList(item);
|
|
3332
3454
|
} else {
|
|
3333
|
-
tempDeviceList.push(item)
|
|
3455
|
+
tempDeviceList.push(item)
|
|
3334
3456
|
}
|
|
3335
3457
|
});
|
|
3336
3458
|
console.log("本次追加邀请人员", tempList);
|
|
3337
3459
|
console.log("本次追加邀请设备", tempDeviceList);
|
|
3338
|
-
|
|
3339
|
-
if
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
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
|
+
// 添加邀请成功后统一的后续处理
|
|
3346
3524
|
});
|
|
3347
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
|
+
}
|
|
3348
3536
|
}
|
|
3349
3537
|
},
|
|
3350
3538
|
pullMonitorDevice(monitorID, monitorName) {
|
|
@@ -3364,51 +3552,113 @@ export default {
|
|
|
3364
3552
|
|
|
3365
3553
|
async sendAppendInviteMessage(uninviteList = []) {
|
|
3366
3554
|
// 政协项目新增
|
|
3367
|
-
if (
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
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
|
+
}
|
|
3373
3573
|
});
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
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
|
+
}
|
|
3385
3590
|
})
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
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
|
+
);
|
|
3395
3637
|
}
|
|
3638
|
+
|
|
3639
|
+
// 等待所有邀请完成后更新列表
|
|
3640
|
+
Promise.allSettled(promises).then(() => {
|
|
3641
|
+
// 可以在这里添加统一的后续处理,如刷新邀请列表
|
|
3642
|
+
});
|
|
3396
3643
|
}
|
|
3397
3644
|
},
|
|
3398
3645
|
phoneCall(num) {
|
|
3399
3646
|
this.liveClient.makeCall(num, num);
|
|
3400
3647
|
},
|
|
3401
3648
|
async miniCall(num) {
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
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
|
+
});
|
|
3412
3662
|
},
|
|
3413
3663
|
sleep(waitTimeInMs) {
|
|
3414
3664
|
return new Promise((resolve) => setTimeout(resolve, waitTimeInMs));
|
|
@@ -4112,10 +4362,11 @@ export default {
|
|
|
4112
4362
|
this.liveClient.off(eventName);
|
|
4113
4363
|
});
|
|
4114
4364
|
}
|
|
4365
|
+
this.liveClient.off("resMeetingRefresh", this.handleResMeetingRefresh);
|
|
4115
4366
|
}
|
|
4116
|
-
}
|
|
4367
|
+
}
|
|
4117
4368
|
},
|
|
4118
|
-
}
|
|
4369
|
+
}
|
|
4119
4370
|
</script>
|
|
4120
4371
|
|
|
4121
4372
|
<style lang="scss" scoped>
|