waterLevel.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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: 700 }"
  24. />
  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 } from '../common.data';
  35. const { hasPermission } = usePermission();
  36. const router = useRouter();
  37. const tableData = ref([]);
  38. //分页切换
  39. const pageChange = (val) => {
  40. console.log(val, 'val');
  41. pagination.current = val.current;
  42. pagination.pageSize = val.pageSize;
  43. getListData();
  44. };
  45. const pagination = reactive({
  46. current: 1, // 当前页码
  47. pageSize: 20, // 每页显示条数
  48. total: 0, // 总条目数,后端返回
  49. showTotal: (total) => `共 ${total} 条`, // 分页右下角显示信息
  50. });
  51. //返回首页
  52. function getBack() {
  53. router.push('/monitorChannel/monitor-alarm-home');
  54. }
  55. async function getListData() {
  56. var params = {
  57. pageIndex: pagination.current,
  58. pageSize: pagination.pageSize,
  59. };
  60. const res = await getHydrology({ ...params });
  61. tableData.value = res.data;
  62. pagination.total = res.count;
  63. }
  64. onMounted(() => {
  65. getListData();
  66. });
  67. onUnmounted(() => {});
  68. </script>
  69. <style lang="less" scoped>
  70. @import '/@/design/theme.less';
  71. @{theme-deepblue} {
  72. .gasWarn {
  73. --image-no-choice: url('/@/assets/images/themify/deepblue/fire/no-choice.png');
  74. --image-choice: url('/@/assets/images/themify/deepblue/fire/choice.png');
  75. --image-border: url('/@/assets/images/themify/deepblue/fire/border.png');
  76. --image-bj1: url('/@/assets/images/themify/deepblue/fire/bj1.png');
  77. --image-top-area: url('/@/assets/images/themify/deepblue/fire/top-area.png');
  78. }
  79. }
  80. .gasWarn {
  81. --image-no-choice: url('/@/assets/images/fire/no-choice.png');
  82. --image-choice: url('/@/assets/images/fire/choice.png');
  83. --image-border: url('/@/assets/images/fire/border.png');
  84. --image-bj1: url('/@/assets/images/fire/bj1.png');
  85. --image-top-area: url('/@/assets/images/fire/top-area.png');
  86. width: 100%;
  87. height: 100%;
  88. padding: 80px 10px 15px 10px;
  89. box-sizing: border-box;
  90. display: flex;
  91. justify-content: space-between;
  92. .gas-content {
  93. position: relative;
  94. width: 100%;
  95. height: 100%;
  96. margin-left: 10px;
  97. padding: 15px;
  98. background: var(--image-border) no-repeat;
  99. background-size: 100% 100%;
  100. box-sizing: border-box;
  101. }
  102. }
  103. </style>