listcontext.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div id="rightcont">
  3. <el-col class="zhengce">
  4. <el-col :span="24" class="topTitle">
  5. {{ columnName }}
  6. </el-col>
  7. <el-col :span="24" class="info">
  8. <ul>
  9. <li v-for="(item, index) in contentList" :key="index" @click="$emit('fetch', item.id)">
  10. <el-col :span="21" class="title textOver">{{ item.name }}</el-col>
  11. <el-col :span="3" class="date">
  12. {{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}
  13. </el-col>
  14. </li>
  15. </ul>
  16. <el-col class="page" :span="24">
  17. <el-pagination
  18. @size-change="handleSizeChange"
  19. @current-change="handleCurrentChange"
  20. :current-page="currentPage"
  21. layout="total, prev, pager, next, jumper"
  22. :total="total"
  23. >
  24. </el-pagination>
  25. </el-col>
  26. </el-col>
  27. </el-col>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'rightcont',
  33. props: {
  34. columnName: null,
  35. contentList: null,
  36. total: null,
  37. },
  38. components: {},
  39. data: () => ({
  40. currentPage: 0,
  41. pageSize: 10,
  42. }),
  43. created() {},
  44. computed: {},
  45. methods: {
  46. handleSizeChange(pageSize) {
  47. // this.$emit('handleSizeChange', pageSize);
  48. },
  49. handleCurrentChange(currentPage) {
  50. console.log(currentPage);
  51. this.$emit('handleCurrentChange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
  52. },
  53. },
  54. };
  55. </script>
  56. <style lang="less" scoped>
  57. ul {
  58. margin: 0;
  59. }
  60. li {
  61. padding: 0;
  62. margin: 0;
  63. color: #a8abb7;
  64. }
  65. .zhengce {
  66. height: 660px;
  67. padding: 20px;
  68. overflow: hidden;
  69. }
  70. .topTitle {
  71. font-size: 22px;
  72. color: #22529a;
  73. margin: 0 0 20px 0;
  74. }
  75. .info {
  76. height: 570px;
  77. overflow: hidden;
  78. }
  79. .info ul {
  80. height: 510px;
  81. overflow: hidden;
  82. padding: 0 0 0 20px;
  83. }
  84. .info ul li {
  85. float: left;
  86. width: 100%;
  87. padding: 0 0 13px 0;
  88. }
  89. .info ul li .title {
  90. font-size: 16px;
  91. color: #60636d;
  92. }
  93. .info ul li .date {
  94. font-size: 16px;
  95. color: #a8abb7;
  96. text-align: right;
  97. }
  98. .info ul li:hover {
  99. cursor: pointer;
  100. }
  101. .info ul li:hover .title {
  102. color: #22529a;
  103. }
  104. .info ul li:hover .date {
  105. color: #22529a;
  106. }
  107. .page {
  108. padding: 11px 0;
  109. text-align: center;
  110. }
  111. </style>