stationTable.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <div class="stationTable">
  3. <div class="content-area">
  4. <a-table :columns="stationColumns" size="small" :data-source="stationTableData" class="tableW" :pagination="false" :scroll="{ y: 620 }">
  5. <template #action="{ record }">
  6. <a class="table-action-link" @click="handlerDetail(record)">详情</a>
  7. <a class="table-action-link" @click="handlerLocation(record)">定位</a>
  8. </template>
  9. </a-table>
  10. </div>
  11. </div>
  12. </template>
  13. <script setup lang="ts">
  14. import { ref, reactive, onMounted, watch, defineExpose } from 'vue';
  15. import { stationColumns } from './comment.data';
  16. import { getListAll } from '../deviceMonitor/components/device/device.api';
  17. let stationTableData = ref<any[]>([]);
  18. let $emit = defineEmits(['locate', 'stationDetail']);
  19. //定位
  20. function handlerLocation(record) {
  21. $emit('locate', record);
  22. }
  23. //查看详情
  24. function handlerDetail(record) {
  25. $emit('stationDetail', record);
  26. }
  27. //查询分站列表
  28. async function getStationList() {
  29. let res = await getListAll();
  30. res.forEach((el) => {
  31. el.key = el.id;
  32. el.linkstatusC = el.linkstatus ? '连接' : '断开';
  33. el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : '';
  34. });
  35. stationTableData.value = res;
  36. }
  37. defineExpose({ getStationList });
  38. onMounted(() => {});
  39. </script>
  40. <style lang="less" scoped>
  41. @ventSpace: zxm;
  42. .stationTable {
  43. .zxm-picker,
  44. .zxm-input {
  45. border: 1px solid #3ad8ff77;
  46. background-color: #ffffff00;
  47. color: #fff;
  48. }
  49. }
  50. :deep(.@{ventSpace}-table-body) {
  51. height: auto !important;
  52. tr > td {
  53. background: #ffffff00 !important;
  54. }
  55. tr.@{ventSpace}-table-row-selected {
  56. td {
  57. background: #007cc415 !important;
  58. }
  59. }
  60. }
  61. :deep(.jeecg-basic-table .@{ventSpace}-table-wrapper .@{ventSpace}-table-title) {
  62. min-height: 0;
  63. }
  64. :deep(.@{ventSpace}-pagination) {
  65. margin-right: 20px !important;
  66. }
  67. :deep(.zxm-table-thead > tr > th:last-child) {
  68. border-right: 1px solid #91e9fe55 !important;
  69. }
  70. </style>