easyToFloodPoint.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="container">
  3. <div class="card">
  4. <div class="card-header">
  5. <i class="icon-line" />
  6. <div class="text">易涝点</div>
  7. </div>
  8. <div class="card-content2">
  9. <el-table
  10. :data="detailsData.dataList"
  11. header-cell-class-name="common-table-header"
  12. :row-class-name="getTableRowClass"
  13. table-layout="auto"
  14. class="common-table"
  15. >
  16. <el-table-column prop="area" align="center">
  17. <template #header>
  18. <div class="table-line" @click="showPicker = true">
  19. <div>{{ !!labelData ? labelData : "所有区县" }}</div>
  20. <i class="icon-down" />
  21. </div>
  22. </template>
  23. </el-table-column>
  24. <el-table-column
  25. label="易涝点名称"
  26. prop="flood_name"
  27. align="center"
  28. />
  29. <el-table-column label="提供单位" prop="unit" align="center" />
  30. <el-table-column label="视频" prop="publicTime" align="center">
  31. <template #default="scope">
  32. <div class="btn" @click="handlePlay(scope.row)">播放</div>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <pagination
  37. v-show="total > 0"
  38. v-model:page="queryParams.current"
  39. v-model:limit="queryParams.size"
  40. :total="total"
  41. :pager-count="3"
  42. size="small"
  43. layout="prev, pager, next"
  44. @pagination="getTableDetail"
  45. />
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script setup lang="ts">
  51. import { ElTable, ElTableColumn } from "element-plus";
  52. import { onMounted, reactive, ref } from "vue";
  53. import router from "@/router";
  54. import { getEasyFlood } from "@/api/disasterRiskMonitor/easyFlood";
  55. let detailsData = ref({
  56. dataList: []
  57. });
  58. let showPicker = ref(false);
  59. let labelData = ref("");
  60. let total = ref(0);
  61. const liveMapState = reactive({
  62. show: false,
  63. activeIndex: 0,
  64. speed: 1,
  65. playing: false,
  66. data: []
  67. });
  68. const queryParams = ref({
  69. query: {
  70. area: "",
  71. keyword: ""
  72. },
  73. current: 1,
  74. size: 10
  75. });
  76. const initData = () => {
  77. getTableDetail();
  78. // detailsData.value.dataList = [
  79. // { area: "茂南区", name: "高山铁路桥底", data1: "城市管理和综合执法局" },
  80. // { area: "茂南区", name: "油城二路桥底", data1: "城市管理和综合执法局" },
  81. // { area: "茂南区", name: "榕园东北侧", data1: "城市管理和综合执法局" },
  82. // { area: "茂南区", name: "人民中路", data1: "城市管理和综合执法局" },
  83. // { area: "化州市", name: "橘城南路", data1: "城市管理和综合执法局" },
  84. // { area: "化州市", name: "下郭大道", data1: "城市管理和综合执法局" },
  85. // { area: "化州市", name: "河西沙埚村", data1: "城市管理和综合执法局" }
  86. // ];
  87. };
  88. const handlePlay = row => {
  89. router.push({
  90. name: "EasyToFloodPointView",
  91. query: {
  92. latitude: row.lat,
  93. longitude: row.lng,
  94. name: encodeURIComponent(row.flood_name)
  95. }
  96. });
  97. };
  98. const getTableDetail = () => {
  99. getEasyFlood(queryParams.value).then(res => {
  100. detailsData.value.dataList = res.rows;
  101. total.value = res.total;
  102. });
  103. };
  104. onMounted(() => {
  105. initData();
  106. });
  107. const getTableRowClass = ({ rowIndex }) => {
  108. return rowIndex % 2 === 0 ? "" : "common-table-tr";
  109. };
  110. </script>
  111. <style scoped lang="scss">
  112. .container {
  113. height: calc(100vh);
  114. padding: 16px;
  115. .card {
  116. background-color: #ffffff;
  117. border: 1px solid #eaedf7;
  118. box-shadow: 0 0 4px 0 #4554661a;
  119. border-radius: 4px;
  120. padding: 2px;
  121. margin-top: 16px;
  122. &:first-child {
  123. margin-top: 0;
  124. }
  125. .card-header {
  126. font-size: 16px;
  127. color: #414f64;
  128. font-weight: bold;
  129. line-height: 26px;
  130. padding: 11px 10px;
  131. display: flex;
  132. align-items: center;
  133. border-top-left-radius: 4px;
  134. border-top-right-radius: 4px;
  135. background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
  136. .icon-line {
  137. display: inline-block;
  138. width: 6px;
  139. height: 16px;
  140. background: url("@/assets/images/line.jpg") no-repeat;
  141. background-size: 100% 100%;
  142. margin-right: 3px;
  143. }
  144. }
  145. .card-content {
  146. padding-bottom: 13px;
  147. }
  148. }
  149. .btn {
  150. font-size: 14px;
  151. color: #2c81ff;
  152. }
  153. }
  154. </style>