AnalysisTable.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="alarm-history-table">
  3. <a-table :dataSource="mockData" :columns="Warncolumns" :scroll="{ y: 300 }"> </a-table>
  4. </div>
  5. </template>
  6. <script setup lang="ts">
  7. import { ref } from 'vue';
  8. const Warncolumns = ref([
  9. {
  10. title: '序号',
  11. align: 'center',
  12. key: 'index',
  13. width: 80,
  14. customRender: ({ index }) => {
  15. return index + 1;
  16. },
  17. },
  18. {
  19. title: '设备名称',
  20. align: 'center',
  21. width: 200,
  22. customRender: () => '特拉布拉主风机',
  23. },
  24. {
  25. title: '故障描述',
  26. align: 'center',
  27. customRender: ({ record }) => {
  28. const activeFaults = record.title;
  29. return activeFaults;
  30. },
  31. },
  32. {
  33. title: '故障原因',
  34. align: 'center',
  35. key: 'faultStatus',
  36. customRender: ({ record }) => {
  37. const activeFaults = record.faultStatus;
  38. return activeFaults;
  39. },
  40. },
  41. {
  42. title: '解决方案',
  43. align: 'center',
  44. key: 'netStatus',
  45. customRender: ({ record }) => {
  46. const activeFaults = record.netStatus;
  47. return activeFaults;
  48. },
  49. },
  50. {
  51. title: '时间',
  52. align: 'center',
  53. key: 'readTime',
  54. customRender: () => {
  55. const now = new Date();
  56. return now.toLocaleString(); // 格式化为本地时间字符串
  57. },
  58. },
  59. ]);
  60. const mockData = [
  61. {
  62. key: 0,
  63. title: '水平或垂直振动>6mm',
  64. faultStatus: '通风阻力增大;静压值低于正常运行值100pa',
  65. netStatus: '检查相关参数传感器、增大风机运行频率',
  66. },
  67. {
  68. key: 1,
  69. title: '前轴/后轴温度>70℃',
  70. faultStatus: '缺乏润滑脂或轴承损坏',
  71. netStatus: '检查轴承润滑脂状态、检查轴承是否损坏、检查相关参数传感器',
  72. },
  73. {
  74. key: 2,
  75. title: '前轴/后轴温度>105℃',
  76. faultStatus: '轴承损坏',
  77. netStatus: '检查轴承是否损坏',
  78. },
  79. {
  80. key: 3,
  81. title: '水平或垂直振动>8mm,且变化范围较大',
  82. faultStatus: '电机轴承发生损坏;风机扇叶发生损坏',
  83. netStatus: '检查振动传感器、检查电机轴承、检查风机扇叶',
  84. },
  85. {
  86. key: 4,
  87. title: '额定电压超过额定值的10%时',
  88. faultStatus: '电网电压出现出现异常或者通风阻力增大',
  89. netStatus: '检查相关参数传感器、检查电网电压',
  90. },
  91. ];
  92. </script>