waterLevel.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <customHeader> 水文监测 </customHeader>
  3. <div class="gasWarn">
  4. <a-button
  5. v-if="!hasPermission('waterLevel:return')"
  6. preIcon="ant-design:rollback-outlined"
  7. type="text"
  8. size="small"
  9. style="position: absolute; left: 15px; top: 15px; color: #fff"
  10. @click="getBack"
  11. >
  12. 返回
  13. </a-button>
  14. <div class="gas-content">
  15. <a-table
  16. :height="300"
  17. :columns="columns"
  18. :data-source="tableData"
  19. size="large"
  20. :pagination="pagination"
  21. class="tableW"
  22. @change="pageChange"
  23. :scroll="{ y: 800 }"
  24. ></a-table>
  25. </div>
  26. </div>
  27. </template>
  28. <script setup lang="ts">
  29. import { ref, reactive, onMounted, onUnmounted, computed } from 'vue';
  30. import CustomHeader from '/@/components/vent/customHeader.vue';
  31. import { getHydrology } from '../common.api';
  32. import { usePermission } from '/@/hooks/web/usePermission';
  33. import { useRouter } from 'vue-router';
  34. import { columns, pagination } from '../common.data';
  35. const { hasPermission } = usePermission();
  36. let router = useRouter();
  37. let tableData = ref([]);
  38. //分页切换
  39. let pageChange = (val) => {
  40. pagination.current = val.current;
  41. pagination.pageSize = val.pageSize;
  42. getListData();
  43. };
  44. //返回首页
  45. function getBack() {
  46. router.push('/monitorChannel/monitor-alarm-home');
  47. }
  48. async function getListData() {
  49. var params = {
  50. pageIndex: pagination.current,
  51. pageSize: pagination.pageSize,
  52. };
  53. const res = await getHydrology(params);
  54. if (res?.result) {
  55. const parsedResult = JSON.parse(res.result);
  56. tableData.value = parsedResult?.data || []; // 默认空数组防undefined
  57. pagination.total = parsedResult.total; // 更新总条数
  58. }
  59. }
  60. onMounted(() => {
  61. getListData();
  62. });
  63. onUnmounted(() => {});
  64. </script>
  65. <style lang="less" scoped>
  66. @import '/@/design/theme.less';
  67. @{theme-deepblue} {
  68. .gasWarn {
  69. --image-no-choice: url('/@/assets/images/themify/deepblue/fire/no-choice.png');
  70. --image-choice: url('/@/assets/images/themify/deepblue/fire/choice.png');
  71. --image-border: url('/@/assets/images/themify/deepblue/fire/border.png');
  72. --image-bj1: url('/@/assets/images/themify/deepblue/fire/bj1.png');
  73. --image-top-area: url('/@/assets/images/themify/deepblue/fire/top-area.png');
  74. }
  75. }
  76. .gasWarn {
  77. --image-no-choice: url('/@/assets/images/fire/no-choice.png');
  78. --image-choice: url('/@/assets/images/fire/choice.png');
  79. --image-border: url('/@/assets/images/fire/border.png');
  80. --image-bj1: url('/@/assets/images/fire/bj1.png');
  81. --image-top-area: url('/@/assets/images/fire/top-area.png');
  82. width: 100%;
  83. height: 100%;
  84. padding: 80px 10px 15px 10px;
  85. box-sizing: border-box;
  86. display: flex;
  87. justify-content: space-between;
  88. .gas-content {
  89. position: relative;
  90. width: 100%;
  91. height: 100%;
  92. margin-left: 10px;
  93. padding: 15px;
  94. background: var(--image-border) no-repeat;
  95. background-size: 100% 100%;
  96. box-sizing: border-box;
  97. }
  98. }
  99. </style>