stationTable.vue 2.1 KB

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