otherMonitor.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div class="otherMonitor">
  3. <div class="container">
  4. <a-table ref="table" :row-selection="rowSelection" size="small" :scroll="monitorscroll2" :columns="columnsOther"
  5. :data-source="monitorlist" :pagination="false" :loading="loading">
  6. <span slot="action" slot-scope="text, record">
  7. </span>
  8. </a-table>
  9. </div>
  10. </div>
  11. </template>
  12. <script lang="ts" setup>
  13. import { onMounted, ref, computed, defineEmits, reactive, onUnmounted, watch, markRaw, defineAsyncComponent } from 'vue';
  14. import {columnsOther} from '../fire.data'
  15. //滚动条
  16. let monitorscroll2 = reactive({ y: 'calc(100% - 150px)' })
  17. //table列表
  18. let monitorlist = reactive([])
  19. //table加载状态
  20. let loading = ref(false)
  21. //table选中的数据
  22. let selectedRow = reactive([])
  23. //table复选框选择
  24. let rowSelection = computed(() => {
  25. return {
  26. onChange: (selectedRowKeys, selectedRows) => {
  27. selectedRow = selectedRows
  28. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRow)
  29. },
  30. getCheckboxProps: (record) => ({
  31. props: {
  32. realId: record.realId,
  33. },
  34. }),
  35. }
  36. })
  37. </script>
  38. <style lang="less" scoped>
  39. .otherMonitor {
  40. width: 100%;
  41. height: 100%;
  42. padding: 20px;
  43. box-sizing: border-box;
  44. .container {
  45. height: 100%;
  46. }
  47. }
  48. </style>