TrafficVideo.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="menu-content">
  3. <div class="container">
  4. <div class="gradient-text title">交通视频</div>
  5. <div class="box-left">
  6. <el-input v-model="queryParams.keyword" class="custom-input" placeholder="搜索" @input="initData">
  7. <template #prefix>
  8. <el-icon class="el-input__icon"><search /></el-icon>
  9. </template>
  10. </el-input>
  11. <div class="btn" @click="handleCancel">取消</div>
  12. </div>
  13. <!-- <div class="gradient-text">视频类型</div>-->
  14. <div class="custom-table">
  15. <div class="th">
  16. <div class="td">
  17. <div style="width: 240px">
  18. <el-select
  19. v-model="queryParams.area"
  20. placeholder="所有区县"
  21. size="large"
  22. class="custom-select2"
  23. popper-class="custom-select-popper2"
  24. :teleported="false"
  25. @change="initData"
  26. >
  27. <el-option label="所有区县" value="" />
  28. <el-option v-for="item in district_type" :key="item.value" :label="item.label" :value="item.label" />
  29. </el-select>
  30. </div>
  31. </div>
  32. <div class="td">名称</div>
  33. </div>
  34. <div class="table-content">
  35. <div v-for="(item, index) in listData" :key="index" class="tr" @click="handleShowDialog(item)">
  36. <div class="td">{{ item.area }}</div>
  37. <div class="td">{{ item.name }}</div>
  38. </div>
  39. </div>
  40. </div>
  41. <Dialog v-if="showDialog" v-model="showDialog" type="md" draggable title="交通视频" hide-footer>
  42. <div style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center">
  43. <HKVideo :dot_data="videoMonitorData" />
  44. </div>
  45. </Dialog>
  46. </div>
  47. </div>
  48. </template>
  49. <script lang="ts" setup>
  50. import { Search } from '@element-plus/icons-vue';
  51. import { getTraffic } from '@/api/globalMap/mitigation';
  52. import { deepClone } from '@/utils';
  53. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  54. const { district_type } = toRefs<any>(proxy?.useDict('district_type'));
  55. const queryParams = reactive({
  56. current: 1,
  57. size: 10,
  58. keyword: '',
  59. area: ''
  60. });
  61. const total = ref(0);
  62. const listData = ref([]);
  63. let showDialog = ref(false);
  64. let videoMonitorData = ref({});
  65. const handleShowDialog = (row) => {
  66. showDialog.value = false;
  67. nextTick(() => {
  68. videoMonitorData.value = row;
  69. showDialog.value = true;
  70. });
  71. };
  72. const initData = () => {
  73. let newQueryParams = deepClone(queryParams);
  74. newQueryParams.query = {
  75. area: queryParams.area,
  76. keyword: queryParams.keyword
  77. };
  78. delete newQueryParams.area;
  79. delete newQueryParams.keyword;
  80. getTraffic(newQueryParams).then((res) => {
  81. listData.value = res.rows;
  82. total.value = res.total;
  83. });
  84. };
  85. const handleCancel = () => {
  86. queryParams.keyword = '';
  87. initData();
  88. };
  89. initData();
  90. </script>
  91. <style lang="scss" scoped>
  92. .menu-content {
  93. width: 1579px;
  94. height: 1394px;
  95. background: url('@/assets/images/map/rightMenu/content.png') no-repeat;
  96. padding: 130px 20px 20px 20px;
  97. font-size: 36px;
  98. position: relative;
  99. color: #ffffff;
  100. }
  101. .title {
  102. font-size: 60px;
  103. position: absolute;
  104. top: 30px;
  105. left: 160px;
  106. }
  107. .custom-table {
  108. width: 1499px;
  109. .table-content {
  110. height: 880px;
  111. overflow-y: auto;
  112. overflow-x: hidden;
  113. }
  114. .th {
  115. width: 1499px;
  116. height: 151px;
  117. background: url('@/assets/images/map/rightMenu/th.png') no-repeat;
  118. display: flex;
  119. }
  120. .tr {
  121. height: 139px;
  122. background: url('@/assets/images/map/rightMenu/td.png') no-repeat;
  123. //margin-left: -23px;
  124. display: flex;
  125. padding-right: 20px;
  126. &:hover {
  127. background: url('@/assets/images/map/rightMenu/td_checked.png') no-repeat;
  128. }
  129. }
  130. .td {
  131. flex: 1;
  132. color: #edfaff;
  133. font-size: 38px;
  134. display: flex;
  135. justify-content: center;
  136. align-items: center;
  137. cursor: pointer;
  138. }
  139. .td-text {
  140. /* 设置字体透明 */
  141. color: transparent;
  142. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  143. -webkit-background-clip: text;
  144. /* 非Webkit内核浏览器需要使用标准前缀 */
  145. background-clip: text;
  146. font-family: 'YouSheBiaoTiHei';
  147. /* 设置线性渐变,从红色渐变到蓝色 */
  148. background-image: linear-gradient(to bottom, #ffffff 50%, #3075d3 100%);
  149. font-size: 48px;
  150. }
  151. .text-green {
  152. background-image: linear-gradient(to bottom, #ffffff 50%, #40c75f 100%);
  153. }
  154. .text-danger {
  155. background-image: linear-gradient(to bottom, #ffffff 50%, #ff2f3c 100%);
  156. }
  157. }
  158. .box-left {
  159. display: flex;
  160. margin-top: 20px;
  161. margin-bottom: 20px;
  162. .btn {
  163. width: 140px;
  164. min-width: 140px;
  165. height: 56px;
  166. background: url('@/assets/images/map/rightMenu/potentialFloodHazard/btn.png') no-repeat;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. cursor: pointer;
  171. margin-left: 20px;
  172. }
  173. }
  174. </style>