list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div id="list">
  3. <el-row>
  4. <el-col :span="24">
  5. <el-col :span="24">
  6. <el-table
  7. ref="multipleTable"
  8. :data="tableData"
  9. tooltip-effect="dark"
  10. :default-sort="{ prop: 'date', order: 'descending' }"
  11. style="width: 100%"
  12. @selection-change="handleSelectionChange"
  13. >
  14. <el-table-column type="selection" align="center"> </el-table-column>
  15. <el-table-column prop="list" label="列表" align="center"> </el-table-column>
  16. <el-table-column prop="list" label="列表" align="center"> </el-table-column>
  17. <el-table-column prop="list" label="列表" align="center"> </el-table-column>
  18. <el-table-column prop="status" label="状态" align="center"> </el-table-column>
  19. <el-table-column prop="list" label="列表" align="center"> </el-table-column>
  20. <el-table-column prop="list" label="列表" align="center"> </el-table-column>
  21. <el-table-column prop="date" label="时间排序" sortable align="center"> </el-table-column>
  22. <el-table-column label="操作" align="center" width="300px">
  23. <template slot-scope="">
  24. <el-button size="mini" type="text" class="other">其他操作</el-button>
  25. <el-button size="mini" type="text" class="other">其他操作</el-button>
  26. <el-button size="mini" type="text" class="view" icon="el-icon-view"></el-button>
  27. <el-button size="mini" type="text" class="edit" icon="el-icon-edit"></el-button>
  28. <el-button size="mini" type="text" class="delete" icon="el-icon-delete"></el-button>
  29. </template>
  30. </el-table-column>
  31. </el-table>
  32. <el-row>
  33. <el-pagination
  34. @size-change="handleSizeChange"
  35. @current-change="handleCurrentChange"
  36. :current-page="currentPage"
  37. :page-sizes="[10, 20, 30, 40]"
  38. :page-size="10"
  39. background
  40. layout="total, sizes, prev, pager, next, jumper"
  41. :total="total"
  42. >
  43. </el-pagination>
  44. </el-row>
  45. </el-col>
  46. </el-col>
  47. </el-row>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. name: 'list',
  53. props: {
  54. tableData: null,
  55. total: null,
  56. },
  57. components: {},
  58. data: () => ({
  59. currentPage: 0,
  60. }),
  61. created() {},
  62. computed: {},
  63. methods: {
  64. handleSelectionChange(val) {
  65. this.multipleSelection = val;
  66. },
  67. handleSizeChange(val) {
  68. console.log(`每页 ${val} 条`);
  69. },
  70. handleCurrentChange(val) {
  71. console.log(`当前页: ${val}`);
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. /deep/.el-checkbox__input.is-checked .el-checkbox__inner {
  78. background-color: red;
  79. border-color: red;
  80. }
  81. /deep/.el-checkbox__input.is-indeterminate .el-checkbox__inner {
  82. background-color: red;
  83. border-color: red;
  84. }
  85. /deep/.el-table th {
  86. background-color: #f5f6fa;
  87. padding: 8px 0;
  88. }
  89. /deep/.el-table td {
  90. padding: 11px 0;
  91. }
  92. .other {
  93. color: #f36302;
  94. }
  95. .view {
  96. color: #f36302;
  97. }
  98. .edit {
  99. color: #2ccc02;
  100. }
  101. .delete {
  102. color: #e9021d;
  103. }
  104. /deep/.el-pagination {
  105. padding: 26px 20px;
  106. }
  107. /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
  108. background-color: red;
  109. }
  110. </style>