FaultTable.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <scroll-view class="uni-container" scroll-y="true" @scrolltolower='scrollbottom'>
  3. <uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据">
  4. <uni-tr class="headerFix">
  5. <uni-th width="120">告警设备</uni-th>
  6. <uni-th width="144">告警标识</uni-th>
  7. <uni-th width="200">告警信息</uni-th>
  8. <uni-th width="162">告警开始时间</uni-th>
  9. <uni-th width="162">告警结束时间</uni-th>
  10. <uni-th width="132">告警状态</uni-th>
  11. <uni-th align="center" width="80">操作</uni-th>
  12. </uni-tr>
  13. <uni-tr v-for="(item, index) in datalist" :key="index">
  14. <uni-td width="120">{{ item.equipment }}</uni-td>
  15. <uni-td width="144">{{ item.code }}</uni-td>
  16. <uni-td width="200">{{ item.info }}</uni-td>
  17. <uni-td width="162">{{ item.beginTime }}</uni-td>
  18. <uni-td width="162">{{ item.endTime }}</uni-td>
  19. <uni-td width="132">{{ item.state===0?'待处理':item.state === 1?'处理中':'已处理' }}</uni-td>
  20. <uni-td width="80" align="center"><view class="editbtn">处理</view></uni-td>
  21. </uni-tr>
  22. </uni-table>
  23. </scroll-view>
  24. </template>
  25. <script>
  26. export default {
  27. name: "PublicTable",
  28. props: ['loading', 'datalist'],
  29. data() {
  30. return {
  31. };
  32. },
  33. methods:{
  34. scrollbottom(){
  35. console.log('scrollbottom')
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .editbtn {
  42. color: #91FDB9;
  43. }
  44. .tableHeader {
  45. display: flex;
  46. }
  47. .uni-group {
  48. display: flex;
  49. align-items: center;
  50. justify-content: center;
  51. view:first-child {
  52. margin-right: 15px;
  53. }
  54. }
  55. .uni-container {
  56. margin-top: 16px;
  57. height: 523px;
  58. box-sizing: border-box;
  59. padding-top: 36px;
  60. }
  61. ::v-deep .uni-table-scroll {
  62. width: 998px;
  63. height: 100%;
  64. }
  65. ::v-deep .table--border {
  66. border: none;
  67. }
  68. .headerFix{
  69. position:fixed;
  70. left: 241px;
  71. z-index: 1;
  72. top: 175px;
  73. }
  74. ::v-deep .uni-table {
  75. background: none;
  76. .empty-border {
  77. border: none;
  78. height: 80px;
  79. line-height: 80px;
  80. }
  81. .uni-table-th {
  82. height: 46px;
  83. background: #1D283E;
  84. box-shadow: 0px 1px 0px 0px #2F3C86;
  85. font-weight: 600;
  86. color: #FFFFFF;
  87. font-size: 14px;
  88. padding: 12px 8px;
  89. }
  90. .uni-table-td {
  91. font-weight: 400;
  92. color: #FFFFFF;
  93. font-size: 14px;
  94. height: 46px;
  95. line-height: 38px;
  96. }
  97. .uni-table-tr:nth-child(n + 2):hover {
  98. background-color: #1e2f36;
  99. }
  100. }
  101. ::v-deep .table--stripe .uni-table-tr:nth-child(2n + 3) {
  102. background-color: #141B2B;
  103. box-shadow: 0px 1px 0px 0px #292D46, 0px -1px 0px 0px #292D46;
  104. }
  105. </style>