banner.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div>
  3. <!-- 搜索标题 -->
  4. <div @click="openTeaching('create')"
  5. class='newBand'>新建</div>
  6. <!-- 列表 -->
  7. <div class="tableWrap">
  8. <el-table :data='tableList' :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  9. <el-table-column align='center'
  10. label="轮播图">
  11. <template slot-scope="scope">
  12. <img class="bannerImg" :src="scope.row.coverImage" alt="">
  13. </template>
  14. </el-table-column>
  15. <el-table-column align='center'
  16. label="跳转连接">
  17. <template slot-scope="scope">
  18. {{ scope.row.linkUrl + '/' + scope.row.id }}
  19. </template>
  20. </el-table-column>
  21. <el-table-column align='center' prop="remark"
  22. label="是否使用">
  23. <template slot-scope="scope">
  24. {{ scope.row.status == 1 ? '是' : '否' }}
  25. </template>
  26. </el-table-column>
  27. <el-table-column align='center' label="操作">
  28. <template slot-scope="scope">
  29. <el-button @click="onDel(scope.row)" type="text">删除</el-button>
  30. <el-button @click="onStop(scope.row)" type="text">停用</el-button>
  31. </template>
  32. </el-table-column>
  33. </el-table>
  34. <pagination :total="pageInfo.total"
  35. :page.sync="pageInfo.page"
  36. :limit.sync="pageInfo.limit"
  37. :page-sizes="pageInfo.page_size"
  38. @pagination="getList" />
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { newsList, newsUpdate } from '@/api/contentManager'
  44. import pagination from '@/components/Pagination/index'
  45. import store from '@/store'
  46. export default {
  47. components: {
  48. pagination
  49. },
  50. data () {
  51. return {
  52. tableList: [],
  53. organId: store.getters.organ,
  54. teacherId: this.$route.query.teacherId,
  55. pageInfo: {
  56. // 分页规则
  57. limit: 10, // 限制显示条数
  58. page: 1, // 当前页
  59. total: 1, // 总条数
  60. page_size: [10, 20, 40, 50] // 选择限制显示条数
  61. }
  62. }
  63. },
  64. mounted() {
  65. this.getList()
  66. },
  67. methods: {
  68. getList() {
  69. let params = {
  70. rows: this.pageInfo.limit,
  71. page: this.pageInfo.page,
  72. type: 3
  73. }
  74. newsList(params).then(res => {
  75. if(res.code == 200) {
  76. this.tableList = res.data.rows
  77. this.pageInfo.total = res.data.total
  78. }
  79. })
  80. },
  81. openTeaching(type, rows) {
  82. this.$router.push({
  83. path: '/contentManager/contentOperation',
  84. query: {
  85. type: 3,
  86. pageType: type
  87. }
  88. })
  89. },
  90. onDel(row) { // 删除
  91. },
  92. onStop(row) { // 停止
  93. // newsUpdate
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .bannerImg {
  100. height: 60px;
  101. }
  102. </style>