libushang 6 miesięcy temu
rodzic
commit
828957c682

+ 98 - 12
src/views/emergencyCommandMap/LeftSection/Communication.vue

@@ -84,11 +84,11 @@
       </div>
       <div class="btn-box">
         <div class="btn">
-          <div class="icon1"></div>
+          <div class="icon1" @click="handleJoinMeeting"></div>
           <div class="text">会议号入会</div>
         </div>
         <div class="btn">
-          <div class="icon2"></div>
+          <div class="icon2" @click="handleStartCall"></div>
           <div class="text">电话呼叫</div>
         </div>
         <div class="btn" @click="handleStartMeeting">
@@ -104,6 +104,9 @@
 import { Search } from '@element-plus/icons-vue';
 import { getStartMiniParan } from '@/api/emergencyCommandMap/communication';
 import { ConvergedCommunication } from '@/utils/convergedCommunication';
+import { ElMessage } from 'element-plus'; // 确保已正确导入 ElMessage
+
+const proxy = getCurrentInstance()?.proxy;
 
 let activeIndex = ref(0);
 const options = ref([{ name: '全部', value: '全部' }]);
@@ -181,37 +184,43 @@ const handleNodeClick = (item) => {
         id: 1,
         name: '李莉莉',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: 'mmyj0006@mm.zw.yj'
       },
       {
         id: 2,
         name: '何里',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: 'mmyj0007@mm.zw.yj'
       },
       {
         id: 3,
         name: '张三',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: 'mmyj0008@mm.zw.yj'
       },
       {
         id: 4,
         name: '张三',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: 'mmyj0009@mm.zw.yj'
       },
       {
         id: 5,
         name: '张三',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: ''
       },
       {
         id: 6,
         name: '张三',
         duty: '副主任',
-        dept: '茂名市/茂名市政府/茂名应急管理局'
+        dept: '茂名市/茂名市政府/茂名应急管理局',
+        mobile: ''
       }
     ];
     data.forEach((item) => {
@@ -252,13 +261,90 @@ const deleteItem = (item) => {
     }
   }
 };
+
+// 会议号入会
+const handleJoinMeeting = () => {
+  proxy?.$message.error('融合通信新开发功能,暂未对接');
+  return false;
+
+  const screenWidth = window.screen.width * window.devicePixelRatio;
+  const screenHeight = window.screen.height * window.devicePixelRatio;
+  const data = {
+    "userid": "", // 空表示后台获取当前用户对应融合通信dev_id
+    "password": "123",
+    roomid: '715724498', // 会议号
+    windowpos: { "x": 0, "y": 0, "width": screenWidth, "height": screenHeight, "top": true },
+    members: { num: 1} // 不用邀请别人
+  };
+  getStartMiniParan(data).then((res) => {
+    // 创建一个a标签元素
+    const a = document.createElement('a');
+    // 设置a标签的href属性
+    a.href = res.data;
+    // 触发点击事件
+    a.click();
+  });
+}
+
+// 电话呼叫
+const handleStartCall = () => {
+  let dev_list = [];
+  userList.value.forEach((item)=>{
+    if(item.checked && item.mobile != '') {
+      dev_list.push({id: item.mobile, avtype: 'a'}); // a 音频 v 视频 默认 av
+    }
+  });
+  if (dev_list.length == 0) {
+    proxy?.$message.error('请勾选人员');
+    return false;
+  }
+  const screenWidth = window.screen.width * window.devicePixelRatio;
+  const screenHeight = window.screen.height * window.devicePixelRatio;
+  const data = {
+    "userid": "", // 空表示后台获取当前用户对应融合通信dev_id
+    "password": "123",
+    roomid: '', // 空表示新会议室
+    windowpos: { "x": 0, "y": 0, "width": screenWidth, "height": screenHeight, "top": true },
+    members: {
+      num: dev_list.length + 2, // 配置多少个座位,一般就是邀请人多少个就多少个
+      "dev-list": dev_list,
+      // "sip-list": [ { "id": "60002" }, { "id": "60008", "avtype": "a" }, { "id": "60003", "avtype": "v" } ]
+    }
+  };
+  getStartMiniParan(data).then((res) => {
+    // 创建一个a标签元素
+    const a = document.createElement('a');
+    // 设置a标签的href属性
+    a.href = res.data;
+    // 触发点击事件
+    a.click();
+  });
+};
+
 // 发起会议
 const handleStartMeeting = () => {
+  let dev_list = [];
+  userList.value.forEach((item)=>{
+    if(item.checked && item.mobile != '') {
+      dev_list.push({id: item.mobile, avtype: 'av'}); // a 音频 v 视频 默认 av
+    }
+  });
+  if (dev_list.length == 0) {
+    proxy?.$message.error('请勾选人员');
+    return false;
+  }
+  const screenWidth = window.screen.width * window.devicePixelRatio;
+  const screenHeight = window.screen.height * window.devicePixelRatio;
   const data = {
-    userid: 'mmyj0006@mm.zw.yj',
-    password: '123',
-    roomid: '',
-    'dev-list': [{ id: 'hh@mm.zw.yj', avtype: 'av' }]
+    "userid": "", // 空表示后台获取当前用户对应融合通信dev_id
+    "password": "123",
+    roomid: '', // 空表示新会议室
+    windowpos: { "x": 0, "y": 0, "width": screenWidth, "height": screenHeight, "top": true },
+    members: {
+      num: dev_list.length + 2, // 配置多少个座位,一般就是邀请人多少个就多少个
+      "dev-list": dev_list,
+      // "sip-list": [ { "id": "60002" }, { "id": "60008", "avtype": "a" }, { "id": "60003", "avtype": "v" } ]
+    }
   };
   getStartMiniParan(data).then((res) => {
     // 创建一个a标签元素