listcontext.vue 2.4 KB

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