mapCrossingDialog.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <div class="detail">
  3. <!-- 标题区域 -->
  4. <div class="detail_title">路口详情</div>
  5. <!-- 视频区域 -->
  6. <div class="detail_video">
  7. <div id="videoDom2"></div>
  8. <div class="video_title">{{ detailObj.name }}</div>
  9. </div>
  10. <!-- 详细信息区域 -->
  11. <div class="detail_msg">
  12. <div class="msg_img">
  13. <img src="@/assets/images/87.png" />
  14. </div>
  15. <div class="msg_info">
  16. <div class="info_title">{{ detailObj.name }}</div>
  17. <div class="info_num">
  18. 当日:{{ dayNum }}人&nbsp;&nbsp;&nbsp;&nbsp;累计:{{ addNum }}人
  19. </div>
  20. </div>
  21. </div>
  22. <!-- 边框线区域 -->
  23. <div class="detail_line"></div>
  24. <!-- 表格区域 -->
  25. <div class="detail_form">
  26. <el-table
  27. :data="tableData"
  28. style="width: 100%"
  29. v-loading="loading"
  30. element-loading-text="加载中..."
  31. element-loading-background="rgba(1,18,38, 0.8)"
  32. >
  33. <el-table-column prop="sm_name" label="姓名" align="center" />
  34. <el-table-column prop="sm_phone" label="电话" align="center" />
  35. <el-table-column prop="sm_time" label="时间" align="center" />
  36. </el-table>
  37. </div>
  38. <!-- 关闭按钮区域 -->
  39. <div class="detail_close" @click="handleCloseDetail"></div>
  40. </div>
  41. </template>
  42. <script setup lang="ts">
  43. import { ref, onMounted, watch, onUnmounted } from "vue";
  44. // 引入路口相关的接口
  45. import {
  46. reqJtNumByDay,
  47. reqJtNumByTotal,
  48. reqJtTableData,
  49. } from "@/api/junction/index";
  50. // 引入路口数据
  51. import { junctionData } from "@/components/map/junctionData";
  52. // 引入监控相关的数据接口
  53. import { getVedio } from "@/api/video/index";
  54. // @ts-ignore
  55. import WasmPlayer from "@easydarwin/easywasmplayer";
  56. // 父组件传递过来的数据
  57. const props = defineProps(["detailObj"]);
  58. const $emit = defineEmits(["closeDetail"]);
  59. // 表格数据
  60. const tableData = ref([]);
  61. // loading加载效果控制
  62. const loading = ref(true);
  63. // 当前路口累计人数
  64. const addNum = ref(0);
  65. // 当前路口当日人数
  66. const dayNum = ref(0);
  67. // 监控实例
  68. const player = ref();
  69. onMounted(() => {
  70. // 获取视频地址
  71. getVideosData();
  72. // 获取各路口当日人数
  73. getJtNumByDay();
  74. // 获取各路口累计人数
  75. getJtNumByTotal();
  76. // 获取表格数据
  77. getTableData();
  78. });
  79. onUnmounted(() => {
  80. // 页面卸载时销毁WasmPlayer实例
  81. player.value.destroy();
  82. });
  83. // 监听路口变化更新数据
  84. watch(props.detailObj, () => {
  85. player.value?.destroy();
  86. getVideosData();
  87. getJtNumByDay();
  88. getJtNumByTotal();
  89. getTableData();
  90. });
  91. // 获取视频地址
  92. const getVideosData = async () => {
  93. const Obj = junctionData.find((ele) => ele.title === props.detailObj.name);
  94. const res = await getVedio(Obj?.rtspaddr as string);
  95. player.value = new WasmPlayer(null, "videoDom2");
  96. player.value.play(res, 1);
  97. };
  98. // 获取各路口当日人数
  99. const getJtNumByDay = async () => {
  100. const res = await reqJtNumByDay();
  101. // console.log(res);
  102. // 匹配出当前路口的当日人数
  103. res.data.forEach((ele: any) => {
  104. if (ele.place_name === props.detailObj.name) {
  105. dayNum.value = ele.num;
  106. }
  107. });
  108. };
  109. // 获取各路口累计人数
  110. const getJtNumByTotal = async () => {
  111. const res = await reqJtNumByTotal();
  112. // console.log(res);
  113. // 匹配出当前路口的累计人数
  114. res.data.forEach((ele: any) => {
  115. if (ele.place_name === props.detailObj.name) {
  116. addNum.value = ele.num;
  117. }
  118. });
  119. };
  120. // 获取表格数据
  121. const getTableData = async () => {
  122. const res = await reqJtTableData(props.detailObj.name);
  123. // console.log(res);
  124. tableData.value = res.data;
  125. loading.value = false;
  126. };
  127. // 点击关闭按钮图标回调
  128. const handleCloseDetail = () => {
  129. $emit("closeDetail", false);
  130. };
  131. </script>
  132. <style lang="scss" scoped>
  133. .detail {
  134. position: absolute;
  135. top: -125px;
  136. left: 2530px;
  137. width: 1016px;
  138. height: 1378px;
  139. color: #fff;
  140. background-image: url(@/assets/images/news-detail-background.png);
  141. background-size: 100% 100%;
  142. .detail_title {
  143. margin-top: 70px;
  144. font-size: 30px;
  145. font-weight: bold;
  146. }
  147. .detail_video {
  148. position: relative;
  149. margin-left: 15px;
  150. margin-top: 75px;
  151. width: 874px;
  152. height: 491px;
  153. .video_title {
  154. z-index: 10;
  155. position: absolute;
  156. top: 31px;
  157. left: 44px;
  158. padding: 15px 15px 0;
  159. font-size: 27px;
  160. background: linear-gradient(
  161. 270deg,
  162. rgba(116, 180, 232, 0.29) 0%,
  163. rgba(44, 95, 143, 1) 100%
  164. );
  165. }
  166. }
  167. .detail_msg {
  168. display: flex;
  169. margin-top: 59px;
  170. margin-left: 57px;
  171. width: 768px;
  172. height: 74px;
  173. .msg_img {
  174. margin-right: 20px;
  175. width: 106px;
  176. height: 74px;
  177. border-radius: 10px;
  178. overflow: hidden;
  179. img {
  180. width: 100%;
  181. height: 100%;
  182. object-fit: contain;
  183. }
  184. }
  185. .msg_info {
  186. display: flex;
  187. flex-direction: column;
  188. justify-content: space-around;
  189. .info_title {
  190. font-size: 24px;
  191. font-weight: bold;
  192. }
  193. .info_num {
  194. font-size: 18px;
  195. }
  196. }
  197. }
  198. .detail_line {
  199. margin-top: 30px;
  200. margin-left: 63px;
  201. width: 772px;
  202. height: 6px;
  203. background-image: url(@/assets/images/news-list-bottomLine.png);
  204. background-size: 100% 100%;
  205. }
  206. .detail_form {
  207. margin-top: 24px;
  208. margin-left: 58px;
  209. width: 773px;
  210. height: 480px;
  211. overflow-y: auto;
  212. }
  213. .detail_close {
  214. position: absolute;
  215. top: 0;
  216. right: 0;
  217. width: 98px;
  218. height: 98px;
  219. cursor: pointer;
  220. }
  221. }
  222. /*最外层透明*/
  223. .detail_form ::v-deep(.el-table),
  224. .detail_form ::v-deep(.el-table__expanded-cell) {
  225. background-color: transparent;
  226. color: white;
  227. border: none;
  228. }
  229. /* 表格内背景颜色 */
  230. .detail_form ::v-deep(.el-table th),
  231. .detail_form ::v-deep(.el-table tr),
  232. .detail_form ::v-deep(.el-table td) {
  233. background-color: transparent !important;
  234. color: white;
  235. font-size: 16px;
  236. border-color: rgba(255, 255, 255, 0.1);
  237. }
  238. // 表格底部白线清除
  239. ::v-deep(.el-table__inner-wrapper::before) {
  240. height: 0;
  241. }
  242. // 修改表头背景颜色
  243. ::v-deep(.el-table__header) {
  244. background-color: rgba(58, 126, 199, 0.5);
  245. }
  246. // 清除表格默认padding
  247. ::v-deep(.el-table .el-table__body-wrapper .el-table__cell) {
  248. padding: 0;
  249. height: 55px;
  250. }
  251. </style>