Communication.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <template>
  2. <div class="communication-container">
  3. <div class="common-title gradient-text">前方通信</div>
  4. <div class="tabs">
  5. <div v-for="(item, index) in menu" :key="index" :class="activeIndex === index ? 'tab tab_active' : 'tab'">
  6. {{ item.name }}
  7. </div>
  8. </div>
  9. <!--视频会商-->
  10. <div v-show="activeIndex === 0" class="content">
  11. <div class="left-content">
  12. <div class="search-box">
  13. <el-input v-model="queryParams.label" class="custom-input" placeholder="组织架构搜索" style="width: 214px" @keyup.enter="getTree">
  14. <template #prefix>
  15. <el-icon class="el-input__icon"><search /></el-icon>
  16. </template>
  17. </el-input>
  18. <el-select
  19. v-model="queryParams.value1"
  20. class="custom-select select-box"
  21. placeholder="全部"
  22. popper-class="custom-select-popper"
  23. :teleported="false"
  24. >
  25. <el-option v-for="level in options" :key="level.value" :label="level.name" :value="level.value"></el-option>
  26. </el-select>
  27. <el-input v-model="queryParams.keyword" class="custom-input" placeholder="组织架构搜索">
  28. <template #prefix>
  29. <el-icon class="el-input__icon"><search /></el-icon>
  30. </template>
  31. </el-input>
  32. </div>
  33. <div class="tree-container">
  34. <div class="tree-box">
  35. <div style="overflow-y: auto; height: 100%">
  36. <el-tree :data="treeData" accordion @node-click="handleNodeClick" />
  37. </div>
  38. </div>
  39. <div class="user-box">
  40. <div class="user-table">
  41. <div class="tr">
  42. <div class="td2">
  43. <div :class="getCheckedClass()" @click="handleChecked"></div>
  44. </div>
  45. <div class="td">姓名</div>
  46. <div class="td3">职务</div>
  47. </div>
  48. <div class="table-content">
  49. <div v-for="(item, index) in userList" :key="index" class="tr2">
  50. <div class="td2">
  51. <div :class="item.checked ? 'common-checked-active' : 'common-checked'" @click="handleChecked2(item)"></div>
  52. </div>
  53. <div class="td">{{ item.name }}</div>
  54. <div class="td3">
  55. {{ item.duty }}
  56. <div class="phone-icon"></div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. <!-- <div class="select-box2">-->
  65. <!-- <div class="select-header">-->
  66. <!-- <div class="left-item">-->
  67. <!-- <div>已选择:</div>-->
  68. <!-- <div class="text">{{ selectList.length }}</div>-->
  69. <!-- <div>人</div>-->
  70. <!-- </div>-->
  71. <!-- <div class="clear-btn" @click="clearSelect">清空</div>-->
  72. <!-- </div>-->
  73. <!-- <div class="select-content">-->
  74. <!-- <div v-for="(item, index) in selectList" :key="index" class="box-item">-->
  75. <!-- <div class="line">-->
  76. <!-- <div class="text1">{{ item.name }}</div>-->
  77. <!-- <div class="text2">{{ item.duty }}</div>-->
  78. <!-- </div>-->
  79. <!-- <div class="line" style="margin-top: 20px">-->
  80. <!-- <div class="text2">{{ item.dept }}</div>-->
  81. <!-- </div>-->
  82. <!-- <div class="close-btn" @click="deleteItem(item)"></div>-->
  83. <!-- </div>-->
  84. <!-- </div>-->
  85. <!-- </div>-->
  86. <div class="btn-box">
  87. <div class="btn" @click="handleJoinMeeting">
  88. <div class="icon1"></div>
  89. <div class="text">会议号入会</div>
  90. </div>
  91. <div class="btn" @click="handleStartCall">
  92. <div class="icon2"></div>
  93. <div class="text">电话呼叫</div>
  94. </div>
  95. <div class="btn" @click="handleStartMeeting">
  96. <div class="icon3"></div>
  97. <div class="text">发起会议</div>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. </template>
  103. <script lang="ts" setup>
  104. import { Search } from '@element-plus/icons-vue';
  105. import { getAvconDeptList, getAvconDeptTree, getStartMiniParan } from '@/api/emergencyCommandMap/communication';
  106. const proxy = getCurrentInstance()?.proxy;
  107. let activeIndex = ref(0);
  108. const options = ref([{ name: '全部', value: '全部' }]);
  109. const menu = ref([{ name: '视频会商' }, { name: '无人机' }, { name: '单兵设备' }]);
  110. const treeData = ref([]);
  111. const userList = ref([]);
  112. const queryParams = reactive({
  113. label: '',
  114. value1: ''
  115. });
  116. const getTree = () => {
  117. getAvconDeptTree(queryParams).then((res) => {
  118. treeData.value = res.data;
  119. });
  120. };
  121. const selectList = computed(() => {
  122. const data = [];
  123. userList.value.forEach((item) => {
  124. if (item.checked) {
  125. data.push(item);
  126. }
  127. });
  128. return data;
  129. });
  130. const getCheckedClass = () => {
  131. let res = 'common-checked';
  132. const len = userList.value.length;
  133. const len2 = selectList.value.length;
  134. if (len2 > 0 && len2 === len) {
  135. res = 'common-checked-active';
  136. } else if (len2 > 0) {
  137. res = 'common-checked-half';
  138. }
  139. return res;
  140. };
  141. const handleNodeClick = (item) => {
  142. // if (item.isLeaf) {
  143. // debugger
  144. getAvconDeptList(item.id).then((res) => {
  145. res.data.forEach((item) => {
  146. item.checked = false;
  147. });
  148. userList.value = res.data;
  149. });
  150. // }
  151. };
  152. // 全选、全取消
  153. const handleChecked = () => {
  154. const checkedClass = getCheckedClass();
  155. let flag = true;
  156. if (checkedClass === 'common-checked-active') {
  157. flag = false;
  158. }
  159. userList.value.forEach((item) => {
  160. item.checked = flag;
  161. });
  162. };
  163. // 单个选中、取消选中
  164. const handleChecked2 = (item) => {
  165. item.checked = !item.checked;
  166. };
  167. // 清空
  168. const clearSelect = () => {
  169. userList.value.forEach((item) => {
  170. if (item.checked) {
  171. item.checked = false;
  172. }
  173. });
  174. };
  175. // 清空指定项
  176. const deleteItem = (item) => {
  177. for (let i = 0; i < userList.value.length; i++) {
  178. if (item.id === userList.value[i].id) {
  179. userList.value[i].checked = false;
  180. break;
  181. }
  182. }
  183. };
  184. // 会议号入会
  185. const handleJoinMeeting = () => {
  186. proxy?.$modal.msgError('融合通信新开发功能,暂未对接');
  187. return false;
  188. const screenWidth = window.screen.width * window.devicePixelRatio;
  189. const screenHeight = window.screen.height * window.devicePixelRatio;
  190. const data = {
  191. "userid": "", // 空表示后台获取当前用户对应融合通信dev_id
  192. "password": "123",
  193. roomid: '715724498', // 会议号
  194. windowpos: { "x": 0, "y": 0, "width": screenWidth, "height": screenHeight, "top": true },
  195. members: { num: 1} // 不用邀请别人
  196. };
  197. getStartMiniParan(data).then((res) => {
  198. // 创建一个a标签元素
  199. const a = document.createElement('a');
  200. // 设置a标签的href属性
  201. a.href = res.data;
  202. // 触发点击事件
  203. a.click();
  204. });
  205. }
  206. // 电话呼叫
  207. const handleStartCall = () => {
  208. let dev_list = [];
  209. userList.value.forEach((item)=>{
  210. if(item.checked && item.mobile != '') {
  211. dev_list.push({id: item.mobile, avtype: 'a'}); // a 音频 v 视频 默认 av
  212. }
  213. });
  214. if (dev_list.length == 0) {
  215. proxy?.$modal.msgError('请勾选人员');
  216. return false;
  217. }
  218. const screenWidth = window.screen.width * window.devicePixelRatio;
  219. const screenHeight = window.screen.height * window.devicePixelRatio;
  220. const data = {
  221. "userid": "", // 空表示后台获取当前用户对应融合通信dev_id
  222. "password": "123",
  223. roomid: '', // 空表示新会议室
  224. windowpos: { "x": 0, "y": 0, "width": screenWidth, "height": screenHeight, "top": true },
  225. members: {
  226. num: dev_list.length + 2, // 配置多少个座位,一般就是邀请人多少个就多少个
  227. "dev-list": dev_list,
  228. // "sip-list": [ { "id": "60002" }, { "id": "60008", "avtype": "a" }, { "id": "60003", "avtype": "v" } ]
  229. }
  230. };
  231. getStartMiniParan(data).then((res) => {
  232. // 创建一个a标签元素
  233. const a = document.createElement('a');
  234. // 设置a标签的href属性
  235. a.href = res.data;
  236. // 触发点击事件
  237. a.click();
  238. });
  239. };
  240. // 发起会议
  241. const handleStartMeeting = () => {
  242. const data = {
  243. userid: 'mmyj0006@mm.zw.yj',
  244. password: '123',
  245. roomid: '',
  246. 'dev-list': [{ id: 'hh@mm.zw.yj', avtype: 'av' }]
  247. };
  248. getStartMiniParan(data).then((res) => {
  249. // 创建一个a标签元素
  250. const a = document.createElement('a');
  251. // 设置a标签的href属性
  252. a.href = res.data;
  253. // 触发点击事件
  254. a.click();
  255. });
  256. };
  257. onMounted(() => {
  258. getTree();
  259. })
  260. </script>
  261. <style lang="scss" scoped>
  262. .communication-container {
  263. width: 527px;
  264. height: 366px;
  265. background: url('@/assets/images/emergencyCommandMap/communication/communicationBg.png') no-repeat;
  266. background-size: 100% 100%;
  267. position: relative;
  268. padding-top: 47px;
  269. padding-left: 10px;
  270. animation-name: slideLeft;
  271. animation-duration: 2s;
  272. .tabs {
  273. display: flex;
  274. .tab {
  275. font-size: 16px;
  276. font-family: YouSheBiaoTiHei;
  277. text-align: center;
  278. color: #b6bbcc;
  279. width: 121px;
  280. height: 30px;
  281. line-height: 33px;
  282. background: url('@/assets/images/emergencyCommandMap/communication/tab.png') no-repeat;
  283. background-size: 100% 100%;
  284. cursor: pointer;
  285. &:hover {
  286. color: #ffffff;
  287. background: url('@/assets/images/emergencyCommandMap/communication/tabActive.png') no-repeat;
  288. background-size: 100% 100%;
  289. }
  290. }
  291. .tab_active {
  292. color: #ffffff;
  293. background: url('@/assets/images/emergencyCommandMap/communication/tabActive.png') no-repeat;
  294. background-size: 100% 100%;
  295. }
  296. }
  297. .content {
  298. margin-top: 12px;
  299. .left-content {
  300. .search-box {
  301. display: flex;
  302. .custom-input {
  303. width: 140px;
  304. }
  305. .select-box {
  306. width: 77px !important;
  307. height: 24px;
  308. line-height: 24px;
  309. margin: 0 10px;
  310. color: #83a3be;
  311. font-size: 14px;
  312. }
  313. .custom-select-popper {
  314. .el-scrollbar {
  315. .el-select-dropdown__item {
  316. color: #b1cae0;
  317. font-size: 14px;
  318. line-height: 24px;
  319. }
  320. }
  321. }
  322. .input {
  323. background: transparent;
  324. color: #83a3be;
  325. font-size: 32px;
  326. outline: none;
  327. appearance: none;
  328. height: 100%;
  329. border: none;
  330. &::placeholder {
  331. color: #83a3be;
  332. }
  333. }
  334. }
  335. }
  336. .tree-container {
  337. margin-top: 15px;
  338. display: flex;
  339. .tree-box {
  340. width: 255px;
  341. height: 180px;
  342. background: url('@/assets/images/emergencyCommandMap/communication/treeBg.png') no-repeat;
  343. padding: 15px 8px;
  344. overflow: hidden;
  345. :deep(.el-tree) {
  346. background-color: transparent;
  347. color: #fbffff;
  348. font-size: 14px;
  349. .el-tree-node__content {
  350. height: auto;
  351. padding-top: 5px;
  352. padding-bottom: 5px;
  353. white-space: normal;
  354. word-break: break-all;
  355. }
  356. .el-tree-node__expand-icon {
  357. color: #297cfc;
  358. font-size: 12px;
  359. }
  360. .el-tree-node:focus > .el-tree-node__content,
  361. .el-tree-node__content:hover {
  362. background-color: transparent !important;
  363. }
  364. }
  365. }
  366. .user-box {
  367. margin-left: 10px;
  368. width: 236px;
  369. height: 180px;
  370. background: url('@/assets/images/emergencyCommandMap/communication/treeBg.png') no-repeat;
  371. background-size: 100% 100%;
  372. .user-table {
  373. padding: 10px 5px;
  374. display: flex;
  375. flex-direction: column;
  376. font-size: 14px;
  377. color: #fbffff;
  378. .tr {
  379. background-color: #102e76;
  380. }
  381. .tr,
  382. .tr2 {
  383. display: flex;
  384. padding: 5px 0;
  385. .td {
  386. flex: 2;
  387. display: flex;
  388. align-items: center;
  389. }
  390. .td2 {
  391. width: 65px;
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. }
  396. .td3 {
  397. flex: 3;
  398. display: flex;
  399. align-items: center;
  400. justify-content: center;
  401. }
  402. }
  403. .table-content {
  404. height: 133px;
  405. overflow-y: auto;
  406. }
  407. .tr2 {
  408. margin-top: 5px;
  409. background-color: #122868;
  410. }
  411. .phone-icon {
  412. flex-shrink: 0;
  413. width: 24px;
  414. height: 25px;
  415. background: url('@/assets/images/emergencyCommandMap/communication/phone.png') no-repeat;
  416. background-size: 100%;
  417. cursor: pointer;
  418. }
  419. }
  420. }
  421. }
  422. .select-box2 {
  423. margin-left: 10px;
  424. width: 579px;
  425. height: 421px;
  426. background: url('@/assets/images/emergencyCommandMap/communication/peopleBg.png') no-repeat;
  427. background-size: 100% 100%;
  428. .select-header {
  429. display: flex;
  430. justify-content: space-between;
  431. align-items: center;
  432. color: #fbffff;
  433. font-size: 32px;
  434. border-bottom: 1px solid #247dff;
  435. padding: 20px;
  436. .left-item {
  437. display: flex;
  438. align-items: center;
  439. .text {
  440. margin: 0 10px;
  441. color: #00e8ff;
  442. font-family: 'BEBAS-1';
  443. }
  444. }
  445. .clear-btn {
  446. color: #00e8ff;
  447. cursor: pointer;
  448. }
  449. }
  450. .select-content {
  451. height: 305px;
  452. overflow-y: auto;
  453. .box-item {
  454. border-bottom: 1px solid #247dff;
  455. padding: 20px;
  456. position: relative;
  457. .line {
  458. color: #fff;
  459. font-size: 38px;
  460. display: flex;
  461. .text1 {
  462. margin-right: 35px;
  463. }
  464. .text2 {
  465. color: #a7ccdf;
  466. }
  467. }
  468. .close-btn {
  469. position: absolute;
  470. right: 10px;
  471. top: 50px;
  472. cursor: pointer;
  473. width: 29px;
  474. height: 29px;
  475. background: url('@/assets/images/emergencyCommandMap/communication/close.png') no-repeat;
  476. }
  477. }
  478. }
  479. }
  480. .btn-box {
  481. width: 100%;
  482. display: flex;
  483. justify-content: flex-end;
  484. align-items: center;
  485. .btn {
  486. width: 114px;
  487. height: 43px;
  488. background: url('@/assets/images/emergencyCommandMap/communication/btn.png') no-repeat;
  489. background-size: 100% 100%;
  490. display: flex;
  491. align-items: center;
  492. justify-content: center;
  493. cursor: pointer;
  494. .icon1,
  495. .icon2,
  496. .icon3 {
  497. margin-top: 3px;
  498. }
  499. .icon1 {
  500. width: 19px;
  501. height: 20px;
  502. background: url('@/assets/images/emergencyCommandMap/communication/icon1.png') no-repeat;
  503. background-size: 100% 100%;
  504. }
  505. .icon2 {
  506. width: 20px;
  507. height: 20px;
  508. background: url('@/assets/images/emergencyCommandMap/communication/icon2.png') no-repeat;
  509. background-size: 100% 100%;
  510. }
  511. .icon3 {
  512. width: 20px;
  513. height: 20px;
  514. background: url('@/assets/images/emergencyCommandMap/communication/icon3.png') no-repeat;
  515. background-size: 100% 100%;
  516. }
  517. .text {
  518. color: #fff;
  519. font-size: 14px;
  520. }
  521. }
  522. }
  523. }
  524. }
  525. .title {
  526. position: absolute;
  527. top: 6px;
  528. left: 141px;
  529. font-size: 60px;
  530. }
  531. </style>