CommunicationSupport.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <Dialog custom-show type="lg" title="通讯保障" hide-footer @close="handleClose">
  3. <div class="content">
  4. <div class="left-content">
  5. <el-input v-model="queryParams.keyword" class="custom-input" placeholder="组织架构搜索">
  6. <template #prefix>
  7. <el-icon class="el-input__icon"><search /></el-icon>
  8. </template>
  9. </el-input>
  10. <div class="tree-container">
  11. <div class="tree-box">
  12. <el-tree :data="treeData" accordion @node-click="handleNodeClick" />
  13. </div>
  14. </div>
  15. </div>
  16. <div class="middle-content">
  17. <div class="search-box">
  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="user-box">
  34. <div class="user-table">
  35. <div class="tr">
  36. <div class="td2">
  37. <div :class="getCheckedClass()" @click="handleChecked"></div>
  38. </div>
  39. <div class="td">姓名</div>
  40. <div class="td3">职务</div>
  41. </div>
  42. <div class="table-content">
  43. <div v-for="(item, index) in userList" :key="index" class="tr2">
  44. <div class="td2">
  45. <div :class="item.checked ? 'common-checked-active' : 'common-checked'" @click="handleChecked2(item)"></div>
  46. </div>
  47. <div class="td">{{ item.name }}</div>
  48. <div class="td3">
  49. {{ item.duty }}
  50. <div class="phone-icon"></div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="select-box2">
  58. <div class="select-header">
  59. <div class="left-item">
  60. <div>已选择:</div>
  61. <div class="text">{{ selectList.length }}</div>
  62. <div>人</div>
  63. </div>
  64. <div class="clear-btn" @click="clearSelect">清空</div>
  65. </div>
  66. <div class="select-content">
  67. <div v-for="(item, index) in selectList" :key="index" class="box-item">
  68. <div class="line">
  69. <div class="text1">{{ item.name }}</div>
  70. <div class="text2">{{ item.duty }}</div>
  71. </div>
  72. <div class="line" style="margin-top: 20px">
  73. <div class="text2">{{ item.dept }}</div>
  74. </div>
  75. <div class="close-btn" @click="deleteItem(item)"></div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </Dialog>
  81. </template>
  82. <script lang="ts" setup>
  83. import { Search } from '@element-plus/icons-vue';
  84. const emits = defineEmits(['close']);
  85. let activeIndex = ref(0);
  86. const options = ref([{ name: '全部', value: '全部' }]);
  87. const queryParams = ref({
  88. value1: '',
  89. keyword: ''
  90. });
  91. const menu = ref([{ name: '视频会商' }, { name: '无人机' }, { name: '单兵设备' }]);
  92. const treeData = ref([
  93. {
  94. label: '茂名市',
  95. children: [
  96. {
  97. label: '茂名市委',
  98. children: [
  99. {
  100. label: '茂名市纪委监委',
  101. isLeaf: true
  102. },
  103. {
  104. label: '茂名市委办公室',
  105. isLeaf: true
  106. },
  107. {
  108. label: '茂名市委组织部',
  109. isLeaf: true
  110. }
  111. ]
  112. },
  113. {
  114. label: '茂名市人大',
  115. children: [
  116. {
  117. label: '茂名市人大常委会秘书长、副秘书长',
  118. isLeaf: true
  119. },
  120. {
  121. label: '茂名市人大常委会办公室',
  122. isLeaf: true
  123. },
  124. {
  125. label: '茂名市人大常委会研究室',
  126. isLeaf: true
  127. }
  128. ]
  129. }
  130. ]
  131. }
  132. ]);
  133. const userList = ref([]);
  134. const selectList = computed(() => {
  135. const data = [];
  136. userList.value.forEach((item) => {
  137. if (item.checked) {
  138. data.push(item);
  139. }
  140. });
  141. return data;
  142. });
  143. const getCheckedClass = () => {
  144. let res = 'common-checked';
  145. const len = userList.value.length;
  146. const len2 = selectList.value.length;
  147. if (len2 > 0 && len2 === len) {
  148. res = 'common-checked-active';
  149. } else if (len2 > 0) {
  150. res = 'common-checked-half';
  151. }
  152. return res;
  153. };
  154. const handleNodeClick = (item) => {
  155. if (item.isLeaf) {
  156. const data = [
  157. {
  158. id: 1,
  159. name: '李莉莉',
  160. duty: '副主任',
  161. dept: '茂名市/茂名市政府/茂名应急管理局'
  162. },
  163. {
  164. id: 2,
  165. name: '何里',
  166. duty: '副主任',
  167. dept: '茂名市/茂名市政府/茂名应急管理局'
  168. },
  169. {
  170. id: 3,
  171. name: '张三',
  172. duty: '副主任',
  173. dept: '茂名市/茂名市政府/茂名应急管理局'
  174. },
  175. {
  176. id: 4,
  177. name: '张三',
  178. duty: '副主任',
  179. dept: '茂名市/茂名市政府/茂名应急管理局'
  180. },
  181. {
  182. id: 5,
  183. name: '张三',
  184. duty: '副主任',
  185. dept: '茂名市/茂名市政府/茂名应急管理局'
  186. },
  187. {
  188. id: 6,
  189. name: '张三',
  190. duty: '副主任',
  191. dept: '茂名市/茂名市政府/茂名应急管理局'
  192. }
  193. ];
  194. data.forEach((item) => {
  195. item.checked = false;
  196. });
  197. userList.value = data;
  198. }
  199. };
  200. // 全选、全取消
  201. const handleChecked = () => {
  202. const checkedClass = getCheckedClass();
  203. let flag = true;
  204. if (checkedClass === 'common-checked-active') {
  205. flag = false;
  206. }
  207. userList.value.forEach((item) => {
  208. item.checked = flag;
  209. });
  210. };
  211. // 单个选中、取消选中
  212. const handleChecked2 = (item) => {
  213. item.checked = !item.checked;
  214. };
  215. // 清空
  216. const clearSelect = () => {
  217. userList.value.forEach((item) => {
  218. if (item.checked) {
  219. item.checked = false;
  220. }
  221. });
  222. };
  223. // 清空指定项
  224. const deleteItem = (item) => {
  225. for (let i = 0; i < userList.value.length; i++) {
  226. if (item.id === userList.value[i].id) {
  227. userList.value[i].checked = false;
  228. break;
  229. }
  230. }
  231. };
  232. // 弹窗关闭后
  233. const handleClose = () => {
  234. emits('close');
  235. };
  236. </script>
  237. <style lang="scss" scoped>
  238. .content {
  239. display: flex;
  240. margin-top: 12px;
  241. .left-content {
  242. width: 910px;
  243. padding-right: 30px;
  244. border-right: 1px solid #2187ff;
  245. }
  246. .middle-content {
  247. width: 910px;
  248. padding: 0 30px;
  249. border-right: 1px solid #2187ff;
  250. .search-box {
  251. display: flex;
  252. .select-box {
  253. flex-shrink: 0;
  254. width: 176px !important;
  255. height: 56px;
  256. line-height: 56px;
  257. margin: 0 10px;
  258. color: #83a3be;
  259. font-size: 32px;
  260. }
  261. }
  262. .user-box {
  263. margin-left: 10px;
  264. width: 100%;
  265. height: 100%;
  266. .user-table {
  267. padding: 15px 0;
  268. display: flex;
  269. flex-direction: column;
  270. font-size: 38px;
  271. color: #fbffff;
  272. .tr {
  273. background-color: #102e76;
  274. }
  275. .tr,
  276. .tr2 {
  277. display: flex;
  278. padding: 6px 0;
  279. .td {
  280. flex: 1;
  281. display: flex;
  282. align-items: center;
  283. }
  284. .td2 {
  285. width: 65px;
  286. display: flex;
  287. align-items: center;
  288. justify-content: center;
  289. }
  290. .td3 {
  291. flex: 2;
  292. display: flex;
  293. align-items: center;
  294. }
  295. }
  296. .table-content {
  297. height: 858px;
  298. overflow-y: auto;
  299. }
  300. .tr2 {
  301. margin-top: 10px;
  302. background-color: #122868;
  303. }
  304. .phone-icon {
  305. width: 62px;
  306. height: 63px;
  307. background: url('@/assets/images/emergencyCommandMap/communication/phone.png');
  308. cursor: pointer;
  309. }
  310. }
  311. }
  312. }
  313. .custom-select-popper {
  314. .el-scrollbar {
  315. .el-select-dropdown__item {
  316. color: #b1cae0;
  317. font-size: 32px;
  318. height: 56px;
  319. line-height: 56px;
  320. }
  321. }
  322. }
  323. .input {
  324. background: transparent;
  325. color: #83a3be;
  326. font-size: 32px;
  327. outline: none;
  328. appearance: none;
  329. height: 100%;
  330. border: none;
  331. &::placeholder {
  332. color: #83a3be;
  333. }
  334. }
  335. .tree-container {
  336. margin-top: 15px;
  337. display: flex;
  338. .tree-box {
  339. width: 100%;
  340. height: 920px;
  341. overflow-y: auto;
  342. padding: 15px 8px;
  343. :deep(.el-tree) {
  344. height: 100%;
  345. background-color: transparent;
  346. color: #fbffff;
  347. font-size: 38px;
  348. .el-tree-node__content {
  349. height: auto;
  350. padding-top: 10px;
  351. padding-bottom: 10px;
  352. white-space: normal;
  353. word-break: break-all;
  354. }
  355. .el-tree-node__expand-icon {
  356. color: #297cfc;
  357. font-size: 23px;
  358. }
  359. .el-tree-node:focus > .el-tree-node__content,
  360. .el-tree-node__content:hover {
  361. background-color: transparent !important;
  362. }
  363. }
  364. }
  365. }
  366. .select-box2 {
  367. margin-left: 30px;
  368. width: 910px;
  369. height: 100%;
  370. .select-header {
  371. display: flex;
  372. justify-content: space-between;
  373. align-items: center;
  374. color: #fbffff;
  375. font-size: 32px;
  376. border-bottom: 1px solid #247dff;
  377. padding: 20px;
  378. .left-item {
  379. display: flex;
  380. align-items: center;
  381. .text {
  382. margin: 0 10px;
  383. color: #00e8ff;
  384. font-family: 'BEBAS-1';
  385. }
  386. }
  387. .clear-btn {
  388. color: #00e8ff;
  389. cursor: pointer;
  390. }
  391. }
  392. .select-content {
  393. height: 858px;
  394. overflow-y: auto;
  395. .box-item {
  396. border-bottom: 1px solid #247dff;
  397. padding: 20px;
  398. position: relative;
  399. .line {
  400. color: #fff;
  401. font-size: 38px;
  402. display: flex;
  403. .text1 {
  404. margin-right: 35px;
  405. }
  406. .text2 {
  407. color: #a7ccdf;
  408. }
  409. }
  410. .close-btn {
  411. position: absolute;
  412. right: 10px;
  413. top: 50px;
  414. cursor: pointer;
  415. width: 29px;
  416. height: 29px;
  417. background: url('@/assets/images/emergencyCommandMap/communication/close.png') no-repeat;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. </style>