PublicTable.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据">
  3. <uni-tr class="headerFix">
  4. <uni-th width="120" align="center">车牌号</uni-th>
  5. <uni-th width="144">车辆识别码(VIN码)</uni-th>
  6. <uni-th width="160">前端电池距离(CM)</uni-th>
  7. <uni-th width="142">创建时间</uni-th>
  8. <uni-th width="142">来源</uni-th>
  9. <uni-th width="142">状态</uni-th>
  10. <uni-th align="center" width="148">操作</uni-th>
  11. </uni-tr>
  12. <uni-tr v-for="(item, index) in tableData" :key="index">
  13. <uni-td width="120" align="center">{{ item.date }}</uni-td>
  14. <uni-td width="144" align="center">{{ item.name }}</uni-td>
  15. <uni-td width="160">{{ item.name }}</uni-td>
  16. <uni-td width="142">{{ item.name }}</uni-td>
  17. <uni-td width="142">{{ item.name }}</uni-td>
  18. <uni-td width="142">{{ item.name }}</uni-td>
  19. <uni-td width="150">
  20. <view class="uni-group">
  21. <view class="editbtn">编辑</view>
  22. <view class="editbtn">删除</view>
  23. </view>
  24. </uni-td>
  25. </uni-tr>
  26. </uni-table>
  27. </template>
  28. <script>
  29. export default {
  30. name: "PublicTable",
  31. props: ['loading', 'tableData'],
  32. data() {
  33. return {
  34. };
  35. },
  36. methods: {
  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: 480px;
  58. padding-top: 46px;
  59. box-sizing: border-box;
  60. }
  61. ::v-deep .uni-table-scroll {
  62. width: 998px;
  63. height: 100%;
  64. }
  65. .headerFix {
  66. position: fixed;
  67. left: 241px;
  68. z-index: 1;
  69. top: 224px;
  70. }
  71. ::v-deep .table--border{
  72. border: none !important;
  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. }
  89. .uni-table-td {
  90. font-weight: 400;
  91. color: #FFFFFF;
  92. font-size: 14px;
  93. height: 46px;
  94. line-height: 38px;
  95. }
  96. .uni-table-tr:nth-child(n + 2):hover {
  97. background-color: #1e2f36;
  98. }
  99. }
  100. ::v-deep .table--stripe .uni-table-tr:nth-child(2n + 3) {
  101. background-color: #141B2B;
  102. box-shadow: 0px 1px 0px 0px #292D46, 0px -1px 0px 0px #292D46;
  103. }
  104. </style>