guidanceLists.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div id="recruitLists">
  3. <el-row>
  4. <el-col :span="24" class="list">
  5. <el-col :span="24" class="topTitle">
  6. {{ columnName }}
  7. </el-col>
  8. <el-col :span="24">
  9. <el-table :data="list" style="width: 100%" border>
  10. <el-table-column label="名称" align="center">
  11. <template slot-scope="scoped">
  12. <el-tooltip effect="dark" content="点击显示详情" placement="left">
  13. <el-col :span="24" @click.native="clickDetailcm(scoped.row)">{{ scoped.row.name }}</el-col>
  14. </el-tooltip>
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
  18. <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
  19. </el-table>
  20. <el-col class="page" :span="24">
  21. <el-pagination
  22. @current-change="handleCurrentChange"
  23. :current-page="currentPage"
  24. layout="total, prev, pager, next, jumper"
  25. :total="total"
  26. :page-size="pageSize"
  27. >
  28. </el-pagination>
  29. </el-col>
  30. </el-col>
  31. </el-col>
  32. </el-row>
  33. </div>
  34. </template>
  35. <script>
  36. import _ from 'lodash';
  37. export default {
  38. name: 'recruitLists',
  39. props: {
  40. recruitData: null,
  41. columnName: null,
  42. total: null,
  43. },
  44. components: {},
  45. data: () => ({
  46. currentPage: 1,
  47. pageSize: 12,
  48. origin: [],
  49. list: [],
  50. }),
  51. created() {},
  52. computed: {},
  53. methods: {
  54. search(page = 1) {
  55. this.$set(this, `list`, this.origin[page - 1]);
  56. },
  57. handleCurrentChange(currentPage) {
  58. this.search(currentPage);
  59. },
  60. clickDetailcm(row) {
  61. this.$emit('detailcm', { data: row });
  62. },
  63. },
  64. watch: {
  65. recruitData: {
  66. immediate: true,
  67. deep: true,
  68. handler(val) {
  69. if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
  70. this.search();
  71. },
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. .list {
  78. height: 740px;
  79. padding: 20px;
  80. overflow: hidden;
  81. }
  82. .topTitle {
  83. font-size: 22px;
  84. color: #22529a;
  85. margin: 0 0 20px 0;
  86. }
  87. .info {
  88. height: 600px;
  89. }
  90. .page {
  91. padding: 11px 0 0 0;
  92. text-align: center;
  93. }
  94. </style>